ferstl / depgraph-maven-plugin

A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, JSON and Text)
Apache License 2.0
561 stars 85 forks source link

maven target does not work #158

Closed flashpixx closed 2 years ago

flashpixx commented 2 years ago

Hello,

I have add to my multimaven project into the root pom.xml the plugin with

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.ferstl</groupId>
                <artifactId>depgraph-maven-plugin</artifactId>
                <version>4.0.1</version>
            </plugin>
        </plugins>
    </build>

I cannot run the plugin with mvn depgraph:aggregate I must run it with mvn com.github.ferstl:depgraph-maven-plugin:aggregate. Is it possible to run the plugin with the short version of the plugin?

ferstl commented 2 years ago

Hi @flashpixx

For that, you need to edit your settings.xml:

<settings>
  <pluginGroups>
    <pluginGroup>com.github.ferstl</pluginGroup>
  </pluginGroups>
</settings>

For further details, see the section "Run on the Command Line" in the README.md.

Cheers, Stefan

flashpixx commented 2 years ago

I know this, but I would like to have got a project-based setup and not modifying my global settings.xml

ferstl commented 2 years ago

This is not possible, because Maven does only look for plugins with the groupId org.apache.maven.plugins and org.codehaus.mojo by default: https://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html . So unless you don't add com.github.ferstl to your maven settings, you can't use the "depgraph" prefix.

If you can't add the pluginGropu to your global Maven settings, maybe you can use a user-specific ~/.m2/settings.xml for that. You can also take a look at this GitHub project which allows you to define a project-specific settings.xml: https://github.com/gzm55/project-settings-maven-extension . I haven't tried if that works for pluginGroups.