You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2018/04/17 09:02:16 UTC
[maven-release] branch mavenproject2model updated: Unsure pomless
perform still works
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch mavenproject2model
in repository https://gitbox.apache.org/repos/asf/maven-release.git
The following commit(s) were added to refs/heads/mavenproject2model by this push:
new 6d4f196 Unsure pomless perform still works
6d4f196 is described below
commit 6d4f196b946038d6fdb60677ff35f3586bc78685
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Apr 17 11:02:10 2018 +0200
Unsure pomless perform still works
---
maven-release-plugin/pom.xml | 2 +-
.../it/projects/perform/pomless/invoker.properties | 19 ++++++++++++++++++
.../it/projects/perform/pomless/test.properties | 17 ++++++++++++++++
.../maven/plugins/release/AbstractReleaseMojo.java | 23 +++++++++++++---------
4 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/maven-release-plugin/pom.xml b/maven-release-plugin/pom.xml
index 091699c..a5fc519 100644
--- a/maven-release-plugin/pom.xml
+++ b/maven-release-plugin/pom.xml
@@ -261,7 +261,7 @@
<id>integration-test-perform</id>
<configuration>
<pomIncludes>
- <pomInclude>projects/perform/*/pom.xml</pomInclude>
+ <pomInclude>projects/perform/*</pomInclude>
</pomIncludes>
<goals>
<goal>clean</goal>
diff --git a/maven-release-plugin/src/it/projects/perform/pomless/invoker.properties b/maven-release-plugin/src/it/projects/perform/pomless/invoker.properties
new file mode 100644
index 0000000..6e18bfa
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/perform/pomless/invoker.properties
@@ -0,0 +1,19 @@
+# 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.
+
+#Require at least Maven3, so we can verify the release.properties
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:perform
\ No newline at end of file
diff --git a/maven-release-plugin/src/it/projects/perform/pomless/test.properties b/maven-release-plugin/src/it/projects/perform/pomless/test.properties
new file mode 100644
index 0000000..8ab8dfc
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/perform/pomless/test.properties
@@ -0,0 +1,17 @@
+# 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.
+connectionUrl = "scm:dummy|nul"
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
index 66c8c7c..fd84900 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
@@ -20,7 +20,6 @@ package org.apache.maven.plugins.release;
*/
import java.io.File;
-import java.io.IOException;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.List;
@@ -159,13 +158,13 @@ public abstract class AbstractReleaseMojo
descriptor.setInteractive( settings.isInteractiveMode() );
Path workingDirectory;
- try
+ if ( reactorProjects == null || reactorProjects.size() <= 1 )
{
- workingDirectory = getCommonBasedir( reactorProjects );
+ workingDirectory = basedir.toPath();
}
- catch ( IOException e )
+ else
{
- throw new RuntimeException( e.getMessage() );
+ workingDirectory = getCommonBasedir( reactorProjects );
}
descriptor.setWorkingDirectory( workingDirectory.toFile().getAbsolutePath() );
@@ -183,8 +182,12 @@ public abstract class AbstractReleaseMojo
{
String versionlessKey = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );
descriptor.putOriginalVersion( versionlessKey, project.getVersion() );
- descriptor.addProjectPomFile( versionlessKey,
- workingDirectory.relativize( project.getFile().toPath() ).toString() );
+
+ if ( project.getFile() != null )
+ {
+ descriptor.addProjectPomFile( versionlessKey,
+ workingDirectory.relativize( project.getFile().toPath() ).toString() );
+ }
}
List<String> profileIds = session.getRequest().getActiveProfiles();
@@ -305,9 +308,11 @@ public abstract class AbstractReleaseMojo
}
static Path getCommonBasedir( List<MavenProject> reactorProjects )
- throws IOException
{
- Path basePath = reactorProjects.get( 0 ).getBasedir().toPath();
+ Path basePath = reactorProjects
+ .get( 0 )
+ .getBasedir()
+ .toPath();
for ( MavenProject reactorProject : reactorProjects )
{
--
To stop receiving notification emails like this one, please contact
rfscholte@apache.org.