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

@readonly Mojo parameter annotation doesn't work

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.7.0-candidate
    • Component/s: Plugin API
    • Labels:
      None

      Description

      In Maven 2.2.1, the @readonly annotation works as described: You can't configure a Mojo parameter in the pom <configuration> section. If you do, the build will fail:

      [INFO] Error configuring: test:test-plugin. Reason: ERROR: Cannot override read-only parameter: testParameter in goal: test:dumpParameter

      In Maven 3.0.2, the @readonly seems to have no effect:

      [INFO] --- test-plugin:0.0.1-SNAPSHOT:dumpParameter (test-exec) @ test-project ---
      testParameter: readonly parameter configured in pom

      You can reproduce the behaviour with the attached example project. Log outputs for Maven 2.2.1 and 3.0.2 are also attached.

        Attachments

        1. readonlytest.zip
          3 kB
          Jochen Ehret
        2. log-maven-2.2.1.txt
          3 kB
          Jochen Ehret
        3. log-maven-3.0.2.txt
          5 kB
          Jochen Ehret

          Issue Links

            Activity

              People

              • Assignee:
                slachiewicz Sylwester Lachiewicz
                Reporter:
                jochenehret Jochen Ehret
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m