Hello Jörg, I have two minor suggestions: 1. Rename flattenDescriptor to pomSections (or pomElements) 2. Start enumerated constants with a lower case letter, e.g. keepIfExists, so that they are consistent with other mojos' configuration
The reason for the above is that I think it reads better that way: <configuration> <pomSections> <name>keepOrAdd</name> <description>keepIfExists</description> <url>remove</url> ... </pomSections> </configuration> Kind regards, -- Sergei Ivanov Friday, 23 May 2014 23:58 +0100 from Jörg Hohwiller <jo...@j-hohwiller.de>: Hi there, I did not get any feedback yet. Meanwhile I refactored the Mojo and invented FlattenDescriptor that can be configured like this: <configuration> <flattenDescriptor> <name>KeepOrAdd</name> <description>KeepIfExists</description> <url>Remove</url> ... </flattenDescriptor> </configuration> I added all optional elements of the POM that make sense in this context. So far I added a first IT to verify this (and found and fixed a bug). As a next step we could add a parameter "flattening" that allows to select a predefined FlattenDescriptor such as "KeepIfExists", "KeepOrAdd", "OSSHR". I hope you are happy with this approach as I would like to go for a release soon since I fixed an important bug... Regards Jörg Am 12.05.2014 22:23, schrieb Jörg Hohwiller: > Hi Robert, > > I would try to refactor as suggested. However to get everything clear: > > The Mojo would be shipped with predefined descriptor configs that > would be read from the classpath. E.g. user only configures > <descriptor>oss</descriptor> in the <configuration> of > flatten-maven-plugin. Then > org/codehaus/mojo/flatten-maven-plugin/descriptors/oss.xml is read. > However, the user could also specify a path such as > <descriptor>${basedir}/flatten-custom.xml</descriptor> that would be > loaded as file. > > Did I get it right? Or do you only want me to put the current config > options into a container element (pomDescriptor) so future Maven > features could help with some magic I can not see yet? > > Best regards > Jörg > > Am 06.05.2014 20:49, schrieb Robert Scholte: >> Ideally what we want is some sort of xslt, however that's probably >> too heavy and too complex. >> Instead you could think of something like (when written as config, or >> equivalent xml file) >> >> <configuration> >> <pomDescriptor> >> <scm/> >> <name/> >> <description> >> ... >> </pomDescriptor> >> </configuration> >> >> IIRC the behavior has changed in our favor with Maven 3, so it should >> be easy to recognize if a value is set (is should become an empty >> String/Object instead of null) >> >> Depending on your definition of 'flatten' an descriptorId should be >> enough if it is the bare minimum required by the OSS Nexus. If you >> want more freedom to choose your fields, don't use ids, just a >> descriptor. >> >> thanks, >> Robert >> >> Op Mon, 05 May 2014 23:45:18 +0200 schreef Jörg Hohwiller >> < jo...@j-hohwiller.de >: >> >>> Am 05.05.2014 22:27, schrieb Robert Scholte: >>>> Hi Jörg, >>> Hi Robert, >>>> >>>> I think we should consider another approach. >>>> Once users can define their own descriptors, you really want to get >>>> rid of these parameters. >>>> >>>> For now I would go for: >>>> @Parameter >>>> private String descriptorId; >>>> >>>> For now it's null by default, or "oss" as predefined value. >>>> >>>> in the code just check >>>> if ( "oss".equals( descriptorId ) ) >>>> { >>>> // add stuff >>>> } >>>> >>>> this way it will be easier/cleaner to move to real descriptors. >>>> >>>> WDYT? >>> Thanks for your input and suggestions. >>> To ensure that I fully understand what you are talking about, could you >>> give me a link to the "descriptor" concept, you are talking about. Do >>> you mean something similar to what assembly-plugin does? >>> So you would suggest to go for an indirection such that the individual >>> configuration per element is extracted to a "descriptor file" that is >>> itself configured as a single parameter? >>> I am not yet completely convinced. Some other "OSS user" might want to >>> set all parameters to "KeepIfExists" instead for some reason. >>> The next parameters I would see are inceptionYear or issueManagement. >>> What would "OSS" mean in the end? >>> Would not an indirection make it even more complex in the end (assuming >>> you get something like "oss+extras" and later >>> "oss+extras-without-something-else")? >>>> >>>> Robert >>> Regards >>> Jörg >>>> >>>> >>>> Op Mon, 05 May 2014 21:27:02 +0200 schreef >>>> < joerg.hohwil...@codehaus.org >: >>>> >>>>> Revision: >>>>> >>>>> 19715 >>>>> Author: >>>>> >>>>> joerg.hohwiller >>>>> Date: >>>>> >>>>> 2014-05-05 14:27:02 -0500 (Mon, 05 May 2014) >>>>> >>>>> Log Message >>>>> >>>>> MOJO-2027: added documentation >>>>> >>>>> Modified Paths >>>>> >>>>> trunk/mojo/flatten-maven-plugin/src/site/xdoc/usage.xml >>>>> >>>>> Diff >>>>> >>>>> Modified: trunk/mojo/flatten-maven-plugin/src/site/xdoc/usage.xml >>>>> (19714 => >>>>> 19715) >>>>> >>>>> >>>>> >>>>> --- trunk/mojo/flatten-maven-plugin/src/site/xdoc/usage.xml >>>>> 2014-05-05 19:20:06 UTC (rev 19714) >>>>> +++ trunk/mojo/flatten-maven-plugin/src/site/xdoc/usage.xml >>>>> 2014-05-05 19:27:02 UTC (rev 19715) >>>>> >>>>> @@ -31,6 +31,20 @@ >>>>> >>>>> </plugins> >>>>> >>>>> </build> >>>>> >>>>> ]]></source> >>>>> >>>>> + <subsection name="Keep developer information"> >>>>> + If you want to keep additional development information in >>>>> your POM, e.g. for >>>>> + <a >>>>> href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">OSSHR</a> >>>>> >>>>> + you can configure flatten-maven-plugin as following: >>>>> + <source><![CDATA[ >>>>> + <configuration> >>>>> + <handleName>KeepOrAdd</handleName> >>>>> + <handleDescription>KeepIfExists</handleDescription> >>>>> + <handleUrl>KeepOrAdd</handleUrl> >>>>> + <handleScm>KeepOrAdd</handleScm> >>>>> + <handleDevelopers>KeepOrAdd</handleDevelopers> >>>>> + </configuration> >>>>> + ]]></source> >>>>> + </subsection> >>>>> >>>>> </section> >>>>> >>>>> </body> >>>>> >>>>> </document> >>>>> >>>>> 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 >> > >