[
https://issues.apache.org/jira/browse/ARCHETYPE-574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sorin Dan updated ARCHETYPE-574:
--------------------------------
Description:
If we don't set in *archetype.properties* the parameters for which a default
value was defined in *archetype-metadata.xml*, running _mvn clean
integration-test_ gives an error as a value is expected for all parameters in
the template and the default value is not used.
{code:java}
$ mvn clean integration-test
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.archetype.test:test-archetype >------------------
[INFO] Building test-archetype 0.0.1-SNAPSHOT
[INFO] --------------------------[ maven-archetype ]---------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-archetype ---
[INFO] Deleting C:\Users\sdan\MSP\aa\test-archetype\target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @
test-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @
test-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-archetype-plugin:3.1.1:jar (default-jar) @ test-archetype ---
[INFO] Building archetype jar:
C:\Users\sdan\MSP\aa\test-archetype\target\test-archetype-0.0.1-SNAPSHOT
[INFO]
[INFO] --- maven-archetype-plugin:3.1.1:integration-test
(default-integration-test) @ test-archetype ---
[INFO] Processing Archetype IT project: it1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.252 s
[INFO] Finished at: 2019-08-07T09:06:42+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-archetype-plugin:3.1.1:integration-test
(default-integration-test) on project test-archetype:
[ERROR] Archetype IT 'it1' failed: Missing required properties in
archetype.properties: service-name
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
{code}
[^test-archetype.zip]
After the fix people will still define all the parameters in
archetype.properties but if they want to use the default value, they will give
no value to the parameter. For example:
parameter_X=
Here is the pull request with the fix:
[https://github.com/apache/maven-archetype/pull/31/files]
Attached is also a working example with my fix. In *archetype.properties* the
property _service-name_ is not defined but has a default value in
*archetype-metadata.xml*.
was:
If we don't set in archetype.properties the parameters for which a default
value was defined in archetype-metadata.xml, running _mvn clean
integration-test_ gives an error as a value is expected for all parameters in
the template and the default value is not used.
After the fix people will still define all the parameters in
archetype.properties but if they want to use the default value, they will give
no value to the parameter:
parameter_X=
Here is the pull request:
[https://github.com/apache/maven-archetype/pull/31/files]
> Integration testing ignores default values
> ------------------------------------------
>
> Key: ARCHETYPE-574
> URL: https://issues.apache.org/jira/browse/ARCHETYPE-574
> Project: Maven Archetype
> Issue Type: Bug
> Components: Archetypes, Plugin
> Affects Versions: 3.1.1
> Reporter: Sorin Dan
> Priority: Major
> Labels: pull-request-available
> Attachments: test-archetype.zip
>
>
> If we don't set in *archetype.properties* the parameters for which a default
> value was defined in *archetype-metadata.xml*, running _mvn clean
> integration-test_ gives an error as a value is expected for all parameters in
> the template and the default value is not used.
> {code:java}
> $ mvn clean integration-test
> [INFO] Scanning for projects...
> [INFO]
> [INFO] -----------------< com.archetype.test:test-archetype
> >------------------
> [INFO] Building test-archetype 0.0.1-SNAPSHOT
> [INFO] --------------------------[ maven-archetype
> ]---------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-archetype ---
> [INFO] Deleting C:\Users\sdan\MSP\aa\test-archetype\target
> [INFO]
> [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @
> test-archetype ---
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources, i.e. build is platform dependent!
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources)
> @ test-archetype ---
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources, i.e. build is platform dependent!
> [INFO] Copying 4 resources
> [INFO]
> [INFO] --- maven-archetype-plugin:3.1.1:jar (default-jar) @ test-archetype ---
> [INFO] Building archetype jar:
> C:\Users\sdan\MSP\aa\test-archetype\target\test-archetype-0.0.1-SNAPSHOT
> [INFO]
> [INFO] --- maven-archetype-plugin:3.1.1:integration-test
> (default-integration-test) @ test-archetype ---
> [INFO] Processing Archetype IT project: it1
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1.252 s
> [INFO] Finished at: 2019-08-07T09:06:42+03:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-archetype-plugin:3.1.1:integration-test
> (default-integration-test) on project test-archetype:
> [ERROR] Archetype IT 'it1' failed: Missing required properties in
> archetype.properties: service-name
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {code}
> [^test-archetype.zip]
> After the fix people will still define all the parameters in
> archetype.properties but if they want to use the default value, they will
> give no value to the parameter. For example:
> parameter_X=
> Here is the pull request with the fix:
> [https://github.com/apache/maven-archetype/pull/31/files]
> Attached is also a working example with my fix. In *archetype.properties* the
> property _service-name_ is not defined but has a default value in
> *archetype-metadata.xml*.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)