我想從一個依賴項中排除所有傳遞依賴項。在一些地方,我已經看到了它建議當我這樣做,我得到一個警告,以用於該在Maven中,如何從特定的依賴項中排除所有傳遞依賴項?
<dependency>
<groupId>myParentPackage</groupId>
<artifactId>myParentProject</artifactId>
<version>1.00.000</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
通配符:
'dependencies.dependency.exclusions.exclusion.groupId' for myParentPackage:myParentProject:jar with value '*' does not match a valid id pattern. @ line 146, column 30
聲明本身是成功的,但:在傳遞依賴真的是在我的構建中被忽略。
我還發現了一個古老的功能要求,它要求exactly this feature
所以,現在我不知道這是否是一個棄用的功能,如果我不應該使用,警告的錯誤,或的特徵尚未完全實現(我正在使用Maven 3.0.4)...有人對此有更多瞭解嗎?
Maven支持[依賴排除](https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html)作爲一個笨重的解決方法。 – 2013-10-15 22:57:37
+1表示通配符排除。警告/無警告,我的Android儀器測試最終可以運行(預先驗證問題的任何人?)。明確排除每個人的依賴是瘋狂的。 – dev 2013-11-20 17:52:32