what is difference between "org.springframework.xyz-2.5.6.A.jar" and "spring-xyz-2.5.6.RELEASE.jar" - spring

i am new to spring framework. When i try to download required jar files for spring, then there is 2 options for same classes-
org.springframework.xyz-2.5.6.A.jar and spring-xyz-2.5.6.RELEASE.jar.
I want to know what is the difference and which is recommended to use?
thanks.

The org.springframework.xyz version is the artifact ID used by SpringSource in their Enterprise Bundle Repository, a self-contained set of OSGi-compliant JARs for both Spring and non-Spring artifacts. The spring-xyz version is the standard non-OSGi version available on Maven Central.
If you're using OSGi then use the EBR JARs, if you're not then use the standard ones.

The current Maven dependency for spring-context is
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
The resulting JAR is spring-context-3.2.4.RELEASE.jar.
So the second name looks OK to me.

Related

DistributedMap feature: how to use it

How to use the Liberty's distributedmap feature in a Java application?
Where I can find the required Maven dependencies (com.ibm.websphere.cache..)?
The Maven dependencies for WebSphere features like the DistributedMap are defined in the https://github.com/WASdev/ci.maven.tools repository and they are published on Maven central.
The following dependency loads all APIs:
<dependency>
<groupId>net.wasdev.maven.tools.targets</groupId>
<artifactId>liberty-apis</artifactId>
<version>${liberty.dependency.version}</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
The Maven coordinates for the distributedMap API would be:
<dependency>
<groupId>com.ibm.websphere.appserver.api</groupId>
<artifactId>com.ibm.websphere.appserver.api.distributedMap</artifactId>
<version>2.0.68</version>
</dependency>
Each release of Liberty will have a different version, but that is from 22.0.0.9 the latest version as of this response. I found this by using search.maven.org and searching for distributedMap. This should work for other features APIs as well.

Force latest version for maven dependencies

I have the following dependency (only so far) pom.xml
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.6.2.RELEASE</version>
</dependency>
This dependency obviously depends on other "dependencies" via it's pom.xml... when maven finished downloading these dependencies I noticed that it didn't grab the latest version of the Spring stuff (4.0.6.RELEASE)... it grabbed a 3.2.x version.
How can I force maven to grab the latest version of the Spring stuff? Do I need to explicitly modify my pom.xml to include all the dependencies or is there some "magic" I can use for this?
Thanks.
Spring "Bill Of Materials"
Salvation may come from special "bill of materials" POMs supported by Maven and published by Spring. Quoting from Maven "Bill Of Materials" Dependency in their manual:
It is possible to accidentally mix different versions of Spring JARs when using Maven. For example, you may find that a third-party library, or another Spring project, pulls in a transitive dependency to an older release. If you forget to explicitly declare a direct dependency yourself, all sorts of unexpected issues can arise.
To overcome such problems Maven supports the concept of a "bill of materials" (BOM) dependency. You can import the spring-framework-bom in your dependencyManagement section to ensure that all spring dependencies (both direct and transitive) are at the same version.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.0.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Would this work for you?
Looking at the spring-data-jpa artifact pom file, we can see that it has a parent called spring-data-parent with current version 1.4.2.RELEASE. It's pom describes dependencies and their versions. Currently spring version is at 3.2.10.RELEASE
One way you can possibly accomplish what you want is to add explicit dependency on spring artifacts. But you would still have to define their versions.

Is it possible to download - all Spring jars in one bundle

I have question concerning to spring framework jars. Is it possible to download whole bundle in "one shoot" - e.g. relase - 4.0.0 - if yes how and where, or shall i download .jar after .jar from http://mvnrepository.com/ ?
Thank you indeed
If you are not using Maven, you need to do download the JARs manually one by one, or you can opt to download a ZIP from here, as there is no official link.
If you are using Maven, you can opt to include whichever Spring dependencies you need - see this answer. This is also the way I prefer to do it.
On the Spring documentation page, they are suggesting doing it in the following way:
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
</dependencies>
It resolves spring-core, spring-aop, spring-context, spring-expression and spring-beans.

Where to find Maven CXF 2.2.6 jar?

I'm converting an ANT project that uses CXF into a Maven one. The problem is that this projects depends on CXF v2.2.6 and when I go to here or even here, there is no jar to download. I don't know what to do. I have the JAR but I want to use the Maven features like dependency management.
Thanks for your help
If using Ant, it likely used the cxf-bundle jar that pretty much contains all of CXF. You can just add:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
<version>2.2.6</version>
</dependency>
to your new pom and it would get that jar along with all the dependencies that it would require.
It is available at Maven central. Use repo1.maven.org as your repository.
Either install it manually to your local repository or use a repository manager like Nexus.

Cannot migrate from spring 2.5 to spring 3.0

Problem is a bit stupid but I can't find any spring3.0-with-dependencies.jar. Is it assumed that I should find all necessary dependencies by myself?
May I use dependencies from spring 2.5 in this case? UPD: answer is no, I can't. So, where are the dependencies??
I guess they don't release them any more. You can have the dependencies automatically if you use maven or ivy. All you need is to define the dependencies in your pom.xml like this:
<pom>
...
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.0.RELEASE</version>
</dependency>
</dependencies>
...
</pom>
Maven will bring all the dependencies transitively.
If you are using Maven, you can get Spring 3.0 jars (and their transitive dependencies) from the central repository. Simply add this to your pom.xml:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.0.RELEASE</version>
</dependency>
For more details, more artifacts, check out Obtaining Spring 3 Artifacts with Maven (and please, don't use EBR if you don't need it or I guarantee the nightmare).
Usually the readme.txt file has the dependencies listed for each module. With that you can usually get them easiest from the maven repository... or better yet, with maven (http://maven.apache.org).

Resources