[Solved] Solve the Maven error “Cannot resolve com.lowagie:itext:2.1.7.js7”

Maven reports an error when downloading the itext dependency of version 2.1.7.js7: “Cannot resolve com.lowagie:itext:2.1.7.js7”

Problem reason:

Since the itext dependency of the 2.1.7.js7 version is specified in the pom file of jasperreports, there is no such tape in the current Maven central warehouse or other mirror warehouses. There are suffixed versions such as js7.

At present, itext has stopped maintenance, and it has migrated from com.lowagie.itext to com.itextpdf.itextpdf from the version after 4.2.2. If necessary, you can use higher The version of itextpdf depends on.

Solution:

Exclude the itext dependency in jasperreports and specify the version yourself.

<dependency>
    <groupId>jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.10.0</version> <!--(or higher)-->
    <exclusions>
        <exclusion>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itextpdf</artifactId>
    <version>5.5.13</version> <!--(or higher)-->
</dependency>

The article knowledge points match the official knowledge files, and you can further learn related knowledge Java skill tree Java overviewMaven basics 59777 people are learning the system