[ http://jira.codehaus.org/browse/MRELEASE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=247472#action_247472 ]
Pedro Rodriguez edited comment on MRELEASE-454 at 12/22/10 10:41 AM: --------------------------------------------------------------------- The rewriteDependencies method was rewritten to use raw dependency definitions directly from the pom xml. Only dependencies found in the pom xml document are processed. However, it was required to interpolate the "groupId", "artifactId" and "version" in the xml in order to compare with the resolved dependencies. Regarding the "MRELEASE-412" issue while updating properties during the rewrite-poms-for-development phase, we only observed that in the case of a dependency management import and it was fixed. New unit tests: One additional "rewrite-for-release" unit test was added imported-dependency-management-in-reactor Two additional "rewrite-poms-for-development" unit tests were added: pom-with-parent-and-properties-in-dependency-management pom-with-parent-and-properties-in-dependency-management-import Persistent issue Maven (2.2.1) always resolves imported dependencyManagement from the repository, ignoring the reactor. Also, Maven does not recognize the imported dependencyManagement pom as a dependency so the reactor order is broken. The workaround we use for that is: 1) Manually order the modules to ensure that dependencyManagement imported POM gets built before the importing module. 2) Execute release:prepare with preparationGoals "install" to ensure that the imported POM can be resolved from the repository during the importing module build. Note: In the new Unit Tests we have added for dependency-management-import we bypassed these issues making available the required artifacts in the test repository. There is already a JIRA open for this: MNG-4052. MNG-4052: import scope dependencies prefer to download pom rather than find it in the current project This issue appears currently closed by it was fixed in 3.0-alpha-3 version. However, the current development version (2.2-SNAPSHOT) of the maven-release-plugin uses Maven 2.0.9. Next (Question): How do we plan to upgrade the plugins to Maven 3? Are we going to create a new "release" branch for the Maven 3 development? ... maven-release-plugin development version "3.0-SNAPSHOT" ???? was (Author: prodriguez): The problem is that the current code rewrites the dependencies already resolved. org.apache.maven.shared.release.phase.AbstractRewritePomsPhase, Line 272 if ( project.getDependencyManagement() != null ) { Element dependencyRoot = rootElement.getChild( "dependencyManagement", namespace ); if ( dependencyRoot != null ) { rewriteDependencies( project.getDependencyManagement().getDependencies(), dependencyRoot, mappedVersions, resolvedSnapshotDependencies, originalVersions, projectId, properties, result, releaseDescriptor ); } } A simple fix could be to add the "imported dependency management" dependencies to the dependencies list we want to rewrite: if ( project.getDependencyManagement() != null ) { Element dependencyRoot = rootElement.getChild( "dependencyManagement", namespace ); if ( dependencyRoot != null ) { List dependencies = new ArrayList( project.getDependencyManagement().getDependencies() ); // Add "imported dependencyManagement" to the dependencies list to allow them to be rewrited as well Element dependencyManagementDependenciesRoot = dependencyRoot.getChild("dependencies", namespace); if( dependencyManagementDependenciesRoot != null ) { List dependencyManagementDependencyElements = dependencyManagementDependenciesRoot.getChildren(); for (Iterator iterator = dependencyManagementDependencyElements .iterator(); iterator.hasNext();) { Element dependencyManagementDependency = (Element) iterator.next(); Element groupId = dependencyManagementDependency.getChild( "groupId", namespace ); Element artifactId = dependencyManagementDependency.getChild( "artifactId", namespace ); Element version = dependencyManagementDependency.getChild( "version", namespace ); Element scope = dependencyManagementDependency.getChild( "scope", namespace ); Element type = dependencyManagementDependency.getChild( "type", namespace ); if( groupId != null && artifactId != null && version != null && scope != null && type != null && "pom".equals(type.getText()) && "import".equals(scope.getText()) ) { Dependency importedDependencyManagement = new Dependency(); importedDependencyManagement.setGroupId( groupId.getText() ); importedDependencyManagement.setArtifactId( artifactId.getText() ); importedDependencyManagement.setVersion( version.getText() ); importedDependencyManagement.setType( type.getText() ); importedDependencyManagement.setScope( scope.getText() ); dependencies.add(importedDependencyManagement); } } } rewriteDependencies( dependencies, dependencyRoot, mappedVersions, resolvedSnapshotDependencies, originalVersions, projectId, properties, result, releaseDescriptor ); } } > The Release-Plugin does not rewrite dependencies in the DependencyManagement > with scope "import" > ------------------------------------------------------------------------------------------------ > > Key: MRELEASE-454 > URL: http://jira.codehaus.org/browse/MRELEASE-454 > Project: Maven 2.x Release Plugin > Issue Type: Bug > Components: prepare > Affects Versions: 2.0-beta-9 > Reporter: Jens Mühlenhoff > Attachments: MRELEASE-454.diff > > > Add the following node to the pom. Then prepare the release and this section > will not be rewriten, because the "imported" entry will not appear in > project.getDependencyManagement().getDependencies(). This methode returns all > the resolved dependencies. In this situation the transformDocument method > from AbstractRewritePomsPhase could not change the given dependencies, > because it is not visible to the method. > <dependencyManagement> > <dependencies> > <dependency> > <groupId>dist</groupId> > <artifactId>deps</artifactId> > <type>pom</type> > <version>4.0.4-SNAPSHOT</version> > <scope>import</scope> > </dependency> > </dependencies> > </dependencyManagement> -- 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