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

Using MAVEN_HOME may clash with other tools #53

Closed
OPeyrusse opened this issue Aug 12, 2020 · 4 comments · Fixed by #54
Closed

Using MAVEN_HOME may clash with other tools #53

OPeyrusse opened this issue Aug 12, 2020 · 4 comments · Fixed by #54
Milestone

Comments

@OPeyrusse
Copy link

As part of the installation process [1], the last command is to run mvnd --install.
This is returning the following error:

Exception in thread "main" java.lang.IllegalStateException: Cannot install if mvnd.home /opt/sdkman/candidates/maven/current exists. Delete it if you want to reinstall.
at org.jboss.fuse.mvnd.client.Installer.installServer(Installer.java:55)
at org.jboss.fuse.mvnd.client.DefaultClient.install(DefaultClient.java:98)
at org.jboss.fuse.mvnd.client.DefaultClient.execute(DefaultClient.java:152)
at org.jboss.fuse.mvnd.client.DefaultClient.main(DefaultClient.java:68)

The reported directory is my current installation. It seems that this happens because the variable MAVEN_HOME is set in my environment.

I see that mvnd --install created a bin directory under .m2/mvnd/<version>. But I don't understand why the failure, particularly as MAVEN_HOME is a variable for maven1, and mvnd claims to be a maven 3+.

Can you explain the reason for such a design? As I plan to call mvnd explicitly instead of mvn, I don't want to enforce a path to the provided maven script.

[1] https://github.com/mvndaemon/mvnd#install-mvnd

@ppalaga
Copy link
Contributor

ppalaga commented Aug 12, 2020

Thanks for the report, I think this is a valid issue. We better should not mess with MAVEN_HOME that can be set/used by other tools with incompatible design. I think we should switch to MVND_HOME and mvnd.home. WDYT, @gnodet ?

@ppalaga
Copy link
Contributor

ppalaga commented Aug 12, 2020

Also note that we are about to make mvnd installable by sdkman in #48. Solving that probably requires to solve this too.

@OPeyrusse
Copy link
Author

That's really cool. I have checked that issue 5 days ago but did not found an easy tutorial on how to do it so I let it pass by.
I can help in any way, do tell me.

@ppalaga ppalaga changed the title Error with mvnd --install Using MAVEN_HOME may clash with other tools Aug 12, 2020
ppalaga added a commit to ppalaga/mvnd that referenced this issue Aug 12, 2020
ppalaga added a commit that referenced this issue Aug 12, 2020
Fix #53 Using MAVEN_HOME may clash with other tools
@OPeyrusse
Copy link
Author

Many thanks. Waiting for the next release, apparently in sdkman 🚀

@ppalaga ppalaga added this to the 0.0.3 milestone Aug 15, 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

Successfully merging a pull request may close this issue.

2 participants