Skip to content

Mixed Java & Scala 3.x compilation broke with release 4.7.2 and newer #673

@roman-mibex-2

Description

@roman-mibex-2

It looks like mixed compilation with Java 8 and Scala 3.x (Scala 3.2.2 in my case) is broken.

The compilation fails with:

[INFO] compiling 2 Scala sources and 54 Java sources to /home/roman/dev/include-cloud/datacenter/target/classes ...
[ERROR] : 1.8 is not a valid choice for -java-output-version
[INFO] :   scalac -help  gives more information
[ERROR] one error found

The issue seems to be introduced by this change: ede3d72

The rough issue: -release 1.8 is added to the Scalac command, which it doesn't like. The ScalaMojoSupport.targetOption does translate the Maven 1.8 Java version to 8, but only for the Scala 2.x compiler series.

So, it seems that either the -release flag isn't correct for Scala 3.x, or the version translation should be applied to Scacal 3.x as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions