我正在尝试在 eclipse 上安装 docx4j,但每次我尝试安装它时都会收到这些错误。我正在按照此 website 的教程进行操作
有人可以帮我吗?
Description Resource Path Location Type Missing artifact org.docx4j:docx4j-core:jar:8.1.2-SNAPSHOT pom.xml /docx4j-JAXB-MOXy line 49 Maven Dependency Problem
Description Resource Path Location Type Missing artifact org.docx4j:docx4j-core:jar:8.1.2-SNAPSHOT pom.xml /docx4j-JAXB-ReferenceImpl line 55 Maven Dependency Problem
Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project docx4j-JAXB-MOXy Unknown Java Problem
Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project docx4j-JAXB-ReferenceImpl Unknown Java Problem
Description Resource Path Location Type The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files NamespacePrefixMapper.java /docx4j-JAXB-MOXy/src/main/java/org/docx4j/jaxb/moxy line 1 Java Problem
Description Resource Path Location Type The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files NamespacePrefixMapper.java /docx4j-JAXB-ReferenceImpl/src/main/java/org/docx4j/jaxb/ri line 1 Java Problem
最佳答案
首先,如果您使用 Maven 中心的 docx4j,请参阅 https://stackoverflow.com/a/56589317/1031689您应该仅使用一个 docx4j-JAXB-* deps(但看起来您有 docx4j-JAXB-MOXy 和 docx4j-JAXB-ReferenceImpl)。
Maven 中心上的 docx4j-JAXB-* 依赖项不指向 -SNAPSHOT jar。
GitHub 上的源代码确实使用 -SNAPSHOT 版本,因此如果您已克隆该版本,请首先运行 mvn install 以在本地 .m2 maven 存储库中安装 SNAPSHOT jar。那么 Eclipse 应该很高兴。您可能需要在 Eclipse 中重建和/或首先在 Eclipse 中的项目上执行“maven update”。
关于java - 缺少 Artifact 8.1.2-SNAPSHOT。无法完全安装docx4j,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56949881/