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: 513
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: 12513

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.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 513
thanks much Tim will try it
 
IntelliJ Java IDE
 
subject: Conditional dependency
 
Threads others viewed
Passed SCEA Part-2 and 3
"throws" UML relationship between classes
Tomcat - The requested resource is not available
How to put Filter in component diagram
DAOs X POJOs X FACADEs
Two Laptop Bag