You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Nicolas Dywicki (Jira)" <ji...@apache.org> on 2020/02/19 13:36:00 UTC
[jira] [Updated] (ARCHETYPE-588) archetype:create-from-project
propertyFile defaults project values
[ https://issues.apache.org/jira/browse/ARCHETYPE-588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Dywicki updated ARCHETYPE-588:
--------------------------------------
Priority: Minor (was: Major)
> archetype:create-from-project propertyFile defaults project values
> ------------------------------------------------------------------
>
> Key: ARCHETYPE-588
> URL: https://issues.apache.org/jira/browse/ARCHETYPE-588
> Project: Maven Archetype
> Issue Type: Bug
> Components: Generator
> Affects Versions: 3.1.2
> Reporter: Nicolas Dywicki
> Priority: Minor
>
> Hi team,
>
> I want to create a multi-module archetype maven project from an existing project.Everything works fine, and I use the *_propertyFile_* to customize some elements.
> I want to use the [Maven CI Friendly Version|[https://maven.apache.org/maven-ci-friendly.html]] (via *${revision}*) but it is automatically replaced when the archetype is generated.
> So I want to force the default version to *${revision}* in the *_propertyFile_* but it is not taken into account in the target generated archetype project even if I set a regular version number like version=2.0
>
> artifact.properties:
>
> {code:java}
> archetype.filteredExtensions=java,yml,json,md,js,properties,xml,html,webapp
> archetype.filteredFileNames=jenkinsfile
> excludePatterns=archetype.properties,BUILD.md,**/.git/**,**/.idea/**,**/*.iml,**/node*/**,**/target/**
> gitignore=.gitignore
> gitattributes=.gitattributes
> version=2.0
> {code}
>
>
> Generate:
>
> {code:java}
> mvnw clean archetype:create-from-project -Darchetype.properties=archetype.properties
> {code}
>
> Target *archetype-metada.xml* does not contain version property:
>
> {code:java}
> <requiredProperties>
> <requiredProperty key="gitignore">
> <defaultValue>.gitignore</defaultValue>
> </requiredProperty>
> <requiredProperty key="gitattributes">
> <defaultValue>.gitattributes</defaultValue>
> </requiredProperty>
> <requiredProperty key="toto">
> <defaultValue>titi</defaultValue>
> </requiredProperty>
> </requiredProperties>
> {code}
>
> Then when y deploy and generate new app, I have to enter the version.
> A workaround is to use *-Dversion=${revision}* parameter:
>
>
> {code:java}
> mvn archetype:generate -DarchetypeGroupId=com.demo -DarchetypeArtifactId=demo-archetype -DgroupId=com.demo -DartifactId=demo -Dversion=${revision}
> {code}
>
> Do you know why the property version is not taken into account as explained in the [documentation|[https://maven.apache.org/archetype/maven-archetype-plugin/create-from-project-mojo.html#propertyFile]]?
>
> Thanks,
> Nicolas
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)