从另一个Maven安装命令触发Maven安装命令 [英] Trigger a maven install command from another maven install command

查看:70
本文介绍了从另一个Maven安装命令触发Maven安装命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以从另一个maven安装命令中触发一个maven安装命令?

Is there a way to trigger a maven install command from another maven install command?

换句话说,我希望能够在Maven项目上(在Eclipse中)执行Maven安装命令,并且我希望这将自动在另一个Maven项目上引起安装命令. 有可能吗?

In other words, I would like to be able to execute a maven install command on a maven project (in eclipse) and I want that this will automatically cause an install command on another maven project. Is that possible?

推荐答案

如前所述,在一组模块上启动目标(让我们说mvn install)的一种行之有效的方法是将它们组织为一个多模块项目并在父pom上启动目标.在幕后,Maven将使用"Maven反应堆"进行这项工作.反应堆将通过对模块之间的依赖关系构造的有向图的节点进行拓扑排序来计算构建顺序.该图是通过查看poms中的<modules><dependencies>标记构造的.

As pointed out, the maven way to launch a goal (lets say mvn install) on a set of modules is to organize them as a multi-module project and to launch the goal on the parent pom. Behind the scene, Maven will use a "Maven reactor" for this work. The reactor will calculate the build order by doing a topological sort of the nodes of the directed graph constructed by the dependency relation between modules. This graph is constructed by looking at <modules> and <dependencies> tags in poms.

但是从父级启动maven并不是唯一的选择,并且maven提供了更多与反应堆一起玩的可能性(例如,制作项目及其依赖项或依赖于它的依赖项):

But launching maven from a parent is not the only option and maven offers more possibilities to play with the reactor (e.g. making a project and its dependencies or those that depend on it):

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