Alex Povar
Alex Povar

Reputation: 4960

PlayFramework 2 and lib built with SBT in repo

I am trying to separate my application written with play framework 2 into small parts. So I've wrote small lib with sbt(1) as build system and publish it into local repository with publish-local command. This repo is situated in /home/user/.ivy2 directory.

Now I am trying to add this lib from /home/user/.ivy2 repository as dependency to my play(2) project. I've try several resolvers:

1) resolvers += "Local Ivy Repository" at "file:///home/user/.ivy2/local"

2) resolvers += Resolver.file("Local repo", file("/home/user/.ivy2/local"))

But both unable to find by repository. Where is the problem could be?

Note:

sbt(1) - is 0.12.1

play(2) - is 0.11.3 could this be a problem?

Upvotes: 2

Views: 683

Answers (2)

Rob Wilton
Rob Wilton

Reputation: 376

To get this working with play 2.2.2 in an sbt 13.1 subproject I had to use "in ThisBuild" to get it work!

resolvers in ThisBuild+= Resolver.file("Local repo", file(System.getProperty("user.home") + "/.ivy2/local"))(Resolver.ivyStylePatterns)

Upvotes: 0

Alex Povar
Alex Povar

Reputation: 4960

I don't know why this is skiped in play documentation, but to add ivy repository you should use

resolvers += Resolver.file("Local repo", file("/home/user/.ivy2/local"))(Resolver.ivyStylePatterns)

instead of

resolvers += Resolver.file("Local repo", file("/home/user/.ivy2/local"))

Upvotes: 4

Related Questions