Maven 说它在“反应堆"中找不到东西 [英] Maven says it cannot find something in the "reactor"

查看:101
本文介绍了Maven 说它在“反应堆"中找不到东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 maven 项目,我从项目的根目录使用这个 --projects 命令来运行几个 pom 文件

I have a maven project, and I'm using this --projects command from the root of the project to run several pom files

mvn clean install --projects proj1, then-proj2

mvn clean install --projects proj1, then-proj2

proj1"和then proj2"是我要运行的项目的工件 ID.也就是说,我转到每个项目的 pom.xml 并在那里使用工件 ID".

The "proj1" and "then proj2" are the artifact ids of the projects I want to run. That is, I go to the pom.xml for each project and use the "artifact id" there.

proj1 &then-proj2 是主 pom 文件中项目的主题子模块.

Both proj1 & then-proj2 are themeslves sub modules of projects in the main pom file.

假设 proj1 在 A 中,然后-proj2 在 B 中,并且 A &B 在主 pom 文件中.

Say proj1 is in A , and then-proj2 is in B, and both A & B are in the main pom file.

当我运行这个时,maven 告诉我:在反应堆中找不到选定的项目:proj1"

When I run this, maven tells me: "could not find the selected project in the reactor: proj1"

这真的很令人沮丧 - 为什么不告诉我反应堆中的所有项目是什么?无论如何,我做错了什么?

This is really frustrating - why not tell me what all the projects in the reactor are? Anyway, what am I doing wrong?

推荐答案

如果您只使用给定项目的 artifactId,则必须在命令行中正确定义它:

If you only use the artifactId's of the given project you have to define that correctly on command line:

Maven 的帮助输出 (mvn --help)

help output of Maven (mvn --help)

要构建的所有指定反应堆项目的逗号分隔列表项目.一个项目可以通过 [groupId]:artifactId 或它的相对路径

Comma-delimited list of specified reactor projects to build of all projects. A project can be specified by [groupId]:artifactId or by its relative path

这意味着在您的情况下,您必须定义:

This means in your case you have to define:

mvn clean install --projects :proj1,:then-proj2

这篇关于Maven 说它在“反应堆"中找不到东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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