2012-12-10 31 views
1

將臨時相關性指定爲分類器標記作爲未默認引入的配置文件的一部分?未引入Maven瞬態相關性

更具體我具有定義如下的依賴項目答:

<dependency> 
    <groupId>com.dependency1</groupId> 
    <artifactId>dependency1</artifactId> 
    <version>12</version> 
    <classifier>${os.classifier}</classifier> 
</dependency> 

以及指定${os.classifier}

<profiles> 
    <profile> 
     <id>x86</id> 
     <activation> 
      <activeByDefault>true</activeByDefault> 
     </activation> 
     <properties> 
      <os.classifier>x86</os.classifier> 
     </properties> 
    </profile> 
    <profile> 
     <id>x86-64</id> 
     <properties> 
      <os.classifier>x86-64</os.classifier> 
     </properties> 
    </profile> 
</profiles> 

當我取決於項目甲從項目B中的輪廓, com.dependency1未帶入。有沒有我丟失的東西,或者這是默認行爲?

+0

您是否測試過如果將分類器離開時會發生什麼?我認爲只有在整個鏈中使用分類器時纔會引入與分類器的依賴關係。 – eis

+0

是的,把它留在項目A中是行不通的,因爲它沒有把jar作爲一個依賴項(這打破了項目A的構建)......除非你說「離開分類器出來」時你的意思是別的。 –

回答

0

傳遞依賴實際上被引入。我的設置沒有任何問題。我所要做的只是強制從項目B重新導入相關項。

相關問題