javamavenpom.xmlmaven-pluginreflections

Unable to find out where a Maven plugin comes from


There executes a particular Maven plugin and I struggle to find out where it comes from to either remove or replace it as its compile dependency link is broken. I am talking about org.reflections:reflections-maven:0.9.8 that depends on org.jfrog.jade.plugins.common:jade-plugin-common:1.3.8 which Maven is not able to download from the central repository as the link redirects to OpenMind location and results in 404 (link).

Instead of including such JAR in the project structure, I would rather figure out where is reflections-maven plugin defined as this plugin is discontinued (GitHub) but somehow is executed during the build (mvn clean install).

[INFO] --- reflections-maven:0.9.5:reflections (default) @ my-module ---
[INFO] Reflections took 240 ms to scan 1 urls, producing 35 keys and 128 values 
[INFO] Reflections successfully saved in C:\Dev\my-project\my-parent\my-module\target\classes\META-INF\reflections\my-module-reflections.xml using XmlSerializer

I haven't found where is reflections-maven defined in any of the multi-module project structure or used. Note I use Maven 3.3.9. My attempts:

Question: If I don't have such JAR in the local repository, the build fails as the plugin is executed. In that case, how can I find a way any plugin (particularly reflections-maven in my case) is truly imported and executed in the project?

Feel free to ask for more info in the commens. I use IntelliJ Idea, Maven 3.3.9 and Java 7 if it matters.


Solution 1 (didn't work for me): I have tried to run mvn -Dverbose=true -Doutput=./effective-pom.xml help:effective-pom and both the normal and the verbose form of effective-pom displays the same output of reflections-maven plugin with no additional information about its origin. Since the file is rather big, I include a screenshot:

enter image description here

This might be an issue with my Maven 3.3.9 with a custom settings.xml and a specific IntelliJ Idea. I assume the verbose output would lead to the true origin.


Solution 2:

Upon installing Netbeans (I use IntelliJ Idea by default), the Effective tab of the POM editor finally led me to the true origin where the plugin is defined.

enter image description here

Sadly, IntelliJ Idea doesn't provide such navigation through its effective POM and navigating to the origin is virtually impossible without manual clicking through parent POMs.


Solution

  • With Help:Effective-Pom:

    mvn -Dverbose=true -Doutput=./effective-pom.xml help:effective-pom

    We can analyze our "effective pom" (Pom#inheritance, Pom#super-Pom).

    "inter alia" it allows us to locate/override any inherited plugin/dependency/"pom element".

    Unfortunately the output generates:

    In we have a "Show effective Pom" command, which basically invokes the mentioned goal and shows the output (in community edition unfortunately!?) without "verbose".


    has a "Effective" tab in its "Pom Editor":

    (, "Graph" view also very nice...(and unique feature among "maven IDES (that i know)", and it can be installed un-rooted;)!


    Update:

    So the mojo seems to work as documented:

    <verbose> boolean (since:)3.2.0 Output POM input location as comments.

    Default value is: false.

    User property is: verbose.

    For verbose to have an effect, we need to:

    <project ...>
     ...
     <build>
       <plugins>
         <artifactId>maven-help-plugin</artifactId>
         <version>3.2.0</version> <!-- or higher! -->
       </plugins>
     </build>
     ...
    </project>
    

    ... respectively can (without pom modification):

    mvn -Dverbose=true -Doutput=./eff.pom.xml \
      org.apache.maven.plugins:maven-help-plugin:3.2.0:effective-pom