Reputation: 2028
When we try and use the org.springframework.wspring-ws as a dependency in a maven project thusly:
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<version>1.5.8</version>
</dependency>
it is not found. Looking at the repo the pom is there and so is the jar, but the jar has -all in the name like spring-ws-1.5.8-all.jar
.
My questions: First, how do I use this as a dependency in a maven pom? Second, why is this file named this way?
Upvotes: 2
Views: 6807
Reputation: 40056
Though there is an accepted answer already, I still want to give some extra information on this, cause the accepted answer is providing something that may be incorrect.
You should not use the spring-ws-ver-all as dependency. In Maven world, you should use the actual artifacts as dependencies instead (e.g. spring-ws-core etc).
One of the reason of not using such uber jar as dependency is, it may cause problem in dependency resolution.
For example, assume you are depending on 2 artifacts, A and B. A have dependency to spring-ws-core version 1.0, B depends on spring-ws-core version 1.1. Normally Maven will resolve to have only one version of spring-ws-core in your classpath.
However, if A is depending on spring-ws-all (which is the uber jar), Maven have no way to know that is spring-ws-all and spring-ws-core is something conflicting, and you will probably encounter problem because you have both classes from spring-ws 1.0 (from spring-ws-all) and 1.1 (from spring-ws-core).
Upvotes: 3
Reputation: 41126
Go to your Maven local repository Use configuration mentioned in Lithium's answer, Or use standalone module jars spring-ws-core, spring-ws-security, etc. instead of this all-in-one jar.~/.m2/repository/org/springframework/ws/spring-ws/1.5.8
, change jar file name to spring-ws-1.5.8.jar
.
Check out source code spring-ws/tags/spring-ws-1.5.8, it use maven-assembly-plugin (pom.xml line 519) which use one assembly descriptor (src/assembly/all.xml) to build final release, the <id>all</id> is appended to pom.version 1.5.8 as classifier.
I would consider this as a mistake in their build scripts.
Upvotes: 0
Reputation: 3763
You can do this:
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<version>1.5.8</version>
<classifier>all</classifier>
</dependency>
Not sure why they have that classifier. Looks like there are no other classifiers for this lib, so no point really. Looks like there are later version of this lib now: http://mvnrepository.com/artifact/org.springframework.ws
And looks like they have rearranged things somewhat, so the classifier is prolly redundant for the latest version.
Upvotes: 5