• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic