You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2023/01/18 22:19:21 UTC

[maven-site] branch master updated: use pluginManagement section to declare plugin

This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git


The following commit(s) were added to refs/heads/master by this push:
     new f3a7295b use pluginManagement section to declare plugin
f3a7295b is described below

commit f3a7295b9a90a5ad361050b280f5f5a6262c3e32
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Thu Jan 19 08:19:17 2023 +1000

    use pluginManagement section to declare plugin
---
 .../plugin/guide-java-plugin-development.apt       | 26 +++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/content/apt/guides/plugin/guide-java-plugin-development.apt b/content/apt/guides/plugin/guide-java-plugin-development.apt
index 608959c5..1782aa58 100644
--- a/content/apt/guides/plugin/guide-java-plugin-development.apt
+++ b/content/apt/guides/plugin/guide-java-plugin-development.apt
@@ -203,13 +203,15 @@ public class GreetingMojo extends AbstractMojo
 +----+
 ...
   <build>
-    <plugins>
-      <plugin>
-        <groupId>sample.plugin</groupId>
-        <artifactId>hello-maven-plugin</artifactId>
-        <version>1.0-SNAPSHOT</version>
-      </plugin>
-    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>sample.plugin</groupId>
+          <artifactId>hello-maven-plugin</artifactId>
+          <version>1.0-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 ...
 +----+
@@ -263,11 +265,19 @@ mvn groupId:artifactId:version:goal
 
 +-----+
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>sample.plugin</groupId>
+          <artifactId>hello-maven-plugin</artifactId>
+          <version>1.0-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>  
     <plugins>
       <plugin>
         <groupId>sample.plugin</groupId>
         <artifactId>hello-maven-plugin</artifactId>
-        <version>1.0-SNAPSHOT</version>
         <executions>
           <execution>
             <phase>compile</phase>