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

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.

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.

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

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.

spring maven repository issue (blog references but wanting to use newer version)

I have created a maven web project using the below site.
http://www.mkyong.com/maven/how-to-create-a-web-application-project-with-maven/
I have performed all the steps given there and executed a simple hello world program. Now, I have to include spring dependencies into my eclipse web project.
So
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>3.1.2</version>
</dependency>
In the dependencies tag, I added the above configuration. Now, it is saying as below:
unable to find jars from the repositories (local and as well as remote)
It gave suggestion to execute the command:
mvn install -artifactid=springframework (something like this)
But when I mentioned version as 2.5.6 it's correctly taken. Is it the problem with the version 3.1.2 being unavailable at maven repository? How do I get the latest versions if maven is not working properly for latest versions?
It also gave me the suggestion to go for manual download and put in local repository.
The Maven coordinates changed over time.
Try:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.core</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
OR Try:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
I'll just find if there is an all-in-one POM or dependency. But "spring-full" looks 1.2.x only and "spring" 2.5.x. CHECKED: Can't find one I've been using separate modules in all projects for sometime (this is better anyway, fine grained dependencies).
The location you can search is at http://ebr.springsource.com/repository/app/
for 3.1.2 see http://ebr.springsource.com/repository/app/library/version/detail?name=org.springframework.spring&version=3.1.2.RELEASE&searchType=librariesByName&searchQuery=spring
Spring have changed their repository URL and online locations at least 3 times to my knowledge over the past 4 years. So I'd look for current information on their website about setting up a Maven <repositories> config to obtain their JARs. Beware of articles with out of date information :(
Also notice the artifactId is different in the 2 example this is another gotcha issue with spring. The "org.springframework.core" are their EBR and OSGi compliant versions of their software. The "spring-core" is the older pre-OSGi co-ordinates. Find what works for you and don't mix them in the same project. For example I am using "spring-core" because I use 3.2.0.M2 which are Milestone releases. But the production release EBR co-ordinates are the best to use.
Sorry for so many edits... but it has been a minefield even if you understand the heritage of getting Spring Source software.

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