0

I have a pom.xml file and have a dependency for itext

       <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>4.2.1</version>
        </dependency>

When I run the mvn clean install -DskipTests -P <profile_name> command, I get a compilation error "package com.lowagie.text does not exist". I checked the Maven dependency folder in Eclipse and found the below dependency in the image instead of "itext-4.1.2.jar" :

img1

The same maven command when I run it on my colleague's machine, it runs properly without any error.

It would be a great help if someone helps me in resolving this issue.

Thanks in advance :)

Harry
  • 3
  • 6
  • As you mention profiles: Maybe the dependencies are different in different profiles? – J Fabian Meier Nov 02 '20 at 07:00
  • Nope, I checked the profiles. All have the same dependency – Harry Nov 02 '20 at 07:10
  • Then have a look at `mvn dependency:tree` – J Fabian Meier Nov 02 '20 at 07:19
  • I ran the above command and got the following warning message : The artifact com.lowagie:itext:jar:4.2.1 has been relocated to com.itextpdf:itextpdf:jar:5.5.6. The itext-4.2.1 redirects to itextsharp. https://stackoverflow.com/questions/31386309/itext-version-4-2-1-redirected-in-maven-central-repository – Harry Nov 02 '20 at 07:44
  • I commented out the reallocation part in the pom.xml of the itext-4.2.1 in the m2 repo and it solved my problem. Thank you @JFabianMeier for your help :) – Harry Nov 02 '20 at 07:46

0 Answers0