maven没有下载spring security jar文件

时间:2015-04-16 07:17:47

标签: maven jar spring-security

我的项目类路径中缺少spring安全jar文件。 Maven清理并安装执行成功但不下载我在pom.xml中提到的spring-security的jar文件(见下文)。所有其他jar文件都被成功下载。

下面是我项目的依赖项 - POM.xml

<version.org.springframework>3.2.4.RELEASE</version.org.springframework>
<version.org.springframework.security>3.2.4.RELEASE</version.org.springframework.security>

<!-- Spring framework dependency management -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

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

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

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${version.org.springframework}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-mock</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                 <artifactId>spring-oxm</artifactId>
                <version>4.0.5.RELEASE</version>
            </dependency>

            <!-- Spring security -->
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-core</artifactId>
                <version>${version.org.springframework.security}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-config</artifactId>
                <version>${version.org.springframework.security}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-web</artifactId>
                <version>${version.org.springframework.security}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-acl</artifactId>
                <version>${version.org.springframework.security}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-taglibs</artifactId>
                <version>${version.org.springframework.security}</version>
            </dependency>

            <!-- Spring MVC -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${version.org.springframework}</version>
            </dependency>

2 个答案:

答案 0 :(得分:0)

您的变量未解决。你有没有正确地初始化它?

正如你在这里看到的那样

http://repo.maven.apache.org/maven2/.error=不能将工件org.springframework.security:spring-security-web:pom:${spring.version}从/向中央传输(http ://repo.maven.apache.org/maven2):索引86处路径中的非法字符:http://repo.maven.apache.org/maven2/org/springframework/security/spring-security-web/$ { spring.version} /弹簧安全的web - $ {spring.version} .pom

初始化$spring-version

答案 1 :(得分:0)

删除包含 ${spring.version} 的文件,并修复您的pom.xml:

<properties>
    <version.org.springframework>3.2.4.RELEASE</version.org.springframework>
    <version.org.springframework.security>3.2.4.RELEASE</version.org.springframework.security>
</properties>

还会在<dependency>标记中加上<dependencies>标记。 如果它是根pom,您应该使用<dependencyManagement>标记。