This page is no longer maintained — Please continue to the home page at www.scala-lang.org

SBT Add a Dependency

4 replies
hossein_haeri
Joined: 2011-09-25,
User offline. Last seen 1 year 2 weeks ago.
Dear all,

[My appologies if this is not the right place to ask SBT questions. Would appreciate it if you redirect me to the right place then...]
On the installation page of a Scala project, I read that having installed SBT, I would need to add a dependency to the project from their webpage. Having had a quick look over the sbt commands, I seem not to be able to do this. Any helps here?

TIA,--Hossein

--------------------------------------------------------------------------------------------------------------

Seyed H. HAERI (Hossein)

Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany

ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: SBT Add a Dependency

On Fri, Jan 27, 2012 at 21:33, Seyed H. HAERI (Hossein)
wrote:
> Dear all,
>
> [My appologies if this is not the right place to ask SBT questions. Would
> appreciate it if you redirect me to the right place then...]
>
> On the installation page of a Scala project, I read that having installed
> SBT, I would need to add a dependency to the project from their webpage.
> Having had a quick look over the sbt commands, I seem not to be able to do
> this. Any helps here?

Most projects tell you exactly how to do that. Usually, it involves
adding a line like this to build.sbt:

libraryDependencies += "groupId" %% "artifactid" % "version"

This assumes it's a Scala dependency. Java dependencies replace that
%% with a %. Can you tell us what that project or dependency is?

hossein_haeri
Joined: 2011-09-25,
User offline. Last seen 1 year 2 weeks ago.
Re: SBT Add a Dependency

Hi Daniel,

> Most projects tell you exactly how to do that. Usually, it involves
> adding a line like this to build.sbt:
>
> libraryDependencies += "groupId" %% "artifactid" % "version"

I see.

> Can you tell us what that project or dependency is?

Sure. That's Kiama:

http://code.google.com/p/kiama/wiki/Installation

Thanks a lot,
--Hossein
--------------------------------------------------------------------------------------------------------------

Seyed H. HAERI (Hossein)

Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany

ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: SBT Add a Dependency

On Sat, Jan 28, 2012 at 16:12, Seyed H. HAERI (Hossein)
wrote:
> Hi Daniel,
>
>> Most projects tell you exactly how to do that. Usually, it involves
>> adding a line like this to build.sbt:
>>
>> libraryDependencies += "groupId" %% "artifactid" % "version"
>
> I see.
>
>> Can you tell us what that project or dependency is?
>
> Sure. That's Kiama:
>
> http://code.google.com/p/kiama/wiki/Installation

Well, in the link they provided to SBT, on the table of contents to
the right, there's a "Library Dependencies" link which talks more
about this.

Have you created an sbt build file?

hossein_haeri
Joined: 2011-09-25,
User offline. Last seen 1 year 2 weeks ago.
Re: SBT Add a Dependency

Hi Daniel,

> Well, in the link they provided to SBT, on the table of contents to the right, there's a "Library Dependencies" link which talks more about this.
>
> Have you created an sbt build file?

Yes, I have. And, I was reading through the SBT guide Kiama links to.
Yet, I hadn't still made it to the "Library Dependencies" section, nor
had I noticed it.

Thanks,
--Hossein

--------------------------------------------------------------------------------------------------------------

Seyed H. HAERI (Hossein)

Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany

ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland