Tag Archives: local maven dependency

Adding dependency from local maven repository to a Play project

I wanted to add a REST API layer to my java project and decided to use Play framework for the REST APIs. This way, in future I can also use Play to serve static web content.

Play framework uses SBT & Ivy whereas I had used Maven for my Java project. To be able to add the jar as dependency and get it working I had to do the below.

PS: I am using Play 2.3.x

1. Add the dependency in build.sbt and also a resolver pointing to my local Maven repository.

libraryDependencies ++= Seq(
 "my.group" % "my-project" % "1.0-SNAPSHOT",

resolvers += Resolver.mavenLocal

2. Do an “activator update”

3. Do an “activator eclipse”

4. Refreshed the project in eclipse.

The main trick was step#2 to update.
You could also use resolver like below:

resolvers += (
 "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository"