我的示例pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<mainClass>src.main.java.hello.helloworld.Main</mainClass>
</configuration>
</plugin>
</plugins>
到目前为止,我的理解是groupId
是unique id of the org which builds this project
而artifactId
是name for the version
。
我了解docs中groupId artifactId version
的内容。但我找不到插件中的这些字段是什么意思?
答案 0 :(得分:3)
artifactId
是工件的ID,可以是jar依赖项或maven插件或由groupid
表示的组织发布的其他产品,version
是该工件的版本
您对组ID的定义是正确的。您可以在引用使用组ID org.apache.maven.plugins
的官方 maven插件时遗漏组ID。
因此,maven插件的处理方式与任何其他项目依赖项一样。