JFrog Artifactory和Oracle存储库

时间:2017-01-04 07:55:40

标签: java oracle maven artifactory

我已经开始使用JFrog Artifactory 4.14,我的maven app需要一个ojdbc jar,可以从oracle资源库下载,如果我使用maven本地设置,我会设置 http://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9010

现在,使用JFrog Artifactory,我根据自己设置了远程仓库 http://buttso.blogspot.lt/2015/02/fronting-oracle-maven-repository-with.html https://www.jfrog.com/blog/fronting-oracle-maven-repository-artifactory/

enter image description here

enter image description here

TEST按钮表示连接成功

我已经用生成的JFrog Artifactory替换了settings.xml文件

/opt/android-sdk

我已添加到我的POM

<?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>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
      <id>central</id>
    </server>
    <server>
      <username>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
      <id>snapshots</id>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <mirrorOf>*</mirrorOf>
      <name>remote-repos</name>
      <url>http://docker.k***.l**:8081/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://docker.k***.l**:8081/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://docker.k***.l**:8081/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release</name>
          <url>http://docker.k***.l**:8081/artifactory/plugins-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot</name>
          <url>http://docker.k***.l**:8081/artifactory/plugins-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

但是当我尝试运行maven命令时

  

清理安装

我得到了

无法解析以下工件:com.oracle.jdbc:ojdbc7:jar:12.1.0.2,com.oracle.jdbc:ucp:jar:12.1.0.2:找不到工件com.oracle.jdbc:ojdbc7 :jar:12.1.0.2 in remote-repos

2 个答案:

答案 0 :(得分:1)

您需要在JFrog中定义虚拟存储库。这将是其他存储库的组合,这是您将在settings.xml中指出的那个。

请参阅https://www.jfrog.com/confluence/display/RTF/Virtual+Repositories

我怀疑你的settings.xml中还需要一个代理元素。

请参阅https://maven.apache.org/guides/mini/guide-proxies.html

答案 1 :(得分:0)

由于您已经创建了新的远程存储库,因此必须将其添加到虚拟存储库中 enter image description here

选择新的(或编辑现有的)

enter image description here

并选择存储库

enter image description here

应该是