Comments (7)
OK, just for completeness, I did work up a version of this patch that only forces the maven-release-plugin version if it's too old:
diff --git a/release-version.sh b/release-version.sh
index 197ebe3..366ada5 100755
--- a/release-version.sh
+++ b/release-version.sh
@@ -30,6 +30,11 @@ no_changes_pending() {
git diff-index --cached --quiet --ignore-submodules HEAD --
}
+mavenEvaluate() {
+ result=$(mvn -B -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args="$1" --non-recursive validate exec:exec 2>&1)
+ test $? -eq 0 && echo "$result" || mvn -B -U -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args="$1" --non-recursive validate exec:exec 2>&1
+}
+
# -- Constants and settings --
SCIJAVA_BASE_REPOSITORY=-DaltDeploymentRepository=scijava.releases::default::dav:https://maven.scijava.org/content/repositories
@@ -118,16 +123,16 @@ Options include:
# -- Extract project details --
debug "Extracting project details"
-echoArg='${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}'
-projectDetails=$(mvn -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
-test $? -eq 0 || projectDetails=$(mvn -U -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
+projectDetails=$(mavenEvaluate '${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}:${maven-release-plugin.version}')
test $? -eq 0 || die "Could not extract version from pom.xml. Error follows:\n$projectDetails"
echo "$projectDetails" | grep -Fqv '[ERROR]' ||
die "Error extracting version from pom.xml. Error follows:\n$projectDetails"
currentVersion=${projectDetails%%:*}
projectDetails=${projectDetails#*:}
licenseName=${projectDetails%%:*}
-parentGAV=${projectDetails#*:}
+projectDetails=${projectDetails#*:}
+parentGAV=${projectDetails%%:*}
+releasePluginVersion=${projectDetails#*:}
# -- Sanity checks --
debug "Performing sanity checks"
@@ -328,10 +333,27 @@ exclude them by setting license.excludes in your POM; e.g.:
Alternately, try again with the --skip-license-update flag.'
}
+# Work around issue with the maven-release-plugin on Windows Git Bash.
+# See: https://github.com/scijava/scijava-scripts/issues/49
+WORKAROUNDS=
+case "$(uname -s 2> /dev/null)" in
+ MINGW*)
+ case "$releasePluginVersion" in
+ 0.*|1.*|2.*)
+ echo "--> Forcing maven-release-plugin version from $releasePluginVersion to 3.0.0-M7"
+ WORKAROUNDS=-Dmaven-release-plugin.version=3.0.0-M7
+ ;;
+ *)
+ echo "--> maven-release-plugin version OK: $releasePluginVersion"
+ ;;
+ esac
+ ;;
+esac
+
# Prepare new release without pushing (requires the release plugin >= 2.1).
debug "Preparing new release"
$DRY_RUN mvn $BATCH_MODE release:prepare -DpushChanges=false -Dresume=false $TAG \
- $PROFILE $DEV_VERSION -DreleaseVersion="$VERSION" \
+ $PROFILE $WORKAROUNDS $DEV_VERSION -DreleaseVersion="$VERSION" \
"-Darguments=-Dgpg.skip=true ${EXTRA_ARGS# }" ||
die 'The release preparation step failed -- look above for errors and fix them.
Use "mvn javadoc:javadoc | grep error" to check for javadoc syntax errors.'
But I won't apply it now, in favor of the anticipated pom-scijava 34 release.
from scijava-scripts.
Closing this, with the assumption that projects extending pom-scijava 34+ are now OK. Please reopen if not.
from scijava-scripts.
Oh, interesting and might be related 👀:
from scijava-scripts.
For maven-release-plugin
at version 2.5.3' (the version currently managed by
pom-scijava-base`, I get:
$ mvn dependency:tree | grep interactivity
[INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-6:compile
... and for the latest release maven-release-plugin-3.0.0-M7
:
$ mvn dependency:tree | grep interactivity
[INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.1:compile
So given the discussion linked in my previous comment, I assume this should be fixed if we bump our dependency in pom-scijava-base
to that version.
from scijava-scripts.
🚀 pinning the version property <maven-release-plugin.version>3.0.0-M7</maven-release-plugin.version>
works around this issue in any downstream project:
For example:
imagej/imagej-plugins-search-biii@caa181c
from scijava-scripts.
@imagejan Cool, glad you found a workaround! 👍 How about if we had this hack to release-version.sh
instead of changing the pom.xml
files of projects being released in this way? Something like:
diff --git a/release-version.sh b/release-version.sh
index 197ebe3..2c80ba6 100755
--- a/release-version.sh
+++ b/release-version.sh
@@ -328,10 +328,16 @@ exclude them by setting license.excludes in your POM; e.g.:
Alternately, try again with the --skip-license-update flag.'
}
+# Work around issue with the maven-release-plugin on Windows Git Bash.
+RELEASE_HACK=
+case "$(uname -s 2> /dev/null)" in
+ MINGW*) RELEASE_HACK=-Dmaven-release-plugin.version=3.0.0-M7 ;;
+esac
+
# Prepare new release without pushing (requires the release plugin >= 2.1).
debug "Preparing new release"
$DRY_RUN mvn $BATCH_MODE release:prepare -DpushChanges=false -Dresume=false $TAG \
- $PROFILE $DEV_VERSION -DreleaseVersion="$VERSION" \
+ $PROFILE $RELEASE_HACK $DEV_VERSION -DreleaseVersion="$VERSION" \
"-Darguments=-Dgpg.skip=true ${EXTRA_ARGS# }" ||
die 'The release preparation step failed -- look above for errors and fix them.
Use "mvn javadoc:javadoc | grep error" to check for javadoc syntax errors.'
A couple of concerns though:
- I didn't test it. 😉 So it might be necessary, instead or in addition, to do:
so that the argument gets passed into the nested
EXTRA_ARGS=" $EXTRA_ARGS -Dmaven-release-plugin.version=3.0.0-M7"
-Darguments
of the build as well? (I'm guessing not, but maybe...) - Once a newer version than 3.0.0-M7 is released, this hack would continue pinning it to the then-not-newest milestone release, which is probably undesirable. So maybe the hack should check first, similar to how the
ci-build.sh
script upgrades the maven-gpg-plugin if it is too old.
Thoughts?
from scijava-scripts.
Thanks, Curtis. Yes, this hack in release-version.sh
would probably make it better at once for all Git Bash users. I'm just afraid of the increased maintenance burden on the scijava-scripts
side (i.e. on you) then.
If a new release of pom-scijava-base
(with scijava/pom-scijava-base#33) and pom-scijava
is around the corner, this would be a more sustainable solution IMHO, as release-version.sh
anyways checks if the parent POM is up to date, so people upgrade and benefit from the change.
from scijava-scripts.
Related Issues (20)
- Travisify.sh: no repoSlug on Windows (GitBash)
- Releasing with release-version.sh stops halfway with Git Bash on Windows HOT 2
- travis-build: also run javadoc generation for PRs HOT 2
- travisify: make sure build.sh is committed as executable on Windows HOT 1
- Reference to non-existing wiki page HOT 2
- Consider japi-tracker integration into CI HOT 6
- Automate generation of release notes HOT 3
- Enable logic to fail the release if SemVer is broken
- melting-pot: deal with clashing artifactId strings
- Deal with github renaming the default branch from master to main HOT 2
- Workflow compatibility in scripts HOT 5
- Error with GPL_3, asks for gpl_v3 HOT 4
- melting-pot: what to do about multi-module builds? HOT 3
- Melting-pot: Detecting incompatible bytecode HOT 4
- release-version: bad behavior when previous release files are present HOT 1
- release-version: newline style is fragile with WSL HOT 1
- Melting pot with `-c ... -p` flags fails
- Release tags point to non-existing commits in github HOT 4
- release_version.sh currently failing bc of unavailable javadoc resources HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scijava-scripts.