Maven - 它是什么组合?

时间:2015-02-26 09:51:26

标签: maven

我的示例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>

 

到目前为止,我的理解是groupIdunique id of the org which builds this projectartifactIdname for the version

我了解docsgroupId artifactId version的内容。但我找不到插件中的这些字段是什么意思?

1 个答案:

答案 0 :(得分:3)

artifactId是工件的ID,可以是jar依赖项或maven插件或由groupid表示的组织发布的其他产品,version是该工件的版本

您对组ID的定义是正确的。您可以在引用使用组ID org.apache.maven.plugins官方 maven插件时遗漏组ID。

因此,maven插件的处理方式与任何其他项目依赖项一样。