scalac error: bad option: '-make:transitive' on mvn package via command line

后端 未结 2 795
孤街浪徒
孤街浪徒 2021-02-06 23:19

Following http://docs.scala-lang.org/tutorials/scala-with-maven.html to setup a simple scala maven project.

I got a BUILD SUCCESS after setting up scala-archetype-simple

相关标签:
2条回答
  • 2021-02-06 23:25

    I just removed <arg>-make:transitive</arg> from pom.xml and compilation worked.

    Also you may need to add

    <dependency>
    <groupId>org.specs2</groupId>
    <artifactId>specs2-junit_${scala.compat.version}</artifactId>
    <version>2.4.16</version>
    <scope>test</scope>
    </dependency>
    

    to get test passed.

    0 讨论(0)
  • 2021-02-06 23:35

    With intellij

    I had to remove it from IntelliJ compiler config, as compilation was failing while running scalatests in intellij.

    The .idea/scala_compiler config was as below,

    cat .idea/scala_compiler.xml
    
    <?xml version="1.0" encoding="UTF-8"?>
    <project version="4">
      <component name="ScalaCompilerConfiguration">
        <profile name="Maven 1" modules="log-service">
          <parameters>
            <parameter value="-make:transitive" />
            <parameter value="-dependencyfile" />
            <parameter value="$PROJECT_DIR$/target/.scala_dependencies" />
          </parameters>
        </profile>
      </component>
    </project>
    

    I removed the -make-transitive parameter for compiler, restarted the intellij.

    I have no idea who/why added -make:transitive parameter to .idea config.

    0 讨论(0)
提交回复
热议问题