开发者

m2eclipse : Maven dependencies as JAR's not projects

I'm having maven project on Eclipse with m2eclipse plugin. This project has some dependencies. Some of them are libraries as slf4j, apache-commons etc. But there are also mine libraries, that I'm developing simultaneously in eclipse. Unfortunately m2eclipse creates build path in such a way that my libraries are added to the classpath not as a JAR archives from M2 repository but as class files from /target开发者_运维知识库/classes directory. For that reason I can not use maven-shade-plugin beacuse I'm gettin a message:

" Error creating shaded jar: error in opening zip file /home/user/workspace/my-project/project-a/target/classes".

When I'm building project-a from command line using mvn clean install everything works well - shaded JAR is generated. How to fix it?


After few hours of searching I've already found solution. This can be made by configurinng Maven Build Configuration 1. Select arrow on Run as.. button 2. Select Run configurations... 3. Select yours project Maven Builder 4. On the right tab (Main tab) deselect: Resolve Workspace artifacts.

Click Apply and build your project - all will work as you wish :).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜