什么是工件,Maven为什么需要它?
当前回答
Maven在项目中组织其构建。
maven中的工件是由maven项目生成的资源。每个maven项目都可以有一个工件,比如罐子、战争、耳朵等。 项目的配置文件“pom.xml”描述了如何构建工件,如何运行单元测试等等。 通常,使用maven构建的软件项目由许多maven项目组成,这些maven项目构建了构成产品的工件(例如jar)。 如。
Root-Project // produces no artifact, simply triggers the build of the other projects
App-Project // The application, that uses the libraries
Lib1-Project // A project that creates a library (jar)
Lib2-Project // Another library
Doc-Project // A project that generates the user documentation from some resources
Maven工件并不局限于java资源。你可以生成任何你需要的资源。例如文档、项目站点、zip-archives、本地库等。
Each maven project has a unique identifier consiting of [groupId, artifactId, version]. When a maven project requires resources of another project a dependency is configured in it's pom.xml using the above-mentioned identifier. Maven then automatically resolves the dependencies when a build is triggered. The artifacts of the required projects are then loaded either from the local repository, which is a simple directory in your user's home, or from other (remote) repositories specified in you pom.xml.
其他回答
工件是一个JAR或存储在存储库中的东西。Maven将它们取出并构建您的代码。
对于maven,构建过程被安排为一组工件。产品包括:
组成Maven本身的插件。 代码所依赖的依赖项。 构建生成的任何东西都可能被其他东西消耗。
工件存在于存储库中。
在一般的软件术语中,“工件”是由软件开发过程产生的东西,无论是与软件相关的文档还是可执行文件。
在Maven术语中,工件是Maven构建的结果输出,通常是jar或war或其他可执行文件。maven中的工件由groupId、artifactId和version组成的坐标系统标识。Maven使用groupId、artifactId和version来标识构建和运行代码所需的依赖项(通常是其他jar文件)。
工件是部署到Maven存储库的文件,通常是JAR。
Maven构建生成一个或多个工件,例如编译后的JAR和“源”JAR。
每个工件都有一个组ID(通常是反向域名,如com.example.foo)、一个工件ID(只是一个名称)和一个版本字符串。三者合在一起唯一地识别了这个神器。
项目的依赖项被指定为工件。
Maven在项目中组织其构建。
maven中的工件是由maven项目生成的资源。每个maven项目都可以有一个工件,比如罐子、战争、耳朵等。 项目的配置文件“pom.xml”描述了如何构建工件,如何运行单元测试等等。 通常,使用maven构建的软件项目由许多maven项目组成,这些maven项目构建了构成产品的工件(例如jar)。 如。
Root-Project // produces no artifact, simply triggers the build of the other projects
App-Project // The application, that uses the libraries
Lib1-Project // A project that creates a library (jar)
Lib2-Project // Another library
Doc-Project // A project that generates the user documentation from some resources
Maven工件并不局限于java资源。你可以生成任何你需要的资源。例如文档、项目站点、zip-archives、本地库等。
Each maven project has a unique identifier consiting of [groupId, artifactId, version]. When a maven project requires resources of another project a dependency is configured in it's pom.xml using the above-mentioned identifier. Maven then automatically resolves the dependencies when a build is triggered. The artifacts of the required projects are then loaded either from the local repository, which is a simple directory in your user's home, or from other (remote) repositories specified in you pom.xml.
推荐文章
- 使用Jackson将JSON字符串转换为漂亮的打印JSON输出
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- Javadoc @see或{@link}?
- 在准备语句中使用“like”通配符
- Android Eclipse -无法找到*.apk
- javac和Eclipse编译器之间的区别是什么?
- 工厂模式和策略模式之间的区别是什么?
- 在Java中使用正则表达式提取值
- 如何允许所有网络连接类型HTTP和HTTPS在Android(9)馅饼?
- Intellij IDEA Java类在保存时不能自动编译
- 何时使用Mockito.verify()?
- 在maven中安装mvn到底做什么
- 不可变与不可修改的集合
- 如何在JSON中使用杰克逊更改字段名
- GSON -日期格式