Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-4840

Prerequisites is not working on m3

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0-alpha-6, 3.0-alpha-7, 3.0-beta-1, 3.0-beta-2, 3.0-beta-3
    • Fix Version/s: 3.0.2
    • Component/s: POM
    • Labels:
      None
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      I set my plugin to prerequisite on maven 4 (ok, it doesn't exists yet), but the build just passed =/

      Sample attached

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          Fixed in r1055174.

          Show
          Benjamin Bentmann added a comment - Fixed in r1055174 .
          Hide
          Mark Petrovic added a comment -

          A simple quickstart project is attached.

          Using maven 3.0.2, I show the lack of enforcement of a maven version in the prerequisites still exists:

          This value does not halt the build

          <prerequisites>
          <maven>3.0.3</maven>
          </prerequisites>

          nor does this value

          <prerequisites>
          <maven>4.0</maven>
          </prerequisites>

          Console output:

          $ mvn --version
          Apache Maven 3.0.2 (r1056850; 2011-01-08 16:58:10-0800)
          Java version: 1.6.0_22, vendor: Apple Inc.
          Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
          Default locale: en_US, platform encoding: MacRoman
          OS name: "mac os x", version: "10.6.5", arch: "x86_64", family: "mac"

          $mvn package
          [INFO] Scanning for projects...
          [INFO]
          [INFO] ------------------------------------------------------------------------
          [INFO] Building testapp 1.0-SNAPSHOT
          [INFO] ------------------------------------------------------------------------
          [INFO]
          [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ testapp —
          [INFO] Using 'UTF-8' encoding to copy filtered resources.
          [INFO] skip non existing resourceDirectory /Users/petrovic/tmp/testapp/src/main/resources
          [INFO]
          [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ testapp —
          [INFO] Compiling 1 source file to /Users/petrovic/tmp/testapp/target/classes
          [INFO]
          [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ testapp —
          [INFO] Using 'UTF-8' encoding to copy filtered resources.
          [INFO] skip non existing resourceDirectory /Users/petrovic/tmp/testapp/src/test/resources
          [INFO]
          [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ testapp —
          [INFO] Compiling 1 source file to /Users/petrovic/tmp/testapp/target/test-classes
          [INFO]
          [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ testapp —
          [INFO] Surefire report directory: /Users/petrovic/tmp/testapp/target/surefire-reports

          -------------------------------------------------------
          T E S T S
          -------------------------------------------------------
          Running com.example.AppTest
          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec

          Results :

          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

          [INFO]
          [INFO] — maven-jar-plugin:2.3.1:jar (default-jar) @ testapp —
          [INFO] Building jar: /Users/petrovic/tmp/testapp/target/testapp-1.0-SNAPSHOT.jar
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 3.367s
          [INFO] Finished at: Wed Feb 02 10:53:02 PST 2011
          [INFO] Final Memory: 12M/81M
          [INFO] ------------------------------------------------------------------------

          Show
          Mark Petrovic added a comment - A simple quickstart project is attached. Using maven 3.0.2, I show the lack of enforcement of a maven version in the prerequisites still exists: This value does not halt the build <prerequisites> <maven>3.0.3</maven> </prerequisites> nor does this value <prerequisites> <maven>4.0</maven> </prerequisites> Console output: $ mvn --version Apache Maven 3.0.2 (r1056850; 2011-01-08 16:58:10-0800) Java version: 1.6.0_22, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.6.5", arch: "x86_64", family: "mac" $mvn package [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building testapp 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ testapp — [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/petrovic/tmp/testapp/src/main/resources [INFO] [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ testapp — [INFO] Compiling 1 source file to /Users/petrovic/tmp/testapp/target/classes [INFO] [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ testapp — [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/petrovic/tmp/testapp/src/test/resources [INFO] [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ testapp — [INFO] Compiling 1 source file to /Users/petrovic/tmp/testapp/target/test-classes [INFO] [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ testapp — [INFO] Surefire report directory: /Users/petrovic/tmp/testapp/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.example.AppTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] — maven-jar-plugin:2.3.1:jar (default-jar) @ testapp — [INFO] Building jar: /Users/petrovic/tmp/testapp/target/testapp-1.0-SNAPSHOT.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.367s [INFO] Finished at: Wed Feb 02 10:53:02 PST 2011 [INFO] Final Memory: 12M/81M [INFO] ------------------------------------------------------------------------
          Hide
          Benjamin Bentmann added a comment -

          This is expected, enforcement of the build environment is left to the Maven Enforcer Plugin and its requireMavenVersion rule, cf. the Enforcer FAQ for general issues with using the <prerequisites> for this.

          Show
          Benjamin Bentmann added a comment - This is expected, enforcement of the build environment is left to the Maven Enforcer Plugin and its requireMavenVersion rule, cf. the Enforcer FAQ for general issues with using the <prerequisites> for this.
          Hide
          Mark Petrovic added a comment -

          I see. Thank you for the clarification.

          Show
          Mark Petrovic added a comment - I see. Thank you for the clarification.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Marvin Froeder
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: