简体   繁体   中英

mvn package org.apache.pdfbox not found

I have these imports (among others):

import org.apache.pdfbox.*;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;

I have this dependency in my pom.xml:

<dependency>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>pdfbox</artifactId>
  <version>2.0.4</version>
</dependency>

I see this line in my eclipse maven dependencies:

pdfbox-2.0.4.jar - C:\Users\Paul\.m2\repository\org\apache\pdfbox\pdfbox\2.0.4\pdfbox-2.0.4.jar

I check the build path in eclipse, and see pdfbox-2.0.4.jar in the Maven Dependencies part.

I run mvn clean compile in a command prompt (Windows).

I get the error "package org.apache.pdfbox does not exist"

I run mvn dependency:build-classpath -Dmdep.outputFile=cp.txt

The following lines are listed in the class path (at the front of the class path):

C:\Users\Paul\.m2\repository\org\apache\pdfbox\pdfbox\2.0.4\pdfbox-2.0.4.jar;
C:\Users\Paul\.m2\repository\org\apache\pdfbox\fontbox\2.0.4\fontbox-2.0.4.jar;

I look in C:\\Users\\Paul.m2\\repository\\org\\apache\\pdfbox\\pdfbox\\2.0.4\\ and I see pdfbox-2.0.4.jar

So what am I missing? Why is the pdfbox jar not being found?

remove this line:

import org.apache.pdfbox.*;

because that package does indeed not exist. The other ones (with deeper levels) are OK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM