Maven says it cannot find something in the "reactor"

Try this:

mvn clean install -pl A/proj1, B/then-proj2

check this out: https://stackoverflow.com/a/23076358/1680793

Another thing is to make sure that you have listed your child projects inside the

<modules>
  <module> 

sections of the corresponding parent multimodule projects.

For example in the below project structure:

  • main
    • A
      • proj1
        • proj1A
    • B
      • then-proj2

Let's say you are trying to build proj1A. When you try

mvn package -pl A/proj1/proj1A

from the main's pom directory you will still have this same reactor error if you don't have:

  • "A" as a module in "main", or
  • "proj1" as a module in "A", or
  • "proj1A" as a module in "proj1"

If your modules are distinguished based on profiles then make sure to consider profiles too. Eg:

mvn -P profile1 -pl relative/path/to/project1 clean install

For this kind of setting, the pom would be:

<profiles>
    <profile>
        <id>profile1</id>
        <modules>
            <module>project1</module>
        </modules>
    </profile>
    <profile>
        <id>profile2</id>
        <modules>
            <module>project2</module>
        </modules>
    </profile>
</profiles>

Not mentioning profile would also give the Not Found in reactor.


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

Tags:

Maven