@@ -165,38 +165,37 @@ EOL
165165 checkSuccess $?
166166 fi
167167
168+ # HACK: Use maven-gpg-plugin 3.0.1+. Avoids "signing failed: No such file or directory" error.
169+ maven_gpg_plugin_version=$( mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args=' ${maven-gpg-plugin.version}' --non-recursive validate exec:exec 2>&1 )
170+ case " $maven_gpg_plugin_version " in
171+ 0.* |1.* |2.* |3.0.0)
172+ echo " --> Forcing maven-gpg-plugin version from $maven_gpg_plugin_version to 3.0.1"
173+ BUILD_ARGS=" $BUILD_ARGS -Dmaven-gpg-plugin.version=3.0.1 -Darguments=-Dmaven-gpg-plugin.version=3.0.1"
174+ ;;
175+ * )
176+ echo " --> maven-gpg-plugin version OK: $maven_gpg_plugin_version "
177+ ;;
178+ esac
179+
180+ # HACK: Install pinentry helper program if missing. Avoids "signing failed: No pinentry" error.
181+ if which pinentry > /dev/null 2>&1 ; then
182+ echo ' --> Installing missing pinentry helper for GPG'
183+ sudo apt-get install -y pinentry-tty
184+ # HACK: Restart the gpg agent, to notice the newly installed pinentry.
185+ if { pgrep gpg-agent > /dev/null && which gpgconf > /dev/null 2>&1 ; } then
186+ echo ' --> Restarting gpg-agent'
187+ gpgconf --reload gpg-agent
188+ checkSuccess $?
189+ fi
190+ fi
191+
168192 # --== BUILD EXECUTION ==--
169193
170194 # Run the build.
171195 BUILD_ARGS=' -B -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"'
172196 if [ " $deployOK " -a -f release.properties ]; then
173197 echo
174198 echo " == Cutting and deploying release version =="
175-
176- # HACK: Use maven-gpg-plugin 3.0.1+. Avoids "signing failed: No such file or directory" error.
177- maven_gpg_plugin_version=$( mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args=' ${maven-gpg-plugin.version}' --non-recursive validate exec:exec 2>&1 )
178- case " $maven_gpg_plugin_version " in
179- 0.* |1.* |2.* |3.0.0)
180- echo " --> Forcing maven-gpg-plugin version from $maven_gpg_plugin_version to 3.0.1"
181- BUILD_ARGS=" $BUILD_ARGS -Dmaven-gpg-plugin.version=3.0.1 -Darguments=-Dmaven-gpg-plugin.version=3.0.1"
182- ;;
183- * )
184- echo " --> maven-gpg-plugin version OK: $maven_gpg_plugin_version "
185- ;;
186- esac
187-
188- # HACK: Install pinentry helper program if missing. Avoids "signing failed: No pinentry" error.
189- if which pinentry > /dev/null 2>&1 ; then
190- echo ' --> Installing missing pinentry helper for GPG'
191- sudo apt-get install -y pinentry-tty
192- # HACK: Restart the gpg agent, to notice the newly installed pinentry.
193- if { pgrep gpg-agent > /dev/null && which gpgconf > /dev/null 2>&1 ; } then
194- echo ' --> Restarting gpg-agent'
195- gpgconf --reload gpg-agent
196- checkSuccess $?
197- fi
198- fi
199-
200199 mvn -B $BUILD_ARGS release:perform
201200 checkSuccess $?
202201
0 commit comments