MOJO-2041 has to wait.MOJO-2042 is kind of surprising, because it seems that central is not always included, only in some special cases. Current fix is good enough (just recognize "central" and exclude it), but I would like to understand where it is coming from and why. I don't think that Maven's "super-pom" is the correct answer, because that contains other things as well like a release profile, which is not included.
So current status looks stable and releasable to me. thanks, RobertOp Wed, 22 Oct 2014 21:21:13 +0200 schreef Jörg Hohwiller <jo...@j-hohwiller.de>:
Hi Robert, I reverted the actual change in the Mojo from SVN. Also I commented the issue that is now waiting for further feedback from Gilard or other requesters: http://jira.codehaus.org/browse/MOJO-2041 Also I had "fixed" and now closed this one: http://jira.codehaus.org/browse/MOJO-2042 I would like to finally pull out beta3. Before that I would like to know if there are any concerns (esp. according to MOJO-2042). Regards Jörg Am 21.10.2014 19:40, schrieb Robert Scholte:I think reverting is the best option right now. Robert Op Mon, 20 Oct 2014 22:53:33 +0200 schreef Jörg Hohwiller <jo...@j-hohwiller.de>:agreed. But shall I revert or disable this to open the road for a rerun of beta3 release? Otherwise we are stuck until we get further feedback and the current beta2 has bugs that prevents core usage of flatten-maven-plugin in some cases what is rather bad. Unfortunately SVN is not very strong on feature branches and merging. I am spoiled by git and other more agile infrastructure now... Regards Jörg Am 19.10.2014 22:34, schrieb Robert Scholte:I've seen a lot of request from users and although some might look good and even get a lot of votes from other developers, they can kill the whole concept. For example: Stephen is also trying very hard keep the versions-maven-plugin clean with the original purpose in mind. I remember someone asking to revert the support for a pomfile in the maven-deploy-plugin. Luckily I convinced him that there was a better solution ;) So let's wait for the example. I also want to ensure that the behavior between the real and flattened pom stays the same, because I think that this will change with the suggested fix. Robert Op Sun, 19 Oct 2014 21:45:20 +0200 schreef Jörg Hohwiller <jo...@j-hohwiller.de>:Hi Robert, We got this as a feature request via this issue: http://jira.codehaus.org/browse/MOJO-2041 I see the use-case of the requester and wanted to support this. Did you properly read and understand his point? He is actually talking about POM projects but he wants to have variables resolved. This is what flatten-maven-plugin can do but he could not use it while keeping elements such as dependencyManagement.Why is making something more flexible a bad idea? Why should we forbidthe configuration for some POM elements and allow them for others? I do not rather mind because I do not have the use-case that Gilard has. But that is exactly the problem when a bunch of a few developers write a plugin but maybe tons of users want to use it with different ideas in mind. In some cases you might consider it as "abusage" - if you keep all elements then flatten-maven-plugin is not really flattening but can helpyou with resolving variables. Do you want to argue that someone shouldbe forced to use a different plugin for his purpose then? Regards Jörg Am 15.10.2014 22:18, schrieb Robert Scholte:Hi Jörg, I don't think this is correct. The whole idea is that: - pom projects should stay as they are - non-pom files should be flattened, meaning mainly resolving dependencies.so parent, modules, properties and reporting are already included forthe first, and should *never* be added to the second. It's okay to have some flexibility, but IMO these changes would kill the whole idea of the flattened pom. thanks, Robert Op Wed, 15 Oct 2014 22:04:01 +0200 schreef <joerg.hohwil...@codehaus.org>:Revision: 20066 Author: joerg.hohwiller Date: 2014-10-15 15:04:01 -0500 (Wed, 15 Oct 2014) Log Message MOJO-2041: implemented, IT still missing Modified Paths trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java Diff Modified: trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java (20065 => 20066) --- trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java 2014-10-15 19:22:14 UTC (rev 20065) +++ trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java 2014-10-15 20:04:01 UTC (rev 20066) @@ -58,6 +58,24 @@ /** @see #isKeepDistributionManagement() */ private String distributionManagement; + /** @see #isKeepDependencyManagement() */ + private String dependencyManagement; + + /** @see #isKeepBuild() */ + private String build; + + /** @see #isKeepParent() */ + private String parent; + + /** @see #isKeepModules() */ + private String modules; + + /** @see #isKeepProperties() */ + private String properties; + + /** @see #isKeepReporting() */ + private String reporting; + /** * The constructor. */ @@ -137,10 +155,34 @@ { this.url = ""; } + if ( descriptor.getChild( "dependencyManagement" ) != null ) + { + this.dependencyManagement = ""; + } + if ( descriptor.getChild( "build" ) != null ) + { + this.build = ""; + } + if ( descriptor.getChild( "parent" ) != null ) + { + this.parent = ""; + } + if ( descriptor.getChild( "modules" ) != null ) + { + this.modules = ""; + } + if ( descriptor.getChild( "properties" ) != null ) + { + this.properties = ""; + } + if ( descriptor.getChild( "reporting" ) != null ) + { + this.reporting = ""; + } } /** - * @return <code>true </code> if we should keep name + * @return <code>true</code> if we should keep name */ public boolean isKeepName() { @@ -148,7 +190,7 @@ } /** - * @return <code>true </code> if we should keep description + * @return <code>true</code> if we should keep description */ public boolean isKeepDescription() { @@ -156,7 +198,7 @@ } /** - * @return <code>true </code> if we should keep url + * @return <code>true</code> if we should keep url */ public boolean isKeepUrl() { @@ -164,7 +206,7 @@ } /** - * @return <code>true </code> if we should keep inceptionYear + * @return <code>true</code> if we should keep inceptionYear */ public boolean isKeepInceptionYear() { @@ -172,7 +214,7 @@ } /** - * @return <code>true </code> if we should keep organization + * @return <code>true</code> if we should keep organization */ public boolean isKeepOrganization() { @@ -180,7 +222,7 @@ } /** - * @return <code>true </code> if we should keep scm + * @return <code>true</code> if we should keep scm */ public boolean isKeepScm() { @@ -188,7 +230,7 @@ } /** - * @return <code>true </code> if we should keep prerequisites + * @return <code>true</code> if we should keep prerequisites */ public boolean isKeepPrerequisites() { @@ -196,7 +238,7 @@ } /** - * @return <code>true </code> if we should keep developers + * @return <code>true</code> if we should keep developers */ public boolean isKeepDevelopers() { @@ -204,7 +246,7 @@ } /** - * @return <code>true </code> if we should keep contributors + * @return <code>true</code> if we should keep contributors */ public boolean isKeepContributors() { @@ -212,7 +254,7 @@ } /** - * @return <code>true </code> if we should keep mailingLists + * @return <code>true</code> if we should keep mailingLists */ public boolean isKeepMailingLists() { @@ -220,7 +262,7 @@ } /** - * @return <code>true </code> if we should keep repositories + * @return <code>true</code> if we should keep repositories */ public boolean isKeepRepositories() { @@ -228,7 +270,7 @@ } /** - * @return <code>true </code> if we should keep pluginRepositories + * @return <code>true</code> if we should keep pluginRepositories */ public boolean isKeepPluginRepositories() { @@ -236,7 +278,7 @@ } /**- * @return <code>true </code> if we should keep issueManagement+ * @return <code>true</code> if we should keep issueManagement */ public boolean isKeepIssueManagement() { @@ -244,7 +286,7 @@ } /** - * @return <code>true </code> if we should keep ciManagement + * @return <code>true</code> if we should keep ciManagement */ public boolean isKeepCiManagement() { @@ -252,7 +294,7 @@ } /** - * @return <code>true </code> if we should keep distributionManagement + * @return <code>true</code> if we should keep distributionManagement */ public boolean isKeepDistributionManagement() { @@ -260,6 +302,54 @@} /** + * @return <code>true</code> if we should keep dependencyManagement + */ + public boolean isKeepDependencyManagement() + { + return this.dependencyManagement != null; + } + + /** + * @return <code>true</code> if we should keep build + */ + public boolean isKeepBuild() + { + return this.build != null; + } + + /** + * @return <code>true</code> if we should keep parent + */ + public boolean isKeepParent() + { + return this.parent != null; + } + + /** + * @return <code>true</code> if we should keep modules + */ + public boolean isKeepModules() + { + return this.modules != null; + } + + /** + * @return <code>true</code> if we should keep properties + */ + public boolean isKeepProperties() + { + return this.properties != null; + } + + /** + * @return <code>true</code> if we should keep reporting + */ + public boolean isKeepReporting() + { + return this.reporting != null; + } + + /** * Sets {@link #isKeepName()}. */ public void setKeepName() @@ -379,4 +469,52 @@ this.distributionManagement = ""; } + /** + * Sets {@link #isKeepDependencyManagement()}. + */ + public void setKeepDependencyManagement() + { + this.dependencyManagement = ""; + } + + /** + * Sets {@link #isKeepBuild()}. + */ + public void setKeepBuild() + { + this.build = ""; + } + + /** + * Sets {@link #isKeepParent()}. + */ + public void setKeepParent() + { + this.parent = ""; + } + + /** + * Sets {@link #isKeepModules()}. + */ + public void setKeepModules() + { + this.modules = ""; + } + + /** + * Sets {@link #isKeepProperties()}. + */ + public void setKeepProperties() + { + this.properties = ""; + } + + /** + * Sets {@link #isKeepReporting()}. + */ + public void setKeepReporting() + { + this.reporting = ""; + } + } Modified: trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java (20065 => 20066) --- trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java 2014-10-15 19:22:14 UTC (rev 20065) +++ trunk/mojo/flatten-maven-plugin/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java 2014-10-15 20:04:01 UTC (rev 20066) @@ -170,8 +170,11 @@ * {@link Model#getProperties() properties}<br/> * {@link Model#getModules() modules}<br/> * {@link Model#getReporting() reporting}</td> - * <td>removed</td> - * <td>Will be completely stripped and never occur in a flattened POM.</td> </tr> + * <td>configurable</td> + * <td>These elements should typically be completely stripped from the flattened POM. However for ultimate flexibility + * (e.g. if you only want to resolve variables in a POM with packaging pom) you can also configure to keep these+ * elements. We strictly recommend to use this feature with extremecare and only if packaging is pom (for + * "Bill of Materials").</td> </tr> * </table> * * @author Joerg Hohwiller (hohwille at users.sourceforge.net) @@ -625,6 +628,33 @@ { flattenedPom.setUrl( effectivePom.getUrl() ); } + // MOJO-2041 + if ( descriptor.isKeepDependencyManagement() ) + { + flattenedPom.setDependencyManagement( effectivePom.getDependencyManagement() ); + } + if ( descriptor.isKeepBuild() ) + { + getLog().warn( "Keeping build section in flattened POM this was never inteded by this plugin." ); + flattenedPom.setBuild( effectivePom.getBuild() ); + } + if ( descriptor.isKeepParent() ) + {+ getLog().warn( "Keeping parent section in flattened POMthis was never inteded by this plugin." ); + flattenedPom.setParent( effectivePom.getParent() ); + } + if ( descriptor.isKeepModules() ) + { + flattenedPom.setModules( effectivePom.getModules() ); + } + if ( descriptor.isKeepProperties() ) + { + flattenedPom.setProperties( effectivePom.getProperties() ); + } + if ( descriptor.isKeepReporting() ) + { + flattenedPom.setReporting( effectivePom.getReporting() ); + } } /** To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email