来自itext的jasper-reports中的依赖错误 [英] Dependency error in jasper-reports from itext

查看:39
本文介绍了来自itext的jasper-reports中的依赖错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从昨天开始,由于 iText jar,我在使用 maven 编译时遇到了问题.我的项目有一个依赖于 itext-1.02b 或更高版本的 jasperreports-2.0.1 的依赖项.

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 的 update 添加没有 jar 的新版本 Pom 并编辑 maven- maven-central 的元数据到该无 jar 版本会使编译崩溃到所有 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆