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

release-version.sh failing on Windows Git Bash #49

Closed
imagejan opened this issue Jan 24, 2023 · 7 comments
Closed

release-version.sh failing on Windows Git Bash #49

imagejan opened this issue Jan 24, 2023 · 7 comments

Comments

@imagejan
Copy link
Member

imagejan commented Jan 24, 2023

As mentioned in ijpb/MorphoLibJ#62 (comment), it seems there's a general issue with release-version.sh when used in Git Bash. I was now able to reproduce the behavior in imagej-plugins-search-biii and get the following output:

Full output of release-version.sh
Version? [0.0.1]:
Detected DEFAULT version bump
From github.com:imagej/imagej-plugins-search-biii
 * branch            master     -> FETCH_HEAD
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< net.imagej:imagej-plugins-search-biii >----------------
[INFO] Building ImageJ Search Plugins for BIII 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- license-maven-plugin:2.0.0:update-project-license (default-cli) @ imagej-plugins-search-biii ---
[INFO] Adding a license repository jar:file:/C:/Users/eglijan/.m2/repository/org/codehaus/mojo/license-maven-plugin/2.0.0/license-maven-plugin-2.0.0.jar!/META-INF/licenses
[INFO] register COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
[INFO] register GNU General Public License (GPL) version 3.0
[INFO] register MIT-License
[INFO] register GNU General Public License (GPL) version 2.0
[INFO] register GNU General Public License (GPL) version 1.0
[INFO] register GNU Free Documentation License (FDL) version 1.3
[INFO] register Eclipse Public License - v 2.0 with Secondary License
[INFO] register Eclipse Public + Distribution License - v 1.0
[INFO] register Eclipse Public License - v 2.0
[INFO] register Eclipse Public License - v 1.0
[INFO] register GNU Affero General Public License (AGPL) version 3.0
[INFO] register GNU General Lesser Public License (LGPL) version 3.0
[INFO] register GNU General Lesser Public License (LGPL) version 2.1
[INFO] register Apache License version 2.0
[INFO] register European Union Public License v1.1
[INFO] register BSD 3-Clause License
[INFO] register BSD 2-Clause License
[INFO]
[INFO] --- license-maven-plugin:2.0.0:update-file-header (default-cli) @ imagej-plugins-search-biii ---
[INFO] Adding a license repository jar:file:/C:/Users/eglijan/.m2/repository/org/codehaus/mojo/license-maven-plugin/2.0.0/license-maven-plugin-2.0.0.jar!/META-INF/licenses
[INFO] register COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
[INFO] register GNU General Public License (GPL) version 3.0
[INFO] register MIT-License
[INFO] register GNU General Public License (GPL) version 2.0
[INFO] register GNU General Public License (GPL) version 1.0
[INFO] register GNU Free Documentation License (FDL) version 1.3
[INFO] register Eclipse Public License - v 2.0 with Secondary License
[INFO] register Eclipse Public + Distribution License - v 1.0
[INFO] register Eclipse Public License - v 2.0
[INFO] register Eclipse Public License - v 1.0
[INFO] register GNU Affero General Public License (AGPL) version 3.0
[INFO] register GNU General Lesser Public License (LGPL) version 3.0
[INFO] register GNU General Lesser Public License (LGPL) version 2.1
[INFO] register Apache License version 2.0
[INFO] register European Union Public License v1.1
[INFO] register BSD 3-Clause License
[INFO] register BSD 2-Clause License
[INFO] Will search files to update from root C:\code\imagej\imagej-plugins-search-biii\src
[INFO] Will search files to update from root C:\code\imagej\imagej-plugins-search-biii\target\generated-sources
[INFO] Scan 3 files header done in 30.847ms.
[INFO]
 * update header on 3 files.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.607 s
[INFO] Finished at: 2023-01-24T13:13:08+01:00
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< net.imagej:imagej-plugins-search-biii >----------------
[INFO] Building ImageJ Search Plugins for BIII 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.5.3:prepare (default-cli) @ imagej-plugins-search-biii ---
[INFO] Verifying that there are no local modifications...
[INFO]   ignoring changes on: **\pom.xml.next, **\release.properties, **\pom.xml.branch, **\pom.xml.tag, **\pom.xml.backup, **\pom.xml.releaseBackup
[INFO] Executing: cmd.exe /X /C "git rev-parse --show-toplevel"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git status --porcelain ."
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] Transforming 'ImageJ Search Plugins for BIII'...
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ---------------< net.imagej:imagej-plugins-search-biii >----------------
[INFO] [INFO] Building ImageJ Search Plugins for BIII 0.0.1
[INFO] [INFO] --------------------------------[ jar ]---------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ imagej-plugins-search-biii ---
[INFO] [INFO] Deleting C:\code\imagej\imagej-plugins-search-biii\target
[INFO] [INFO]
[INFO] [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-rules) @ imagej-plugins-search-biii ---
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] [INFO] Adding ignore: com.google.inject.*
[INFO] [INFO] Adding ignore: javax.xml.namespace.QName
[INFO] [INFO] Adding ignore: jnr.ffi.*
[INFO] [INFO] Adding ignore: org.apache.hadoop.yarn.*.package-info
[INFO] [INFO] Adding ignore: org.apache.spark.unused.UnusedStubClass
[INFO] [INFO] Adding ignore: org.eclipse.aether.*
[INFO] [INFO] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
[INFO] [INFO] Adding ignore: org.jetbrains.kotlin.daemon.common.*
[INFO] [INFO] Adding ignore: org.junit.runner.Runner
[INFO] [INFO] Adding ignore: org.jzy3d.plot3d.pipelines.*
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO]
[INFO] [INFO] --- maven-help-plugin:3.2.0:active-profiles (show-active-profiles) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] Active Profiles for Project 'net.imagej:imagej-plugins-search-biii:jar:0.0.1':
[INFO]
[INFO] The following profiles are active:
[INFO]
[INFO]  - deploy-to-scijava (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]  - scijava-platform-amd64 (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]  - scijava-platform-windows (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]
[INFO]
[INFO]
[INFO] [INFO]
[INFO] [INFO] --- build-helper-maven-plugin:3.2.0:regex-property (sanitize-version) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- build-helper-maven-plugin:3.2.0:regex-property (guess-package) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- buildnumber-maven-plugin:1.4:create (default) @ imagej-plugins-search-biii ---
[INFO] [INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] [INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] [INFO] Storing buildNumber: 5714ca6521a21b8eb91fc527cfd7e80adb5fa36a at timestamp: 1674562394460
[INFO] [INFO] Storing buildScmBranch: master
[INFO] [INFO]
[INFO] [INFO] --- scijava-maven-plugin:2.1.0:set-rootdir (set-rootdir) @ imagej-plugins-search-biii ---
[INFO] [INFO] Setting rootdir: C:\code\imagej\imagej-plugins-search-biii
[INFO] [INFO]
[INFO] [INFO] --- jacoco-maven-plugin:0.8.7:prepare-agent (jacoco-initialize) @ imagej-plugins-search-biii ---
[INFO] [INFO] argLine set to -javaagent:C:\\Users\\eglijan\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.7\\org.jacoco.agent-0.8.7-runtime.jar=destfile=C:\\code\\imagej\\imagej-plugins-search-biii\\target\\jacoco.exec
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ imagej-plugins-search-biii ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] [INFO] skip non existing resourceDirectory C:\code\imagej\imagej-plugins-search-biii\src\main\resources
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ imagej-plugins-search-biii ---
[INFO] [INFO] Compiling 3 source files to C:\code\imagej\imagej-plugins-search-biii\target\classes
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ imagej-plugins-search-biii ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] [INFO] skip non existing resourceDirectory C:\code\imagej\imagej-plugins-search-biii\src\test\resources
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ imagej-plugins-search-biii ---
[INFO] [INFO] Nothing to compile - all classes are up to date
[INFO] [INFO]
[INFO] [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ imagej-plugins-search-biii ---
[INFO] [INFO] No tests to run.
[INFO] [INFO]
[INFO] [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ imagej-plugins-search-biii ---
[INFO] [INFO] Building jar: C:\code\imagej\imagej-plugins-search-biii\target\imagej-plugins-search-biii-0.0.1.jar
[INFO] [INFO]
[INFO] [INFO] >>> maven-source-plugin:3.2.1:jar (attach-sources-jar) > generate-sources @ imagej-plugins-search-biii >>>
[INFO] [INFO]
[INFO] [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-rules) @ imagej-plugins-search-biii ---
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] [INFO] Adding ignore: com.google.inject.*
[INFO] [INFO] Adding ignore: javax.xml.namespace.QName
[INFO] [INFO] Adding ignore: jnr.ffi.*
[INFO] [INFO] Adding ignore: org.apache.hadoop.yarn.*.package-info
[INFO] [INFO] Adding ignore: org.apache.spark.unused.UnusedStubClass
[INFO] [INFO] Adding ignore: org.eclipse.aether.*
[INFO] [INFO] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
[INFO] [INFO] Adding ignore: org.jetbrains.kotlin.daemon.common.*
[INFO] [INFO] Adding ignore: org.junit.runner.Runner
[INFO] [INFO] Adding ignore: org.jzy3d.plot3d.pipelines.*
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO] Adding ignore: module-info
[INFO] [INFO]
[INFO] [INFO] --- maven-help-plugin:3.2.0:active-profiles (show-active-profiles) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] Active Profiles for Project 'net.imagej:imagej-plugins-search-biii:jar:0.0.1':
[INFO]
[INFO] The following profiles are active:
[INFO]
[INFO]  - deploy-to-scijava (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]  - scijava-platform-amd64 (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]  - scijava-platform-windows (source: org.scijava:pom-scijava-base:15.0.3)
[INFO]
[INFO]
[INFO]
[INFO] [INFO]
[INFO] [INFO] --- build-helper-maven-plugin:3.2.0:regex-property (sanitize-version) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- build-helper-maven-plugin:3.2.0:regex-property (guess-package) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- buildnumber-maven-plugin:1.4:create (default) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- scijava-maven-plugin:2.1.0:set-rootdir (set-rootdir) @ imagej-plugins-search-biii ---
[INFO] [INFO]
[INFO] [INFO] --- jacoco-maven-plugin:0.8.7:prepare-agent (jacoco-initialize) @ imagej-plugins-search-biii ---
[INFO] [INFO] argLine set to -javaagent:C:\\Users\\eglijan\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.7\\org.jacoco.agent-0.8.7-runtime.jar=destfile=C:\\code\\imagej\\imagej-plugins-search-biii\\target\\jacoco.exec
[INFO] [INFO]
[INFO] [INFO] <<< maven-source-plugin:3.2.1:jar (attach-sources-jar) < generate-sources @ imagej-plugins-search-biii <<<
[INFO] [INFO]
[INFO] [INFO]
[INFO] [INFO] --- maven-source-plugin:3.2.1:jar (attach-sources-jar) @ imagej-plugins-search-biii ---
[INFO] [INFO] Building jar: C:\code\imagej\imagej-plugins-search-biii\target\imagej-plugins-search-biii-0.0.1-sources.jar
[INFO] [INFO]
[INFO] [INFO] --- jacoco-maven-plugin:0.8.7:report (jacoco-site) @ imagej-plugins-search-biii ---
[INFO] [INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] [INFO]
[INFO] [INFO] --- maven-javadoc-plugin:3.3.0:jar (attach-javadocs) @ imagej-plugins-search-biii ---
[INFO] [INFO] No previous run data found, generating javadoc.
[INFO] [INFO]
[INFO] Loading source file C:\code\imagej\imagej-plugins-search-biii\src\main\java\net\imagej\search\biii\BIIIeuSearcher.java...
[INFO] Loading source file C:\code\imagej\imagej-plugins-search-biii\src\main\java\net\imagej\search\biii\BIIIeuSearchResult.java...
[INFO] Loading source file C:\code\imagej\imagej-plugins-search-biii\src\main\java\net\imagej\search\biii\OpenBIIIeuInBrowserActionFactory.java...
[INFO] Loading source files for package net.imagej.search.biii...
[INFO] Constructing Javadoc information...
[INFO] Standard Doclet version 1.8.0_361
[INFO] Building tree for all the packages and classes...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\BIIIeuSearcher.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\BIIIeuSearchResult.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\OpenBIIIeuInBrowserActionFactory.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\package-frame.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\package-summary.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\package-tree.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\constant-values.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\BIIIeuSearcher.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\BIIIeuSearchResult.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\OpenBIIIeuInBrowserActionFactory.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\OpenBIIIeuInBrowserActionFactory.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\BIIIeuSearchResult.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\class-use\BIIIeuSearcher.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\net\imagej\search\biii\package-use.html...
[INFO] Building index for all the packages and classes...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\overview-tree.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\index-all.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\deprecated-list.html...
[INFO] Building index for all classes...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\allclasses-frame.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\allclasses-noframe.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\index.html...
[INFO] Generating C:\code\imagej\imagej-plugins-search-biii\target\apidocs\help-doc.html...
[INFO] 6 warnings
[INFO] [WARNING] Javadoc Warnings
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://imagej.net/ij/developer/api/
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://javadoc.scijava.org/MorphoLibJ/
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://javadoc.scijava.org/Eclipse/
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://javadoc.scijava.org/JGraphT/
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://javadoc.scijava.org/JOML/
[INFO] [WARNING] javadoc: warning - Error fetching URL: https://javadoc.scijava.org/Javassist/
[INFO] [INFO] Building jar: C:\code\imagej\imagej-plugins-search-biii\target\imagej-plugins-search-biii-0.0.1-javadoc.jar
[INFO] [INFO]
[INFO] [INFO] --- maven-jar-plugin:3.2.0:test-jar (default) @ imagej-plugins-search-biii ---
[INFO] [INFO] Skipping packaging of the test-jar
[INFO] [INFO]
[INFO] [INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) @ imagej-plugins-search-biii ---
[INFO] [INFO] No tests to run.
[INFO] [INFO]
[INFO] [INFO] --- maven-failsafe-plugin:2.22.2:verify (default) @ imagej-plugins-search-biii ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time:  37.181 s
[INFO] [INFO] Finished at: 2023-01-24T13:13:49+01:00
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git rev-parse --show-toplevel"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git status --porcelain ."
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[WARNING] Ignoring unrecognized line: ?? pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] Executing: cmd.exe /X /C "git commit --verbose -F C:\Users\eglijan\AppData\Local\Temp\maven-scm-660226626.commit pom.xml"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Tagging release with the label imagej-plugins-search-biii-0.0.1...
[INFO] Executing: cmd.exe /X /C "git tag -F C:\Users\eglijan\AppData\Local\Temp\maven-scm-1213442929.commit imagej-plugins-search-biii-0.0.1"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git ls-files"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Transforming 'ImageJ Search Plugins for BIII'...
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git rev-parse --show-toplevel"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Executing: cmd.exe /X /C "git status --porcelain ."
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[WARNING] Ignoring unrecognized line: ?? pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] Executing: cmd.exe /X /C "git commit --verbose -F C:\Users\eglijan\AppData\Local\Temp\maven-scm-260965389.commit pom.xml"
[INFO] Working directory: C:\code\imagej\imagej-plugins-search-biii
[INFO] Release preparation complete.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  40.768 s
[INFO] Finished at: 2023-01-24T13:13:50+01:00
[INFO] ------------------------------------------------------------------------
The release preparation step failed -- look above for errors and fix them.
Use "mvn javadoc:javadoc | grep error" to check for javadoc syntax errors.

It looks like the maven release plugin finishes release preparation successfully, and the respective changes were committed locally:

commit 3dfb9947b1665ad5afa61128bae4eef3aeea30ae (HEAD -> master)
Author: Jan Eglinger <jan.eglinger@fmi.ch>
Date:   Tue Jan 24 13:13:50 2023 +0100

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

commit 502842b900bcc0f4b8f160ecf711a6df0397a351 (tag: imagej-plugins-search-biii-0.0.1)
Author: Jan Eglinger <jan.eglinger@fmi.ch>
Date:   Tue Jan 24 13:13:49 2023 +0100

    [maven-release-plugin] prepare release imagej-plugins-search-biii-0.0.1

So it seems the script is running until here:

$DRY_RUN mvn $BATCH_MODE release:prepare -DpushChanges=false -Dresume=false $TAG \
$PROFILE $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 then maven returns a non-zero exit code?!

Indeed, runnning:

 mvn --batch-mode release:prepare -DpushChanges=false -Dresume=false -Pdeploy-to-scijava -DreleaseVersion=0.0.1 -Darguments=-Dgpg.skip=true; echo "result=$?"

... results in:

[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  39.127 s
[INFO] Finished at: 2023-01-24T13:45:35+01:00
[INFO] ------------------------------------------------------------------------
result=1

@ctrueden any ideas?

@imagejan
Copy link
Member Author

Oh, interesting and might be related 👀:

mojohaus/versions#483

@imagejan
Copy link
Member Author

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.

@imagejan
Copy link
Member Author

imagejan commented Jan 24, 2023

🚀 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

@ctrueden
Copy link
Member

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

  1. I didn't test it. 😉 So it might be necessary, instead or in addition, to do:
    EXTRA_ARGS=" $EXTRA_ARGS -Dmaven-release-plugin.version=3.0.0-M7"
    so that the argument gets passed into the nested -Darguments of the build as well? (I'm guessing not, but maybe...)
  2. 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?

@imagejan
Copy link
Member Author

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.

@ctrueden
Copy link
Member

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.

@ctrueden
Copy link
Member

Closing this, with the assumption that projects extending pom-scijava 34+ are now OK. Please reopen if not.

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

No branches or pull requests

2 participants