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

How to use #91

Closed LeoDroidCoder closed 5 years ago

LeoDroidCoder commented 5 years ago

Sorry for offtop, but I cannot figure out how to use it with the android studio. As far as I understood, I added a dependency to my Android project debugImplementation 'com.github.ferstl:depgraph-maven-plugin:3.2.2' Then I installed the maven with homebrew as: brew install maven

Trying to run it with mvn depgraph:graph Which results in an error:

[No plugin found for prefix 'depgraph' in the current project and in the plugin groups org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/user/.m2/repository), central (https://repo.maven.apache.org/maven2)]

How to finally get it work?

ferstl commented 5 years ago

Hi,

By default Maven does only search for plugins with the groupId org.apache.maven.plugins and org.codehaus.mojo when you are using the short "prefix" invocation of a plugin.

To run the depgraph-maven-plugin, you have these three options:

  1. Configure com.github.ferstl as additional plugin group in your settings.xml (located in $MAVEN_HOME/conf/ or in $HOME/.m2/):

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

    With this setting you can simply run mvn depgraph:graph. See also the documentation about Plugin Prefix Resolution for further details.

  2. Fully qualify the invocation of the plugin:

    mvn com.github.ferstl:depgraph-maven-plugin:3.2.2:graph

    (you can omit the version if you have already defined it in the <pluginManagement> section of your POM file)

  3. Create an explicit plugin execution in your POM file:

    <build>
     <plugins>
       <plugin>
         <groupId>com.github.ferstl</groupId>
         <artifactId>depgraph-maven-plugin</artifactId>
         <version>3.2.2</version>
         <executions>
           <execution>
             <id>create-graph</id>
             <!-- use a phase that suits you best -->
             <phase>package</phase>
             <configuration>
               ...
             </configuration>
             <goals>
               <goal>graph</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
     </plugins>
    </build>

    This example will create the graph automatically when you run mvn package or mvn install or mvn deploy.

HTH

ferstl commented 5 years ago

Im closing this issue now. If you have further questions, just contact me again.