maven - inter workspace dependencies

♀尐吖头ヾ 提交于 2019-12-11 06:48:21

问题


i am using eclipse and maven integration.

maven install puts the resources to the local repositories. local repositories is divided into "local repository" and "workspace projects" as shown in eclipse view "Maven Repositories".

The resource is unvailable to be linked by other projects of a different workspace. is there a way having "maven install" to put shnapshots to the "top" local repository available for any project? or do i missunterstand the concept?


回答1:


Workspace projects is a just a convenience feature provided by the m2e plugin where it resolves the dependencies to projects in the current workspace if the artifact specification (group id, artifact id and version) matches that of a project in the workspace. If there are no matches, m2e just uses the jar in the .m2/repo folder as the dependency.

The benefit of this feature is that you don't have to maven build and install the dependency projects continuously, your code changes are reflected immediately in the dependent project.

However, this is just a convenience feature and you can always do a maven install in a dependency project and refresh the dependent project to get the change reflected there.

TL;DR just do a usual maven install on your dependency project and refresh any workspace. It should work.



来源:https://stackoverflow.com/questions/12568950/maven-inter-workspace-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!