我认为这是可能的。实际上,从版本2.0.9开始,Maven使用POM顺序来构建类路径,因此您现在就可以对其进行 *** 作。而且,如果将此与Dependency Scope结合使用,则应该有可能实现您想要的。实际上,如果你把GlassFish的javaee依赖(与测试范围)前的javaee-api依赖关系,前者应前后来在测试类路径,从而通过单元测试中使用,而后者将在编译过程中使用放置。从理论上讲,这应该可行,但它有点脆弱,因此需要仔细记录。
这样的东西(带有虚构的GFv3 jar):
<dependencies> <dependency><!-- this one will be first on the test classpath --> <groupId>org.glassfish</groupId> <artifactId>javaee</artifactId> <version>6.0</version> <scope>test</scope> <dependency> <dependency><!-- this one will be used during compile --> <groupId>javax.javaee-api</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> <dependency> ...</dependencies>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)