문제

Is it possible to grant/request evelated privileges for particular goals within a pom?

Splecifically I need to retrieve an artifact from a repository then store that artifact in a file system directory the user does not have write permissions on.

Ideally I would like to elevate the users privileges just for the goal that writes the retrived file to the file system.

Is there any way to use the maven-dependency-plugin copy goal using sudo or something similar to achive this?

It needs to go in the pom.xml so it will work for testing the project within eclipse, so

sudo mvn ...

isn't an option (irrespective of that being a good idea or not).

도움이 되었습니까?

해결책

I don't think that's possible. But the question is a bit confusing. You want to pull the artifact from a repository that the user can't access or you want to install the resulting artifact in a local repository that the user can't access?

In either case i can't see why a user that's trying to install an artifact (or pull a dependency) would be using a repository that it can't access. Maybe if you give a bit of context we can suggest an alternative

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top