gpt4 book ai didi

maven - 为什么 maven 构建在从不正确的 repo 中下载 itext 时失败?

转载 作者:行者123 更新时间:2023-12-01 07:26:14 26 4
gpt4 key购买 nike

我正在从外部存储库下载某些依赖项。所以我在我的 pom.xml 中添加了以下存储库标签

<repository>
<id>cdatoolsrelease</id>
<name>cdatools.com-releases</name>
<url>http://www.cdatools.com:8081/artifactory/ext-release-local</url>
</repository>
<repository>
<id>cdatoolssnapshot</id>
<name>cdatools.com-snapshot</name>
<url>http://www.cdatools.com:8081/artifactory/libs-snapshot-local</url>
</repository>

一切正常。我也可以看到我下载的所需依赖项。但是当我尝试构建这个项目时,我得到以下异常并且构建失败\
D:\WORKSPACE\some-project>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count
of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building some-project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://www.cdatools.com:8081/artifactory/libs-snapshot-local/com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.122 s
[INFO] Finished at: 2014-07-17T11:53:53+05:45
[INFO] Final Memory: 10M/246M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project some-project: Could not resolve dependencies for project ProjectName:some-project:war:0.0.1-SNAPSHOT: Failed to collect dependencies at net.sf.jasperrepor
ts:jasperreports:jar:5.1.2 -> com.lowagie:itext:jar:2.1.7.js2: Failed to read artifact descriptor for com.lowagie:itext:jar:2.
1.7.js2: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js2 from/to cdatoolssnapshot (http://www.cdatools.com:8081/ar
tifactory/libs-snapshot-local): Failed to transfer file: http://www.cdatools.com:8081/artifactory/libs-snapshot-local/com/lowa
gie/itext/2.1.7.js2/itext-2.1.7.js2.pom. Return code is: 409 , ReasonPhrase:The repository 'libs-snapshot-local' rejected the
artifact 'libs-snapshot-local:com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.pom' due to its snapshot/release handling policy.. -
> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我的 pom 文件中没有 itext 依赖项,但我确实有 jasper 依赖项。
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.1.2</version>
</dependency>

Maven 正在尝试在 cdatools 存储库中搜索 itext 依赖项,但如果它没有得到它,则 maven 构建失败。我怎样才能让它工作。当我删除 repo 时,一切正常,就像在添加新的 repo 标签之前一样

最佳答案

我解决了这个问题,在 pom.xml 中添加了 2 个存储库:

<repository>
<id>jasper</id>
<url>http://jasperreports.sourceforge.net/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jasper1</id>
<url>http://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-repo/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

关于maven - 为什么 maven 构建在从不正确的 repo 中下载 itext 时失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24796190/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com