Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何从默认的central maven&;下载maven JAR及其依赖项;其他公共回购协议?_Java_Maven - Fatal编程技术网

Java 如何从默认的central maven&;下载maven JAR及其依赖项;其他公共回购协议?

Java 如何从默认的central maven&;下载maven JAR及其依赖项;其他公共回购协议?,java,maven,Java,Maven,我希望下载Atlassian jar及其依赖项(存在于不同的repo中) 我正在尝试下载 使用从上述jar文件中提取的pom.xml文件 我正在使用ApacheMaven3.6.3 到目前为止,我已经通过查看各种So链接尝试了以下命令 mvn dependency:copy-dependencies -DoutputDirectory="D:\pom\jira\output" mvn -DrepoUrl="https://packages.atlassian.com/maven-public

我希望下载Atlassian jar及其依赖项(存在于不同的repo中)

我正在尝试下载

使用从上述jar文件中提取的pom.xml文件

我正在使用ApacheMaven3.6.3

到目前为止,我已经通过查看各种So链接尝试了以下命令

mvn dependency:copy-dependencies -DoutputDirectory="D:\pom\jira\output"

mvn -DrepoUrl="https://packages.atlassian.com/maven-public/" -DgroupId=com.atlassian.jira -DartifactId=jira-rest-java-client-api -Dversion=5.1.6 dependency:copy-dependencies


mvn -DoutputDirectory="D:\pom\jira\output" -DrepoUrl="https://packages.atlassian.com/maven-public/"  org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DgroupId=com.atlassian.jira -DartifactId=jira-rest-java-client-api -Dversion=5.1.6


mvn -DoutputDirectory="D:\pom\jira\output" -DrepoUrl="https://packages.atlassian.com/maven-public/"  org.apache.maven.plugins:maven-dependency-plugin:2.1:get dependency:get -DgroupId=com.atlassian.jira -DartifactId=jira-rest-java-client-api -Dversion=5.1.6
我相信错误只是在暗示,它在默认的中央ApacheMaven2 repo中找不到Atlassian库


有人能帮我吗?

有两种方法:

1) 在项目中指定要使用的存储库:

<project>
...
...
  <repositories>

    <repository>
      <id>repo1</id>
      <name>your custom Repo1</name>
      <url>your repo1 url</url>
    </repository>

    <repository>
      <id>repo2</id>
      <name>your custom Repo2</name>
      <url>your repo2 url</url>
    </repository>

  </repositories>
...
...
</project>

...
...
报告1
您的定制报告1
您的repo1 url
报告2
您的定制报告2
您的repo2 url
...
...
2) 在maven设置文件中创建配置文件 ${user.home}/.m2/settings.xml

    <settings>
   ...
   <profiles>
      ...
      <profile>
         <id>myprofile</id>
         <repositories>
            <repository>
               <id>repo1</id>
               <name>your custom Repo1</name>
               <url>your repo1 url</url>
            </repository>
            <repository>
               <id>repo2</id>
               <name>your custom Repo2</name>
               <url>your repo2 url</url>
            </repository>
         </repositories>
      </profile>
      ...
   </profiles>
   <activeProfiles>
      <activeProfile>myprofile</activeProfile>
   </activeProfiles>
   ...
</settings>
(如果您已下载maven版本,则应在以下文件夹中编辑:您的自定义maven\u解压缩文件夹/conf/settings.xml


...
...
我的个人资料
报告1
您的定制报告1
您的repo1 url
报告2
您的定制报告2
您的repo2 url
...
我的个人资料
...

我将在
设置.xml
中配置存储库。