maven - 工作间依赖关系 [英] maven - inter workspace dependencies

查看:181
本文介绍了maven - 工作间依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用eclipse和maven集成。

i am using eclipse and maven integration.

maven install将资源放到本地存储库中。本地存储库分为本地存储库和工作空间项目,如eclipse视图Maven Repositories所示。

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".

资源不可用,以被其他项目链接不同的工作区。有没有一种方法有maven安装将shnapshots放置到可用于任何项目的顶级本地存储库?
或者我是否错过这个概念?

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?

推荐答案

工作空间项目是m2e插件提供的一个便利功能如果工件规范(组ID,工件标识和版本)与工作空间中的项目的工件匹配,它将解析当前工作空间中项目的依赖关系。如果没有匹配项,m2e将使用 .m2 / repo 文件夹中的jar作为依赖关系。

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.

这个功能的好处是,你不需要连续地修改依赖项目,而不需要修改 build 安装更改立即反映在依赖项目中。

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.

但是,这只是一个方便的功能,您可以随时在依赖项目中执行maven安装,并将依赖项目刷新获取更改反映在那里。

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只是在依赖项目上执行一般的maven安装,并刷新任何工作区。它应该工作。

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

这篇关于maven - 工作间依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆