question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scala 2.12.4 support

See original GitHub issue

When I try to compile a project with scala 2.12.4 and Java 8:

[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.3.1:compile (default) on project black-marlin-processors-core: wrap: java.lang.reflect.InvocationTargetException: ExceptionInInitializerError: Not a version: 9 -> [Help 1]

And when I run the scala-maven-plugin integ-test build locally with the scala version set to 2.12.4 I see the following:

[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Test for Java + Scala compilation with too many files and non-forked execution 1.0-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ testLotsofJavaFiles ---
[INFO] [INFO] Deleting /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/target
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ testLotsofJavaFiles ---
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/src/main/resources
[INFO] [INFO]
[INFO] [INFO] --- scala-maven-plugin:3.3.2-SNAPSHOT:add-source (scala-compile-first) @ testLotsofJavaFiles ---
[INFO] [INFO] Add Source directory: /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/src/main/scala
[INFO] [INFO] Add Test Source directory: /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/src/test/scala
[INFO] [INFO]
[INFO] [INFO] --- scala-maven-plugin:3.3.2-SNAPSHOT:compile (scala-compile-first) @ testLotsofJavaFiles ---
[INFO] [INFO] /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/src/main/java:-1: info: compiling
[INFO] [INFO] /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/src/main/scala:-1: info: compiling
[INFO] [INFO] Compiling 514 source files to /Users/ama112/git/scala-maven-plugin/target/it/testLotsofJavaFiles/target/classes at 1517260608759
[INFO] [INFO] java.lang.reflect.InvocationTargetException
[INFO] [INFO] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [INFO] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [INFO] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [INFO] 	at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] [INFO] 	at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[INFO] [INFO] 	at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] [ERROR] Caused by: java.lang.ExceptionInInitializerError
[INFO] [INFO] 	at scala.tools.nsc.util.package$.<init>(package.scala:127)
[INFO] [INFO] 	at scala.tools.nsc.util.package$.<clinit>(package.scala)
[INFO] [INFO] 	at scala.tools.nsc.Global.throwableAsString(Global.scala:326)
[INFO] [INFO] 	at scala.tools.nsc.Global.reportThrowable(Global.scala:325)
[INFO] [INFO] 	at scala.tools.nsc.Driver.process(Driver.scala:58)
[INFO] [INFO] 	at scala.tools.nsc.Driver.main(Driver.scala:68)
[INFO] [INFO] 	at scala.tools.nsc.Main.main(Main.scala)
[INFO] [INFO] 	... 6 more
[INFO] [INFO] Caused by: java.lang.NumberFormatException: Not a version: 9
[INFO] [INFO] 	at scala.util.PropertiesTrait.parts$1(Properties.scala:186)
[INFO] [INFO] 	at scala.util.PropertiesTrait.isJavaAtLeast(Properties.scala:189)
[INFO] [INFO] 	at scala.util.PropertiesTrait.isJavaAtLeast$(Properties.scala:183)
[INFO] [INFO] 	at scala.util.Properties$.isJavaAtLeast(Properties.scala:17)
[INFO] [INFO] 	at scala.reflect.internal.util.ScalaClassLoader$.<init>(ScalaClassLoader.scala:157)
[INFO] [INFO] 	at scala.reflect.internal.util.ScalaClassLoader$.<clinit>(ScalaClassLoader.scala)
[INFO] [INFO] 	... 13 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
joziccommented, Jun 18, 2018

funny enough, it does compiles with scala 2.12.4 and 2.12.5, only 2.12.6 causes this error for me

2reactions
joziccommented, Jun 17, 2018

could you please share your scala-maven-plugin configuration? I’ve tried 2.12.6 and got aforementioned java.lang.NumberFormatException: Not a version: 9

here’s my config (well, part which is relevant I believe)

    <properties>
        <java.version>1.8</java.version>
        <scala.version>2.12.6</scala.version>
        <scala.binary.version>2.12</scala.binary.version>
    </properties>

    <build>
        <plugins>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.3.2</version>
                    <configuration>
                        <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
                        <scalaVersion>${scala.version}</scalaVersion>
                        <args>
                            <arg>-Xlint</arg>
                            <arg>-deprecation</arg>
                            <arg>-unchecked</arg>
                            <arg>-feature</arg>
                            <arg>-language:postfixOps</arg>
                            <arg>-language:implicitConversions</arg>
                            <arg>-language:higherKinds</arg>
                            <arg>-Xfatal-warnings</arg>
                            <arg>-Ywarn-unused</arg>
                            <arg>-Ywarn-unused-import</arg>
                            <arg>-Ywarn-inaccessible</arg>
                            <arg>-Ywarn-dead-code</arg>
                            <arg>-Ypartial-unification</arg>
                        </args>
                        <jvmArgs>
                            <jvmArg>-Xmx4g</jvmArg>
                        </jvmArgs>
                    </configuration>
                    <executions>
                        <execution>
                            <id>scala-compile-first</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
         </plugins>
    </build>

it works fine with 2.12.3

I appreciate your time, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scala 2.12.4
Need help running the binaries? Download and use Scala with IntelliJ and then build a project, then test it. Using SDKMAN!, you ...
Read more >
Overview - Spark 2.4.4 Documentation - Apache Spark
For the Scala API, Spark 2.4.4 uses Scala 2.12. You will need to use a compatible Scala version (2.12.x). Note that support for...
Read more >
org.scala-lang » scala-library » 2.12.4 - Maven Repository
Scala Library » 2.12.4 ; Date, Oct 11, 2017 · Files, pom (1 KB) jar (5.0 MB) View All · Repositories, CentralJCenterSonatype ·...
Read more >
scala@2.12 - Homebrew Formulae
Bottle (binary package) installation support provided. Current versions: stable, ✓, 2.12.17. Other versions: scala@2.13, 2.13.
Read more >
Our fork of the Scala compiler - Typelevel
Support for Scala 2.10.6 will be considered if sponsors step forward to ... The quickest way to get to a Typelevel Scala 2.12.4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found