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

noDaemon not supported in native mode

Open rmannibucau opened this issue 3 years ago • 6 comments

$ mvnd install -Dmvnd.noDaemon=true
Exception in thread "main" java.lang.UnsupportedOperationException: The mvnd.noDaemon property is not supported in native mode.
	at org.mvndaemon.mvnd.client.DaemonConnector.connectNoDaemon(DaemonConnector.java:126)
	at org.mvndaemon.mvnd.client.DaemonConnector.connect(DaemonConnector.java:93)
	at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:245)
	at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:112)

Would be great to have at least a fallback not "leaking" a daemon when used (even if it is about starting a daemon and killing it at the end)

rmannibucau avatar Mar 10 '21 12:03 rmannibucau

What's your use case for using this option ? My original purpose was to ease debugging, but since you want to use it in native mode, I suspect yours is different ...

gnodet avatar Mar 15 '21 07:03 gnodet

Mvnd brings more than just mvn without the daemon, like better defaults to cite just one thing. In some cases I dont want to leak the daemon (consumes too much mem for me in some cases) Installed with sdkman it is native so unifying both options would be nice.

rmannibucau avatar Mar 15 '21 07:03 rmannibucau

With Maven wrapper I have to choose either mvn or mvnd. I don't want to force users either way.

delanym avatar Mar 30 '23 11:03 delanym

With Maven wrapper I have to choose either mvn or mvnd. I don't want to force users either way.

You choose the tool (maven vs any other build system) and the version of the tool used, but you don't want to force the user between mvn and mvnd. Why ?

gnodet avatar Mar 30 '23 11:03 gnodet

mvnd requires at least another 1Gb of always-on memory

delanym avatar Mar 30 '23 11:03 delanym

mvnd requires at least another 1Gb of always-on memory

Makes sense. I totally agree with the idea of spawning a daemon and not keeping it alive if the mvnd.noDaemon option is set. It should just be a matter of spawning a daemon, passing the mvnd.noDaemon option and handle it correctly in the daemon after the build (i.e. letting the process die).

gnodet avatar Mar 30 '23 12:03 gnodet