Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create runtime files/directories in installation directory #179

Closed
mikaelstaldal opened this issue Nov 2, 2020 · 8 comments
Closed
Milestone

Comments

@mikaelstaldal
Copy link

mikaelstaldal commented Nov 2, 2020

mvnd 0.0.11 creates a daemon directory in the installation directory, which does not work if you install it in a system directory (like /opt or /usr/local) and let it be own by root:

$ mvnd
Exception in thread "main" org.jboss.fuse.mvnd.common.DaemonException: java.nio.file.AccessDeniedException: /opt/mvnd-0.0.11-linux-amd64/daemon
        at org.jboss.fuse.mvnd.common.DaemonRegistry.<init>(DaemonRegistry.java:81)
        at org.jboss.fuse.mvnd.client.DefaultClient.execute(DefaultClient.java:151)
        at org.jboss.fuse.mvnd.client.DefaultClient.main(DefaultClient.java:74)
Caused by: java.nio.file.AccessDeniedException: /opt/mvnd-0.0.11-linux-amd64/daemon
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
        at java.nio.file.Files.createDirectory(Files.java:689)
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:796)
        at java.nio.file.Files.createDirectories(Files.java:782)
        at org.jboss.fuse.mvnd.common.DaemonRegistry.<init>(DaemonRegistry.java:74)
        ... 2 more

It should create runtime files/directories in /tmp if they do not need to survive reboot, or otherwise in $HOME/.cache.

@gnodet
Copy link
Contributor

gnodet commented Nov 4, 2020

Using $HOME/.mvnd/daemon sounds reasonable to me.

@famod
Copy link
Contributor

famod commented Nov 4, 2020

AFAICT, depending on which files actually end up there, different mvnd installations would need to be taken into account.

@gnodet
Copy link
Contributor

gnodet commented Nov 4, 2020

@famod you mean different mvnd versions ? I don't think I see a use case for having a user installing the same mvnd version in different multiple times.

@ppalaga
Copy link
Contributor

ppalaga commented Nov 4, 2020

I think we need distinct registries per mvnd version.

@famod
Copy link
Contributor

famod commented Nov 4, 2020

@gnodet See #122 (comment)

@gnodet
Copy link
Contributor

gnodet commented Nov 4, 2020

@gnodet See #122 (comment)

Ok, but I still haven't understood the use case. I'm refactoring the daemon settings handling so that it will be easier to add properties passed to the daemon, and also make all those properties part of the daemon selection process.
I'll also add support for specifying more than one daemon property file for configuration (global, user, local).
This mean that any difference in the daemon properties will mean using a different daemon.

Is configuration your use case for using different installations ?

@gnodet
Copy link
Contributor

gnodet commented Nov 4, 2020

And for the local maven repository, I think it should currently be already working. I.e. the daemon should not messed up the different repositories. However, it also means it won't cache anything when switching from one repo to another, so we could investigate making the local repo a discriminating property too.

@gnodet
Copy link
Contributor

gnodet commented Nov 6, 2020

This has been done as part of 4030f8b

The default is ${USER.HOME}/.mvnd/v${version}/ but it can be changed using the mvnd.daemon.storage property to point to a different location.

@gnodet gnodet closed this as completed Nov 6, 2020
@gnodet gnodet added this to the 0.0.12 milestone Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants