Re: Maven build failed: multiple scala versions

341 views
Skip to first unread message

James Waldrop

unread,
Apr 4, 2013, 2:56:21 PM4/4/13
to iago-...@googlegroups.com
The multiple versions of scala libraries detected is a red herring induced by the fact that Iago is still using Specs, which doesn't have a 2.9.2 version for the version of Specs we're using.

I just did a clean clone onto my system here at Twitter and it compiled fine. However, that said, it's not a fully valid replication of your scenario -- I would need to get a truly virgin system and try it on that, which I won't be able to do until later. If someone else on the list is able to test that scenario and can report back sooner, that'd be awesome. Otherwise my current answer is "works for me." Sorry. :(

James



On Thu, Apr 4, 2013 at 9:22 AM, Aécio Santos <aecio....@gmail.com> wrote:
I just cloned the lastest version from github repository and the build is failing with the following error message.
Am I doing something wrong?

$ mvn package -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building iago
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [finagle-thrift:compile {execution: thrift-sources}]
[INFO] Generated thrift files up to date, skipping compile.
[INFO] [build-helper:add-source {execution: add-source}]
[INFO] Source directory: /home/aeciosantos/workspace/zunnit/iago/target/generated-sources added.
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory /home/aeciosantos/workspace/zunnit/iago/target/generated-resources
[INFO] [scala:add-source {execution: scala-compile-first}]
[INFO] [scala:compile {execution: scala-compile-first}]
[INFO] Checking for multiple versions of scala
[WARNING]  Expected all dependencies to require Scala version: 2.9.2
[WARNING]  com.twitter:iago:0.5.1-SNAPSHOT requires scala version: 2.9.2
[WARNING]  com.twitter:util-collection:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-core:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:util-codec:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-http:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-kestrel:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:util-hashing:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-memcached:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-ostrich4:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:finagle-thrift:5.3.4 requires scala version: 2.9.2
[WARNING]  com.twitter:scala-json:3.0.0 requires scala version: 2.9.2
[WARNING]  com.twitter:util-jvm:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:ostrich:8.2.3 requires scala version: 2.9.2
[WARNING]  com.twitter:util-core:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:util-eval:5.3.6 requires scala version: 2.9.2
[WARNING]  org.scala-lang:scala-compiler:2.9.2 requires scala version: 2.9.2
[WARNING]  com.twitter:util-eval:5.3.6 requires scala version: 2.9.2
[WARNING]  com.twitter:util-logging:5.3.6 requires scala version: 2.9.2
[WARNING]  org.scala-tools.testing:specs_2.9.1:1.6.9 requires scala version: 2.9.1
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] /home/aeciosantos/workspace/zunnit/iago/src/main/scala:-1: info: compiling
[INFO] /home/aeciosantos/workspace/zunnit/iago/target/generated-sources/thrift/gen-java:-1: info: compiling
[INFO] /home/aeciosantos/workspace/zunnit/iago/target/generated-sources:-1: info: compiling
[INFO] Compiling 60 source files to /home/aeciosantos/workspace/zunnit/iago/target/classes at 1365092254759
[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:57)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:616)
[INFO]  at scala_maven_executions.MainHelper.runMain(MainHelper.java:161)
[INFO]  at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] 
[ERROR] error: fatal error: object scala not found.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Apr 04 13:17:35 BRT 2013
[INFO] Final Memory: 38M/241M
[INFO] ------------------------------------------------------------------------

--
 
---
You received this message because you are subscribed to the Google Groups "Iago Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iago-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Aécio

unread,
Apr 5, 2013, 6:03:14 PM4/5/13
to iago-...@googlegroups.com
I just cloned Iago in another system and the build worked fine.
I suspect maven got some corrupted jars in my system, but I was not able fix it yet.
Thank you.


2013/4/4 James Waldrop <j...@twitter.com>

James Waldrop

unread,
Apr 5, 2013, 6:48:53 PM4/5/13
to iago-...@googlegroups.com

Glad to hear it!


Sent from Mailbox for iPhone

Aécio

unread,
Apr 6, 2013, 11:07:54 AM4/6/13
to iago-...@googlegroups.com
I removed the folder ~/.m2/repository and the build completed successfully!


2013/4/5 James Waldrop <j...@twitter.com>

nicol...@gmail.com

unread,
Nov 26, 2013, 11:50:13 AM11/26/13
to iago-...@googlegroups.com
I'm having this problem at the moment and clearing my m2 repository is not helping. Anyone else come across this/got any tips on how to resolve it?

Thanks,

Nic

nicol...@gmail.com

unread,
Nov 27, 2013, 5:57:41 AM11/27/13
to iago-...@googlegroups.com
Just to provide some more info, I've tried clearing out my maven cache (rm ~/.m2/repository) but this doesn't seem to help.

I've also raised this on github here: https://github.com/twitter/iago/issues/18 (to avoid duplication, it's probably best to reply there now).

nicol...@gmail.com

unread,
Nov 27, 2013, 10:16:09 AM11/27/13
to iago-...@googlegroups.com
Figured it out - it's a scansafe issue at work blocking some of the twitter maven files. No idea why it thinks some are dangerous but not others. Bad scansafe.

nicol...@gmail.com

unread,
Nov 27, 2013, 10:17:46 AM11/27/13
to iago-...@googlegroups.com
To provide a bit more context. The actual maven exception about 'object scala not found' is pretty misleading. To identify/check for corrupt jars run something like:

find repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid

I then manually downloaded them on another computer/system to get around the scansafe blocking.
Reply all
Reply to author
Forward
0 new messages