java - 缺少 Artifact 8.1.2-SNAPSHOT。无法完全安装docx4j

标签 java maven docx4j

我正在尝试在 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/

相关文章:

java - 插入mysql表时出现异常

java - Maven 释放另一个用户凭据

java - docx4j 转换 w :numPr convert to <ul>?

java - 无法覆盖 onBeforeConvert : "...have the same erasure, yet neither overrides the other"

java - 编译具有依赖关系的类时出现问题

java - 反射和多态

maven - 如何从 Maven 多模块项目中的 Javadoc 生成中排除单个模块?

java - 如何解决将 Java 8 代码迁移到 Java 11 的依赖和包问题

java - 如何使用 OpenDoPE 的内容控制数据绑定(bind)从模板创建 Word 文档

java - 将 HTML 转换为 DOCX