我可以在本地构建 Play 框架模块并在本地使用它,但如何将其发布到内部 (Nexus) Maven 存储库(而不是公共(public) Play 存储库)以便 Play 能够找到它?
最佳答案
我设法使用project/Build.scala中的以下配置将play 2.0模块构建到私有(private)maven服务器(在我的例子中是Artificatory):
object ApplicationBuild extends Build {
/* Stuff about your app (version,name etc) and dependencies */
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
organization := "org.myorg"
).settings(
publishTo := Some("My Realm" at "https://myserver.com/libs-release-local")
).settings(
credentials += Credentials("My Realm", "myserver.com", "username", "password")
)
}
然后输入
play publish
在项目目录中
编辑
对于 Play 2.3,将以下内容添加到build.sbt
resolvers += "My Server" at "https://myserver.com/libs-release-local"
credentials += Credentials("Artifactory Realm", "myserver.com", "username", "password")
然后发出
sbt publish
关于playframework - 将 play 模块发布到内部 Maven 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9294629/