2015-04-16 54 views
0

彈簧安全jar文件從我的項目classpath中丟失。 Maven clean並安裝成功執行,但不會下載我在我的pom.xml中提到的spring-security的jar文件(請參閱下文)。所有其他jar文件正在成功下載。下面彈簧安全jar文件不被maven破譯

是爲我的項目的依賴關係 - 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> 

請幫助!!!!

+0

刪除您的USER_HOME/.m2/repository/org /目錄並執行全新安裝。 – shazin

+0

我刪除並再次嘗試,這次沒有爲spring-security創建的文件夾或jar。除了這些彈簧安全罐之外,所有其他罐子都在那裏。 –

+0

我認爲上次安裝spring的時候,是因爲我用其他一些pom.xml進行了測試..........在我的項目中,實際的問題是,這些jar沒有被maven下載。 .............看到更新的問題。 - @shazin –

回答

0

您的變量未解析。你是否正確初始化它?

正如你可以在這裏看到

http://repo.maven.apache.org/maven2/.error=Could不轉讓神器org.springframework.security:spring-security-web:pom:$ { spring.version} from/to central(http://repo.maven.apache.org/maven2):索引86處路徑中的非法字符:http://repo.maven.apache.org/maven2/org/springframework/安全/彈簧安全的web/$ {} spring.version /彈簧安全網絡 - $ {} spring.version .pom

初始化$spring-version

+0

我沒有在我的pom.xml中的任何地方使用這個變量,請問我應該初始化它的值。 –

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> 

而且具有<dependencies>標籤包裝你<dependency>標籤。 如果它是一個根目錄,你應該使用一個<dependencyManagement>標籤。

+0

我只共享了部分POM.xml文件,這些值分別正確放置在屬性標記和依賴關係標記中。 –