maven build failing to download com.lowagie:itext:jar:2.1.7.js6 dependency

Viewed 12219

Previously my build is running fine but all of a sudden it's failing with the below error.

Failed to collect dependencies at ar.com.fdvs:DynamicJasper:jar:5.3.0 -> net.sf.jasperreports:jasperreports:jar:6.8.0 -> com.lowagie:itext:jar:2.1.7.js6: Failed to read artifact descriptor for com.lowagie:itext:jar:2.1.7.js6: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js6 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [jaspersoft-third-party (http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/, default, releases+snapshots), jr-ce-releases (http://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases, default, releases+snapshots)] -> [Help 1]
[ERROR] 

These are the dependencies I am using in my code.

        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7.js6</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ar.com.fdvs</groupId>
            <artifactId>DynamicJasper</artifactId>
            <version>5.3.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/ar.com.fdvs/DynamicJasper-core-fonts -->
        <dependency>
            <groupId>ar.com.fdvs</groupId>
            <artifactId>DynamicJasper-core-fonts</artifactId>
            <version>2.0</version>
        </dependency>

I tried changing the DynamicJasper version also but no luck.

In the docker file, I am using the below image as a base image.

FROM maven:3.6.0-jdk-11-slim AS build
5 Answers
<dependency>
  <groupId>com.lowagie</groupId>
  <artifactId>itext</artifactId>
  <version>4.2.0</version>
</dependency>
        

My issue resolved after adding this dependency.

if you run maven on linux .then use this

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.12.1</version>
    <exclusions>
        <exclusion>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<!--        "jasperreports" can't resolve "itext" dependency on jenkins.so it added independently-->
<dependency>
    <groupId>com.lowagie</groupId>
    <artifactId>itext</artifactId>
    <version>2.1.7</version>
</dependency>

It looks like there is error in downloading com.lowagie:itext:pom:2.1.7.js6. I think there is a version number change in maven repository. there is not any 2.1.7.js6 version in maven repository.

<!-- https://mvnrepository.com/artifact/com.lowagie/itext -->
<dependency>
    <groupId>com.lowagie</groupId>
    <artifactId>itext</artifactId>
    <version>2.1.7</version>
</dependency>

for your ref: https://mvnrepository.com/artifact/com.lowagie/itext/2.1.7

Try to remove this dependency folder from users\.m2 folder and run maven install again. This will remove the old dependency which is causing issues and will download the same dependency again.

Related