如何在没有父项目的情况下在NetBeans中构建我自己的Maven依赖项 [英] How to build my own Maven dependencies in NetBeans, without a parent project

查看:117
本文介绍了如何在没有父项目的情况下在NetBeans中构建我自己的Maven依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NetBeans 7.4 RC1来创建Maven项目。



假设我创建了两个Maven项目,名为A和B,第三个名为X包括其他两个项目作为依赖项。



在构建X Maven时,在本地Maven存储库(以及连接的公司代理)中搜索依赖项,显然没有找到任何项目最初。



如果我在项目A和B上运行NetBeans的构建命令,它会执行maven安装,然后将项目安装到我的本地存储库中。现在,当我构建X时,它会找到依赖项,一切都很好。



有没有办法配置Maven(或NetBeans)来自动构建依赖项(和将它安装到我的本地存储库)?我知道有一个解决方案可以在POM项目中执行此操作,其中可以将模块(在本例中为A,B和XI)添加到其中,并将POM项目指定为所有模块中的父项 - 这将允许我选择Build with Dependencies选项,然后将构建POM项目中的所有模块。但是,如果说项目A是一个实用项目,在许多其他项目中使用,这不是一个好的解决方案。



基本上我想避免的是构建所有项目每次我想测试我的项目时项目的依赖项;特别是当我同时处理项目及其依赖项时。



我希望我错过了这一点。

I'm using NetBeans 7.4 RC1 to create Maven projects.

Let's say I create two Maven projects, named A and B, and a third named X which includes the other two projects as dependencies.

On building X Maven searches the local Maven repository (and the connected company-proxy) for the dependencies and obviously does not find any initially.

If I run the build command of NetBeans on projects A and B, it performs a maven install, which then installs the projects into my local repository. Now, when I build X it will find the dependency and all is well.

Is there a way to configure Maven (or NetBeans) to automatically build the dependencies (and install it to my local repository)? I know there's a solution to do this with POM Projects where the modules (in this case A, B and X I suppose) can be added to it, and the POM project specified as a parent in all the modules - this will allow me to select the "Build with Dependencies" option, which will then build all the modules in the POM project. But this is not a good solution if say project A is a utility project, used in many other projects.

Essentially what I'd like to avoid is building all the dependencies for a project every time I want to test my project; especially when I'm working on the project and its dependencies at the same time.

I hope I'm missing the point.

推荐答案

我想你可能会忽略这一点[或者我]



TTBOMK,一旦依赖关系首次构建的话一切都会照顾好自己。因此,无需一直重建所有项目,重建工作将在需要时完成。
I think you may be missing the point [or I am]

TTBOMK, once the dependencies are built for the first time then everything will look after itself. So there is no need to keep rebuilding all the projects all the time, the rebuilds are done as and when they are needed.


这篇关于如何在没有父项目的情况下在NetBeans中构建我自己的Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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