Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Maven: custom packaging of only few child modules with specific contents

madhusudhan Jr
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
currently i have added maven profile concept to parent pom.xml which is creating custom client jars across the child modules.
But am getting default jar and client jars both, i need to get them separately on execution of maven package commnad, like mvn package -Pclient - only
client jars should be cretaed without default jars. Also i need to exclude or skip a module, please suggest.

My actual reuirement is i need to skip all the test packages from the child module 1 to 5, except child module 6. I need to create the module jars excluding test packages for 1to5 modules. So added the profile "client" in parent pom.xml, am able to get the custom jars but am also getting default jar with all the packages. jars are present in target folder.

Stephan van Hulst
Saloon Keeper
Posts: 12295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to CodeRanch!

What do you mean by skipping the test packages?

Why don't you use the standard Maven layout for test packages? Don't put them in src/main/java, put them in src/test/java instead. Maven will automatically run your tests when you compile, and exclude them from the packaging. An added bonus is that your test classes can be in the same package as the classes they're testing (e.g., and they can test package private methods.
A timing clock, fuse wire, high explosives and a tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic