davidB / scala-maven-plugin

The scala-maven-plugin (previously maven-scala-plugin) is used for compiling/testing/running/documenting scala code in maven.
https://davidb.github.io/scala-maven-plugin/
The Unlicense
557 stars 151 forks source link

Yet another (maybe user-error) problem with 4.8.1 #691

Closed clayreimann closed 1 year ago

clayreimann commented 1 year ago

Hi I also tried to upgrade to version 4.8.1 and am running into compile errors. I've seen #683 and #686 and couldn't exactly follow their problems, but I did come up with a tiny build that exhibits the issue I've got in our larger build https://github.com/clayreimann/scala-maven-plugin-reproducer

Maybe I've just misconfigured something and you can point me in the direct of a fix.

Unrelated to the compile error I also tried to set <displayCmd>true</displayCmd> and it doesn't seem to actually print anything.

Also, thanks for taking the time to maintain this super useful maven plugin!

slandelle commented 1 year ago

Hi,

These JVM args are invalid and cause the forked JVM to crash.

First, -Djava.net.preferIPv4Stack=true is a System property, not a JVM option. I don't even know what you're trying to achieve with this and how it could be related to compiling code.

Then, you must pass options individually, not as a single string that contains spaces:

                    <jvmArgs>
                        <jvmArg>--add-exports</jvmArg>
                        <jvmArg>java.base/jdk.internal.misc=ALL-UNNAMED</jvmArg>
                        <jvmArg>--add-exports</jvmArg>
                        <jvmArg>java.base/jdk.internal.ref=ALL-UNNAMED</jvmArg>
                    </jvmArgs>