2013-08-22 31 views
7

當我打電話mvn dependency:tree的項目中,我得到以下警告和錯誤:Maven的發現路徑無效POM進行依賴

[WARNING] The POM for com.sun.xml.stream.buffer:streambuffer:jar:0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

[WARNING] The POM for org.jvnet.staxex:stax-ex:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:tree (default-cli) on project rdbms-service: Execution default-cli of goal org.apache.maven.plugins:maven-dependency-plugin:2.1:tree failed: For artifact {org.jvnet.staxex:stax-ex:null:jar}: The version cannot be empty. -> [Help 1]

但是因爲樹構建失敗,我不知道哪個是依賴這些拉無效的依賴關係。有沒有什麼辦法可以找出來?

我試過排除那些與mvn dependency:tree -Dexcludes=*stream.buffer,*staxex罐子,但沒有區別。

回答

5

嘗試mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:tree強制Maven來使用maven-依賴性的插件

+0

工作沒有問題。乾杯:) – MikeFHay

+2

其2015年,我有同樣的錯誤,同一個罐子! - 顯式調用「mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree」可行,但是當同一個插件是pom.xml的一部分時會失敗 - [錯誤]無法執行目標org.apache.maven .plugins:maven-dependency-plugin:2.10:項目樹(樹)dms-webservice-v1:目標執行樹org.apache.maven.plugins:maven-dependency-plugin:2.10:樹失敗:對於artifact {org .jvnet.staxex:stax-ex:null:jar}:版本不能爲空。 - > [幫助1] –

0

org.jvnet.staxex:stax-ex:1.0 appears to miss element in the pom in remote repository, contains instead which was never included in the pom.xml schema AFAIK. Apparently some manually created pom (in a wrong way) that ended up in java.net and then central.

嘗試的最新版本,以排除STAX-EX依賴性和顯式定義一個新的。例如:

 <!-- jaxws-rt with replaced broken stax-ex --> 
     <dependency> 
      <groupId>com.sun.xml.ws</groupId> 
      <artifactId>jaxws-rt</artifactId> 
      <version>2.1.7</version> 
      <exclusions> 
       <exclusion> 
        <groupId>org.jvnet.staxex</groupId> 
        <artifactId>stax-ex</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.jvnet.staxex</groupId> 
      <artifactId>stax-ex</artifactId> 
      <version>1.2</version> 
     </dependency>