如何使用Luna Service上的Eclipse m2e(4.4.1)将jar文件添加到我的本地Maven存储库? [英] How do I add a jar file to my local Maven repository using Eclipse m2e on Luna Service (4.4.1)?

查看:129
本文介绍了如何使用Luna Service上的Eclipse m2e(4.4.1)将jar文件添加到我的本地Maven存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条警告消息,因为我手动将jar文件添加到我的本地maven存储库。



[INFO]正在下载:



要使用m2e执行此操作,您需要使用小型hack。创建Maven启动配置。在基本目录字段中,键入一个始终解析为实际目录的值,例如 $ {workspace_loc} 。在目标字段中,键入 install:install-file ,然后在参数表中添加参数(请参阅下面段落中的链接)(使用添加按钮添加参数)。然后运行此启动配置。


I am getting an warning message because I manually added a jar file to my local maven repository.

[INFO] Downloading: http://repo.maven.apache.org/maven2/com/netsuite/nsws-2014/1.0/nsws-2014-1.0.pom

[WARNING] The POM for com.netsuite:nsws-2014:jar:1.0 is missing, no dependency information available

How do I properly add a jar file to my local Maven repository using Eclipse m2e on Luna Service (4.4.1)?

Like can I use the builder?

解决方案

The local Maven repository is effectively a standard Maven repository; as such, it must adhere to a particular format (there are a few Maven-compatible repository formats).

Dropping files into a repository isn't going to cut it, unless you are able to mimic the creation of additional artifacts in accordance to the Maven repository format that you use.

The only foolproof way to do so would be to use the install:install-file goal, as specified here: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

To do this using m2e, you need to use a small hack. Create a Maven Launch configuration. In the "base directory" field, type in a value that will always resolve to a real directory, such as ${workspace_loc}. In the "Goals", field, type install:install-file, and then add the parameters (see the link in the paragraph below) in the "parameters" table (use the "Add" button to add parameters). Then run this launch configuration.

这篇关于如何使用Luna Service上的Eclipse m2e(4.4.1)将jar文件添加到我的本地Maven存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆