File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Conditional dependency" Watch "Conditional dependency" New topic
Author

Conditional dependency

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 509
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: 11740

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.


A lot the of modern-day software development platforms are designed to permit parcelling out work to those with the best aptitude for it. A lot of modern-day business is predicated on making one person do all the work, regardless of aptitude.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 509
thanks much Tim will try it
 
 
subject: Conditional dependency
 
MyEclipse, The Clear Choice