iText version 4.2.1 redirected in maven central repository

As documented here, the people who published the iText forks versions 4.x.y didn't follow the rules as explained by Apache:

I have a patched version of the foo project developed at foo.com, what groupId should I use?

When you patch / modify a third party project, that patched version becomes your project and therefore should be distributed under a groupId you control as any project you would have developed, never under com.foo. See above considerations about groupId.

They published an unofficial version of iText using a groupId that led people to believe that they were using an original version of iText, which was not the case. This error has caused much confusion and frustration.

To stop the confusion, iText Group has reclaimed the groupId so that no third party can introduce software that infringes third part rights or even malware into your code base (this is a risk you take when you allow Maven to automatically upgrade).

Your allegation that iText 4.2.1 is the last free version is incorrect. There are some serious issues with iText versions prior to iText 5, but that's another discussion and the subject of a conference talk at JavaOne 2015 entitled IANAL: What Developers Should Know About IP and Legal.

In any case, the easiest solution is for you to change the dependecy to:

<dependency>
  <groupId>com.lowagie</groupId>
  <artifactId>itext</artifactId>
  <version>[1.02b,2.1.7]</version>
  <scope>compile</scope>
</dependency>

See this answer in answer to Dependency error in jasper-reports from itext for even more background information.


First solution

You can download the jar locally and then install it locally with the following command.

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> 
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

Use groupId, artifactId, version and packaging you like.

In this case:

mvn install:install-file -Dfile=itext.jar -DgroupId=com.lowagie
-DartifactId=itext -Dversion=4.2.1 -Dpackaging=jar

Second solution:

You can also download the jar locally and reference it with the following dependency group

<dependency>
    <groupId>com.lowagie</groupId>
    <artifactId>itext</artifactId>
    <version>4.2.1</version>
    <scope>system</scope>
    <systemPath>/PATHTOJAR/itext.jar</systemPath>
</dependency>

Tags:

Java

Maven

Itext