Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6279

-pl <module> at *end* of command line should raise a warning

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 3.0.5
    • None
    • Command Line
    • None
    • Ubuntu 14.04.3 LTS

    Description

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

      #!/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
      

      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...>?"

      Attachments

        Activity

          People

            Unassigned Unassigned
            Pr0methean Chris Hennick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: