You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jochen Ehret (JIRA)" <ji...@codehaus.org> on 2010/06/17 09:46:12 UTC

[jira] Created: (ARCHETYPE-318) not correctly filtered

<requiredProperty> <defaultValue> not correctly filtered
--------------------------------------------------------

                 Key: ARCHETYPE-318
                 URL: http://jira.codehaus.org/browse/ARCHETYPE-318
             Project: Maven Archetype
          Issue Type: Bug
          Components: Generator
    Affects Versions: 2.0-alpha-5
            Reporter: Jochen Ehret
            Priority: Minor


In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:

<requiredProperty key="subArtifactId">
    <defaultValue>${artifactId}.itest1</defaultValue>
</requiredProperty>

When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (ARCHETYPE-318) not correctly filtered

Posted by "Krzysztof Cislo (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=237528#action_237528 ] 

Krzysztof Cislo commented on ARCHETYPE-318:
-------------------------------------------

It would be perfect if we can used not only pure variable but also other Velocity syntax (as far as archetype is somehow based on Velocity).

E.g.: I want to set module name to generate exampled module with a class. I set property wit h value "test" which is used for package name but for class name I have to set "Test" so first letter has to be changed to upper case. Of course I can use two properties but it is much easier for somebody who use my archetype to set only one.

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> <requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (ARCHETYPE-318) not correctly filtered

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276588#comment-276588 ] 

Herve Boutemy commented on ARCHETYPE-318:
-----------------------------------------

Tuomas,

from the description, there seems to be some improvements that could be useful
but I don't really understand your explanations ("transitive properties"?)
and the actual patch is missing tests to better show the new features

If you're ready to work with me, we can probably improve things in next Archetype plugin version

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (ARCHETYPE-318) not correctly filtered

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated ARCHETYPE-318:
------------------------------------

    Fix Version/s: 2.1

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.1
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (ARCHETYPE-318) not correctly filtered

Posted by "Tuomas Kiviaho (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tuomas Kiviaho updated ARCHETYPE-318:
-------------------------------------

    Attachment: DefaultArchetypeGenerationConfigurator.patch

This patch unifies interactive and batch mode behavior. Replacement of required properties now fails if transitive properties are not resolved. I noticed in the code that in order for ${foobar} to be replaced with foobars actual value, foobar must be a required property, but that another story. There also an oddity with groupId, artifactId, version (and package). They are forced as required properties in the new configuration as well so declaring of artifactId for instance without requiring will only lead to two properties with the same name of which one is optional and the (forced) one is still required.

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (ARCHETYPE-318) not correctly filtered

Posted by "Tuomas Kiviaho (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276630#comment-276630 ] 

Tuomas Kiviaho commented on ARCHETYPE-318:
------------------------------------------

I see that there is a property-setting-cli that could be converted to batch mode test quite easily. The required property in the declaration is a good permutation to begin with and both cli and batch mode should contain also more deeply nested property referencing scenarios. (a=${b},b=${c},c=foobar). 

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (ARCHETYPE-318) not correctly filtered

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated ARCHETYPE-318:
------------------------------------

    Description: 
In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:

{code:xml}<requiredProperty key="subArtifactId">
    <defaultValue>${artifactId}.itest1</defaultValue>
</requiredProperty>{code}

When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

  was:
In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:

<requiredProperty key="subArtifactId">
    <defaultValue>${artifactId}.itest1</defaultValue>
</requiredProperty>

When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".


> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (ARCHETYPE-318) not correctly filtered

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276709#comment-276709 ] 

Herve Boutemy commented on ARCHETYPE-318:
-----------------------------------------

yeah, I worked on IT additions since it was absolutely necessary before thinking at changing any feature
please see how you can improve the actual ones: I'm going to do a release in a few days
if you can provide something before, it can be in the release

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (ARCHETYPE-318) not correctly filtered

Posted by "Tuomas Kiviaho (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276627#comment-276627 ] 

Tuomas Kiviaho commented on ARCHETYPE-318:
------------------------------------------

>This patch unifies interactive and batch mode behavior.
filtering is done only in part of the code that get's executed when interactive mode is used. Batch mode has completely separate handling. I merged these two execution paths together so that the only real difference is that required user input in interactive mode is replaced with default values in batch mode

>Replacement of required properties now fails if transitive properties are not resolved.
code seems to call as property values containing references to other properties (like ${artifactId}.itest1) as 'transitive properties'. If property references can't be resolved the build fails.

>There (is) also an oddity...
Codebase seems to treat groupId, artifactId, version (and package) a bit differently than other properties. Properties with same name can't be configured for instance as optional because what you'd only be generating duplicate properties with same name. This is just something that caught my eye.

There wasn't existing test cases to begin with so I only could test with my own code and while trying to keep the number of changed lines in minimum.


> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (ARCHETYPE-318) not correctly filtered

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated ARCHETYPE-318:
------------------------------------

    Fix Version/s:     (was: 2.1)
                   2.x

> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive mode everything works fine. But when we try to set the parameter "subArtifactId" on the command line (mvn archetype:generate -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is ignored. In the generated pom.xml the variable ${subArtifactId} is always replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira