1

我正在尝试将JIRA 的 REST Java 客户端添加到我的 Scala 项目中。我在这里找到了应该添加到我的build.sbt文件中的说明:https ://www.versioneye.com/java/com.atlassian.jira:jira-rest-java-client/1.0

libraryDependencies += "com.atlassian.jira" % "jira-rest-java-client" % "2.0.0-m2"

但是我收到一个错误:

[error] (*:update) sbt.ResolveException: unresolved dependency: com.atlassian.jira#jira-rest-java-client;2.0.0-m2: not found

我以为 SBT 不知道这个库的正确存储库,我补充说:

resolvers += "Jira repository" at "https://maven.atlassian.com/content/repositories/atlassian-public/"

现在我收到错误:

[error] (*:update) sbt.ResolveException: unresolved dependency: commons-codec#commons-codec;1.6: configuration not found in commons-codec#commons-codec;1.6: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.2.1-atlassian-2 compile

我究竟做错了什么?我是 Scala 和 Java 基础架构的新手——向项目添加新库的正确流程是什么?


PS。这是build.sbt文件内容:

name := "MyJiraTest"

version := "1.0"

libraryDependencies += "org.scalatest" %% "scalatest" % "2.1.6" % "test"

libraryDependencies += "com.typesafe.slick" %% "slick" % "2.1.0-M2"

libraryDependencies += "com.h2database" % "h2" % "1.3.175"

libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.1"

libraryDependencies += "org.scalaj" % "scalaj-time_2.10.0-M7" % "0.6"

libraryDependencies += "com.typesafe.play" %% "play" % "2.2.2"

libraryDependencies += "net.liftweb" %% "lift-json" % "2.5.1"

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

libraryDependencies ++= Seq(
    "org.joda" % "joda-convert" % "1.5",
    "com.github.tototoshi" %% "slick-joda-mapper" % "1.2.0-SNAPSHOT"
)

libraryDependencies += "postgresql" % "postgresql" % "9.1-901.jdbc4"

libraryDependencies += "com.github.tminglei" % "slick-pg_2.10" % "0.5.3"

libraryDependencies += "com.github.tminglei" % "slick-pg_joda-time_2.10" % "0.5.3"

libraryDependencies += "com.github.tminglei" % "slick-pg_play-json_2.10" % "0.5.3"

resolvers += "Jira repository" at "https://maven.atlassian.com/content/repositories/atlassian-public/"

libraryDependencies += "com.atlassian.jira" % "jira-rest-java-client" % "2.0.0-m2"

聚苯乙烯。sbt 的输出约:

[info] Loading project definition from /.../MyJiraTest/project
[info] Set current project to MyJiraTest (in build file:/.../MyJiraTest/)
[info] This is sbt 0.13.5
[info] The current project is {file:/.../MyJiraTest/}myjiratest 1.0
[info] The current project is built against Scala 2.10.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.4

购买力平价。sbt“显示外部解析器”

[info] Loading project definition from /.../MyJiraTest/project
[info] Set current project to MyJiraTest (in build file:/.../MyJiraTest/)
[info] ArrayBuffer(FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false)), public: http://repo1.maven.org/maven2/, Sonatype OSS Snapshots: https://oss.sonatype.org/content/repositories/snapshots, Jira repository: https://maven.atlassian.com/content/repositories/atlassian-public/)
[success] Total time: 0 s, completed Jun 30, 2014 10:15:43 AM
4

1 回答 1

1

我在我的项目中使用 atlassian 存储库。我认为您需要更改在 build.sbt 中添加到“解析器”的条目

resolvers += "releases"  at "https://maven.atlassian.com/repository/public/"
于 2015-10-04T04:27:53.757 回答