在没有反应堆的情况下按顺序清理/安装多个Maven项目 [英] Clean/Install Multiple maven projects in order without reactor

查看:40
本文介绍了在没有反应堆的情况下按顺序清理/安装多个Maven项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目结构:

Parent-Prj(pom.xml)

Parent-Prj (pom.xml)

  • P1
  • P2(取决于P1)

详细信息:

  • 在父项目pom(Parent-Prj)中指定为模块的P1/P2
  • P2依赖于P1(此依赖关系在P2的pom中指定)

我们正在使用自定义的Maven插件(带有用于清除/安装/编译等按钮的eclipse插件).导致的问题:

We are using a custom maven plugin (eclipse plugin with buttons provided for clean/install/compile etc). Issues due to that:

    在父项目pom中将
  1. P1/P2指定为模块.但是,这些项目没有按顺序执行.由于指定了依赖关系,因此应该在P1之前构建P1.怀疑反应堆不工作
  2. 没有命令行界面.

问题:

我想按顺序从父pom清理/安装这些项目.

I want to clean / install these project in order from parent pom.

顺序应为:

  • P1(清洁并安装)
  • P2(清洁并安装)

有没有反应堆插件的方法,因为它似乎无法在此自定义插件中工作?

Is there a way I can do that without reactor plugin as it does not seem to work in this custom plugin ?

更新:查看程序集插件

推荐答案

只需确保您的父pom文件中包含此代码

just make sure you have this code in you parent pom file

<modules>
  <module>p1</module>
  <module>p2</module>
</modules>

上面是构建项目的顺序.

the above is order of which the projects will be build.

在上面的配置p1中,将首先编译p2,然后再编译p2.

in above configuration p1 will be compiled first and later p2 will.

编辑-由于p2取决于P1,因此需要先编译P1.

EDIT - since p2 depends on P1, P1 needs to be compiled first.

要实现此目的,您需要全新安装父pom.

to achieve this you need to clean install of the parent pom.

  1. 这将清理模块1并进行构建.
  2. 第二个模块2已清理并构建.

,另请参阅此maven示例链接,用于构建多个模块项目.

and also see this maven example link , for building multiple module projects.

http://books.sonatype.com/mvnex-book/reference/multimodule-sect-building-multimodule.html

这篇关于在没有反应堆的情况下按顺序清理/安装多个Maven项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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