scala:console

24 views
Skip to first unread message

braver

unread,
May 12, 2009, 2:10:46 AM5/12/09
to Maven and Scala
So the Scala project builds with Maven, but when trying to do

mvn scala:console

-- it says, among other things,

[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin' does
not exist or no valid version could be found

-- however, all the pon.xml files seem to refer to

<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>

<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>

<reporting>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
</plugin>
</plugins>
</reporting>

-- and so in build, etc. How do I get my scala:console going?
Cheers,
Alexy

braver

unread,
May 12, 2009, 3:02:24 AM5/12/09
to Maven and Scala
Some extra info: I'm on Mac OSX Leopard (10.5.6), with Java 1.6.0 64-
bit set as top in preferences (/usr/bin/java is it and JAVA_HOME set
to /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home).

mvn -e scala:console says,

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'scala'.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin' does
not exist or no valid version could be found
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin
'org.apache.maven.plugins:maven-scala-plugin' does not exist or no
valid version could be found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin
(DefaultLifecycleExecutor.java:1546)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
(DefaultLifecycleExecutor.java:1786)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds
(DefaultLifecycleExecutor.java:446)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:176)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:
315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:
430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by:
org.apache.maven.plugin.version.PluginVersionNotFoundException: The
plugin 'org.apache.maven.plugins:maven-scala-plugin' does not exist or
no valid version could be found
at
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion
(DefaultPluginVersionManager.java:229)
at
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion
(DefaultPluginVersionManager.java:91)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin
(DefaultPluginManager.java:172)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin
(DefaultLifecycleExecutor.java:1517)
... 14 more
[INFO]
------------------------------------------------------------------------

-- I apologize if this is too long a list! (BTW, how do I show it
all?)
Cheers,
Alexy

David Bernard

unread,
May 12, 2009, 3:32:51 AM5/12/09
to maven-a...@googlegroups.com
scala:console need to know the version of scala-library.
=> you should run it under a project where scala-library is part of the dependencies or set <scalaVersion> in the <configuration> section of maven-scala-plugin.

could you send ues the pom.xml to see what is wrong in the pom.xml or in the plugin ?

/davidb

braver

unread,
May 12, 2009, 3:02:12 PM5/12/09
to Maven and Scala
On May 12, 3:32 am, David Bernard <david.bernard...@gmail.com> wrote:
> scala:console need to know the version of scala-library.
> => you should run it under a project where scala-library is part of the
> dependencies or set <scalaVersion> in the <configuration> section of
> maven-scala-plugin.
>
> could you send ues the pom.xml to see what is wrong in the pom.xml or in the
> plugin ?

OK -- this is talkingpuffin.org, Dave Briccetti's Twitter client, with
Mark MacBride's APIs now. The problem occurred when I invoked mvn
scala:console at the top -- there's no scala version in the plugin
configuration there:

http://github.com/mccv/talking-puffin/blob/7b2ef775c851756544f40e4f34d0ae41bf9fdbdb/pom.xml

I can do scala:console from a subdirectory where pom.xml has plugin
configuration, such as twitter-api -- when I added it there, it
worked.

http://github.com/mccv/talking-puffin/blob/7b2ef775c851756544f40e4f34d0ae41bf9fdbdb/twitter-api/pom.xml

However, if I want to sit in the console and play with any subproject,
what should I say in the top-level pom.xml? Also, apparently the
project does not specify dependency on scala-library, doing explicit
scala.version instead. What's the modern way of doing these things to
get scala:console work on top?

Cheers,
Alexy

braver

unread,
May 12, 2009, 3:04:37 PM5/12/09
to Maven and Scala
Also, when I do mvn scala:console, it now says this:

SystemFlippers: didn't consume all data for long ID 0 (pBase =
0x100175950, p = 0x100175954, pEnd = 0x100175958)
SystemFlippers: didn't consume all data for long ID 0 (pBase =
0x100182100, p = 0x100182104, pEnd = 0x100182108)
2009-05-12 15:03:03.940 java[44202:613] Error loading /Library/
ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit
Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/
Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did
find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/
Adobe Unit Types: no matching architecture in universal wrapper
java: OpenScripting.framework - scripting addition /Library/
ScriptingAdditions/Adobe Unit Types.osax declares no loadable
handlers.
2009-05-12 15:03:04.001 java[44202:613] Error loading /Users/alexyk/
Library/ScriptingAdditions/List & Record Tools.osax/Contents/MacOS/
List & Record Tools: dlopen(/Users/alexyk/Library/ScriptingAdditions/
List & Record Tools.osax/Contents/MacOS/List & Record Tools, 262): no
suitable image found. Did find:
/Users/alexyk/Library/ScriptingAdditions/List & Record Tools.osax/
Contents/MacOS/List & Record Tools: no matching architecture in
universal wrapper
java: OpenScripting.framework - scripting addition /Users/alexyk/
Library/ScriptingAdditions/List & Record Tools.osax declares no
loadable handlers.
Welcome to Scala version 2.7.4.final (Java HotSpot(TM) 64-Bit Server
VM, Java 1.6.0_07).
Type in expressions to have them evaluated.
Type :help for more information.

scala>

-- how do I get rid of these SystemFlippers struggles?
Cheers,
Alexy

braver

unread,
May 12, 2009, 6:20:13 PM5/12/09
to Maven and Scala
OK, the SystemFlippers is a known Java bug on Leopard, benign, and the
rest are AppleScripts which are obsolete but Leopard tries to load all
of them whenever scripting is needed, which is apparently going on in
case of mvn scala:console, for some dark reason.

The only thing left needed is an example on how to replace
scala.version by scala-library dependency!

Cheers,
Alexy

Josh Suereth

unread,
May 12, 2009, 6:28:43 PM5/12/09
to maven-a...@googlegroups.com
It looks like it's already declared:

   <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>


You seem to be missing the parent pom (or whoever sets the ${scala.version} property).

I believe you can try mvn -Dscala.version=2.7.4 scala:console.


Cheers!
-Josh

David Bernard

unread,
May 13, 2009, 3:39:07 AM5/13/09
to maven-a...@googlegroups.com
IMHO :  all modules have scala-library as direct dependency so you could :
* move in your root pom.xml the dependency section with scala-library and scala-swing.
* move build instruction about maven-scala-plugin into root pom.xml

scala:console is made to run/test code from project where there is code (and dependencies)

/davidB
Reply all
Reply to author
Forward
0 new messages