Uploaded image for project: 'Maven Archetype Bundles'
  1. Maven Archetype Bundles
  2. MARCHETYPES-74

m-a-archetype generates project with unresolved property in descriptor

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.4
    • None
    • None

    Description

      New archetype generated with maven-archetype-archetype contains unresolved artifactId in archetype-descriptor in name attribute.
      This name is then used still unresolved in few places, including debug logs.

       

      #!/bin/bash
      
      export MAVEN_OPTS=-Dmaven.repo.local=repository
      MAAV=${1:-1.4}
      
      echo Using o.a.m.a:m-a-a:${MAAV}
      
      # generate new archetype
      \rm -rf bobin-archetype
      mvn archetype:generate \
        -B -q \
        -DarchetypeGroupId=org.apache.maven.archetypes \
        -DarchetypeArtifactId=maven-archetype-archetype \
        -DarchetypeVersion=${MAAV} \
        -DgroupId=pzrep -DartifactId=bobin-archetype -Dversion=1.0-SNAPSHOT -Dpackage=pzrep
      
      echo Inspect descriptor:
      grep -B3 artifactId bobin-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
      
      # install new archetype in repository
      mvn install -q -f bobin-archetype 
      
      # use new archetype to generate another project
      \rm -rf drake
      mvn archetype:generate \
        -B -q \
        -DarchetypeGroupId=pzrep \
        -DarchetypeArtifactId=bobin-archetype \
        -DarchetypeVersion=1.0-SNAPSHOT \
        -DgroupId=pzrep -DartifactId=drake -Dversion=1.0-SNAPSHOT -Dpackage=pzrep \
        -X | grep '\[DEBUG\] Processing complete'
      

      results in

      Using o.a.m.a:m-a-a:1.5-SNAPSHOT
      Inspect descriptor:
      
      <archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
        name="${artifactId}">
      [DEBUG] Processing complete archetype ${artifactId}
      

      (where 1.5-SNAPSHOT=19b32d3).

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            pzygielo Piotr Zygielo

            Dates

              Created:
              Updated:

              Slack

                Issue deployment