maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Hennick (JIRA)" <>
Subject [jira] [Created] (MNG-6279) -pl <module> at *end* of command line should raise a warning
Date Wed, 06 Sep 2017 03:21:00 GMT
Chris Hennick created MNG-6279:

             Summary: -pl <module> at *end* of command line should raise a warning
                 Key: MNG-6279
             Project: Maven
          Issue Type: Bug
          Components: Command Line
    Affects Versions: 3.0.5
         Environment: Ubuntu 14.04.3 LTS
            Reporter: Chris Hennick

I recently tried to run tests on only one specific module using this shell script:

mvn jacoco:prepare-agent -pl betterrandom &&\
mvn test -pl betterrandom &&\
mvn jacoco:report -pl betterrandom &&\
if [ "$TRAVIS" = "true" ]; then
  mvn coveralls:report -pl betterrandom

It took me a long time to find out that the -pl <module> option needed to come *before*
the goals it was to apply to. Since -pl <module> with no goals after it can't have any
effect, it's almost certainly a sign that the command-line parameters are out of order. And
since this is such an easy mistake to make when one's new to multi-module Maven projects,
the invocation should raise a warning along the lines of "-pl <module> in this position
has no effect. To filter a goal to a specific module, it must come *before* that goal on the
command line. Did you mean mvn -pl <module> <goal...>?"

This message was sent by Atlassian JIRA

View raw message