我的项目类路径中缺少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>
您的变量未解决。你正确地初始化了吗?
正如你在这里看到的那样
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 } /弹簧安全网络 - $ {} spring.version .pom
初始化$spring-version
删除包含${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>
标签。