diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/pom.xml new file mode 100644 index 000000000..53f9ff4a9 --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/pom.xml @@ -0,0 +1,41 @@ + + + + + org.apache.maven.plugin.release + mrelease-1053-parent + 1.0-SNAPSHOT + ../module-parent/pom.xml + + 4.0.0 + org.apache.maven.plugin.release + module-a + module-a + 1.0-SNAPSHOT + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/main/java/org/apache/maven/plugin/release/module/a/App.java b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/main/java/org/apache/maven/plugin/release/module/a/App.java new file mode 100644 index 000000000..05ca6ecab --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/main/java/org/apache/maven/plugin/release/module/a/App.java @@ -0,0 +1,32 @@ +package org.apache.maven.plugin.release.module.a; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java new file mode 100644 index 000000000..ca41b5f53 --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-a/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java @@ -0,0 +1,57 @@ +package org.apache.maven.plugin.release.module.a; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-parent/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-parent/pom.xml new file mode 100644 index 000000000..3589acd30 --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/module-parent/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + org.apache.maven.plugin.release + mrelease-1053-parent + pom + 1.0-SNAPSHOT + parent-project + + + http://localhost/myscm/${project.scm.tag} + scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/flat-multi-module/${project.scm.tag}/ + scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/flat-multi-module/${project.scm.tag}/ + trunk + + + + + @maven.compiler.source@ + @maven.compiler.target@ + + + + + + + org.apache.maven.plugins + maven-release-plugin + @project.version@ + + + + + + + + junit + junit + 3.8.1 + test + + + diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/pom.xml new file mode 100644 index 000000000..62f5db212 --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + org.apache.maven.plugin.release + mrelease-1053 + pom + 1.0-SNAPSHOT + parent-project + http://maven.apache.org + + org.apache.maven.plugin.release + mrelease-1053-parent + module-parent/pom.xml + 1.0-SNAPSHOT + + + + module-a + module-parent + + diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy new file mode 100644 index 000000000..25e5f40ad --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// check parent project +def project = new XmlSlurper().parse( new File( new File ( basedir, 'module-parent' ), 'pom.xml.next' ) ) +assert project.version.text() == '1.1-SNAPSHOT' +assert project.scm.url.text() == 'http://localhost/myscm/${project.scm.tag}' + +// check execution root project +project = new XmlSlurper().parse( new File ( basedir, 'pom.xml.next' ) ) +assert 0 == project.scm.size() // scm element must not exist in reactor root + +// check module a project +project = new XmlSlurper().parse( new File( new File ( basedir, 'module-a' ), 'pom.xml.next' ) ) +assert 0 == project.scm.size() // scm element must not exist in reactor root +return true; diff --git a/maven-release-plugin/src/it/projects/prepare/regular-multi-module/module-parent/pom.xml b/maven-release-plugin/src/it/projects/prepare/regular-multi-module/module-parent/pom.xml new file mode 100644 index 000000000..b97919cd8 --- /dev/null +++ b/maven-release-plugin/src/it/projects/prepare/regular-multi-module/module-parent/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + org.apache.maven.plugin.release + regular-multi-module-project-parent + pom + 1.0-SNAPSHOT + parent-project + + + http://localhost/myscm/${project.scm.tag} + scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/flat-multi-module/${project.scm.tag}/ + scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/flat-multi-module/${project.scm.tag}/ + trunk + + + + + @maven.compiler.source@ + @maven.compiler.target@ + + + + + + + org.apache.maven.plugins + maven-release-plugin + @project.version@ + + + + + + + + junit + junit + 3.8.1 + test + + + diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java index 6804603b2..f7113bbc3 100644 --- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java +++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java @@ -175,7 +175,7 @@ else if ( project.getScm().getConnection() != null ) String projectId = ArtifactUtils.versionlessKey( reactorProject.getGroupId(), reactorProject.getArtifactId() ); - descriptor.addOriginalScmInfo( projectId, buildScm( project ) ); + descriptor.addOriginalScmInfo( projectId, buildScm( reactorProject ) ); } }