Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven says it cannot find something in the "reactor"

Tags:

maven

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

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.

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

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

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?

like image 270
bharal Avatar asked Sep 16 '17 11:09

bharal


1 Answers

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

help output of Maven (mvn --help)

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
like image 181
khmarbaise Avatar answered Sep 19 '22 08:09

khmarbaise