Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21743 - Maven users need write access to /usr/share/maven/ directories
Summary: Maven users need write access to /usr/share/maven/ directories
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Adrian Almenar
URL:
Whiteboard:
Keywords:
Depends on: 27962
Blocks:
  Show dependency tree
 
Reported: 2003-05-26 21:54 UTC by Ryan Shaw
Modified: 2003-09-22 20:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for adding maven group and fix owner and permissions. (mavenfix.diff,1.43 KB, patch)
2003-07-04 08:28 UTC, Alwyn Schoeman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Shaw 2003-05-26 21:54:54 UTC
Currently the dev-java/maven-1.0_beta9 ebuild creates maven's plugins and
repository directories under /usr/share/maven. However, normal users do not have
write access to these directories, which means that they cannot run maven builds
which require 1) expanding jars in /usr/share/maven/plugins and 2) downloading
jars to /usr/share/maven/repository.

Reproducible: Always
Steps to Reproduce:
1. Install maven.
2. Attempt to run a maven build as a normal user.


Actual Results:  
org.apache.maven.MavenException: Unable to extract plugin

This happens because maven is trying to expand a plugin in
/usr/share/maven/plugins, which a normal user does not have access to.

Expected Results:  
This is what I did:

Have the ebuild create a "maven" group. Chgrp maven /usr/share/maven/plugins and
/usr/share/maven/repository, and chmod g+w these two dirs. Add an info message
saying that maven users must be added to the maven group.

However, this may not be the best solution.
Comment 1 Alwyn Schoeman 2003-07-04 08:28:56 UTC
Created attachment 14158 [details, diff]
Patch for adding maven group and fix owner and permissions.
Comment 2 Alwyn Schoeman 2003-07-04 08:32:33 UTC
Hi Ryan,

Created the patch according to your guidelines.

To use, copy /usr/portage/dev-java/maven to /usr/local/portage/dev-java/maven and apply the diff.

It does the following:
1) Adds/Remove group maven.
2) Sets permissions and ownership on plugin and repository directories.
3) Remove extracted plugins on unemerge.

Please note that if user doesn't do a newgrp maven before running maven for the first time, the files will be created with primary group of user.  Should work for normal users afterwards though as they have read access.  Other than that the group doesn't really help.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-08 21:04:08 UTC
if users are going to have write access to some area, it needs to be moved outside /usr.
Many competant sysadmins (including myself) mount /usr as read-only for increased security.
(mount it read-write as needed for maintance only).
Comment 4 Adrian Almenar 2003-09-09 05:04:21 UTC
Im finding a solution trying the user to have $HOME/.maven so he can write to 
that directory. 
 
As soona as i can ill post more comments on this. 
Comment 5 Adrian Almenar 2003-09-09 21:28:42 UTC
I found a problem, if i set in /etc/env.d/25maven this: 
MAVEN_HOME=/usr/share/maven 
MAVEN_LOCAL_REPO=$HOME/.maven/repository 
 
MAVEN_LOCAL_REPO doesnt get SET on user enviroment, any ideas on how to set a 
variable for the user ? 
Comment 6 Adrian Almenar 2003-09-22 20:16:30 UTC
This has been fixed in maven-1.0_beta10.ebuild also maven project fixed the bug that 
made this error happen, so it should be working ok with this new version. 
Comment 7 Adrian Almenar 2003-09-22 20:22:39 UTC
Fixed