简体   繁体   English

找不到Itext7 jar

[英]Itext7 jar not found

I would like use Itext7 but when I try to import the dependency with maven, jar is not found.我想使用 Itext7,但是当我尝试使用 maven 导入依赖项时,找不到 jar。 And when I search on maven central : Maven central Itext7 I found item but there is not jar in this dependency Itext 7 repository当我在 maven central 上搜索时: Maven central Itext7我找到了项目,但在这个依赖项Itext 7 存储库中没有 jar

iText7 is no longer a single jar. iText7不再是一个单独的 jar。 It has a lot of modules.它有很多模块。 itext7-core artifact is merely an ensemble of modules comprising Core product. itext7-core artifact 只是包含Core产品的模块的集合。 It is not a jar per se, it just has a dependency on all modules that comprise Core .它本身不是一个 jar,它只是依赖于组成Core所有模块。

If you want to download the jars manually, use the following links (for 7.0.2 ):如果要手动下载 jar,请使用以下链接(适用于7.0.2 ):

You can also find how to reference those dependencies separately with Maven here .您还可以在此处找到如何使用 Maven 单独引用这些依赖项。

itext7-core-7.0.2 is POM-only, as you can see in the POM file. itext7-core-7.0.2仅支持 POM,如您在 POM 文件中所见。 It's only purpose is to have the other jars as a dependency.它的唯一目的是将其他罐子作为依赖项。

Make explicit the type as 'pom'明确类型为“pom”

<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itext7-core</artifactId>
    <version>7.0.2</version>
    <type>pom</type> 
</dependency>

As mentioned above IText7 is now multiple jars which you can download as required.如上所述,IText7 现在是多个 jars,您可以根据需要下载。

The below particular link is useful as it mentions clearly which are DEFINITELY required and which are optional下面的特定链接很有用,因为它清楚地提到了哪些是绝对必需的,哪些是可选的

IText7 Download Links From ITextSite IText7 从 ITextSite 下载链接

Setting the type as 'pom' may help in simple projects.将类型设置为 'pom' 可能有助于简单的项目。 But if you create a new Maven --> JavaFX Application, and if you explicitly mark the dependency as 'pom', then any attempt to build the application FAILS with message: " Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:unpack-dependencies (unpack-dependencies) on project DemoItext7: Unknown archiver type: No such archiver: 'pom'. -> [Help 1] " For details see demo .但是,如果您创建一个新的 Maven --> JavaFX 应用程序,并且如果您明确地将依赖项标记为“pom”,那么任何构建应用程序的尝试都会失败并显示消息:“无法执行目标 org.apache.maven.plugins:maven -dependency-plugin:3.1.1:unpack-dependencies (unpack-dependencies) on project DemoItext7: Unknown archiver type: No such archiver: 'pom'. -> [Help 1] " 详情请看演示

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

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