1

我开始了一个新的游戏项目:xyz。我想添加对 customGroupId:customArtifactId:0.10 的依赖项,该依赖项托管在主机 nexus.xyz.com 上的 nexus 存储库中,但只能通过用户名和密码访问。

所以,我编辑了 xyz\project\Build.scala

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

    val appName         = "xyz"
    val appVersion      = "1.0-SNAPSHOT"

    val appDependencies = Seq(
      "customGroupId" % "customArtifactId" % "0.10"
    )

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
      credentials += Credentials("realm1", "nexus.xyz.com", "myUser", "myPassword"),

      resolvers += "realm1" at "https://nexus.xyz.com/svn/eessi/maven2/releases"
    )

}

然后我在xyz跑了。

play
run

我明白了

play! 2.0.3, http://www.playframework.org
[xyz] $ run
[info] Updating {file:/C:/Users/grigocn/work/xyz/}xyz...
[warn]  module not found: customGroupId#customArtifactId;0.10
[warn] ==== local: tried
[warn]   c:\Users\grigocn\apps\play\framework\..\repository/local/customGroupId/customArtifactId/0.10/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/customGroupId/customArtifactId/0.10/customArtifactId-0.10.pom
[warn] ==== realm1: tried
[warn]   https://webgate.ec.europa.eu/CITnet/svn/eessi/maven2/releases/customGroupId/customArtifactId/0.10/customArtifactId-0.10.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/customGroupId/customArtifactId/0.10/customArtifactId-0.10.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
...

PS。我试图遵循这一点,但没有奏效:Play framework and sbt:passing credentials to a nexus passowrd protected repo

4

2 回答 2

1

你检查域名是否正确?我的关系领域(我认为是默认领域)例如是

Sonatype Nexus 存储库管理器

于 2012-09-18T15:30:57.243 回答
0

我发现/记得领域不是我可以用来引用服务器的唯一标识符,而是当您进行身份验证时服务器显示的文本。

在这种情况下,领域是“PROXY_INTERNET” 领域认证

所以现在我的有效配置如下。请注意,“eessi-releases”不是服务器的领域或 id。

import sbt._
import Keys._
import PlayProject._
import com.github.play2war.plugin._

object ApplicationBuild extends Build {

    val appName         = "reliable-transport-ui"
    val appVersion      = "1.0-SNAPSHOT"
    val bmServerVersion = "0.113"

    //val mySubProject = Project("transport-server", file("../reliable-transport-server/src/main/java")) 
    //val mySubProject2 = Project("transport-server", file("../reliable-transport-server/src/main/resources")) 


    val appDependencies = Seq(
      javaCore,
      javaJdbc,
      // Add your project dependencies here,
      "commons-io" % "commons-io" % "1.4"
    )

    import com.typesafe.sbteclipse.core.EclipsePlugin._

    import play.Project._ 

    val main = play.Project(appName, appVersion, appDependencies).settings(defaultScalaSettings:_*).settings(
        //Subversion is the realm - the text displayed by server when it asks for username/password. Don't change it from <Subversion>
        credentials += Credentials("Subversion", "webgate.ec.europa.eu", "grigocn", "<pass>")

        ,resolvers += "eessi-releases" at "https://webgate.ec.europa.eu/CITnet/svn/eessi/maven2/releases"

        ,resolvers += "eessi-thirdparty" at "https://webgate.ec.europa.eu/CITnet/svn/eessi/maven2/thirdparty"

        ,resourceDirectory in Test <<= baseDirectory(_ / "test-resources")

        ,EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

        ,EclipseKeys.withSource := true 
    )
)
于 2013-07-15T14:19:40.133 回答