来自 itext 的 jasper-reports 中的依赖错误 [英] Dependency error in jasper-reports from itext
问题描述
从昨天开始,由于 iText jar,我在使用 Maven 编译时遇到了问题.我的项目依赖于 jasperreports-2.0.1,它依赖于 itext-1.02b 或更高版本.
From yesterday I have problems compiling with maven because of iText jar. My project has a dependency of jasperreports-2.0.1 that depends on itext-1.02b or higher.
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>[1.02b,)</version>
<scope>compile</scope>
</dependency>
这是maven中的日志错误:
That is the log error in maven:
Failed to collect dependencies for [jasperreports:jasperreports:jar:2.0.1 (compile)]: Failed to read artifact descriptor for com.lowagie:itext:jar:4.2.2: Could not transfer artifact com.itextpdf:itextpdf:pom:4.2.2 from/to jaspersoft (http://www.jasperforge.org/maven2): Access denied to http://www.jasperforge.org/maven2/com/itextpdf/itextpdf/4.2.2/itextpdf-4.2.2.pom. Error code 403, Forbidden -> [Help 1]
我看到此处来自 Amedee Van Gasse 的评论,其中谈到了 4.2.2没有jar的版本.
I see here a comment from Amedee Van Gasse that says something about a 4.2.2 version with no jar.
为什么 1.02b 版本附加到 4.2.2?
Why does the 1.02b version attach to 4.2.2?
Jasper-reports 使用开放版本范围:
Jasper-reports uses an open version range:
[1.02b,)
这个范围告诉 maven 获取库的最新版本.
This range says to maven to take the library latest version.
使用 更新 从 iText 添加新版本的 Pom 没有 jar 并编辑 maven-该无 jar 版本的 maven-central 元数据会导致编译为所有 jar 依赖于最新的 com.lowagie 库.
With the update from iText adding new version Pom with no jar and editting the maven-metadata of maven-central to that no-jar version crashes the compilation to all jar depending form latest com.lowagie library.
从 ...m2 epositorycomlowagieitext 本地更新您的 maven-metadata-central.xml(以及其他元数据,如果您的公司拥有自己的 nexus.public)到那个作品.暂时解决,直到 iText 更新元数据或所有对其最新版本具有依赖关系的公司更新它的 pom
Updating locally your maven-metadata-central.xml (and other metadata if your company has it's own nexus.public) from ...m2 epositorycomlowagieitext to that works. Temporally solucion until iText updates the metadata or ALL companies that has dependencies for it's latest version updates it's pom
<metadata modelVersion="1.1.0">
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<versioning>
<latest>4.2.1</latest>
<release>4.2.1</release>
<versions>
<version>0.99</version>
<version>1.1.4</version>
<version>1.02b</version>
<version>1.2.3</version>
<version>1.3</version>
<version>1.3.1</version>
<version>1.4</version>
<version>1.4.8</version>
<version>2.0.1</version>
<version>2.0.6</version>
<version>2.0.7</version>
<version>2.0.8</version>
<version>2.1.0</version>
<version>2.1.2</version>
<version>2.1.3</version>
<version>2.1.4</version>
<version>2.1.5</version>
<version>2.1.7</version>
<version>4.2.0</version>
<version>4.2.1</version>
</versions>
<lastUpdated>20150709153501</lastUpdated>
</versioning>
</metadata>
推荐答案
一个更简单的解决方案可能是升级到更新版本的 jasperreports
.版本 6.1.0
对 iText 有这种依赖性:
A much simpler solution may be to upgrade to a newer version of jasperreports
. Version 6.1.0
has this dependency on iText:
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7.js2</version>
<scope>compile</scope>
</dependency>
不再浮动"依赖 iText,它是为 jasperreports 定制的版本!
No more "floating" dependency on iText, and it's a version that's custom made for jasperreports!
见http://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.1.0 完整的pom.xml
.
这篇关于来自 itext 的 jasper-reports 中的依赖错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!