我想将jpoller.jar
添加为Maven依赖项,因此我编辑了pom.xml文件以包含它:
<dependency>
<groupId>org.sadun</groupId>
<artifactId>jpoller</artifactId>
<version>1.5.2</version>
</dependency>
现在,正如预期的那样,当我从命令行进行编译时,出现错误,因为
jpoller
不在pom中列出的任何存储库中,也找不到它。尽管我可以为此创建一个存储库,但我现在不愿意。因此,出现以下错误:[INFO] Failed to resolve artifact.
Missing: ---------- 1) org.sadun:jpoller:jar:1.5.2
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=org.sadun -DartifactId=jpoller -Dversion=1.5.2 -Dpackaging=jar -Dfile=/path/to/file
在无法使用maven CLI的计算机上,如何从M2Eclipse插件执行此操作?
最佳答案
How can I do this from the M2Eclipse plugin on machines where the maven CLI isn't available?
好吧,只需从Eclipse进行即可。首先,获取该jpoller jar并将其保存在文件系统中的某个位置。然后,在Eclipse中,从顶部栏中,通过运行>运行配置... ,然后在上的上单击鼠标右键,在上右键单击,并配置刚创建的 New_configuration :
install:install-file
-D
前缀(例如file
作为Parameter name
和/path/to/file
作为Value,以此类推,groupId
,artifactId
,packaging
和version
)。 并运行此配置。或者...只需安装Maven。
关于maven-2 - 如何告诉M2Eclipse将jar文件安装为Maven依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2209950/