Skip to content

[MARCHETYPES-74] m-a-archetype generates project with unresolved property in descriptor #54

Description

@jira-importer

Piotr Zygielo opened MARCHETYPES-74 and commented

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}

1. 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

1. install new archetype in repository
mvn install -q -f bobin-archetype 

1. 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).


Affects: 1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:minorMinor loss of function, or other problem where easy workaround is present

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions