我正在尝试将 REST Java Client for JIRA 添加到我的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"
PPS。输出 sbt about :
[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
PPPS。 sbt"显示externalResolvers" :
[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
答案 0 :(得分:1)
我在我的项目中使用atlassian存储库。我认为你需要更改你在build.sbt中添加到“解析器”的条目
resolvers += "releases" at "https://maven.atlassian.com/repository/public/"