ERROR: Failed to create /usr/share/tomcat7/.m2 on Maven project

17 views
Skip to first unread message

Miguel Almeida

unread,
Aug 2, 2017, 1:34:54 PM8/2/17
to jenkins...@googlegroups.com
I've just updated Jenkins to 2.x and am having problems configuring some jobs.

1. I created a Global Maven settings.xml file with the  Config File Management Plugin
2. Within that file I added: <localRepository>/srv/maven/.m2/repository</localRepository> , since I want the repository to be on that location
3. Created a new Maven Project. Tried to make the Job see that file by:
3.1 Build Environment - Provide Configuration file -Choose my file, variable MY_SETTINGS OR
3.2 Add pre-build step - provide configuration files
AND: then adding -s $MY_SETTINGS to either goals and options or MAVEN_OPTS

However, none of these seems to work. The job seems to try to use the default maven repository location (/usr/share(tomcat7/.m2) - which I have no idea how to re-define:

provisioning config files...
copy managed file [MYFILE settings] to file:/srv/webapps/jenkins/jobs/testJob/workspace@tmp/config3408982272576109420tmp
provisioning config files...
copy managed file [MYFILE settings] to file:/srv/webapps/jenkins/jobs/testJob/workspace@tmp/config2203063037747373567tmp
Parsing POMs
using global settings config with name MYFILE settings
Replacing all maven server entries not found in credentials list is true
Deleting 1 temporary files
ERROR: Failed to create /usr/share/tomcat7/.m2
Finished: FAILURE

Do you know what could be missing, or how to fix this?

Cheers,
Miguel

Miguel Almeida

unread,
Aug 2, 2017, 1:51:15 PM8/2/17
to jenkins...@googlegroups.com
Follow up:

Similar job in Freestyle seems to work. However, it won't work if the Job name has whitespaces, failing with (for a job named "acceptance test 4"):
[ERROR] The specified user settings file does not exist: /srv/webapps/jenkins/jobs/acceptance

This happens regardless of how I pass the settings file (see 3 in previous email)
Reply all
Reply to author
Forward
0 new messages