问题
I have a project, which uses the maven-assembly-plugin to compile one JAR out of a number of projects.
I want to run the build with eclipse (Neon 4.6.3). When I run the build, I select the option Resolve Workspace Artifacts
.
Resolving workspace artifacts seems to work fine for compiling the classes and testing. However, when it comes to executing the assembly into a JAR, maven does not use the projects from the eclipse workspace but only projects in the local maven repository.
Is there a way to make the maven-assembly-plugin also resolve the projects in the eclipse workspace?
回答1:
maven-assembly-plugin does resolve workspace artifacts.
I just had configuration issues in the workspace. Specifically, not ALL dependencies for the project were available in the workspace. After I had assured, that ALL dependencies can be resolved from the workspace, the maven-assembly-plugin collected the correct versions.
(You can check this by extending the Maven Dependencies under the project and assert that no *.jar dependencies are left to things which should be resolved from the eclipse projects).
来源:https://stackoverflow.com/questions/45992264/maven-assembly-plugin-and-eclipse-workspace-resolution