Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-518

Archetype cannot be created from project if parent pom.xml evaluates system properties

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None

      Description

      Given a project A, which has a parent B with pom.xml that evaluates system properties like this:

          <profile>
             <id>doclint-java8-disable</id>
             <activation>
               <jdk>[1.8,)</jdk>
             </activation>
             <properties>
               <javadoc.additional.params>-Xdoclint:none</javadoc.additional.params>
             </properties>
           </profile>
      

      The mvn archetype:create-from-project fails with an error. This is because the ProjectBuildingRequest has no userProperties or systemProperties set:

      https://github.com/apache/maven-archetype/blob/master/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java#L439

      I will commit an @Ignored test case and a commented fix.

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build maven-archetype-m3 #261 (See https://builds.apache.org/job/maven-archetype-m3/261/)
        ARCHETYPE-518 (paranoiabla: rev 45d44b1d92df582bea9df3069e7dce9e3e106900)

        • (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/archetype.properties.sample
        • (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/pom-parent.xml.sample
        • (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/pom.xml.sample
        • (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/src/main/java/App.java
        • (edit) archetype-testing/archetype-final/src/test/java/org/apache/maven/archetype/creator/DefaultArchetypeCreatorIT.java
        • (edit) archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-archetype-m3 #261 (See https://builds.apache.org/job/maven-archetype-m3/261/ ) ARCHETYPE-518 (paranoiabla: rev 45d44b1d92df582bea9df3069e7dce9e3e106900) (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/archetype.properties.sample (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/pom-parent.xml.sample (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/pom.xml.sample (add) archetype-testing/archetype-final/src/test/resources/projects/included-system-properties/src/main/java/App.java (edit) archetype-testing/archetype-final/src/test/java/org/apache/maven/archetype/creator/DefaultArchetypeCreatorIT.java (edit) archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java
        Hide
        rfscholte Robert Scholte added a comment -
        Show
        rfscholte Robert Scholte added a comment - Fixed in f2f119e17af285d731b85d52636897aa0760b6c4
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Jenkins build maven-archetype-m3 #262 (See https://builds.apache.org/job/maven-archetype-m3/262/)
        ARCHETYPE-518 Archetype cannot be created from project if parent (rfscholte: rev f2f119e17af285d731b85d52636897aa0760b6c4)

        • (edit) archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java
        • (edit) archetype-testing/archetype-final/src/test/java/org/apache/maven/archetype/creator/DefaultArchetypeCreatorIT.java
        • (edit) maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java
        • (edit) archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationRequest.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Jenkins build maven-archetype-m3 #262 (See https://builds.apache.org/job/maven-archetype-m3/262/ ) ARCHETYPE-518 Archetype cannot be created from project if parent (rfscholte: rev f2f119e17af285d731b85d52636897aa0760b6c4) (edit) archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java (edit) archetype-testing/archetype-final/src/test/java/org/apache/maven/archetype/creator/DefaultArchetypeCreatorIT.java (edit) maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java (edit) archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationRequest.java

          People

          • Assignee:
            rfscholte Robert Scholte
            Reporter:
            paranoiabla Petar Tahchiev
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development