Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
madhusudhan Jr
Greenhorn
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
Bartender
Pie
Posts: 5567
53
  • 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. com.pages.abc), and they can test package private methods.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic