Maven的插件管理
阿新 • • 發佈:2017-07-28
插件 配置 art exe compiler ring pom nbsp 過程
<pluginManagement>
這個元素和<dependencyManagement>相類似,它是用來進行插件管理的。
在我們項目開發的過程中,也會頻繁的引入插件,所以解決這些復雜配置的方法就是使用插件管理
我們可以在父POM中做如下聲明:
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId></groupId>
- <artifactId></artifactId>
- <version></version>
- <executions> //插入點表達式
- <execution>
- <id></id>
- <goals>
- <goal></goal>
- </goals>
- <phase></phase>
- <configuration>
- <source></source>
- <target></target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
- </build></span>
在子模塊中,我們可以直接繼承
- <span style="font-size:12px;"><build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- </plugins>
- </build></span>
我們會發現,繼承的細節上和<dependencyManagement>幾乎一樣。
Maven的插件管理