-
Notifications
You must be signed in to change notification settings - Fork 213
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
Use muti-release jar to fallback mvnd-client to original maven #722
Conversation
The mvnd-client is built to a muti-release jar. The default version of DefaultClient is compiled against the same target version as the embedded maven which only invoke the MavenCli.main(). The java-11 version is the full qualified mvnd-client.
Thanks for the contribution, this looks very interesting, @gzm55. Do I understand correctly that this is intended to provide an automatic fallback to the embedded vanilla Maven on platforms for which we (1) do not have a GraalVM native executable and (2) they have java <11? There is no change in behavior on systems where the mvnd native executable works (because that one is inherrently Java 11), right? I wonder what are the advantages against running Maven in the traditional way on those systems? I wonder how portable the fallback is: we forward all command line parameters, some of which won't work with the embedded Maven. |
1. build SimpleAppender for JDK 1.7 since it is the log appender only for the embedded maven 2. restore maven-resolver to 1.6.3 for JDK 1.7 3. remove DaemonNamedLockFactorySelector.java, it is for resolver 1.7.3, and not compatible to the latest resolver
Right.
Improve the usability, and developers can only install mvnd package for a faster and more reliable maven.
Now only few flags break the original maven.
|
Thanks for confirming.
Install only one package sounds like a useful thing but I still wonder whether the silent fallback to the embedded Maven is a good idea. Won't the users be misled that they use daemon when they actually don't? Just to explain: this kinda clashes with how I saw mvnd so far. For me, mvnd was a better and faster Maven-like tool that works great on supported platforms but does not necessarily have to stick with all Maven legacy. Now we are smuggling the old slow Maven into mvnd even in situations when users may not know that this even happens. I am not sure this is a good thing. Maybe we should make it opt in by default? - have a new
Thanks for the precise listing and investigating the impact! All you say sounds right. |
Yes, the user should be able to select what he want. Does
As a mvnd user, I would like (or hope) to see |
Yes, that's the idea. Note that I do not insist on the Also note that we already have
I see. Would the opt-in explicit fallback to embedded Maven be a viable option for you? |
I'm OK to the switch, and it is reasonable for a package manager to always to call the native image. In this pr, we can focus on providing the fallback function, keeping the most entry behavior. I think the opt switch could be implemented in #717 . |
Sounds good, thanks! |
# Conflicts: # client/pom.xml # common/pom.xml # daemon/pom.xml # daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactorySelector.java # pom.xml
* Use muti-release jar to fallback mvnd-client to original maven The mvnd-client is built to a muti-release jar. The default version of DefaultClient is compiled against the same target version as the embedded maven (4.x, so JDK 1.8) which only invoke the MavenCli.main(). The java-11 version is the full qualified mvnd-client. * update cmd scripts * embedded maven now works under JDK 1.8 Build SimpleAppender for JDK 1.8 since it is the log appender only for the embedded maven Co-authored-by: Guillaume Nodet <[email protected]> # Conflicts: # pom.xml
The mvnd-client is built to a muti-release jar. The default version of DefaultClient is compiled against the same target version (
1.7
) as the embedded maven which just invokes theMavenCli.main()
. The java-11 version is the full qualified mvnd-client.To keep the embedded runnable undre JDK 1.7, we have to restore maven-resolver to 1.6.3 and remove
DaemonNamedLockFactorySelector.java
.