Scala game addiction

I am trying to get a game project to have another local scala project as a dependency. I have a local scala project that deploys in my local M2 repository with this line in my configuration file.

publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository"))) 

And I'm trying to load a dependency in my play project using this line

 val appDependencies = Seq( "com.experimentalcork" %% "timeywimeyentities" % "0.0.2" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings( resolvers += "Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",testOptions in Test := Nil ) 

The magazines, as I do the "play compile", say that it cannot find the dependency. He looks in the place where I indicated the addiction will be.

 [warn] ==== Local Maven Repository: tried [warn] file://C:/Users/caelrin/.m2/repository/com/experimentalcork/timeywimeyentities_2.9.1/0.0.2/timeywimeyentities_2.9.1-0.0.2.pom 

And when I go to check this directory, I can confirm that the pom and jar files are there. I am completely puzzled by how it might look in a directory that contains pom and does not find it. Has anyone had experience with this?

+4
source share
1 answer

I also need a call to .dependsOn.

 val timeywimeyentities: Project = Project([Put all of your settings here for the project just like you would a play project]) val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings( resolvers += "Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",testOptions in Test := Nil ).dependsOn(timeywimeyentities % "compile->compile") 

Adding "compile-> compile" makes the main code of your game project based on the main code of your dependency. If you want the test code of your game project to also depend on it, you can use "compile-> test". If you only need test code to see each other, you can use "test-> test". You can also link them together, for example: "compile-> compile; test-> test". If you only want to "compile-> compile", you do not need to explicitly specify it.

See https://github.com/harrah/xsbt/wiki/Getting-Started-Multi-Project for more details.

0
source

All Articles