views:

250

answers:

1

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?

A: 

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 :).

Ajan