使用人工制品时“遗失”

问题描述 投票:0回答:1

我有一个正在尝试使用Maven进行构建的Eclipse项目,其JAR文件位于我的专用Artifactory服务器上,其他一些Maven存储库。

在我的POM文件中(在添加Artifactory存储库之前),我指定了存储库:

 <repositories>
 <repository>
    <id>third-party</id>
    <name>Atlassian 3rdParty</name>
    <url>https://repo.spring.io/plugins-release/</url>
 </repository>
 <repository>
    <id>ICM</id>
    <name>ICM Repository</name>
    <url>http://maven.icm.edu.pl/artifactory/repo/</url>
 </repository>
 </repositories>

存储库使我能够访问构建所需的几个库,包括(但不限于):

      ...
    <dependency>
       <groupId>xerces</groupId>
       <artifactId>xerces</artifactId>
       <version>2.4.0</version>
   </dependency>     
   <dependency>
     <groupId>com.oracle</groupId>
     <artifactId>ojdbc6</artifactId>
     <version>11.2.0.3</version>
   </dependency>
   <dependency>
     <groupId>com.sun.mail</groupId>
     <artifactId>javax.mail</artifactId>
   </dependency>
       ...

我有几个要从Artifactory服务器访问的JAR文件。这些文件在我创建的存储库中Factor_Snapshot,其中有两个:factorbase-1.0.0.jar和lowerbase-1.0.0.jar。

为了通过Artifactory获得所有内容(正确地将其用作remore存储库的代理,我将这些存储库添加到Artifactory。然后,我使用“设置我”链接来尝试为POM文件生成正确的条目。

我注意到的一件事是,我似乎无法获得生成的条目来包括Factor_Snapshot存储库。生成的条目似乎只包括以前存在的libs-release和libs-snapshot存储库。当我单击“生成Maven设置”并选择快照时,只允许我选择libs-snapshot,gradle-dev,libs-release等。无法选择我的快照存储库Factor_Snapshot。生成的设置如下所示:

<?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>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://192,168.1.230:8081/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://192,168.1.230:8081/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://192,168.1.230:8081/artifactory/libs-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://192,168.1.230:8081/artifactory/libs-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

当然,因为似乎没有用于在Eclipse中放入活动配置文件的settings.xml文件,所以我怀疑是否可以使用此文件无论如何。另外:不清楚如何获取文件中引用的加密密码。

根据我在Artifactory服务器上的组织方式,添加了以下依赖关系:

      ...
   <dependency>
      <groupId>com.factor3</groupId>
      <artifactId>lowerbase</artifactId>
      <version>1.0.0</version>
    </dependency>
   <dependency>
      <groupId>com.factor3</groupId>
      <artifactId>factorbase</artifactId>
      <version>1.0.0</version>
   </dependency>
       ...

我相信我正确设置了它们。保存POM文件后,我确实收到了错误消息,说缺少构件Lowerbase:jar和factorbase:jar。这是预料之中的,因为我还没有放入存储库声明。

我最终还是在猜测回购声明,因此我根据Artifactory文档和回购的设置方式在POM文件中创建了以下条目:

 <repositories>
    <repository>
      <id>snapshots</id>
      <name>soliandisk</name>
     <url>http://192,168.1.230:8081/artifactory/Factor_Snapshot</url>
 </repository>
 <repository>
    <id>third-party</id>
    <name>Atlassian 3rdParty</name>
    <url>https://repo.spring.io/plugins-release/</url>
 </repository>
 <repository>
    <id>ICM</id>
    <name>ICM Repository</name>
    <url>http://maven.icm.edu.pl/artifactory/repo/</url>
 </repository>
 </repositories>

但是当我添加Factor_Snapshot存储库时,现在出现失败,提示all缺少JAR文件工件-甚至是factorbase和lowerbase工件!

我知道我在配置中缺少某些内容,但是我不知道是什么。

如何配置Artifactory和我的POM文件,以便获得所有必要的JAR?

eclipse maven-2 artifactory
1个回答
0
投票

您的URL http://192,168.1.230:8081包含“,”而不是“。”

© www.soinside.com 2019 - 2024. All rights reserved.