javamavenmaven-3maven-site-plugin

Why `maven-site-plugin` present in maven java project


I just created an empty Maven project using Intellij and ran mvn dependency:resolve-plugins.

Plugin Resolved: maven-site-plugin-3.3.jar
[INFO]     Plugin Dependency Resolved: maven-reporting-exec-1.1.jar
[INFO]     Plugin Dependency Resolved: maven-core-3.0.jar

pom.xml looks like this

<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org</groupId>
    <artifactId>lucid</artifactId>
    <version>1.0-SNAPSHOT</version>    
</project>

Update: I have tried effective-pom as suggested and here is result.

<plugin>
    <artifactId>maven-site-plugin</artifactId>  <!-- org.apache.maven:maven-core:3.6.1:default-lifecycle-bindings -->
    <version>3.3</version>  <!-- org.apache.maven:maven-core:3.6.1:default-lifecycle-bindings -->
    // some other config
</plugin>

As I haven't specified anywhere about this plugin (maven-site) or (maven-core), finding it difficult to understand.

Why is the Maven site plugin present along with other plugins, and how do I remove it?


Solution

  • This is brought in by Maven's internal definition of the site lifecycle:

            <default-phases>
              <site>
                org.apache.maven.plugins:maven-site-plugin:3.3:site
              </site>
              <site-deploy>
                org.apache.maven.plugins:maven-site-plugin:3.3:deploy
              </site-deploy>
            </default-phases>
    

    It's not part of your pom, or any parent pom.

    The effective-pom output you show has a pointer to the source, in org.apache.maven:maven-core:3.6.1:default-lifecycle-bindings:

        <artifactId>maven-site-plugin</artifactId>  <!-- org.apache.maven:maven-core:3.6.1:default-lifecycle-bindings -->
        <version>3.3</version>  <!-- org.apache.maven:maven-core:3.6.1:default-lifecycle-bindings -->