I have a Jenkins Maven job that has a post build script written in BASH. Periodically, while the post script is running, it seems like some sort of Maven operation is interfering with the BASH script causing the build to fail.
Here's some sample output from the Jenkins console
+ version_override='Downloading: http://clojars.org/repo/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://clojars.org/repo/org/codehaus/mojo/maven-metadata.xml
Downloading: http://oss.sonatype.org/content/repositories/releases/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://oss.sonatype.org/content/repositories/releases/org/codehaus/mojo/maven-metadata.xml
See how my BASH variable appears to be getting assigned a value from the Maven download? Now I won't say for certain that's what's going on. Maybe there's just two output streams going to the console simultaneously, one from Maven updating the repo, another from my BASH post build script. Either way, the Maven download seems to be interfering with my BASH script as it eventually crashes the build.
+ read config_path
+ '[' '!' -z http://clojars.org/repo/org/apache/maven/plugins/maven-metadata.xml ']'
+ http://clojars.org/repo/org/apache/maven/plugins/maven-metadata.xml
/usr/share/build-utils/lib/java.sh: line 115: http://clojars.org/repo/org/apache/maven/plugins/maven-metadata.xml: No such file or directory
That definitely looks like Maven output is creeping into my BASH script!
I'm almost positive this is Maven looking for updates. The strange thing is why would that run in parallel with a post build script. And even then, how is it possible that it would interfere with the runtime of said script? Truly bizarre!
Another reason I'm sure there's nothing wrong with my post build script. Every time this error comes up, I run the build again and it works. It's only when Maven is updating that the build fails.
I don't care if Maven wants to look for updates, but is there some way to configure it so that repo updates happen before my post build script?