What's the right way to use an ivy.xml file with sbt? I'm getting a scala.tools.nsc.MissingRequi...

371 views
Skip to first unread message

James Moore

unread,
Oct 14, 2012, 9:08:18 PM10/14/12
to simple-b...@googlegroups.com
I'm playing with using an ivy.xml file along with sbt.  (I'd like an ivy.xml file so the ivy eclipse plugin can create a classpath container for me).

Problem is that I get this:

scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:655)
at scala.tools.nsc.symtab.Definitions$definitions$.getModule(Definitions.scala:605)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:145)

When I add this to build.sbt:

externalIvyFile( baseDirectory { base => base / "ivy.xml"} )

Suggestions?  This is just with a small sample project consisting of:

==> ivy.xml <==
<?xml version="1.0" encoding="ISO-8859-1"?>
    version="2.0"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" >

    <info
        module=""
        organisation="com.restphone"
        status="integration" >
    </info>

    <dependencies>

        <dependency
            name="guava"
            org="com.google.guava"
            rev="13.0.1" />

        <dependency
            name="artifactname"
            org="com.restphone"
            rev="1.0" />
        
    </dependencies>

</ivy-module>
==> build.sbt <==
sourceDirectory in Compile <<= baseDirectory(_ / "src")

scalaSource in Compile <<= baseDirectory(_ / "src")

externalIvyFile( baseDirectory { base => base / "ivy.xml"} )

==> src/com/restphone/Foo.scala <==
object Startme extends App {
  println("go!")
}

Mark Harrah

unread,
Oct 18, 2012, 10:28:31 AM10/18/12
to simple-b...@googlegroups.com
On Sun, 14 Oct 2012 18:08:18 -0700 (PDT)
James Moore <ja...@banshee.com> wrote:

> I'm playing with using an ivy.xml file along with sbt. (I'd like an
> ivy.xml file so the ivy eclipse plugin can create a classpath container for
> me).

You can use deliver-local to generate an Ivy file from your normal sbt build definition. If you still prefer ivy.xml, it must contain all dependencies, including the dependency on scala-library. The inline configuration provides this dependency automatically.

-Mark
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/GXOUMYCh4xoJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

James Moore

unread,
Oct 18, 2012, 12:48:58 PM10/18/12
to simple-b...@googlegroups.com
On Thu, Oct 18, 2012 at 7:28 AM, Mark Harrah <dmha...@gmail.com> wrote:
> On Sun, 14 Oct 2012 18:08:18 -0700 (PDT)
> James Moore <ja...@banshee.com> wrote:
>
>> I'm playing with using an ivy.xml file along with sbt. (I'd like an
>> ivy.xml file so the ivy eclipse plugin can create a classpath container for
>> me).
>
> You can use deliver-local to generate an Ivy file from your normal sbt build definition. If you still prefer ivy.xml, it must contain all dependencies, including the dependency on scala-library. The inline configuration provides this dependency automatically.

Thanks, that should solve my problem. I only wanted the ivy.xml file
to make life easier from Eclipse, so having it generated (and then
probably hand-edited) from native sbt is just fine.

--
James Moore
ja...@restphone.com
http://blog.restphone.com/
http://www.linkedin.com/in/jamesmmooreiv
Reply all
Reply to author
Forward
0 new messages