Maven依赖与多模块? [英] Maven dependency vs multimodule?

查看:165
本文介绍了Maven依赖与多模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Maven的新手,有人可以向我解释使用maven模块与仅将对您的maven项目的依赖关系添加到工作区中的另一个maven项目之间的区别吗?您什么时候可以使用另一个?

Very new to Maven, can someone please explain to me the difference between using maven modules vs just adding a dependency to your maven project to another maven project in your workspace? When would you use one over the other?

推荐答案

依赖项是预构建的实体.您可以从Maven Central(或Nexus等)中获得有关该依赖关系的工件.通常将依赖关系用于属于其他团队或项目的代码.例如,假设您需要Android中的CSV库.您可以将其作为依赖项.

A dependency is a pre-built entity. You get the artifact for that dependency from Maven Central (or Nexus or the like.) It is common to use dependencies for code that belongs to other teams or projects. For example, suppose you need a CSV library in Android. You'd pull it as a dependency.

与项目一样,将构建Maven模块.对于项目拥有的组件,通常使用Maven模块.例如,也许您的项目创建了三个jar文件.

A Maven module gets built just like your project does. It is common to use Maven modules for components that the project owns. For example, maybe your project creates three jar files.

这篇关于Maven依赖与多模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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