2013-06-02 46 views
1

我使用Maven 3.0.5的一部分,在pom.xml中,我有以下Maven的排斥罐子還是戰爭文件

  <dependency> 
      <groupId>antlr</groupId> 
      <artifactId>antlr</artifactId> 
      <version>2.7.7</version> 
      <scope>runtime</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>xerces</groupId> 
        <artifactId>xercesImpl</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>xml-apis</groupId> 
        <artifactId>xml-apis</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>janino</groupId> 
        <artifactId>janino</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

當我建立使用mvn install戰爭中,我可以看到,在戰爭文件xml-apis-1.0.b2.jar也包括在內,儘管我已將xml-apis列入排除列表。

爲什麼在排除中提到的artifactId是war文件的一部分?

我怎樣才能確保xml-apis-1.0.b2.jar不是戰爭文件的一部分?

任何幫助是非常可觀的。

+0

它可能通過一些其他的依賴包括在內? – Thilo

+0

@Thilo找出除了單獨註釋外還有哪些其他依賴項導致問題的最佳方法是什麼? – user75ponic

+1

如果您使用的是Eclipse,您可以查看依賴關係樹(POM編輯器上的選項卡)。 – Thilo

回答

1

看看maven repo中的maven依賴性描述,我沒有看到antlr的任何傳遞依賴性。

所以這意味着檢索到的xml-apis依賴項來自項目中的其他依賴項。請檢查是否是這種情況。

+0

Shinchan找出哪個依賴關係是導致問題的最佳方法,而不是逐個單獨評論? – user75ponic

+1

檢查[this](http://jlorenzen.blogspot.in/2009/06/maven-global-excludes.html)是否有幫助。 – Shinchan

+0

Shinchan你最近的評論確實解決了我的問題,我已經按照提供的方式添加了'xml-apis'。 'xml-apis'來自hibernate庫。例如。 'hibernate-core'有'antlr','antlr'有'xml-apis'。感謝您的信息。 – user75ponic

相關問題