Issue
I have a Maven project in IntelliJ working with the bundled version of Maven however when I come to do a release:prepare release:perform
directly from within the IDE I get the following error.
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project XXXXXX: Maven execution failed, exit code: '126'
Within IntelliJ I am using a project specific JDK (JDK 8) which is different to my machine JDK (JDK 11). I also am using the bundled Maven 3 with IntelliJ 2020.1 but have no Maven installed on my machine outside of the IDE.
I don't use JDK 8 or Maven anywhere other than this one project so would like to not have to install the extra tools globally if I can get away with running then from within this one project in the IDE. Is that possible? I'm building a Jenkins plugin for context if that matters?
Question: What is exit code 126?
Question: In order to perform a release:prepare release:perform
do I need to to install the bundled project specific tools on my machine as opposed to keeping them within my project in IntelliJ?
Edit: Running with -x
or --debug
yields this error:
[INFO] Executing: /bin/sh -c cd /home/XXX/Development/XXXXX-plugin && /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn -s /tmp/release-settings2724175258197430802.xml clean install --no-plugin-updates -P jenkins
/bin/sh: 1: /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn: Permission denied
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
Solution
It appears to be this bug: https://youtrack.jetbrains.com/issue/IDEA-139236
Which is duplicated by: https://youtrack.jetbrains.com/issue/IDEA-157229 that contains the following workaround:
Using a newly generated plugin project using the maven-archytype-plugin, when I tried running the default integration test, it failed due to the following error:
/bin/sh: /Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/mvn: Permission denied
When checking the
/Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/
:evil-jim-klo:lib2 jklo$ cd "/Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/" evil-jim-klo:bin jklo$ ls -l total 88 -rw-r--r--@ 1 jklo admin 183 Dec 21 04:08 m2.conf -rw-r--r--@ 1 jklo admin 5063 Dec 21 04:08 mvn -rw-r--r--@ 1 jklo admin 5985 Dec 21 04:08 mvn.bat -rw-r--r--@ 1 jklo admin 5253 Dec 21 04:08 mvnDebug -rw-r--r--@ 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat -rw-r--r--@ 1 jklo admin 5539 Dec 21 04:08 mvnyjp
Note none of the files are set to executable. The expectation is that all maven binaries should be executable by default upon installation or application update.
I corrected the problem by performing:
chmod a+x * chmod a-x m2.conf
to produce the following permissions:
evil-jim-klo:bin jklo$ ls -l total 88 -rw-r--r--@ 1 jklo admin 183 Dec 21 04:08 m2.conf -rwxr-xr-x@ 1 jklo admin 5063 Dec 21 04:08 mvn -rwxr-xr-x@ 1 jklo admin 5985 Dec 21 04:08 mvn.bat -rwxr-xr-x@ 1 jklo admin 5253 Dec 21 04:08 mvnDebug -rwxr-xr-x@ 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat -rwxr-xr-x@ 1 jklo admin 5539 Dec 21 04:08 mvnyjp
Answered By - mez.pahlan