maven-scala plugin not able to build scala on some projects

766 views
Skip to first unread message

Tommy Chheng

unread,
Dec 7, 2011, 2:39:49 PM12/7/11
to scala-user
Hi,
One of my colleagues is having trouble compiling a scala project with
the maven scala plugin.
We are using mac osx lion 10.7.2 with maven-scala 2.15.2/maven 3.0.3
and scala 2.9.1 This project currently works on my mac.

Oddly, my colleague can compile another scala 2.9.1 project correctly.
Below is the stack trace, what can cause this type of error? It's the
first time i've seen this.

[ERROR] error: error while loading <root>, error in opening zip
file[ERROR] error: scala.tools.nsc.MissingRequirementError: object
scala not found.[INFO] at
scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:655)[INFO]
at scala.tools.nsc.symtab.Definitions$definitions$.getModule(Definitions.scala:605)[INFO]
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:145)[INFO]
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass(Definitions.scala:146)[INFO]
at scala.tools.nsc.symtab.Definitions$definitions$.AnyClass(Definitions.scala:176)[INFO]
at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scala:814)[INFO]
at scala.tools.nsc.Global$Run.<init>(Global.scala:697)[INFO] at
scala.tools.nsc.Main$.process(Main.scala:105)[INFO] at
scala.tools.nsc.Main$.main(Main.scala:123)[INFO] at
scala.tools.nsc.Main.main(Main.scala)[INFO] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[INFO] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[INFO]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[INFO]
at java.lang.reflect.Method.invoke(Method.java:597)[INFO] at
org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:161)[INFO]
at org_scala_tools_maven_executions.MainWithArgsInFile.main
The pom build section:
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.compiler.version}</scalaVersion>
<encoding>${project.build.sourceEncoding}</encoding>
<charset>${project.build.sourceEncoding}</charset>
<args>
<arg>-optimise</arg>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
</configuration>
</plugin>


* please don't suggest convert to sbt :)

--
@tommychheng
http://tommy.chheng.com

Peter Kwan

unread,
Dec 21, 2011, 6:50:50 PM12/21/11
to scala...@googlegroups.com
Hi Tommy, are you able to find the solution to this problem that you posted?

Ken Brumer

unread,
Aug 27, 2012, 8:37:09 PM8/27/12
to scala...@googlegroups.com, peter...@gmail.com
We encountered this issue as well, and it turned out to be a bad jar in our maven repo (which was also in our Nexus repo). Deleting this jar solved our issue.

Here was a command to run to try and find bad jars in your maven repo:

find . -name *.jar -exec bash -c "echo {} && jar tvf {} | head -n 1" \;

Lanny Ripple

unread,
Aug 29, 2012, 11:15:39 AM8/29/12
to scala...@googlegroups.com, peter...@gmail.com
As an aside the maven-scala-plugin is now the scala-maven-plugin[1] and at version 3.10.   It's got sbt's incremental compilation now with zinc[2].

Reply all
Reply to author
Forward
0 new messages