开发者

Can maven eclipse plugin to generate artifacts so that src/main is on top of src/test?

开发者 https://www.devze.com 2023-01-12 23:45 出处:网络
When I generate eclipse artifacts,Eclipse shows the sou开发者_StackOverflow社区rce folder in this order.

When I generate eclipse artifacts, Eclipse shows the sou开发者_StackOverflow社区rce folder in this order.

src/test/java src/test/resources src/main/java src/main/resources

I would prefer,

src/main/java src/main/resources src/test/java src/test/resources

Thanks in advance!


I'm not aware of any configuration parameter in the maven-eclipse-plugin that would allow to tweak the ordering of classpathentry in the generated .classpath.

Assuming this is what Eclipse uses, changing the order would require patching the plugin.

Another option would be to use m2eclipse which gives you what you're looking for out of the box.


This would break default functionality. Per convention, the contents of src/test/java and src/test/resources must be on top in the class path, so that you can easily replace artifacts from the main tree with test implementations without changing the main tree.

Example:

src/test/resources/META-INF/persistence.xml

src/main/resources/META-INF/persistence.xml

(tests will use the first version, while the second version will be deployed)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号