Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

theit
Copy link
Contributor

@theit theit commented Oct 26, 2017

This pull requests adds support to release:prepare to let it automatically resolve snapshot dependencies without user interaction. Without this it is (almost) impossible to use the release plugin in full batch mode:

Assume your project A's pom.xml contains a snapshot dependency to project B which was released in the meantime. As long as you're running "mvn release:prepare release:perform" in a console on project A, everything works; the user is asked to resolve the snapshot dependency. So far, so good.
If you're using a build server for doing releases in batch mode, i.e. without the ability for user interaction, this won't work because release:prepare hangs while waiting for user input that never happens.

@olamy
Copy link
Member

olamy commented Oct 27, 2017

@theit I'm happy with those changes. Except the lack of test. Is there anything you can do? A plugin IT test?

@rfscholte
Copy link
Contributor

Due to my codechanges there are conflicts. IMHO this PR requires 2 things. Only 1 new parameter, autoResolveSnapshotDependenciesMode, which is null by default, meaning no auto resolution.
And just like Olivier said: due to the new process this change requires at least a unittest. There are enough examples.

@theit
Copy link
Contributor Author

theit commented Dec 20, 2019

@rfscholte :
Sorry for the very long delay. I was a bit too busy with $DAYJOB and a few other things...
I finally merged the changes that happened in the meantime in the master branch, and according to your suggestion I replaced the former two parameters by only one that is null by default.
Additionally an IT was added for this PR, hoping that it fits your needs.

operations. This feature was introducted in Subversion 1.9 and is
available in maven-scm-plugin since version 1.11.1
@rfscholte
Copy link
Contributor

@theit I can't apply the patch locally (required to run it on https://builds.apache.org/job/maven-box/job/maven-release/ ). Can you squash your commits for me?

@theit
Copy link
Contributor Author

theit commented Dec 20, 2019

@rfscholte Can you try again?

@rfscholte
Copy link
Contributor

rfscholte commented Dec 20, 2019

@theit
Copy link
Contributor Author

theit commented Dec 20, 2019

Can you tell me where you have merge errors?

@theit
Copy link
Contributor Author

theit commented Jan 7, 2020

@rfscholte: I've tried again to squash them and rebase the master branch into the PR. Can you again have a look please?

@rfscholte
Copy link
Contributor

Still not possible. Can you try these instructions: https://github.com/wprig/wprig/wiki/How-to-squash-commits

author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433024 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433018 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433016 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433015 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433011 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578433009 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578432997 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578432995 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578432994 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 1578432986 +0100

parent ce04d7f
author Stephen Connolly <stephen.alan.connolly@gmail.com> 1511735859 +0000
committer Thorsten Heit <theit@gmx.de> 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 <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

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

Removed changes from MRELEASE-549
@theit
Copy link
Contributor Author

theit commented Jan 7, 2020

@rfscholte: Sorry for the noise, I used the wrong push command (typical user error)... :-/
Can you try again please?

@rfscholte
Copy link
Contributor

@rfscholte
Copy link
Contributor

Jenkins build is good. One more question: do you have an ICLA? (see https://www.apache.org/licenses/contributor-agreements.html )

@theit
Copy link
Contributor Author

theit commented Jan 8, 2020

I just filled out the PDF and sent it to the given email address in your link.

@rfscholte rfscholte merged commit ec43b59 into apache:master Jan 8, 2020
@theit theit deleted the MRELEASE-835 branch January 9, 2020 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants