我正在使用JBoss AS 7和Maven,并且还添加了RichFaces,我几乎可以肯定,它不带有JBoss。所以我把它添加到我的pom.xml:
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
<version>4.1.0.Final</version>
<scope>compile</scope>
</dependency>
但Richfaces也有它的依赖关系,所以cssparser
和sac
也带有编译范围,但它们也在JBoss AS 7中,所以当我运行JBoss时出现以下警告:
Deployment "deployment.test.war" is using a private module ("org.w3c.css.sac:main") which may be changed or removed in future versions without notice.
Deployment "deployment.test.war" is using a private module ("net.sourceforge.cssparser:main") which may be changed or removed in future versions without notice.
我相信出现这个警告是因为我在战争和JBoss上都有这个模块,所以我想知道:在我的POM中有一种方法可以改变它们的范围吗?即使他们是遗传的?
答案 0 :(得分:1)
不,您无法更改传递依赖项的范围。您可以做的最好的事情是在依赖项声明中使用<exclusions>
排除这些依赖项。