Skip to content

Commit

Permalink
Add Jenkinsfile
Browse files Browse the repository at this point in the history
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 <olamy@apache.org>

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 <theit@gmx.de> 1530186251 +0200
committer Thorsten Heit <theit@gmx.de> 1576873523 +0100

parent 657d493
author Thorsten Heit <theit@gmx.de> 1530186251 +0200
committer Thorsten Heit <theit@gmx.de> 1576873428 +0100

parent 657d493
author Thorsten Heit <theit@gmx.de> 1530186251 +0200
committer Thorsten Heit <theit@gmx.de> 1576873366 +0100

parent 657d493
author Thorsten Heit <theit@gmx.de> 1530186251 +0200
committer Thorsten Heit <theit@gmx.de> 1576873234 +0100

parent 657d493
author Thorsten Heit <theit@gmx.de> 1530186251 +0200
committer Thorsten Heit <theit@gmx.de> 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 apache#22

Expose dependency.dev and dependency.rel properties

As part of this: apache#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 apache#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
  • Loading branch information
stephenc authored and theit committed Jan 7, 2020
1 parent ce04d7f commit f6af4e8
Show file tree
Hide file tree
Showing 13 changed files with 246 additions and 58 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
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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ public void testSuppressCommitWithRemoteTaggingFails()
List<MavenProject> reactorProjects = createReactorProjects();

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

ScmProvider scmProviderMock = mock( ScmProvider.class );
Expand Down
Loading

0 comments on commit f6af4e8

Please sign in to comment.