带有 m2e Eclipse 插件的 Maven - 将 jar 推送到存储库

发布于 2024-12-26 02:47:53 字数 260 浏览 2 评论 0原文

我想迁移到 Maven,但我有一些 jars 没有任何我想使用的 POM。当其他人下载该项目时,他不需要担心任何 Maven 命令行安装命令。

有没有一种仅使用 Ecplise 和 m2e 来使用 jar 文件的简单方法?

例如,jar 已经在 /src/main/resources 中,所以也许只需简单地单击 pom.xml 即可?

我对 Maven 完全陌生,所以也许这个问题很愚蠢,但这确实阻止了我开始使用 Maven 并说服其他人使用 Maven。

I want to migrate to Maven, but I've got a few jars without any POM that I want to use. When somebody else downloads the project he shouldn't need to fidget around with any maven commandline install commands.

Is there an easy way only with Ecplise and m2e to use jar files?

E.g the jars are already in /src/main/resources so maybe just a simple click on the pom.xml?

I'm totally new to Maven so maybe the question is stupid, but this is really preventing me from getting started and convincing anybody else to use Maven.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ˇ宁静的妩媚 2025-01-02 02:47:53

由于 Maven 的主要思想是只向任何人提供包含所有依赖项的 pom.xml,因此最好的办法是(至少第一步)将文件安装在本地 Maven 缓存中。 (应该在 ~/.m2/ 中找到)

如何操作如下所述:
http://maven.apache.org/guides/mini /guide-3rd-party-jars-local.html

执行此操作后,您应该修改 pom.xml 并添加依赖项,以及为调用该工具提供的值。

您的同事必须将您的 jar 安装到本地 Maven 缓存中。

更好的解决方案是下载artifactory (http://www.jfrog.com/products.php),这是一个存储所有maven jar 并允许任何构建从中下载它们的工具。

Since the main idea of maven is to provide anybody only with a pom.xml which contains all dependencies, the best would be (at least for the first step) to install your files in your local maven cache. (should be found in ~/.m2/)

How to do it is described here:
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

After doing this you should modify your pom.xml and add the dependencies, with the values provided for calling the tool.

Your colleagues have to do install your jars in there local maven cache to.

A better solution would be to download artifactory (http://www.jfrog.com/products.php), a tool which stores all your maven jars and allows any build to download them from it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文