1. 程式人生 > >maven 構建專案時,modules子模組,module對應name中的欄位

maven 構建專案時,modules子模組,module對應name中的欄位

當maven構建專案時,modules的module所使用的是子專案中pom中的name欄位名,而不是artifactId,也不是groupId

例如:

父專案Pom

<modules>

<module>global-fairy-webMaven Webapp</module>

</modules>

子專案pom:

<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.0http://maven.apache.org/xsd/maven-4.0.0.xsd"

>

<modelVersion>4.0.0</modelVersion>

<parent>

<groupId>org.jzg.fairy</groupId>

<artifactId>global-fairy-parent</artifactId>

<version>0.0.1-SNAPSHOT</version>

</parent>

<groupId>org.global.fairy</groupId>

<artifactId>global-fairy-web</artifactId

>

<packaging>war</packaging>

<name>global-fairy-web Maven Webapp</name>

在這裡是通過name:

<name>global-fairy-web Maven Webapp</name>

進行關聯的,

而不是artifactId: <artifactId>global-fairy-web</artifactId>