Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exclude an external jar while building my application - Maven.

 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Lets say I have a jar named "A.jar" which is a freesource library and I include it in my pom.xml dependencies while development, and then, when I build my application "jar", it extracts all the jars to a common place and builds MyApp.jar.

My requirement is, I want the A.jar to be there while development, but when I build the MyApp.jar I should be able to exclude A.jar from the build, as I will be putting the A.jar in my servers classpath, while execution. I dont need it again in my MyApp.jar.

Any ideas ?

Thanks in advance... !
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<dependency>
<groupId>jar</groupId>
<artifactId>id</artifactId>
<version>0.00</version>
<scope>provided</scope>
</dependency>

I did some more googling and this Works!, the scope "provided" stops the jar from getting included in the build , nevermind thanks !
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is indeed correct, well done on finding the answer!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic