当我从POM文件中的JUnit依赖项声明中排除Antlr时,我遇到了一个针对hibernate-entitymanager的构建问题。
我不得不排除Antlr,因为JBoss AS 7似乎正在引入自己的jar文件副本。在我添加了排除之后,我就能够构建并部署到JBoss,但除非手动删除排除,否则我无法运行单元测试。
下面是POM文件的相关部分。
在运行Antlr时,解决此问题或告诉Maven不排除JUnit的最佳方法是什么?
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
<scope>compile</scope>
<!-- Exclude antlr since it conflicts with Jboss AS7
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions> -->
</dependency>发布于 2014-03-20 12:58:09
由于ctomc的建议,我使用了这个对我有用的解决方案。再次感谢!
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
<scope>compile</scope>
<!-- Exclude antlr since it conflicts with Jboss AS7 -->
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
<scope>provided</scope>
</dependency>https://stackoverflow.com/questions/22479741
复制相似问题