You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Chris Hennick (JIRA)" <ji...@apache.org> on 2017/09/06 03:21:00 UTC

[jira] [Created] (MNG-6279) -pl at *end* of command line should raise a warning

Chris Hennick created MNG-6279:
----------------------------------

             Summary: -pl <module> at *end* of command line should raise a warning
                 Key: MNG-6279
                 URL: https://issues.apache.org/jira/browse/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:

{code:sh}
#!/bin/sh
mvn jacoco:prepare-agent -pl betterrandom &&\
mvn test -pl betterrandom &&\
mvn jacoco:report -pl betterrandom &&\
if [ "$TRAVIS" = "true" ]; then
  mvn coveralls:report -pl betterrandom
fi
{code}

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
(v6.4.14#64029)