2

我想使用 maven 下载 jira-rest-java-client-0.2-m1.jar。但我不知道对此的依赖。

我尝试了以下

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client</artifactId>
    <version>0.2-m1</version>
</dependency>

但它没有下载。当我运行mvn compile它说

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.444s
[INFO] Finished at: Thu May 02 09:53:19 IST 2013
[INFO] Final Memory: 7M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for project com.package.myproject:myproject:war:1.0-SNAPSHOT
: Failure to find com.atlassian.jira:jira-rest-java-client:jar:0.2-m1 in http://repository.codehaus.org was cached in the local repository, resolu
tion will not be reattempted until the update interval of codehaus-release-repo has elapsed or updates are forced -> [Help 1]

手动我可以下载jar。但我想用maven下载它。我怎样才能做到这一点?谢谢

4

1 回答 1

4

看起来您可能只需将 Atlassian 的公共存储库添加到您的settings.xml或您的pom.xml.

来自:https://developer.atlassian.com/display/DOCS/Atlassian+Maven+Repositories,公共 repo 的 url 是http://maven.atlassian.com/public

谷歌搜索还表明这个 repo URL 也可以工作:https ://repository.atlassian.com/maven2

例如,要添加到项目的 pom.xml 中,您可以将以下内容添加为 的子项<project>

<repositories>
  <repository>
    <id>central</id>
    <name>Atlassian Public Repository</name>
    <layout>default</layout>
    <url>http://maven.atlassian.com/public</url>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

(如果您已经有一个存储库部分,那么您只需将存储库添加到它)。如果您想了解更多信息,这里是 pom 的文档:http ://maven.apache.org/guides/introduction/introduction-to-the-pom.html

于 2013-05-02T04:49:44.650 回答