Jenkins builds a question Maven Home does not exist

I get the following error while executing Jenkins build on slave servers. On the main server, the assembly worked fine.

ERROR: Maven Home /bgl-build-1/usr/local/maven doesn?t exist 

My setup consists of one Master and two slave servers. Maven is installed on the core server. A slave creature has a maven. The setup worked well before. Getting this error in the last two days,

The slave device ".bashrc" file contains the maven path installed on the core server.

 export EDITOR=/usr/bin/vim export BGL_BUILD_1=/bgl-build-1 export JAVA_HOME=$BGL_BUILD_1/usr/java/default export M2_HOME=$BGL_BUILD_1/usr/local/apache-maven-2.2.1 export PATH="$BGL_BUILD_1/usr/local/bin:$BGL_BUILD_1/usr/local/maven/bin:$BGL_BUILD_1/usr/java/default/bin:$PATH"; export PATH="/bgl-build-1/usr/local/maven/bin:$PATH"; 

I mentioned a similar post reg this issue I have a problem setting jenkins in slave using maven (Maven home does not exist)

My question is do I need to have maven on all servers (including slave), or am I missing some reg reg and slave setup settings in Jenkins.

My Jenkins Version is 1.582

Maven Version - 2.2.1

+5
source share
2 answers

Yes, you need Maven on the slave in order to build Maven on this slave.

There are two ways to get Maven on this slave:

  • Manually install Maven at the OS level of this slave (accessible to everyone)
  • Let Jenkins install Maven on this slave (you can use only Jenkins without affecting the rest of the OS)

(You can have both methods too)

For Jenkins to install maven:

  • In the Global Settings section, find "Maven Preferences"
  • Add a Maven installation, give it a name
  • Choose your version
  • Select a source (automatic installation should be ok)

Then, when you set up your maven job:

  • If you choose the default version of Maven, it will try to use what is at the OS level
  • If you select a named version of Maven (as you named it in Global Configuration), it will use that particular version, and Jenkins will install it for you on demand.
+3
source

This problem may also occur if the maven version is updated and the old version is deleted, but the project still points to the old version. To solve this problem, just select the new version!

0
source

Source: https://habr.com/ru/post/1203768/


All Articles