Bug 1021722 - Jenkins cartridge unable to create local maven repository at ~/.m2/repository
Summary: Jenkins cartridge unable to create local maven repository at ~/.m2/repository
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-21 22:15 UTC by hexafraction
Modified: 2015-05-14 23:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-30 00:49:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description hexafraction 2013-10-21 22:15:32 UTC
Description of problem:
My Jenkins cartridge is unable to create its ~/.m2/repository directory, which also cannot be created over SSH(access denied)

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Create standalone Jenkins cartridge
2. Log into jenkins on this cartridge, create a new project to be built. Provide access to a valid git repository with a maven repo for the project.
3. Install the JDK and maven as follows:
   a. SCP the tarballs for JDK 7u45 and latest Maven version to ~/jenkins/data
   b. Extract packages, and give Jenkins the locations to which the packages were extracted.
4. Run a Maven-enabled job in Jenkins. Observe its successfully calling JDK and Maven commands(proving it can find and run them). Observe Maven command giving error that it cannot create a repo at ~/.m2
5. Attempt to change the location to which Maven will write its repo with its settings.xml or command-line options in Jenkins. This has no effect. 

Actual results:

Maven unconditionally uses the unusable location ~/.m2 for its repository. This directory does not exist and it cannot be created with mkdir ("Access denied" message)

Expected results:

~/.m2 is writeable and can be created(contingent on disk quota). 

Additional info:

As far as I can tell, this is a showstopper for Maven builds using the Jenkins cartridge short of recompiling Jenkins with changes, as the latter does not allow overriding the location passed to Maven.

The cartridge is new, only a day old. It was created standalone, not by adding jenkins to an existing cartridge, but is not the first application on the domain.

Disk quotas:

[jenkins-mosstest.rhcloud.com 52646f325973ca65bb000260]\> quota
Disk quotas for user 52646f325973ca65bb000260 (uid 6210):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/mapper/EBSStore01-user_home01
                 411560       0 1048576            6337       0   40000
[jenkins-mosstest.rhcloud.com 52646f325973ca65bb000260]\> quota -s
Disk quotas for user 52646f325973ca65bb000260 (uid 6210):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/mapper/EBSStore01-user_home01
                   402M       0   1024M            6337       0   40000

Comment 1 Jhon Honce 2013-10-22 17:30:30 UTC
Is your cartridge code available for public review?  You should be able to create the ~/.m2 directory during the setup or install scripts for the cartridge.

The current JBoss cartridges have examples of this: https://github.com/openshift/origin-server/blob/stage/cartridges/openshift-origin-cartridge-jbossas/bin/setup#L9

Comment 2 hexafraction 2013-10-22 18:55:17 UTC
Jhon: I am not using my own cartridge. Using my own I can create ~/.m2 just fine. The problem is that the Jenkins cartridge should really be creating this folder itself due to Jenkins' close interaction with Maven.

Comment 3 openshift-github-bot 2013-10-23 03:46:32 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ba8b89a38d351addf96258040d61a0d987ffd9d6
Bug 1021722 - Create ~/.m2 for all jenkins gears

Comment 4 Qiushui Zhang 2013-10-24 10:50:38 UTC
Tested on devenv_3939.

The folder ".m2" will be created successfully.
App build will not meet those errors.

Make the bug as verified.


Note You need to log in before you can comment on or make changes to this bug.