2

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?

lucid
  • 2,722
  • 1
  • 12
  • 24

1 Answers1

1

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 -->
Joe
  • 29,416
  • 12
  • 68
  • 88
  • I was checking this https://maven.apache.org/ref/3.6.3/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging. couldn't find plug-in in default binding. Can you please help explaining that part if possible ? – lucid Jul 15 '20 at 12:25
  • `site` is its own lifecycle, not a type of packaging for the `default` lifecycle. See [Lifecycles Reference - `site` Lifecycle](https://maven.apache.org/ref/3.6.3/maven-core/lifecycles.html#site_Lifecycle). – Joe Jul 15 '20 at 12:59
  • Basically what my understanding is "each packaging has default plugin binding" and then "each plugin has it's own lifecycle". So, i am still not able to understand if plugin is not part of default binding of packaging, why it's coming as part if default-lifecycle binding. Please correct me if i mis understood something. – lucid Jul 15 '20 at 13:51
  • 1
    See https://stackoverflow.com/questions/26607834/maven-lifecycle-vs-phase-vs-plugin-vs-goal for some guidance on the difference between lifecycles (`default`, `clean` and `site`) and the different packaging types that associate goals with the `default` (i.e. regular build) lifecycle. – Joe Jul 15 '20 at 14:08