ItextPDF dependency not found by Maven - java

I have the following dependency declared in my pom.xml file
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.2.0</version>
</dependency>
I'm working in Intellij and it says it's not found. It also won't let me import anything from the com.itextpdf packages.
I've tried a couple clean builds and restarts with no change. I also tried adding the itextpdf repository to the POM file with no change.

it is
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext7-core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.2.0</version>
<type>pom</type>
</dependency>

Related

Maven Dependencies .jar non existing library

The container 'Maven Dependencies' references non existing library 'C:\.m2\repository\com\portal\pcm\12.0.3\pcm-12.0.3.jar'
If i check the folder there are files that have the same name as the jar but end on jar.lastUpdated.
I tried maven clean and maven update which did not work. I delete the *.jar.lastUpdated in m2, but did not work too.
The line in my pom.xml is:
Missing artifact com.portal:pcm:jar:12.0.3
Missing artifact com.portal:pcmext:jar:12.0.3
Missing artifact com.portal:pcmext:jar:12.0.3
This block is the one with the marker where it states the artifact is missing.
<dependency>
<groupId>com.portal</groupId>
<artifactId>pcm</artifactId>
<version>12.0.3</version>
</dependency>
<dependency>
<groupId>com.portal</groupId>
<artifactId>pcmext</artifactId>
<version>12.0.3</version>
</dependency>
<dependency>
<groupId>com.portal</groupId>
<artifactId>pfc</artifactId>
<version>12.0.3</version>
</dependency>
I tried to use a version suggested by mvnrepository.com/artifact/com.portal.pcm/pcm/7.5, but didnt work too.
<dependency>
<groupId>com.portal.pcm</groupId>
<artifactId>pcm</artifactId>
<version>7.5</version>
</dependency>
<dependency>
<groupId>com.portal.pcm</groupId>
<artifactId>pcmext</artifactId>
<version>7.5</version>
</dependency>
<dependency>
<groupId>com.portal.pcm</groupId>
<artifactId>pfc</artifactId>
<version>7.5</version>
</dependency>
i guess dependency configuration is incorrect, but which is correct?

AEM, Maven : duplicated package name

I want to add "fop-core" dependency.
My project was added "uber-jar" dependency already.
The uber-jar dependency has org.apache.fop.apps.FopFactory.java file.
But, doesn't have org.apache.fop.apps.FopFactoryBuilder.java file.
The fop-core dependency has both FopFactory.java and FopFactoryBuilder.java files.
Thus, my program loads FopFactory.java in "uber-jar" instead of "fop-core".
How can I resolve this duplication??
Can I remove "FopFactory.java" file in "uber-jar" dependency?
OR
Can I force load "FopFactory.java" file in "fop-core" dependency?
uber-jar
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
fop-core
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop-core</artifactId>
<version>2.5</version>
</dependency>
Make sure that the fop-core dependency is coming first in your pom. That should do the trick.
HTH, OliG
Echoing Oliver Gebert response, I did that a few months ago for Apache POI, in the main pom.xml, I put it as the first dependency:
<dependencyManagement>
<dependencies>
<!-- Apache POI (First in order to avoid conflict with the version from the UberJar) -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>

What is the dependancy for EmbeddedActiveMQBroker?

I'm new to Maven and not sure how to write dependancies for my pom.xml
I am trying to use the following class:
import org.apache.activemq.junit.EmbeddedActiveMQBroker;
And this is my attempt at writing a dependancy:
<dependency>
<groupId>org.apache</groupId>
<artifactId>activemq-junit</artifactId>
<version>5.15.9</version>
</dependency>
But I am still getting an error
Try with the following.
<dependency>
<groupId>org.apache.activemq.tooling</groupId>
<artifactId>activemq-junit</artifactId>
<version>5.13.1</version>
<scope>test</scope>
</dependency>
You can get the details from mvnrepository.com.
First of all we go to the official Maven Dependencies Page of ActiveMQ - https://mvnrepository.com/artifact/org.apache.activemq/activemq-broker/5.15.9.
Then, we go to the "Test Dependencies" category, where we clearly can see the JUnit artifact.
so, use in your pom.xml file next dependency for version 5.15.19:
<!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-broker -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.15.9</version>
</dependency>
UPDATE
Add also the next dependency:
<!-- https://mvnrepository.com/artifact/org.apache.activemq.tooling/activemq-junit -->
<dependency>
<groupId>org.apache.activemq.tooling</groupId>
<artifactId>activemq-junit</artifactId>
<version>5.15.9</version>
<scope>test</scope>
</dependency>

Missing artifact error when adding a Maven dependency

I am not familiar with maven but I need to add a jnativehook dependency in a Java/Jersey project. I tried to add this dependency in my pom.xml
<dependency>
<groupId>com.1stleg</groupId>
<artifactId>system-hook</artifactId>
<version>2.0.3</version>
</dependency>
But I get an error on Eclipse
Missing artifact com.1stleg:system-hook:jar:2.0.3
According this, it should be:
<dependency>
<groupId>com.1stleg</groupId>
<artifactId>jnativehook</artifactId>
<version>2.0.3</version>
</dependency>
instead of
<dependency>
<groupId>com.1stleg</groupId>
<artifactId>system-hook</artifactId>
<version>2.0.3</version>
</dependency>
Hope it helps!

Maven deps do not find version fields in POM

I have a Maven project which, following a restart, has had a peculiar issue: it reports that there is no version field for one of the dependencies (apache-camel), even though the field is in fact populated. I have checked the pom.xml source, and confirmed that the field is in fact there and populated for all the dependencies. I am uncertain why m2e is saying otherwise. Is this a known issue, and if so, is there a specific fix for it?
The version of the m2e plugin is 1.5.1, and this is the parent POM for the project. Here is the dependencies section of POM file in question:
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>apache-camel</artifactId>
<type>pom</type>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
<type>pom</type>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<type>pom</type>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-parent</artifactId>
<type>pom</type>
<version>3.0.0-M2</version>
</dependency>
</dependencies>
I had the same problem with m2e saying that the version field was not present.
In my case the version field was not the problem. Actually the problem was, that the dependency was defined twice.
Have you checked if the apache-camel or any other dependency (maybe also from a parent pom) is defined twice?

Categories