Skip to content
Advertisement

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?

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement