maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Use mvnd as MAVEN_HOME (Apache Netbeans with mvnd ?)

Open nicoloboschi opened this issue 4 years ago • 4 comments

In some contexts you have to configure MAVEN_HOME property to indicate which maven to use, for example on Apache Netbeans IDE you have to choose directory to use to run maven In this case NB will try to execute /bin/mvn so you can't set mvnd path because mvnd/bin/mvn does not exist

I workarounded this by adding a directory "maven_home" inside mvnd root folder, creating a soft link like this

/maven_home/bin/mvn -> /bin/mvnd

and then configuring /maven_home as property in Netbeans

Is this a good workaround? in that case i will send a PR, this might be useful and we can 'sponsorize' mvnd to Netbeans users

nicoloboschi avatar Jul 13 '21 15:07 nicoloboschi

Unfortunately, we need to keep mvn distinct from mvnd, see https://github.com/mvndaemon/mvnd/pull/89

gnodet avatar Jul 21 '21 15:07 gnodet

Thanks you @gnodet But I feel that is a different issue (btw I may missing some points)

I'm using a maven distro installed outside mvnd I want to setup Apache Netbeans using mvnd as maven, so when I'll build a project from NB it will result in mvnd clean install ..... (more more faster 😀 ) but to do this you have to tell NB a maven home directory to use and NB will use that as path to find the mvn executable:

/bin/mvn (this is hardcoded in NB maven plugin IMO)

In order to do this I mocked a directory like mock_maven_home/bin/mvn where "mvn" file points (with a soft link) to mvnd executable

Adding this mock directory does not impact usage with embedded maven or external maven, but is a "short-hand" to enable mvnd on NB

nicoloboschi avatar Jul 22 '21 11:07 nicoloboschi

If so, it would be nice to try using mvnd inside eclipse and IntelliJ idea too.

gnodet avatar Jul 27 '21 14:07 gnodet

btw NB can use mvnd since NB 13 without having to link anything (https://github.com/apache/netbeans/pull/3210). All you have to do is to register your mvnd distribution in the maven options UI and it will start using it.

mbien avatar Sep 25 '23 05:09 mbien