[ http://jira.codehaus.org/browse/ARCHETYPE-235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=170657#action_170657 ]
Christian Bauer commented on ARCHETYPE-235: ------------------------------------------- Example of installing the patch under windows. Edit the patch (for example with jedit) to transform the newlines to DOS format and save the file as maven-archetype-2.0-alpha-4-patch-19032009.windows.patch Run the following script: REM go to the directory of this script cd %~dp0 %~d0 echo on REM if the patch command is not installed on your system, you can download it from REM http://gnuwin32.sourceforge.net/packages/patch.htm REM Enter the path to the bin Directory of patch command like REM C:\Programme\GnuWin32\bin SET /P PATCHPATH= REM you need the svnkit subversion client, because otherwise you get problems with the length of the filenames REM is the snvkit installed REM Enter the path to the svnkit like REM C:\Christian\Programme\svnkit-1.2.3.5521 SET /P SVNKITPATH= REM check out call %SVNKITPATH%\jsvn.bat co https://svn.apache.org/repos/asf/maven/archetype/tags/maven-archetype-2.0-alpha-4/ echo on cd maven-archetype-2.0-alpha-4 call %PATCHPATH%\patch -p0 <..\maven-archetype-2.0-alpha-4-patch-19032009.windows.patch echo on pause call mvn install cd %~dp0 echo on rem deleting the archetype dir pause rem the name is too long so it is renamed before rename maven-archetype-2.0-alpha-4 a rmdir /s /q a > DefaultPomManager.mergePoms ignores ordering of plugins > -------------------------------------------------------- > > Key: ARCHETYPE-235 > URL: http://jira.codehaus.org/browse/ARCHETYPE-235 > Project: Maven Archetype > Issue Type: Bug > Affects Versions: 2.0-alpha-4 > Reporter: Christian Bauer > Attachments: maven-archetype-2.0-alpha-4-patch-19032009.patch > > > when you invoke an archetype with attribute partial=true > (<archetype-descriptor partial="true" .... ) the pom of the > archetype-resources is merged with the existing pom. > During the merge of build plugins the DefaultPomManager ignores the ordering > of the plugins in the archetype (generatedModel). > The DefaultPomManager uses the ordering of the map generatedPluginsByIds : > Map pluginsByIds = model.getBuild().getPluginsAsMap(); > Map generatedPluginsByIds = > generatedModel.getBuild().getPluginsAsMap(); > Iterator generatedPluginsIds = > generatedPluginsByIds.keySet().iterator(); > while ( generatedPluginsIds.hasNext() ) > { > String generatedPluginsId = (String) > generatedPluginsIds.next(); > if ( !pluginsByIds.containsKey( generatedPluginsId ) ) > { > model.getBuild().addPlugin((Plugin) > generatedPluginsByIds.get( generatedPluginsId ) > ); > } > else > { > getLogger().warn( "Can not override plugin: " + > generatedPluginsId ); > } > } > When the build process depends on the ordering of the plugins it may fail. > The solution is to iterate over the list of plugins instead of the map > Map pluginsByIds = model.getBuild().getPluginsAsMap(); > List generatedPlugins = generatedModel.getBuild().getPlugins(); > Iterator generatedPluginsIterator = generatedPlugins.iterator(); > while ( generatedPluginsIterator.hasNext() ) > { > Plugin plugin = (Plugin)generatedPluginsIterator.next(); > String generatedPluginsId = plugin.getKey(); > if ( !pluginsByIds.containsKey( generatedPluginsId ) ) > { > model.getBuild().addPlugin(plugin); > } > else > { > getLogger().warn( "Can not override plugin: " + > generatedPluginsId ); > } > } -- 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