You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "George Armhold (JIRA)" <ji...@codehaus.org> on 2007/06/15 16:58:59 UTC
[jira] Created: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
properties not expanded in generated POMs when building A/B/C nested projects
-----------------------------------------------------------------------------
Key: MNG-3057
URL: http://jira.codehaus.org/browse/MNG-3057
Project: Maven 2
Issue Type: Bug
Components: Inheritance and Interpolation
Affects Versions: 2.0.8
Reporter: George Armhold
Attachments: example.tar.gz, generated-poms.tar.gz
Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
$ mvn install -Dglobal-version=1.0.0
I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
Many thanks for your attention.
--
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] Closed: (MNG-3057) properties not expanded in generated POMs
when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey closed MNG-3057.
---------------------------
Resolution: Fixed
Added new interpolation strategy that uses raw contents of the POM XML file, and interpolates it from that string. This is a two-stage process, where the first stage interpolator isolates the version elements and hands the value off to the second-stage interpolator to actually resolve any expressions. Then, the result is re-inserted into the XML.
Also, adjusted the handling for artifacts with type == pom during install/deploy, such that the accompanying file is forcibly set to the artifact's file, to work around MCOMPILER-94. Attachments should be handled separately, since they have their own Artifact instance. I've modified the integration test for MNG-3057 to inject the configuration from MCOMPILER-94 just to be sure it works.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Issue Comment Edited: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148493#action_148493 ]
henrik242 edited comment on MNG-3057 at 9/19/08 5:49 AM:
------------------------------------------------------------------------
I've updated [the patch|^InstallMojo.java.patch]. System properties are taken into account as well now.
was (Author: henrik242):
I've updated the patch. System properties are taken into account as well now.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-3057:
------------------------------
Affects Version/s: (was: 2.0.8)
2.0.7
Fix Version/s: 2.0.x
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Issue Comment Edited: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "Harsha Rai (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=145614#action_145614 ]
hg2008 edited comment on MNG-3057 at 8/20/08 6:33 PM:
----------------------------------------------------------
Hello:
The above patch does not work, if the global-version property is defined outside pom.xml or outside settings.xml . In other words, if you define like :
$ mvn install -Dglobal-version=1.0.0
in maven 2.0.9 it does not reflect the property "global-version" into the project properties (another existing bug against maven).
Hence, the generated pom still will have stale ${global-version} as value.
As you can guess obviously, one need to add a few lines of code to fix the bug. Check property against System.getProperty(key) to see if there is a global property defined from command line...
Here is a partial diff:
+ while (m.find()) {
+ String match = m.group();
+ String key = match.substring(2, match.length()-1);
+ String value = properties.getProperty(key);
+ if (value == null) {
+ System.out.println("Trying .. system wide property..");
+ value = System.getProperty(key);
+ if (value !=null)
+ System.out.println("Found value from sys=" + value);
+ }
+ if (value != null) {
+ s = s.replaceAll("\\$\\{" + key + "\\}", value);
+ }
was (Author: hg2008):
Hello:
The above patch does not work, if the global-version property is defined outside pom.xml or outside settings.xml . In other words, if you define like :
$ mvn install -Dglobal-version=1.0.0
in maven 2.0.9 it does not reflect the property "global-version" into the project properties (another existing bug against maven).
Hence, the generated pom still will have stale ${global-version} as value.
As you can guess obviously, one need to add a few lines of code to fix the bug. Check property against System.getProperty(key) to see if there is a global property defined from command line...
Here is a partial diff:
+ while (m.find()) {
+ String match = m.group();
+ String key = match.substring(2, match.length()-1);
+ String value = properties.getProperty(key);
+ if (value == null) {
+ System.out.println("Trying .. system wide property..");
+ value = System.getProperty(key);
+ if (value !=null)
+ System.out.println("Found value from sys=" + value);
+ }
+ if (value != null) {
+ s = s.replaceAll("\\$\\{" + key + "\\}", value);
+ }
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Work stopped: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on MNG-3057 stopped by John Casey.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey updated MNG-3057:
----------------------------
Fix Version/s: (was: 2.2.0-M1)
2.1.0
moving back into 2.1.0 bucket for discussions related to MDEPLOY-94, etc. Maybe we should take a shot at this and start climbing the learning curve now in terms of use cases.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=166879#action_166879 ]
John Casey commented on MNG-3057:
---------------------------------
Thanks, Benjamin, that saved me some time. :)
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Work started: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on MNG-3057 started by John Casey.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Work started: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on MNG-3057 started by John Casey.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henrik Brautaset Aronsen updated MNG-3057:
------------------------------------------
Attachment: InstallMojo.java.patch
[^InstallMojo.java.patch] is a patch against revision 672740 of maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java. It's not very pretty, but it fixes this problem.
How to apply and build:
{code}
$ svn checkout http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-install-plugin maven-install-plugin
$ cd maven-install-plugin/src/main/java/org/apache/maven/plugin/install
$ patch < InstallMojo.java.patch
$ cd ../../../../../../../..
$ mvn clean install
{code}
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Reopened: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey reopened MNG-3057:
-----------------------------
POM version-expression transformer is removing comments, because it's using the XPP3 reader/writer. I'm not sure how to work around this yet.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148493#action_148493 ]
Henrik Brautaset Aronsen commented on MNG-3057:
-----------------------------------------------
I've updated the patch. System properties are taken into account as well now.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Issue Comment Edited: (MNG-3057) properties not expanded in
generated POMs when building A/B/C nested projects
Posted by "Maxim Petrashev (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152040#action_152040 ]
mpetrashev edited comment on MNG-3057 at 10/27/08 10:10 AM:
-----------------------------------------------------------------
Hi, Henrik
Can you, please,
- add supporting of nested values? I mean if we have property:
someProperty1=/somepath/somesubpath/${otherPropery2}/something
then it will fail with
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:706)
at java.util.regex.Matcher.replaceAll(Matcher.java:806)
at java.lang.String.replaceAll(String.java:2000)
at org.apache.maven.plugin.install.InstallMojo.insertProperties(InstallMojo.java:118)
where my InstallMojo.java:118 line is:
s = s.replaceAll("\\$\\{" + key + "\\}", value);
- extend mask for "." sign in property names? In you case {myComponent-version} works fine, but {myComponent.version} doesn't work
- I see just 1 place for properties replacement:
if ( isPomArtifact )
{
installer.install( insertProperties(pomFile), artifact, localRepository );
}
how about else statement?
else
{
metadata = new ProjectArtifactMetadata( artifact, pomFile );
I believe we have to change it on
metadata = new ProjectArtifactMetadata( artifact, insertProperties(pomFile) );
too?
- Am I right that we need to extend deploy plugin too to make it configurable for pomFile property? Otherwise, original pom.xml will be deployed, not target/maven-install-plugin/pom.xml
Many thanks for your efforts! Does maven team have any plans to include this patch in the next release?
was (Author: mpetrashev):
Hi, Henrik
Can you, please,
- add supporting of nested values? I mean if we have property:
someProperty1=/somepath/somesubpath/${otherPropery2}/something
then it will fail with
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:706)
at java.util.regex.Matcher.replaceAll(Matcher.java:806)
at java.lang.String.replaceAll(String.java:2000)
at org.apache.maven.plugin.install.InstallMojo.insertProperties(InstallMojo.java:118)
where my InstallMojo.java:118 line is:
s = s.replaceAll("\\$\\{" + key + "\\}", value);
- extend mask for "." sign in property names? In you case {myComponent-version} works fine, but {myComponent.version} doesn't work
- I see just 1 place for properties replacement:
if ( isPomArtifact )
{
installer.install( insertProperties(pomFile), artifact, localRepository );
}
how about else statement?
else
{
metadata = new ProjectArtifactMetadata( artifact, pomFile );
I believe we have to change it on
metadata = new ProjectArtifactMetadata( artifact, insertProperties(pomFile) );
too?
- Am I right that we need to extend deploy plugin too to make it configurable for pomFile property? Otherwise, original pom.xml will be deployed, not target/maven-install-plugin/pom.xml
Many thanks for your efforts! Does maven team any plans to include this patch in next releases?
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=166845#action_166845 ]
Benjamin Bentmann commented on MNG-3057:
----------------------------------------
John, the removal of the license header was a regression of MNG-2820 for which I just added a (disabled) IT.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henrik Brautaset Aronsen updated MNG-3057:
------------------------------------------
Attachment: maven-install-parent.patch
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henrik Brautaset Aronsen updated MNG-3057:
------------------------------------------
Attachment: InstallMojo.quoteReplacement.patch
Maxim: Here's a quick fix for the Illegal group reference bug (nested properties): [^InstallMojo.quoteReplacement.patch]
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152123#action_152123 ]
Henrik Brautaset Aronsen commented on MNG-3057:
-----------------------------------------------
Hi Maxim.
I'm attaching [^maven-install-parent.patch], which is the one I've been using locally for awhile. It fixes dots in property names and the properties replacements you mentioned, as well as the failing unit tests.
I am not using nested properties and mvn deploy myself, and haven't given that much thought -- sorry about that.
I don't think the maven team have any plans of including *this* patch, but there's ongoing work in MNG-624 to do something simliar which [might be included in Maven 2.1.0-M6|http://docs.codehaus.org/display/MAVEN/Maven+2.1.0+Release+Plan] .
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henrik Brautaset Aronsen updated MNG-3057:
------------------------------------------
Attachment: maven-dependency-problem.zip
This issue is still not fixed in 2.1.0.
Steps to reproduce:
- download and unzip [^maven-dependency-problem.zip]
- cd first
- mvn clean install
- cd fourth
- mvn clean install (which fails)
The project layout is this:
{noformat}
first--+--second----third
|
+--fourth
{noformat}
"third" has "second" as parent version, and "second"/"fourth" has "first" as parent version. They all use a common applicationVersion property, which is set in "first". "fourth" has a dependency on "third", which resolves OK, but it fails to resolve the transitive dependency to "second":
{code}
[INFO] Failed to resolve artifact.
GroupId: me
ArtifactId: second
Version: ${applicationVersion}
Reason: Unable to download the artifact from any repository
me:second:pom:${applicationVersion}
{code}
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-dependency-problem.zip, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henrik Brautaset Aronsen updated MNG-3057:
------------------------------------------
Attachment: InstallMojo.java.patch
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139956#action_139956 ]
Henrik Brautaset Aronsen commented on MNG-3057:
-----------------------------------------------
I added another test case for this problem in MNG-2446.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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] Closed: (MNG-3057) properties not expanded in generated POMs
when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey closed MNG-3057.
---------------------------
Resolution: Fixed
The fix will interpolate version expressions for parent, project, dependencies, dependencyManagement, plugins, pluginManagement, plugin-level dependencies, and reporting plugins. It will leave all other fields alone and uninterpolated.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=181879#action_181879 ]
Benjamin Bentmann commented on MNG-3057:
----------------------------------------
The code that was introduced for this fix was removed from Maven 2.2+ due to reasons outlined in MNG-4223.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-dependency-problem.zip, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey updated MNG-3057:
----------------------------
Fix Version/s: (was: 2.1.0)
2.2.0-M1
Remaining Estimate: 0 minutes
Original Estimate: 0 minutes
We need to do more design work/discussion on this point, since interpolating versions before deployment must happen selectively, if at all. Additionally, if the POM has packaging == "pom" it may be an organizational POM, which could conceivably mean that versions made up of multiple expressions could be meant to allow those parts to vary in child POMs and be interpreted correctly. If that were true, then interpolating these versions on deployment of the org POM would violate that expectation.
This seems related to the practice of using things like ${wagonVersion} in POMs where multiple related dependencies are specified in a parent POM. In most cases, these versions are specified in an application's parent POM, which means they should NOT vary in child POMs...so making them concrete on deployment could actually be a good thing. But I'm not sure we've got the use cases covered well enough to make this change.
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Assignee: John Casey
> Fix For: 2.2.0-M1
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Maxim Petrashev (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152040#action_152040 ]
Maxim Petrashev commented on MNG-3057:
--------------------------------------
Hi, Henrik
Can you, please,
- add supporting of nested values? I mean if we have property:
someProperty1=/somepath/somesubpath/${otherPropery2}/something
then it will fail with
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:706)
at java.util.regex.Matcher.replaceAll(Matcher.java:806)
at java.lang.String.replaceAll(String.java:2000)
at org.apache.maven.plugin.install.InstallMojo.insertProperties(InstallMojo.java:118)
where my InstallMojo.java:118 line is:
s = s.replaceAll("\\$\\{" + key + "\\}", value);
- extend mask for "." sign in property names? In you case {myComponent-version} works fine, but {myComponent.version} doesn't work
- I see just 1 place for properties replacement:
if ( isPomArtifact )
{
installer.install( insertProperties(pomFile), artifact, localRepository );
}
how about else statement?
else
{
metadata = new ProjectArtifactMetadata( artifact, pomFile );
I believe we have to change it on
metadata = new ProjectArtifactMetadata( artifact, insertProperties(pomFile) );
too?
- Am I right that we need to extend deploy plugin too to make it configurable for pomFile property? Otherwise, original pom.xml will be deployed, not target/maven-install-plugin/pom.xml
Many thanks for your efforts! Does maven team any plans to include this patch in next releases?
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Harsha Rai (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=145614#action_145614 ]
Harsha Rai commented on MNG-3057:
---------------------------------
Hello:
The above patch does not work, if the global-version property is defined outside pom.xml or outside settings.xml . In other words, if you define like :
$ mvn install -Dglobal-version=1.0.0
in maven 2.0.9 it does not reflect the property "global-version" into the project properties (another existing bug against maven).
Hence, the generated pom still will have stale ${global-version} as value.
As you can guess obviously, one need to add a few lines of code to fix the bug. Check property against System.getProperty(key) to see if there is a global property defined from command line...
Here is a partial diff:
+ while (m.find()) {
+ String match = m.group();
+ String key = match.substring(2, match.length()-1);
+ String value = properties.getProperty(key);
+ if (value == null) {
+ System.out.println("Trying .. system wide property..");
+ value = System.getProperty(key);
+ if (value !=null)
+ System.out.println("Found value from sys=" + value);
+ }
+ if (value != null) {
+ s = s.replaceAll("\\$\\{" + key + "\\}", value);
+ }
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.0.x
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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: (MNG-3057) properties not expanded in generated
POMs when building A/B/C nested projects
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-3057:
------------------------------
Fix Version/s: (was: 2.0.x)
2.1.0-M3
review as a popular issue
> properties not expanded in generated POMs when building A/B/C nested projects
> -----------------------------------------------------------------------------
>
> Key: MNG-3057
> URL: http://jira.codehaus.org/browse/MNG-3057
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.7
> Reporter: George Armhold
> Fix For: 2.1.0-M3
>
> Attachments: example.tar.gz, generated-poms.tar.gz, InstallMojo.java.patch, InstallMojo.java.patch, InstallMojo.quoteReplacement.patch, maven-install-parent.patch
>
>
> Using Maven version: 2.0.8-SNAPSHOT, svn r547427.
> I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:
> $ mvn install -Dglobal-version=1.0.0
> I get poms with the string "${global-version}" embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.
> I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.
> Many thanks for your attention.
--
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