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

@readonly Mojo parameter annotation doesn't work any more

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0-alpha-1, 3.0.2
    • 4.0.x-candidate
    • Plugin API
    • 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. log-maven-2.2.1.txt
          3 kB
          Jochen Ehret
        2. log-maven-3.0.2.txt
          5 kB
          Jochen Ehret
        3. pom.xml
          1 kB
          Herve Boutemy
        4. readonlytest.zip
          3 kB
          Jochen Ehret

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jochenehret Jochen Ehret
              Votes:
              5 Vote for this issue
              Watchers:
              11 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