Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into MRELEASE-835
Browse files Browse the repository at this point in the history
Accoding to rfscholte's comment the two parameters autoResolveSnapshotDependencies and autoResolveSnapshotDependenciesMode were replaced by only one (autoResolveSnapshots) which is null by default.
Additionally an IT was added for this PR.
  • Loading branch information
theit committed Dec 20, 2019
2 parents 8936491 + 1123e3b commit f22f467
Show file tree
Hide file tree
Showing 103 changed files with 2,827 additions and 481 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

asfMavenTlpStdBuild()
asfMavenTlpPlgnBuild()
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public interface ReleaseDescriptor

/**
* Get nOTE : currently only implemented with svn scm. Enable a workaround to prevent issue due to svn client >
* 1.5.0 (http://jira.codehaus.org/browse/SCM-406).
* 1.5.0 (https://issues.apache.org/jira/browse/SCM-406).
*
* @return boolean
*/
Expand All @@ -133,6 +133,18 @@ public interface ReleaseDescriptor
*/
boolean isPushChanges();

/**
* Get default version to use for new working copy.
*
* Some SCMs may require a Work Item or a Task to allow the
* changes to be pushed or delivered.
* This field allows you to specify that Work Item
* or Task. It is optional, and only relevant if pushChanges is true.
*
* @return String
*/
String getWorkItem();

/**
* Get default version to use for new working copy.
*
Expand Down Expand Up @@ -207,6 +219,12 @@ public interface ReleaseDescriptor
*/
boolean isScmUseEditMode();

/**
*
* @return list of profiles to activate
*/
List<String> getActivateProfiles();

/**
* Get the last completed phase.
*
Expand Down Expand Up @@ -256,6 +274,38 @@ public interface ReleaseDescriptor
*/
String getScmCommentPrefix();

/**
* Get the SCM commit comment when setting pom.xml to release.
*
* @return String
* @since 3.0.0-M1
*/
String getScmReleaseCommitComment();

/**
* Get the SCM commit comment when setting pom.xml back to development.
*
* @return String
* @since 3.0.0-M1
*/
String getScmDevelopmentCommitComment();

/**
* Get the SCM commit comment when branching.
*
* @return String
* @since 3.0.0-M1
*/
String getScmBranchCommitComment();

/**
* Get the SCM commit comment when rolling back.
*
* @return String
* @since 3.0.0-M1
*/
String getScmRollbackCommitComment();

/**
* Get pass phrase for the private key.
*
Expand Down Expand Up @@ -416,20 +466,19 @@ public interface ReleaseDescriptor
void setScmSourceUrl( String scmUrl );

/**
* Get whether unresolved snapshot dependencies are automatically resolved.
* If this is set to "true", then the default values for the dependency's
* release and next development version are used.
* Returns whether unresolved SNAPSHOT dependencies should automatically be resolved.
* If this is set, then this specifies the default answer to be used when unresolved SNAPSHOT
* dependencies should automatically be resolved ( 0:All 1:Project Dependencies 2:Plugins
* 3:Reports 4:Extensions ). Possible values are:
* <ul>
* <li>"all" or "0": resolve all kinds of snapshots, ie. project, plugin, report and extension dependencies </li>
* <li>"dependencies" or "1": resolve project dependencies</li>
* <li>"plugins" or "2": resolve plugin dependencis</li>
* <li>"reports" or "3": resolve report dependencies</li>
* <li>"extensions" or "4": resolve extension dependencies</li>
* </ul>
*
* @return boolean
*/
boolean isAutoResolveSnapshotDependencies();

/**
* Get the default answer to be used when unresolved snapshot dependencies
* should automatically be resolved ( 0:All 1:Project Dependencies 2:Plugins
* 3:Reports 4:Extensions ).
*
* @return int
* @return String
*/
int getAutoResolveSnapshotDependenciesMode();
String getAutoResolveSnapshots();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AetherVersion
{
private final org.eclipse.aether.version.Version version;

public AetherVersion( String version )
AetherVersion( String version )
throws VersionParseException
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MavenArtifactVersion
{
private final ArtifactVersion version;

public MavenArtifactVersion( String version )
MavenArtifactVersion( String version )
{
this.version = new DefaultArtifactVersion( version );
}
Expand Down
35 changes: 35 additions & 0 deletions maven-release-api/src/site/site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
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.
-->

<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="JavaDocs" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
</menu>

<menu ref="parent" inherit="top" />
</body>
</project>
1 change: 0 additions & 1 deletion maven-release-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<goals>
Expand Down
10 changes: 6 additions & 4 deletions maven-release-manager/src/main/components-fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<component-set>
<components>
<!-- START SNIPPET: default-strategy -->
<component>
<role>org.apache.maven.shared.release.strategy.Strategy</role>
<role-hint>default</role-hint>
Expand Down Expand Up @@ -76,6 +77,7 @@
</updateVersionsPhases>
</configuration>
</component>
<!-- END SNIPPET: default-strategy -->
<component>
<role>org.apache.maven.shared.release.phase.ReleasePhase</role>
<role-hint>map-release-versions</role-hint>
Expand Down Expand Up @@ -141,7 +143,7 @@
</requirement>
</requirements>
<configuration>
<messageFormat>prepare release {0}</messageFormat>
<descriptorCommentGetter>getScmReleaseCommitComment</descriptorCommentGetter>
</configuration>
</component>
<component>
Expand All @@ -154,7 +156,7 @@
</requirement>
</requirements>
<configuration>
<messageFormat>prepare for next development iteration</messageFormat>
<descriptorCommentGetter>getScmDevelopmentCommitComment</descriptorCommentGetter>
<rollbackMessageFormat>rollback changes from release preparation of {0}</rollbackMessageFormat>
</configuration>
</component>
Expand All @@ -168,7 +170,7 @@
</requirement>
</requirements>
<configuration>
<messageFormat>prepare branch {0}</messageFormat>
<descriptorCommentGetter>getScmBranchCommitComment</descriptorCommentGetter>
</configuration>
</component>
<component>
Expand All @@ -181,7 +183,7 @@
</requirement>
</requirements>
<configuration>
<messageFormat>rollback the release of {0}</messageFormat>
<descriptorCommentGetter>getScmRollbackCommitComment</descriptorCommentGetter>
</configuration>
</component>
<component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,41 @@ public void prepare( ReleasePrepareRequest prepareRequest )
private void prepare( ReleasePrepareRequest prepareRequest, ReleaseResult result )
throws ReleaseExecutionException, ReleaseFailureException
{

final ReleaseDescriptorBuilder builder = prepareRequest.getReleaseDescriptorBuilder();

// Create a config containing values from the session properties (ie command line properties with cli).
ReleaseUtils.copyPropertiesToReleaseDescriptor( prepareRequest.getUserProperties(),
new ReleaseDescriptorBuilder()
{
public ReleaseDescriptorBuilder addDevelopmentVersion( String key,
String value )
{
builder.addDevelopmentVersion( key, value );
return this;
}

public ReleaseDescriptorBuilder addReleaseVersion( String key,
String value )
{
builder.addReleaseVersion( key, value );
return this;
};
} );
new ReleaseDescriptorBuilder()
{
public ReleaseDescriptorBuilder addDevelopmentVersion( String key,
String value )
{
builder.addDevelopmentVersion( key, value );
return this;
}

public ReleaseDescriptorBuilder addReleaseVersion( String key,
String value )
{
builder.addReleaseVersion( key, value );
return this;
}

public ReleaseDescriptorBuilder addDependencyReleaseVersion( String dependencyKey,
String version )
{
builder.addDependencyReleaseVersion( dependencyKey, version );
return this;
}

public ReleaseDescriptorBuilder addDependencyDevelopmentVersion( String dependencyKey,
String version )
{
builder.addDependencyDevelopmentVersion( dependencyKey, version );
return this;
}
} );

BuilderReleaseDescriptor config;
if ( BooleanUtils.isNotFalse( prepareRequest.getResume() ) )
Expand All @@ -131,7 +146,7 @@ public ReleaseDescriptorBuilder addReleaseVersion( String key,
}
else
{
config = ReleaseUtils.buildReleaseDescriptor( prepareRequest.getReleaseDescriptorBuilder() );
config = ReleaseUtils.buildReleaseDescriptor( builder );
}

Strategy releaseStrategy = getStrategy( config.getReleaseStrategyId() );
Expand Down Expand Up @@ -666,4 +681,4 @@ private void captureException( ReleaseResult result, ReleaseManagerListener list

result.setResultCode( ReleaseResult.ERROR );
}
}
}
Loading

0 comments on commit f22f467

Please sign in to comment.