2012-03-17 5 views
3

私のMavenプロジェクトでは、たくさんのSpring依存関係を定義しましたが、pom.xmlに同じように指定されているにもかかわらず、アーティファクトの異なるバージョンを選択することがあることに気付きました。Mavenが異なるバージョンのSpring成果物をダウンロードするのはなぜですか?

これは私がすべての春の成果物に使用するプロパティを定義している、そしてそれはそうのように定義されています私のpom.xmlでmvn dependency:tree

[INFO] com.vrutberg.blogping:blogping:war:1.0-SNAPSHOT 
[INFO] +- junit:junit:jar:4.7:test 
[INFO] +- javax.servlet:servlet-api:jar:2.4:compile 
[INFO] +- com.sun.jersey:jersey-server:jar:1.12:compile 
[INFO] | +- asm:asm:jar:3.1:compile 
[INFO] | \- com.sun.jersey:jersey-core:jar:1.12:compile 
[INFO] +- com.sun.jersey:jersey-bundle:jar:1.12:compile 
[INFO] +- javax.ws.rs:jsr311-api:jar:1.1.1:compile 
[INFO] +- org.springframework:spring-core:jar:3.0.0.RC3:compile 
[INFO] +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile 
[INFO] +- org.springframework:spring-beans:jar:3.0.0.RC3:compile 
[INFO] +- org.springframework:spring-aop:jar:3.0.0.RC3:compile 
[INFO] +- org.springframework:spring-context:jar:3.0.0.RC3:compile 
[INFO] +- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile 
[INFO] +- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile 
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile 
[INFO] +- org.springframework:spring-orm:jar:3.0.5.RELEASE:compile 
[INFO] | \- org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile 
[INFO] +- org.springframework:spring-oxm:jar:3.0.5.RELEASE:compile 
[INFO] +- org.springframework:spring-web:jar:3.0.0.RC3:compile 
[INFO] +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile 
[INFO] | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile 
[INFO] +- org.springframework:spring-test:jar:3.0.5.RELEASE:test 
[INFO] \- com.sun.jersey.contribs:jersey-spring:jar:1.12:compile 
[INFO] \- com.sun.jersey:jersey-servlet:jar:1.12:compile 

の概要である:

<org.springframework.version>3.0.5.RELEASE</org.springframework.version> 

そして、これらの私の依存関係です:

<!-- spring libraries --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-expression</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-beans</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-aop</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context-support</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-tx</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-oxm</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
     <version>${org.springframework.version}</version> 
     <scope>test</scope> 
    </dependency> 

どうして私は別のバージョンを使用しますか?

編集:

さて、これらの警告が見つかりました。これと関連があると思われます。

Downloading: http://download.java.net/maven/2/org/springframework/spring-core/3.0.0.RC3/spring-core-3.0.0.RC3.pom 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-core/3.0.0.RC3/spring-core-3.0.0.RC3.pom 
[WARNING] Missing POM for org.springframework:spring-core:jar:3.0.5.RELEASE 
Downloading: http://download.java.net/maven/2/org/springframework/spring-beans/3.0.0.RC3/spring-beans-3.0.0.RC3.pom 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-beans/3.0.0.RC3/spring-beans-3.0.0.RC3.pom 
[WARNING] Missing POM for org.springframework:spring-beans:jar:3.0.5.RELEASE 
Downloading: http://download.java.net/maven/2/org/springframework/spring-aop/3.0.0.RC3/spring-aop-3.0.0.RC3.pom 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-aop/3.0.0.RC3/spring-aop-3.0.0.RC3.pom 
[WARNING] Missing POM for org.springframework:spring-aop:jar:3.0.5.RELEASE 
Downloading: http://download.java.net/maven/2/org/springframework/spring-context/3.0.0.RC3/spring-context-3.0.0.RC3.pom 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-context/3.0.0.RC3/spring-context-3.0.0.RC3.pom 
[WARNING] Missing POM for org.springframework:spring-context:jar:3.0.5.RELEASE 
Downloading: http://download.java.net/maven/2/org/springframework/spring-web/3.0.0.RC3/spring-web-3.0.0.RC3.pom 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-web/3.0.0.RC3/spring-web-3.0.0.RC3.pom 
[WARNING] Missing POM for org.springframework:spring-web:jar:3.0.5.RELEASE 

なぜアーティファクトにはポムがありませんか?なぜ3.0.0.RC3を使用することに戻りますか?

+0

プロジェクトによって必要とされる他のライブラリの依存関係のため、他のバージョンをダウンロードします。依存関係をダウンロードしないようにすることができます。 –

+0

これはどのように見ることができますか?他の依存関係によって必要とされるものであっても、すべての依存関係をリストするMavenコマンドがありますか? – vrutberg

+2

eclipseでは、少なくとも最後のバージョンでは、依存関係ツリーを見ることができるポームビューがあります。そのため、ライブラリが他の依存関係の連続として追加された理由を知ることができます。 – jddsantaella

答えて

3

eclipseでは、少なくとも最後のバージョンでは、依存関係ツリーを見ることができるpomビューがありますので、なぜライブラリが他のライブラリの連合として追加されたのかを知ることができます。

関連する問題