Skip to content

Commit

Permalink
parent ce04d7f
Browse files Browse the repository at this point in the history
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433024 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433018 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433016 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433015 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433011 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578433009 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578432997 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578432995 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578432994 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578432986 +0100

parent ce04d7f
author Stephen Connolly <[email protected]> 1511735859 +0000
committer Thorsten Heit <[email protected]> 1578432982 +0100

Add Jenkinsfile

Add Jenkinsfile and .repository ignores to rat

Add Apache license header (a tad ridiculous)

[MRELEASE-993] Use shallow checkout per default (git scm)

Signed-off-by: olivier lamy <[email protected]>

Manage dependencies

Upgrade to XMLUnit 2.x

Remove AbstractRunGoalsPhase#setMavenExecutor; only used for tests and won't work after M3.0 migration because componentsMap will become immutable.

Fix invalid project, flatten module should adjust relativePath

Verify update-versions and rollback without ReflectionUtils

Move unittests to proper unit

replace whitebox usage

Remove all reflection calls in tests

Use latest surefire

Remove unwanted writes to stderr during unittests

Make project Java 9-proof

Clean up failsafe IT

Clean up file copy with Path power

Directories should not start with a slash, in some cases there can be resolved as absolute paths

Proper usage of createReactorProjects( String sourcePath, String targetPath, String executionRoot )

Separate test project preparation from execution

Fix relativePath

With Maven3+ distributionManagement.status not allowed in effective pom

Prepare pathTranslator replacement with SuperPomProvider

Make org.eclipse.aether:aether-util optional, so maven-artifact-transfer can work with Maven 3.0 too.

Unittests expect expression for finalName, ITs expect explicit value. Let's make it explicit for both

Add missing remote extension artifact

Clone incorrectly set project.reporting.excludeDefaults from null to Boolean.FALSE

[MRELEASE-994] Drop Maven2 support
Upgrade mavenVersion dependencies to 3.0 (cleanup maven dependencies)
GenerateReleasePomsPhase, replace deprecated PathTranslator with SuperPomProvider and ModelInterpolator
JDomReporting, delete removed overridden methods

PlexusJUnit4TestCase, use code from org.sonatype.sisu:sisu-inject-plexus
AbstractReleaseTestCase, replace deprecated MavenProjectBuilder with ProjectBuilder
AbstractRewritingReleasePhaseTestCase, ignore internal extension based tests, not supported anymore
DefaultVersionInfoTest, adjust tests due to new comparison results
Add dummy org.codehaus.plexus:plexus-utils:1.1, required due to auto injection by org.apache.maven.plugin.internal.PlexusUtilsInjector

Code cleanup, no implementation changes

Use try-with-resources
Remove unnecessary @SuppressWarnings( "unchecked" )

Clean up code, no implementation changes

Clean up code, no implementation changes

Ensure all Maps in ReleaseDescriptor have proper generics

OddEvenVersionPolicy should not depend on maven-release-manager

Remove all overloaded methods from ReleaseManager, only use Release<Goal>Request

simplify code, replace iterators with foreach loops

[MRELEASE-956] Release Strategy Interface

[MRELEASE-992] Deprecated maven flag --no-plugin-updates shows warnings in the console output

Replace ROLE name with class

Apply multi-catch

Remove more deprecated/overloaded methods

Don't reask resolve questions in case of multimodule projects

No need for reflection anymore

Fix mocking/stubbing tests

[MRELEASE-601] The Maven 2 release plugin modifies CDATA elements in pom.xml files.

[MRELEASE-998] Add ability to create custom phases

Copy javadoc

Add unittest for DefaultVersionPolicy

Reorganize if/then/else -statements to reduce nesting

[MRELEASE-694] -SNAPSHOT is unexpectedly appended to version in branched pom.xml

Pull up commonBasedir

Move AbstractReleasePhase to maven-release-api

releaseDescriptor.getOriginalScmInfo( projectId ) is checked twice, so 1 can be removed.

Switch to Paths, which are more reliable and powerful compared to Files

More Path replacements

Revert "More Path replacements"

This reverts commit 45cd37f.

Revert "Switch to Paths, which are more reliable and powerful compared to Files"

This reverts commit 52bfff2.

[MRELEASE-1005] Extract ResourceGenerator from ReleasePhase

updated Modello xsd url

Make use of Path instead of File

[MRELEASE-1007] Rework usage workingDirectory and commonBasedir

[MNGSITE-328] use sha1 checksum instead of md5

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873523 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873428 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873366 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873234 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873185 +0100

Fixes for MRELEASE-1009:
- clean up ambigous reference in JUnit test
- upgrade Surefire to 2.22.0 to avoid a NullPointerException under Java 10 when executing "mvn package"

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-956] Release Strategy Interface

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fixed improper merge with upstream

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fixed improper merge with upstream

Fixed improper merge with upstream

Fixed Checkstyle error

Javadoc comment improved

[MRELEASE-1010] - Update parent to 32
 o Fixed checkstyle reported errors based on upgrade.
 o Switch to asfMavenTlpPlgnBuild
 o Support https.protocols for JDK 7
 o Removed hard coded version for maven-invoker-plugin now using
   3.0.1 instead of inherited 3.1.0
 o Changed scm version to release 1.10.0 instead of old snapshot version.

[INFRA-16467] move components documentation out of CMS space

[MPOM-205] use sha512 checksums instead of sha1

removed version already inherited from parent

Updated to correct URL.

[MRELEASE-1024] Upgrade to SCM 1.11.2

MRELEASE-985 Override snapshot dependencies from command line

 - Copy properties to the correct release descriptor in DefaultReleaseManager.
 - Do not fail the build if the property is resolved from the comand-line (in CheckDependencySnapshotsPhase).

See https://issues.apache.org/jira/browse/MRELEASE-985

[MRELEASE-1023] Minor code cleanups

This closes #22

Expose dependency.dev and dependency.rel properties

As part of this: #18 and this: https://issues.apache.org/jira/browse/MRELEASE-985
we need to check if the command line property starts with dependency.dev or dependency.rel to be able to override the value of the
property.

[MRELEASE-985] Add integration test

improve documentation site

Verify that schemaLocation keeps its original value

Codehaus Jira moved to ASF Jira

switch to https

[MRELEASE-1031] log info on release goals/phases progress

improve landing page

[MRELEASE-1032] add https://m.a.o/xsd/maven-4.0.0.xsd

[MRELEASE-229] implementation of RemoveScmTagPhase, with unit test

this closes #29

remove extraneous commas

@hboutemy

changed error to warn if tag is not present at rollback; fixed typos

Remove unused import

MRELEASE-980 Allow commit comments to be controlled

[maven-release-plugin] prepare release maven-release-3.0.0-M1

[maven-release-plugin] prepare for next development iteration

MRELEASE-1035 upgraded maven-plugin-tools and plexus-component-metadata to reproducible versions

Merge with master

Fix invalid project, flatten module should adjust relativePath

Remove unwanted writes to stderr during unittests

Fix relativePath

With Maven3+ distributionManagement.status not allowed in effective pom

Make org.eclipse.aether:aether-util optional, so maven-artifact-transfer can work with Maven 3.0 too.

Add missing remote extension artifact

Clone incorrectly set project.reporting.excludeDefaults from null to Boolean.FALSE

[MRELEASE-992] Deprecated maven flag --no-plugin-updates shows warnings in the console output

Apply multi-catch

[MRELEASE-601] The Maven 2 release plugin modifies CDATA elements in pom.xml files.

Add unittest for DefaultVersionPolicy

Reorganize if/then/else -statements to reduce nesting

[MRELEASE-694] -SNAPSHOT is unexpectedly appended to version in branched pom.xml

releaseDescriptor.getOriginalScmInfo( projectId ) is checked twice, so 1 can be removed.

[MRELEASE-1005] Extract ResourceGenerator from ReleasePhase

updated Modello xsd url

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873523 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873428 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873366 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873234 +0100

parent 657d493
author Thorsten Heit <[email protected]> 1530186251 +0200
committer Thorsten Heit <[email protected]> 1576873185 +0100

Fixes for MRELEASE-1009:
- clean up ambigous reference in JUnit test
- upgrade Surefire to 2.22.0 to avoid a NullPointerException under Java 10 when executing "mvn package"

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-956] Release Strategy Interface

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fixed improper merge with upstream

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

Fix for MRELEASE-835: Automatically resolve snapshot dependencies in release:prepare

[MRELEASE-998] Add ability to create custom phases

Fixed improper merge with upstream

Fixed improper merge with upstream

Fixed Checkstyle error

Javadoc comment improved

[MRELEASE-1010] - Update parent to 32
 o Fixed checkstyle reported errors based on upgrade.
 o Switch to asfMavenTlpPlgnBuild
 o Support https.protocols for JDK 7
 o Removed hard coded version for maven-invoker-plugin now using
   3.0.1 instead of inherited 3.1.0
 o Changed scm version to release 1.10.0 instead of old snapshot version.

[INFRA-16467] move components documentation out of CMS space

[MPOM-205] use sha512 checksums instead of sha1

removed version already inherited from parent

Updated to correct URL.

[MRELEASE-1024] Upgrade to SCM 1.11.2

MRELEASE-985 Override snapshot dependencies from command line

 - Copy properties to the correct release descriptor in DefaultReleaseManager.
 - Do not fail the build if the property is resolved from the comand-line (in CheckDependencySnapshotsPhase).

See https://issues.apache.org/jira/browse/MRELEASE-985

[MRELEASE-1023] Minor code cleanups

This closes #22

Expose dependency.dev and dependency.rel properties

As part of this: #18 and this: https://issues.apache.org/jira/browse/MRELEASE-985
we need to check if the command line property starts with dependency.dev or dependency.rel to be able to override the value of the
property.

[MRELEASE-985] Add integration test

improve documentation site

Verify that schemaLocation keeps its original value

Codehaus Jira moved to ASF Jira

switch to https

[MRELEASE-1031] log info on release goals/phases progress

improve landing page

[MRELEASE-1032] add https://m.a.o/xsd/maven-4.0.0.xsd

[MRELEASE-229] implementation of RemoveScmTagPhase, with unit test

this closes #29

remove extraneous commas

@hboutemy

changed error to warn if tag is not present at rollback; fixed typos

Remove unused import

MRELEASE-980 Allow commit comments to be controlled

[maven-release-plugin] prepare release maven-release-3.0.0-M1

[maven-release-plugin] prepare for next development iteration

MRELEASE-1035 upgraded maven-plugin-tools and plexus-component-metadata to reproducible versions

Merge with master

Removed changes from MRELEASE-549
  • Loading branch information
stephenc authored and theit committed Jan 7, 2020
1 parent ce04d7f commit dba8a32
Show file tree
Hide file tree
Showing 17 changed files with 249 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,19 @@ public interface ReleaseDescriptor
void setScmSourceUrl( String scmUrl );

/**
* Get whether the "--pin-externals" option in svn copy commands is enabled
* which is new in Subversion 1.9.
* 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
* @return String
*/
boolean isPinExternals();
String getAutoResolveSnapshots();
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,18 @@ public void write( BuilderReleaseDescriptor config, File file )

properties.setProperty( "remoteTagging", Boolean.toString( config.isRemoteTagging() ) );

properties.setProperty( "pinExternals", Boolean.toString( config.isPinExternals() ) );

properties.setProperty( "pushChanges", Boolean.toString( config.isPushChanges() ) );

if ( config.getWorkItem() != null )
{
properties.setProperty( "workItem", config.getWorkItem() );
}

if ( config.getAutoResolveSnapshots() != null )
{
properties.setProperty( "autoResolveSnapshots", config.getAutoResolveSnapshots() );
}

// others boolean properties are not written to the properties file because the value from the caller is always
// used

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ public ReleaseDescriptorBuilder addDependencyDevelopmentVersion( String dependen
return this;
}

public ReleaseDescriptorBuilder setPinExternals( boolean pinExternals )
public ReleaseDescriptorBuilder setAutoResolveSnapshots( String autoResolveSnapshots )
{
releaseDescriptor.setPinExternals( pinExternals );
releaseDescriptor.setAutoResolveSnapshots( autoResolveSnapshots );
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ public static void copyPropertiesToReleaseDescriptor( Properties properties, Rel
String remoteTaggingStr = properties.getProperty( "remoteTagging" );
builder.setRemoteTagging( Boolean.valueOf( remoteTaggingStr ) );
}
if ( properties.containsKey( "pinExternals" ) )
{
String pinExternals = properties.getProperty( "pinExternals" );
builder.setPinExternals( Boolean.valueOf( pinExternals ) );
}
if ( properties.containsKey( "pushChanges" ) )
{
String pushChanges = properties.getProperty( "pushChanges" );
Expand All @@ -175,6 +170,11 @@ public static void copyPropertiesToReleaseDescriptor( Properties properties, Rel
{
builder.setWorkItem( properties.getProperty( "workItem" ) );
}
if ( properties.containsKey( "autoResolveSnapshots" ) )
{
String resolve = properties.getProperty( "autoResolveSnapshots" );
builder.setAutoResolveSnapshots( resolve );
}

loadResolvedDependencies( properties, builder );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void checkProject( MavenProject project, ReleaseDescriptor releaseDescri
if ( !usedSnapshotDependencies.isEmpty() || !usedSnapshotReports.isEmpty()
|| !usedSnapshotExtensions.isEmpty() || !usedSnapshotPlugins.isEmpty() )
{
if ( releaseDescriptor.isInteractive() )
if ( releaseDescriptor.isInteractive() || null != releaseDescriptor.getAutoResolveSnapshots() )
{
resolveSnapshots( usedSnapshotDependencies, usedSnapshotReports, usedSnapshotExtensions,
usedSnapshotPlugins, releaseDescriptor );
Expand Down Expand Up @@ -365,49 +365,101 @@ private void resolveSnapshots( Set<Artifact> projectDependencies, Set<Artifact>
{
try
{
String autoResolveSnapshots = releaseDescriptor.getAutoResolveSnapshots();
if ( resolveSnapshot == null )
{
prompter.showMessage( RESOLVE_SNAPSHOT_MESSAGE );
resolveSnapshot = prompter.prompt( RESOLVE_SNAPSHOT_PROMPT, Arrays.asList( "yes", "no" ), "no" );
if ( autoResolveSnapshots != null )
{
resolveSnapshot = "yes";
prompter.showMessage( RESOLVE_SNAPSHOT_PROMPT + " " + resolveSnapshot );
}
else
{
resolveSnapshot = prompter.prompt( RESOLVE_SNAPSHOT_PROMPT, Arrays.asList( "yes", "no" ), "no" );
}
}

if ( resolveSnapshot.toLowerCase( Locale.ENGLISH ).startsWith( "y" ) )
{
if ( resolveSnapshotType == null )
{
prompter.showMessage( RESOLVE_SNAPSHOT_TYPE_MESSAGE );
resolveSnapshotType =
prompter.prompt( RESOLVE_SNAPSHOT_TYPE_PROMPT, Arrays.asList( "0", "1", "2", "3" ), "1" );
int defaultAnswer = -1;
if ( autoResolveSnapshots != null )
{
if ( "all".equalsIgnoreCase( autoResolveSnapshots ) )
{
defaultAnswer = 0;
}
else if ( "dependencies".equalsIgnoreCase( autoResolveSnapshots ) )
{
defaultAnswer = 1;
}
else if ( "plugins".equalsIgnoreCase( autoResolveSnapshots ) )
{
defaultAnswer = 2;
}
else if ( "reports".equalsIgnoreCase( autoResolveSnapshots ) )
{
defaultAnswer = 3;
}
else if ( "extensions".equalsIgnoreCase( autoResolveSnapshots ) )
{
defaultAnswer = 4;
}
else
{
try
{
defaultAnswer = Integer.parseInt( autoResolveSnapshots );
}
catch ( NumberFormatException e )
{
throw new ReleaseExecutionException( e.getMessage(), e );
}
}
}
if ( defaultAnswer >= 0 && defaultAnswer <= 4 )
{
prompter.showMessage( RESOLVE_SNAPSHOT_TYPE_PROMPT + " " + autoResolveSnapshots );
resolveSnapshotType = Integer.toString( defaultAnswer );
}
else
{
resolveSnapshotType =
prompter.prompt( RESOLVE_SNAPSHOT_TYPE_PROMPT, Arrays.asList( "0", "1", "2", "3" ), "1" );
}
}

switch ( Integer.parseInt( resolveSnapshotType.toLowerCase( Locale.ENGLISH ) ) )
{
// all
case 0:
processSnapshot( projectDependencies, releaseDescriptor );
processSnapshot( pluginDependencies, releaseDescriptor );
processSnapshot( reportDependencies, releaseDescriptor );
processSnapshot( extensionDependencies, releaseDescriptor );
processSnapshot( projectDependencies, releaseDescriptor, autoResolveSnapshots );
processSnapshot( pluginDependencies, releaseDescriptor, autoResolveSnapshots );
processSnapshot( reportDependencies, releaseDescriptor, autoResolveSnapshots );
processSnapshot( extensionDependencies, releaseDescriptor, autoResolveSnapshots );
break;

// project dependencies
case 1:
processSnapshot( projectDependencies, releaseDescriptor );
processSnapshot( projectDependencies, releaseDescriptor, autoResolveSnapshots );
break;

// plugins
case 2:
processSnapshot( pluginDependencies, releaseDescriptor );
processSnapshot( pluginDependencies, releaseDescriptor, autoResolveSnapshots );
break;

// reports
case 3:
processSnapshot( reportDependencies, releaseDescriptor );
processSnapshot( reportDependencies, releaseDescriptor, autoResolveSnapshots );
break;

// extensions
case 4:
processSnapshot( extensionDependencies, releaseDescriptor );
processSnapshot( extensionDependencies, releaseDescriptor, autoResolveSnapshots );
break;

default:
Expand All @@ -420,7 +472,8 @@ private void resolveSnapshots( Set<Artifact> projectDependencies, Set<Artifact>
}
}

private void processSnapshot( Set<Artifact> snapshotSet, ReleaseDescriptor releaseDescriptor )
private void processSnapshot( Set<Artifact> snapshotSet, ReleaseDescriptor releaseDescriptor,
String autoResolveSnapshots )
throws PrompterException, VersionParseException
{
Iterator<Artifact> iterator = snapshotSet.iterator();
Expand All @@ -435,8 +488,17 @@ private void processSnapshot( Set<Artifact> snapshotSet, ReleaseDescriptor relea

prompter.showMessage(
"Dependency '" + versionlessKey + "' is a snapshot (" + currentArtifact.getVersion() + ")\n" );
String result = prompter.prompt( "Which release version should it be set to?",
versionInfo.getReleaseVersionString() );
String message = "Which release version should it be set to?";
String result;
if ( null != autoResolveSnapshots )
{
result = versionInfo.getReleaseVersionString();
prompter.showMessage( message + " " + result );
}
else
{
result = prompter.prompt( message, versionInfo.getReleaseVersionString() );
}

releaseDescriptor.addDependencyReleaseVersion( versionlessKey, result );

Expand All @@ -456,7 +518,16 @@ private void processSnapshot( Set<Artifact> snapshotSet, ReleaseDescriptor relea
nextVersion = versionInfo.toString();
}

result = prompter.prompt( "What version should the dependency be reset to for development?", nextVersion );
message = "What version should the dependency be reset to for development?";
if ( null != autoResolveSnapshots )
{
result = nextVersion;
prompter.showMessage( message + " " + result );
}
else
{
result = prompter.prompt( message, nextVersion );
}

releaseDescriptor.addDependencyDevelopmentVersion( versionlessKey, result );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro
scmBranchParameters.setMessage( releaseDescriptor.getScmCommentPrefix() + "copy for branch " + branchName );
scmBranchParameters.setRemoteBranching( releaseDescriptor.isRemoteTagging() );
scmBranchParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() );
scmBranchParameters.setPinExternals( releaseDescriptor.isPinExternals() );

result = provider.branch( repository, fileSet, branchName, scmBranchParameters );
}
Expand Down Expand Up @@ -144,10 +143,6 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir
logInfo( result, " To SCM URL: " + releaseDescriptor.getScmBranchBase() );
}
logInfo( result, " with label: '" + releaseDescriptor.getScmReleaseLabel() + "'" );
if ( releaseDescriptor.isPinExternals() )
{
logInfo( result, " with pinned externals" );
}

result.setResultCode( ReleaseResult.SUCCESS );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,13 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro
new ScmTagParameters( releaseDescriptor.getScmCommentPrefix() + "copy for tag " + tagName );
scmTagParameters.setRemoteTagging( releaseDescriptor.isRemoteTagging() );
scmTagParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() );
scmTagParameters.setPinExternals( releaseDescriptor.isPinExternals() );
if ( getLogger().isDebugEnabled() )
{
getLogger().debug(
"ScmTagPhase :: scmTagParameters remotingTag " + releaseDescriptor.isRemoteTagging() );
getLogger().debug(
"ScmTagPhase :: scmTagParameters scmRevision " + releaseDescriptor.getScmReleasedPomRevision() );
getLogger().debug( "ScmTagPhase :: fileSet " + fileSet );
getLogger().debug(
"ScmTagPhase :: scmTagParameters pinExternals " + releaseDescriptor.isPinExternals() );
}
result = provider.tag( repository, fileSet, tagName, scmTagParameters );
}
Expand Down Expand Up @@ -171,10 +168,6 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir
logInfo( result, "Full run would be tagging remotely " + basedirAlignedReleaseDescriptor.getScmSourceUrl()
+ " with label: '" + releaseDescriptor.getScmReleaseLabel() + "'" );
}
if ( releaseDescriptor.isPinExternals() )
{
logInfo( result, "Full run would pin externals" );
}

result.setResultCode( ReleaseResult.SUCCESS );

Expand Down
26 changes: 17 additions & 9 deletions maven-release-manager/src/main/mdo/release-descriptor.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,22 @@
</field>

<field>
<name>pinExternals</name>
<name>autoResolveSnapshots</name>
<version>3.0.0+</version>
<type>boolean</type>
<defaultValue>false</defaultValue>
<type>String</type>
<description>
Enable the "--pin-externals" option in svn copy commands which is new in Subversion 1.9.
NOTE : Currently only implemented with Subversion.
(https://issues.apache.org/jira/browse/SCM-805)
<![CDATA[Specifies whether unresolved SNAPSHOT dependencies are automatically resolved.
If set, it is used as the answer to use when being asked how unresolved SNAPSHOT
dependencies should be resolved:
<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 dependencies</li>
<li>"reports" or "3": resolve report dependencies</li>
<li>"extensions" or "4": resolve extension dependencies</li>
</ul>
Additionally this implies that the default values for the dependency's release and next
development version are used.]]>
</description>
</field>

Expand Down Expand Up @@ -797,7 +805,6 @@
updateVersionsToSnapshot != that.isUpdateVersionsToSnapshot() ||
allowTimestampedSnapshots != that.isAllowTimestampedSnapshots() ||
remoteTagging != that.isRemoteTagging() ||
pinExternals != that.isPinExternals() ||
localCheckout != that.isLocalCheckout() ||
pushChanges != that.isPushChanges()
)
Expand All @@ -811,7 +818,8 @@
!java.util.Objects.equals( performGoals, that.getPerformGoals() ) ||
!java.util.Objects.equals( defaultReleaseVersion, that.getDefaultReleaseVersion() ) ||
!java.util.Objects.equals( workItem, that.getWorkItem() ) ||
!java.util.Objects.equals( scmReleasedPomRevision, that.getScmReleasedPomRevision() )
!java.util.Objects.equals( scmReleasedPomRevision, that.getScmReleasedPomRevision() ) ||
!java.util.Objects.equals( autoResolveSnapshots, that.getAutoResolveSnapshots() )
)
{
return false;
Expand Down Expand Up @@ -1067,7 +1075,7 @@
result = 29 * result + java.util.Objects.hashCode( defaultReleaseVersion );
result = 29 * result + java.util.Objects.hashCode( scmReleasedPomRevision );
result = 29 * result + java.util.Objects.hashCode( workItem );
result = 29 * result + java.util.Objects.hashCode( pinExternals );
result = 29 * result + java.util.Objects.hashCode( autoResolveSnapshots );
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public void testSuppressCommitBeforeTagOrBranch()
builder.setGenerateReleasePoms( true );
builder.setSuppressCommitBeforeTagOrBranch( true );
builder.setRemoteTagging( false );
builder.setPinExternals( false );
mapNextVersion( builder, "groupId:artifactId" );

phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );
Expand All @@ -136,7 +135,6 @@ public void testSuppressCommitBeforeTagOrBranchAndReomoteTagging()
builder.setGenerateReleasePoms( true );
builder.setSuppressCommitBeforeTagOrBranch( true );
builder.setRemoteTagging( true );
builder.setPinExternals( false );
mapNextVersion( builder, "groupId:artifactId" );

phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public boolean matches( Object argument )
{
ScmBranchParameters sbp = (ScmBranchParameters) argument;
return sbp.getMessage().equals( this.scmBranchParameters.getMessage() )
&& sbp.isRemoteBranching() == this.scmBranchParameters.isRemoteBranching()
&& sbp.isPinExternals() == this.scmBranchParameters.isPinExternals();
//&& stp.isRemoteTagging() == this.scmBranchParameters.isRemoteTagging()
;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public boolean matches( Object argument )
{
ScmTagParameters stp = (ScmTagParameters) argument;
return stp.getMessage().equals( this.scmTagParameters.getMessage() )
&& stp.isRemoteTagging() == this.scmTagParameters.isRemoteTagging()
&& stp.isPinExternals() == this.scmTagParameters.isPinExternals();
&& stp.isRemoteTagging() == this.scmTagParameters.isRemoteTagging();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public void testNoCommitOrRollbackRequired()
List<MavenProject> reactorProjects = createReactorProjects();

builder.setRemoteTagging( false );
builder.setPinExternals( false );
builder.setSuppressCommitBeforeTagOrBranch( true );
builder.setUpdateWorkingCopyVersions( false );

Expand Down
Loading

0 comments on commit dba8a32

Please sign in to comment.