aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Conditional dependency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Conditional dependency" Watch "Conditional dependency" New topic
Author

Conditional dependency

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 614
Hi,

I have to add an dependency for JTA jar files and one conf folder (under <resources> tag) , but only when i build it for tomcat, how can i achieve this in pom.xml ?

-P


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

Use the Maven profile facility. Define one or more profiles in the POM with the extra stuff in them and use the "-P" option on Maven to activate the profile when you need to.

I've been using this for things like building test apps for Tomcat when the production build is an IBM iSeries.


Customer surveys are for companies who didn't pay proper attention to begin with.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 614
thanks much Tim will try it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conditional dependency