什么是工件,Maven为什么需要它?
当前回答
通常我们谈论Maven术语关于组Id,工件Id和快照版本
组Id:项目所属组的标识 工件Id:项目的标识 快照版本:项目使用的版本。
Artifact不过是Jar、War、Ear等结果文件....
简单地说工件只是包。
其他回答
对于maven,构建过程被安排为一组工件。产品包括:
组成Maven本身的插件。 代码所依赖的依赖项。 构建生成的任何东西都可能被其他东西消耗。
工件存在于存储库中。
工件是项目可以使用或生成的元素。在Maven术语中,工件是Maven项目构建后生成的输出。例如,它可以是jar、war或任何其他可执行文件。
此外,Maven工件包括五个关键元素,groupId、artifactId、版本、打包和分类器。这些是我们用来识别工件的元素,被称为Maven坐标。
从这里开始阅读
工件是一个JAR或存储在存储库中的东西。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.
通常我们谈论Maven术语关于组Id,工件Id和快照版本
组Id:项目所属组的标识 工件Id:项目的标识 快照版本:项目使用的版本。
Artifact不过是Jar、War、Ear等结果文件....
简单地说工件只是包。
推荐文章
- 在流中使用Java 8 foreach循环移动到下一项
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 用Java计算两个日期之间的天数
- 如何配置slf4j-simple
- 在Jar文件中运行类
- 带参数的可运行?
- 我如何得到一个字符串的前n个字符而不检查大小或出界?
- 我可以在Java中设置enum起始值吗?
- Java中的回调函数
- c#和Java中的泛型有什么不同?和模板在c++ ?
- 在Java中,流相对于循环的优势是什么?
- Jersey在未找到InjectionManagerFactory时停止工作
- 在Java流是peek真的只是调试?
- Recyclerview不调用onCreateViewHolder
- 将JSON字符串转换为HashMap