Artifactory:先在libs版本中寻找Jars,然后再寻找maven central



我在使用Artifactory时遇到了一些问题。目前的设置方式是从远程存储库下载jar,而不是首先从我的libs发行版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版本中下载,我们将不胜感激!

这是因为您已经设置了mirror。只要移除它,您的libs-relese就会被使用。

相关内容

最新更新