maven-assembly-plugin和Eclipse工作区解析 [英] maven-assembly-plugin and eclipse Workspace resolution
问题描述
我有一个项目,该项目使用 maven-assembly-plugin 从多个项目中编译一个JAR.
I have a project, which uses the maven-assembly-plugin to compile one JAR out of a number of projects.
我想使用Eclipse(Neon 4.6.3)运行构建.运行构建时,选择选项Resolve Workspace Artifacts
.
I want to run the build with eclipse (Neon 4.6.3). When I run the build, I select the option Resolve Workspace Artifacts
.
解决工作空间工件似乎可以很好地用于编译类和测试.但是,在将程序集执行到JAR中时, maven不使用Eclipse工作区中的项目,而仅使用本地maven存储库中的项目.
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.
是否有一种方法可以使Maven-assembly-plugin也解决Eclipse工作区中的项目?
Is there a way to make the maven-assembly-plugin also resolve the projects in the eclipse workspace?
推荐答案
maven-assembly-plugin确实可以解决工作区工件.
我刚在工作区中遇到配置问题.具体来说,工作空间中不是项目的所有依赖项都可用.在我确定可以从工作空间中解决所有依赖关系之后,maven-assembly-plugin收集了正确的版本.
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.
(您可以通过在项目下扩展 Maven依赖项并断言没有* .jar依赖项留给应从Eclipse项目解决的事物来进行检查).
(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).
这篇关于maven-assembly-plugin和Eclipse工作区解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!