Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

maven

scala

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:1.6 using mvn archetype:generate.

But when I mvn package, I get [ERROR] scalac error: bad option: '-make:transitive'

What might the issue be? How can I fix it?

Using Scala version 2.11.7

like image 831
jaydeep Avatar asked Jan 26 '16 15:01

jaydeep


2 Answers

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.

like image 178
Boris R Avatar answered Nov 17 '22 12:11

Boris R


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.

like image 7
prayagupa Avatar answered Nov 17 '22 13:11

prayagupa