maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARCHETYPE-509) RequiredProperty not set in batch mode
Date Wed, 14 Sep 2016 05:23:20 GMT

    [ https://issues.apache.org/jira/browse/ARCHETYPE-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15489462#comment-15489462
] 

ASF GitHub Bot commented on ARCHETYPE-509:
------------------------------------------

GitHub user max-norris opened a pull request:

    https://github.com/apache/maven-archetype/pull/14

    Fix for batch mode not being able to replace required properties

    https://issues.apache.org/jira/browse/ARCHETYPE-509
    
    If I specify a required property and then use that in another required property, as follows:
    
    ```
    	<requiredProperties>
    		<requiredProperty key="groupName">
    		</requiredProperty>
    		<requiredProperty key="serviceName">
    		</requiredProperty>
    		<requiredProperty key="groupId">
    			<defaultValue>com.example.${groupName}</defaultValue>
    		</requiredProperty>
    		<requiredProperty key="package">
    			<defaultValue>com.example.${groupName}</defaultValue>
    		</requiredProperty>
    		<requiredProperty key="artifactId">
    			<defaultValue>${serviceName}</defaultValue>
    		</requiredProperty>
    		<requiredProperty key="version">
    			<defaultValue>1.0.0-SNAPSHOT</defaultValue>
    		</requiredProperty>
    	</requiredProperties>
    
    ```
    
    When I run an archetype generate with those properties specified:
    
    `mvn archetype:generate -B -DarchetypeGroupId=com.example -DarchetypeArtifactId=example-archetype
-DgroupName=MyGroup -DserviceName=MyService`
    
    I get the following output:
    
    ```
    [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-app/pom.xml
    [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-proxy/pom.xml
    [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-dto/pom.xml
    [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-integration-tests/pom.xml
    [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-codegen/pom.xml
    [INFO] project created from Archetype in dir: /private/tmp/${serviceName}
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/max-norris/maven-archetype master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-archetype/pull/14.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14
    
----
commit f9e290c350b5918716ecb07c71b698a425ac1273
Author: Max Norris <mnorris@ancestry.com>
Date:   2016-09-14T05:20:17Z

    Updating batch mode so it can replace required fields that have property placeholders.

----


> RequiredProperty not set in batch mode
> --------------------------------------
>
>                 Key: ARCHETYPE-509
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-509
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Archetypes
>    Affects Versions: 2.4
>            Reporter: Max Norris
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Same issue as https://issues.apache.org/jira/browse/ARCHETYPE-318.
> If I specify a required property and then use that in another required property, as follows:
> {code:xml}
> 	<requiredProperties>
> 		<requiredProperty key="groupName">
> 		</requiredProperty>
> 		<requiredProperty key="serviceName">
> 		</requiredProperty>
> 		<requiredProperty key="groupId">
> 			<defaultValue>com.example.${groupName}</defaultValue>
> 		</requiredProperty>
> 		<requiredProperty key="package">
> 			<defaultValue>com.example.${groupName}</defaultValue>
> 		</requiredProperty>
> 		<requiredProperty key="artifactId">
> 			<defaultValue>${serviceName}</defaultValue>
> 		</requiredProperty>
> 		<requiredProperty key="version">
> 			<defaultValue>1.0.0-SNAPSHOT</defaultValue>
> 		</requiredProperty>
> 	</requiredProperties>
> {code}
> When I run an archetype generate with those properties specified:
> {code:xml}
> mvn archetype:generate -B -DarchetypeGroupId=com.example -DarchetypeArtifactId=example-archetype
-DgroupName=MyGroup -DserviceName=MyService
> {code}
> I get the following output:
> {code:xml}
> [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-app/pom.xml
> [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-proxy/pom.xml
> [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-dto/pom.xml
> [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-integration-tests/pom.xml
> [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-codegen/pom.xml
> [INFO] project created from Archetype in dir: /private/tmp/${serviceName}
> {code}
> I'll do a pull request on github.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message