Artifactory:在libs中寻找Jars-release然后maven central

时间:2013-11-22 18:58:56

标签: java maven maven-2 artifactory repository

我在使用Artifactory时遇到了一些麻烦。它目前的设置方式是从远程存储库下载jar,而不是先从我的libs-release repo下载jar。

将Settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
  <username>admin</username>
  <id>central</id>
</server>
<server>
  <username>admin</username>
  <id>snapshots</id>
</server>
 </servers>
  <mirrors>
<mirror>
      <mirrorOf>*</mirrorOf>
  <name>remote-repos</name>
      <url>http://server:port/artifactory/remote-repos</url>
  <id>remote-repos</id>
</mirror>
</mirrors>
<profiles>
<profile>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>libs-release</name>
      <url>http://server:port/artifactory/libs-release</url>
    </repository>
    <repository>
      <snapshots />
      <id>snapshots</id>
      <name>libs-snapshot</name>
      <url>http://server:port/artifactory/libs-snapshot</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>plugins-release</name>
      <url>http://server:port/artifactory/plugins-release</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots />
      <id>snapshots</id>
      <name>plugins-snapshot</name>
      <url>http://server:port/artifactory/plugins-snapshot</url>
    </pluginRepository>
  </pluginRepositories>
  <id>artifactory</id>
</profile>
 </profiles>
 <activeProfiles>
   <activeProfile>artifactory</activeProfile>
 </activeProfiles>
</settings>

有关如何制作它的任何见解,以便它在我的libs-release下载之前,在远程存储库中寻找它将非常感谢!

1 个答案:

答案 0 :(得分:0)

那是因为您设置了mirror。只需删除它,您的libs-relese即可使用。