[
https://issues.apache.org/jira/browse/ARCHETYPE-556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olivier Cailloux updated ARCHETYPE-556:
---------------------------------------
Description:
In {{archetype-metadata.xml}} I have:
{code:xml}
<requiredProperty key="package">
<defaultValue>${groupId}.${artifactId}</defaultValue>
</requiredProperty>
{code}
This default value is used correctly when using mvn archetype in interactive
mode, but it is used incorrectly when using mvn archetype -B. In that case, the
value of package is literally ${groupId}.${artifactId} with no replacement.
To reproduce, type:
{code:java}
mvn -B archetype:generate -DarchetypeGroupId=io.github.oliviercailloux
-DarchetypeArtifactId=java-se-1.8-archetype -DgroupId=mygroupid
-DartifactId=myartifactid
{code}
then {{ls a/src/main/java/}}. Observe that the directory is literally
{{$\{groupId}}} instead of the expected {{mygroupid}}.
This archetype is published to Maven Central and its source code is
[here|https://github.com/oliviercailloux/java-se-1.8-archetype].
Possibly related: 490, comment of 397.
was:
In {{archetype-metadata.xml}} I have:
{code:xml}
<requiredProperty key="package">
<defaultValue>${groupId}.${artifactId}</defaultValue>
</requiredProperty>
{code}
This default value is used correctly when using mvn archetype in interactive
mode, but it is used incorrectly when using mvn archetype -B. In that case, the
value of package is literally ${groupId}.${artifactId} with no replacement.
To reproduce, type:
{code:java}
mvn -B archetype:generate -DarchetypeGroupId=io.github.oliviercailloux
-DarchetypeArtifactId=java-se-1.8-archetype -DgroupId=mygroupid
-DartifactId=myartifactid
{code}
then {{ls a/src/main/java/}}. Observe that the directory is literally
{{$\{groupId}}} instead of the expected {{mygroupid}}.
The artifact is published to Maven Central and its source code is
[here|https://github.com/oliviercailloux/java-se-1.8-archetype].
Possibly related: [490|https://issues.apache.org/jira/browse/ARCHETYPE-490],
[comment|https://issues.apache.org/jira/browse/ARCHETYPE-397?focusedCommentId=16005599&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16005599]
of 397.
> Property in default-value is not replaced when using automated mode
> -------------------------------------------------------------------
>
> Key: ARCHETYPE-556
> URL: https://issues.apache.org/jira/browse/ARCHETYPE-556
> Project: Maven Archetype
> Issue Type: Bug
> Reporter: Olivier Cailloux
> Priority: Major
>
> In {{archetype-metadata.xml}} I have:
> {code:xml}
> <requiredProperty key="package">
> <defaultValue>${groupId}.${artifactId}</defaultValue>
> </requiredProperty>
> {code}
> This default value is used correctly when using mvn archetype in interactive
> mode, but it is used incorrectly when using mvn archetype -B. In that case,
> the value of package is literally ${groupId}.${artifactId} with no
> replacement.
> To reproduce, type:
> {code:java}
> mvn -B archetype:generate -DarchetypeGroupId=io.github.oliviercailloux
> -DarchetypeArtifactId=java-se-1.8-archetype -DgroupId=mygroupid
> -DartifactId=myartifactid
> {code}
> then {{ls a/src/main/java/}}. Observe that the directory is literally
> {{$\{groupId}}} instead of the expected {{mygroupid}}.
> This archetype is published to Maven Central and its source code is
> [here|https://github.com/oliviercailloux/java-se-1.8-archetype].
> Possibly related: 490, comment of 397.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)