Downloading every Spring library with maven

Must I define every single spring library one by one in my pom.xml , or is there somekind of multipack?

I found out that, for example, when I let maven download spring-core, it also downloaded spring-asm.

Are there more such packs or similar shortcuts....?

Answers


There is a possible duplicate here: Maven - include all submodules of a pom as dependencies in another module

The short answer is no. The long answer is even if you could it would not be a good idea.

Spring used to offer a bundle groupId=org.springframework artifactId=spring and groupId=org.springframework artifactId=spring-all. For various reasons (I can't find the link) Spring decided this was a bad practice and I tend to agree.

The best thing to do is if your really want to include all the spring submodules is to use parent poms and a property to denote the version ... eg:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.snaphop</groupId>
  <artifactId>snaphop-parent</artifactId>
  <version>0.0.53-SNAPSHOT</version>
  <name>snaphop-parent</name>
    <packaging>pom</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.6</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>3.1.0.RELEASE</spring.version>
    </properties>

..skip some lines

<dependencyManagement>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>

You'll have to read about parent poms here: http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance_vs_Project_Aggregation (or just google).

The other option is to make your own dummy project with all spring dependencies and depend on that.

That being said I really recommend you explicitly choose your dependecies as it can really help modularize/decouple/refactor your project in the future.


Need Your Help

Can this build system be sped up?

linux optimization makefile make symlink

Our build is dog slow. It uses nested gnu makefiles on linux. It creates three builds for three different targets from the same source tree. It uses symlinks to point to each of the three parallel

Is there an alternative to using a counter variable in a each do loop in Ruby?

ruby

I'm outputting a list of items from an array in Ruby. I need to output the position of each item in the array, as well as the value. I thought I was being clever by using the index of the value as I

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.