0

我正在我们基于工件的存储库中部署一个名为edireader.jar的特定 jar。在 Artifactory 中 Edireader 的存储库浏览器页面中,显示了以下依赖项。我在模块的 POM.xml 中使用的相同依赖项。

<dependency>

<groupId>com.berryworks</groupId>

<artifactId>edireader</artifactId>

<version>4.7.3</version> 

</dependency>

运行 maven install 时遇到以下错误,

“com.berryworks:edireader:jar:4.7.3 (compile)]: Failed to read artifact descriptor for com.berryworks:edireader:jar:4.7.3: Could not find artifact com.berryworks:berryworks:pom:4.7.3 in central (http://SERVER_Name:PORT/artifactory/libs-releases)”

它正在尝试从 SERVER_Name:PORT/artifactory/libs-snapshots/com/berryworks/berryworks/4.7.3/berryworks-4.7.3.pom 下载 jar,这似乎是错误的,因为 jar 位于 //SERVER_Name:PORT/artifactory /simple/libs-releases-local/com/berryworks/edireader/4.7.3/

我尝试更改所有内容,但无法找到问题。我的问题是为什么它在 maven 安装期间没有选择 jar,因为它存在于工件服务器中。

编辑:这是我正在使用的 settings.xml

 <profiles>
<profile>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>libs-releases</name>
      <url>http://SERVER_Name:PORT/artifactory/libs-releases</url>
    </repository>
    <repository>
      <snapshots />
      <id>snapshots</id>
      <name>libs-snapshots</name>
      <url>http://SERVER_Name:PORT/artifactory/libs-snapshots</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>plugins-releases</name>
      <url>http://SERVER_Name:PORT/artifactory/plugins-releases</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots />
      <id>snapshots</id>
      <name>plugins-snapshots</name>
      <url>http://SERVER_Name:PORT/artifactory/plugins-snapshots</url>
    </pluginRepository>
  </pluginRepositories>
  <id>artifactory</id>
</profile>
4

1 回答 1

1

我通过在 POM 中删除一些由 artifactory 创建的组件来解决上述问题

产生问题的POM如下

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.berryworks</groupId>
  <artifactId>edireader</artifactId>
  <packaging>jar</packaging>
  <version>4.7.3</version>
  <name>edireader</name>
  <url>http://maven.apache.org</url>

  <parent>
    <groupId>com.berryworks</groupId>
    <artifactId>berryworks</artifactId>
    <version>4.7.3</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.berryworks</groupId>
      <artifactId>test-tools</artifactId>
      <version>4.7.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.berryworks</groupId>
      <artifactId>JQuantify</artifactId>
      <version>3.3</version>
    </dependency>
    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>false</addClasspath>
              <mainClass>com.berryworks.edireader.demo.EDItoXML</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

</project>

现在它只包含以下内容并且正在工作

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.berryworks</groupId>
  <artifactId>edireader</artifactId>
  <packaging>jar</packaging>
  <version>4.7.3</version>
  <name>edireader</name>
  <url>http://maven.apache.org</url>
</project>
于 2013-01-03T10:22:55.013 回答