Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
660 views
in Technique[技术] by (71.8m points)

java - Dependency can't be found if gradle version is increased

We currently use gradle 5.6.4 version. After I upgrade the gradle version, above 6, I tried with 6.3 and 6.7.1, the following error occurs:

What went wrong:

Execution failed for task ':compileJava'.

> Could not resolve all files for configuration ':compileClasspath'.

   > Could not find com.lowagie:itext:2.1.7.js8.

     Required by:

         project : > net.sf.jasperreports:jasperreports:6.16.0

The dependency exists in ".gradle/caches/modules-2/files-2.1". I also tried with --refresh-dependencies flag, but nothing works. Any ideas?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had the same issue. Some solutions which worked for me:

  1. Adding new repositories
    repositories {
        mavenCentral()
        maven{url "http://jasperreports.sourceforge.net/maven2/"}
        maven{url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/"
    }

    dependencies {
        ...
        implementation 'net.sf.jasperreports:jasperreports:6.16.0'
        ...
    }
  1. Excluding a deprecated artifact (com.lowagie)
<dependency>
    <groupId>jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.16.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
        </exclusion>
    </exclusions>
</dependency>

PS. Similar problem with itext library


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...