Maven“模块” vs“项目” (Eclipse,m2eclipse插件) [英] Maven "Module" vs "Project" (Eclipse, m2eclipse plugin)

查看:89
本文介绍了Maven“模块” vs“项目” (Eclipse,m2eclipse插件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Maven的初学者,我从命令行的角度来看,有一点,所以现在我试图在Eclipse中使用它;我安装了m2eclipse插件。



但是从一开始就被困扰了!显然我错过了一些术语在某处。我无法跟踪所有这些新的Maven术语... 什么是Maven项目,什么是Maven模块?这些是在Eclipse中的Maven类别中创建新项目时的选项

解决方案

他们基本上是一样的,但有一点区别。创建模块时,必须指定一个父项目。指定父项目时,将向父项目pom.xml添加< modules>部分。该部分基本上对父项目说,首先运行我对所有模块的每个命令。所以如果你在顶级项目中运行mvn package,那么它首先运行mvn package对所有的模块项目。



希望有所帮助。 p>

I'm a beginner at Maven and I've played with it from a command line point of view a little, so now I was trying to use it in Eclipse; I installed the m2eclipse plugin to do so.

But I'm stumped from the very beginning! Apparently I've missed a bit of terminology somewhere along the line. I can't keep track of all these new Maven terms... What is a Maven Project, and what is a Maven Module? These are my options when creating a new project in the Maven category in Eclipse.

解决方案

They are basically the same thing, but with one difference. When you create a module, you must specify a parent project. When you specify the parent project, it adds a <modules> section to the parent projects pom.xml. That section basically says to the parent project, "run every command I get against all of my modules first". So if you run, "mvn package" on the top level project, it will run "mvn package" against all it's module projects first.

Hope that helps.

这篇关于Maven“模块” vs“项目” (Eclipse,m2eclipse插件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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