简体   繁体   English

找不到mvn套件org.apache.pdfbox

[英]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: 我的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: 我在Eclipse Maven依赖项中看到以下行:

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. 我在eclipse中检查了构建路径,并在Maven Dependencies部分中看到了pdfbox-2.0.4.jar。

I run mvn clean compile in a command prompt (Windows). 我在命令提示符下(Windows)运行mvn clean compile。

I get the error "package org.apache.pdfbox does not exist" 我收到错误消息“包org.apache.pdfbox不存在”

I run mvn dependency:build-classpath -Dmdep.outputFile=cp.txt 我运行MVN依赖项: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 我看着C:\\ Users \\ Paul.m2 \\ repository \\ org \\ apache \\ pdfbox \\ pdfbox \\ 2.0.4 \\,然后看到pdfbox-2.0.4.jar

So what am I missing? 那我想念什么呢? Why is the pdfbox jar not being found? 为什么找不到pdfbox jar?

remove this line: 删除此行:

import org.apache.pdfbox.*;

because that package does indeed not exist. 因为该软件包确实不存在。 The other ones (with deeper levels) are OK. 其他(更深层次)也可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 包 org.apache.pdfbox 不存在 - package org.apache.pdfbox does not exist 在使用org.apache.pdfbox和java解析pdf文档时,将&#39;-&#39;转换为&#39;?&#39; - while parsing a pdf document using org.apache.pdfbox and java , '-' is converted as '?' 如何让 Netbeans 识别 org.apache.pdfbox jar? - How can I get Netbeans to recognize the org.apache.pdfbox jar? PDFBox错误:存在时出现“找不到org.apache.pdfbox.rendering.PDFRenderer” - PDFBox error: “org.apache.pdfbox.rendering.PDFRenderer not found” when it is present Apache Felix mvn 包 - Apache Felix mvn package PDFBox org.apache.pdfbox.cos.COSInteger 无法转换为 org.apache.pdfbox.cos.COSDictionary - PDFBox org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.cos.COSDictionary jul-to-log4j-bridge“ mvn软件包”结尾为“软件包org.apache.log4j.plugins不存在”编译错误 - jul-to-log4j-bridge “mvn package” ends with “package org.apache.log4j.plugins does not exist” COMPILATION ERROR ClassNotFoundException:org.apache.pdfbox.pdmodel.PDDocument - ClassNotFoundException: org.apache.pdfbox.pdmodel.PDDocument 缺少org.apache.http的软件包,找不到JAR - Missing package for org.apache.http, JAR can't be found java.lang.ClassNotFoundException:org.apache.pdfbox.exceptions.COSVisitorException - java.lang.ClassNotFoundException: org.apache.pdfbox.exceptions.COSVisitorException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM