我正在尝试在maven / eclipse中安装一个名为icepdf-core.jar的jar。
我正在运行以下命令,之后在〜.m2 / repository中创建了org.icepdf.core文件夹,但是目录中没有安装jar文件。
mvn install:install-file -Dfile=/Users/me/Downloads/ICEpdf-4.1.4-bin/icepdf/icepdf-core.jar
-DgroupId=org.icepdf
-DartifactId=core
-Dversion=4.1.4
-Dpackaging=jar
-DgeneratePom=true
运行此命令后,我手动将core-4.1.4.pom.xml和maven-metadata-local.xml复制到我的eclipse项目的local_repo文件夹中。
我还在pom.xml中添加了依赖项,如下所示:
<dependency>
<groupId>org.icepdf</groupId>
<artifactId>icepdf-core</artifactId>
<version>4.1.4</version>
</dependency>
我在日食中遇到错误说:
缺少工件org.icepdf:icepdf-core:jar:4.1.4:compile
我该如何做到这一点?
答案 0 :(得分:4)
如果您正在使用eclipse indigo,您还可以使用m2e将jar导入您的maven仓库。转到 file / import / maven / install或将工件部署到maven存储库
您只需填写组和工件ID
即可答案 1 :(得分:1)
您似乎做错了:在您的Maven install-file
命令中,您指出artifactId
是核心,但是在您的依赖关系定义中,您正在使用artifactId
icepdf-core 。
尝试使用以下Maven命令重新安装工件:
mvn install:install-file -Dfile = /用户/我/下载/ ICEpdf-4.1.4-斌/ icepdf / icepdf-core.jar添加 -DgroupId = org.icepdf -DartifactId = icepdf-core -Dversion = 4.1.4 -Dpackaging = jar -DgeneratePom = true