Java 11 + Gradle 5.6 (+ M1)

256 views
Skip to first unread message

Jens Hardings

unread,
May 25, 2021, 8:00:13 PM5/25/21
to Moqui Framework
Hi all,

first time on a mac for me now, thanks to David for sharing his experience earlier on, it helped making the decision. Works fine generally but I have noticed some problems with the gradle wrapper and environment variables using java 11.

The problem seems to be the combination of Java 11 + Gradle 5.6 on apple (m1) silicon. When using this combination, the environment variables are not available inside the JVM, so when I use environment vars to set configurations for moqui or try to push to a repository that requires access to the ssh-agent for keys, it does not work.
Changing to Java 8 (both jdks I am testing are from Zulu for the ARM chipset, no Rosetta virtualization) makes it work.

I think it would be wise to update gradle 5.6 to a newer version before making java 11 mandatory for moqui, not just because of this problem but generally because it is an important dependency that is pretty outdated and does not have much support anymore.

The hurdle to do so seems to be that com.eriwen.gradle.js, the gradle plugin used to minify the css and javascript code, does not work with gradle newer than 5.6.4 (see https://github.com/eriwen/gradle-js-plugin/issues/177). This package seems to no longer be maintained, as there has been no release to fix this in over 2 years now.

Updating to gradle 7.0.2 requires some tweaking of the build files, but so far I seem to have it working at least for the tasks I commonly use (clean, build, run, addRuntime, etc), except for the minifying tasks which I have commented out for now.

Is there something else I might be missing? Does anyone here have experience with another minifier that could be used to replace com.eriwen.gradle.js?

Cheers,
--
Jens.

David E Jones

unread,
Jun 4, 2021, 1:02:39 PM6/4/21
to Moqui Framework
Hi Jens,

Yes, the eriwen JS minify and combine task library is the dependency preventing an update to Gradle beyond the 5 series. I looked around a while back to find alternatives and found nothing, and it sounds like you found the same (no other Gradle plugin to minify and combine JS).

One alternative is to get rid of the JS minify and use the JS files as-is. This will have a performance impact (network data transferred, browser parsing time), but maybe not significant enough to be worth this issue.

Another alternative might be to use the Java libraries that the eriwen gradle plugin uses, but not use the eriwen gradle plugin. Another option might be to contribute updates to the plugin, or create a fork with updates for Gradle 7.

-David
 

--
You received this message because you are subscribed to the Google Groups "Moqui Ecosystem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moqui+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/moqui/CAKSRDRmzpS43WJDctPwwc2NT6BRQLRdc0Atwtwkdqoq97HX5Wg%40mail.gmail.com.

Francisco Faes García

unread,
Jun 4, 2021, 3:58:08 PM6/4/21
to mo...@googlegroups.com
Hi Jens and David,

For JS minify from Gradle, perhaps this might be enough:


First option, as a JavaExec task.

(Not tested with Moqui yet, though)

Francisco Faes
www.blurbiness.com



Reply all
Reply to author
Forward
0 new messages