I'm using intellij
with tomcat server to deploy my spring mvc application, i have another 3-th party jars (10) that i would like to add them to the war file while packing it with maven, is there a way to tell maven -> Include all these jars in this folder?
Asked
Active
Viewed 221 times
0

USer22999299
- 5,284
- 9
- 46
- 78
-
1Don't do that - it's not really what Maven is for. List each jar separately and get them from maven central or somwewhere similar, not your hard-drive. Your approach won't work in a team and won't work for future developers. If you don't have a team, don't care about the future, and don't want to follow the standard maven way of doing things, then perhaps you shouldn't be using maven. – Software Engineer May 20 '16 at 16:47
-
the problem is that i'm using eBay SDK, i did not find it in any repo beside ebay releases. – USer22999299 May 20 '16 at 19:32
2 Answers
1
There's no option to include every jar in a folder,if you want to include individual jar's from the file system:
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

KlajdPaja
- 959
- 1
- 8
- 17
-
1You should always avoid using system dependencies like this, they're not portable and will usually not work for a team. – Software Engineer May 20 '16 at 16:44
-
Still have the problem, while building the project and run it with tomcat, seems like maven is not copying the jars files into the target\xxx-sanpshot\web-inf\lib folder, only while copying the files manually it works, any other solution how to make maven to copy the jars files to target folder? – USer22999299 May 23 '16 at 10:08
-
1In that case see here [Maven 2 assembly with dependencies: jar under scope “system” not included](http://stackoverflow.com/questions/2065928/maven-2-assembly-with-dependencies-jar-under-scope-system-not-included), probably you will end up with @EngineerDollery suggestion (install dependencies in local repository!!!) – KlajdPaja May 23 '16 at 10:24
-
I was doing that, created a local repo, deploy the external jars into the @KLajdPaja local repo folder, but while deploying the war file, i cant see the eBay jars in the nested lib folder under target ( i can see all of the spring jars there) only while manually copying the jar files to the lib folder it is working, any idea how can i force maven to pack the local repo into the war file? – USer22999299 May 24 '16 at 07:44
-
That's weird because maven for generated wars copy's all dependencies unless scope is defined as provided – KlajdPaja May 24 '16 at 07:48
0
The ebay SDK is on bintray
<dependency>
<groupId>com.ebay</groupId>
<artifactId>sdk</artifactId>
<version>883</version>
<type>pom</type>
</dependency>

Software Engineer
- 15,457
- 7
- 74
- 102
-
Thanks, but the problem is that ver 995, is out at https://go.developer.ebay.com/javasdk but not at bintray.. unfortunately seems like eBay not maintains there versions as they should .. – USer22999299 May 22 '16 at 11:19