如何添加本地非maven项目作为maven项目的依赖项? [英] How to add a local non-maven project as a dependency for a maven project?

查看:263
本文介绍了如何添加本地非maven项目作为maven项目的依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的Spring Web应用程序,我非常想使用Maven来处理构建/依赖项。我的问题是该项目依赖于一些现有的本地项目,并且目前不是一种选择。是否有可能依赖这些项目而不对它们进行大规模化?

I created a new Spring web app, and I'd very much like to use Maven to handle builds/dependencies. My problem is that the project depends on some existing local projects, and mavenizing them is not currently an option. Is it possible to depend on these projects without mavenizing them?

推荐答案

不,你不应该尝试。 Maven的主要目标是实现标准化构建。这就是使Maven易于使用的原因:例外不是常态。这就是为什么Maven要求所有依赖项都采用典型的Maven格式(POM + jar)。

No and you shouldn't try that. Maven's main goal is to have a standardized build. This is what makes Maven so easy to use: Exceptions aren't be the norm. That's why Maven requires that all dependencies are in the typical Maven format (POM + jar).

当你说将它们当成一种选项时,你基本上说Maven目前不是一个选择。根据我的经验,将现有项目转换为Maven只需要几分钟......除非所述项目使用混乱,不可靠的构建过程,在这种情况下,你真的将其转换为Maven ASAP只是为了停止浪费更多宝贵的时间。 : - )

When you say "mavenizing them is not currently an option", you basically say "Maven is not currently an option". In my experience, converting an existing project to Maven just takes a couple of minutes ... unless said project uses a messy, unreliable build process in which case you really should convert it to Maven ASAP just to stop wasting even more of your precious time. :-)

如果其他一切都失败了,请使用构建服务器从依赖项目生成JAR文件,并将它们部署到公司范围的存储库服务器或仅部署到本地计算机。

If everything else fails, use a build server to produce JAR files from the dependent projects and deploy them to a company wide repository server or just to your local machine.

这篇关于如何添加本地非maven项目作为maven项目的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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