Maven没有下载,正确的版本jar

时间:2012-10-17 02:59:42

标签: spring maven-3 maven-dependency-plugin

我是maven&的新手遇到了问题。我的项目正在使用maven进行构建,但它下载了不同版本的jar(Spring core 2.5.6.SEC03.jar),尽管我在POM.xml中指定了3.1.1版本。

Maven在下载jar时是否会引用任何其他地方/配置文件?

我正在使用Maven3,我的Pom.XML看起来像

<properties>
    <spring.version>3.1.1.RELEASE</spring.version>             
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
         <version>${spring.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
         <version>${spring.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
         <version>${spring.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
         <version>${spring.version}</version>
    </dependency>
    <dependency>

它正确地下载了Spring Tx,JDBC,JMS,但我正在获得Spring Aop,核心,bean,上下文,Web版本“2.5.6 SEC03”。这五个jar根本没有变化,即使我升级/降级Pom中的版本。

我不确定原因是什么,我尝试删除repositry&amp;再次下载。任何帮助都会很棒 谢谢 索尼娅

1 个答案:

答案 0 :(得分:1)

我们也遇到过类似的问题。

尝试mvn -Dverbose=true dependency:tree并查看哪些依赖项使用的是Spring jar版本2.5.6 SEC03。然后删除这些依赖项或排除Spring jar版本2.5.6 SEC03。

希望它能解决问题。

相关问题