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

Failed to execute goal `com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor` #144

Closed svbrunov closed 2 years ago

svbrunov commented 2 years ago

Defect

Dear Stefan Ferstl (@ferstl),

I have just tried to upgrade the Maven plugin for my current multi-module Maven project.

After performing the Maven plugin upgrade, the depgraph:reactor goal execution (mvn depgraph:reactor) fails with the following error message:

[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor (default-cli) on project custom-maven-project: Execution default-cli of goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor failed: Cannot invoke "String.equals(Object)" because the return value of "com.github.ferstl.depgraph.dependency.puml.PumlNodeInfo.getStereotype()" is null -> [Help 1]

Maven plugin configuration

<project>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.ferstl</groupId>
                    <artifactId>depgraph-maven-plugin</artifactId>
                    <version>4.0.0</version>
                    <configuration>
                        <graphFormat>puml</graphFormat>
                        <scope>compile</scope>
                        <excludes>
                            <exclude>org.slf4j:slf4j-api</exclude>
                            <exclude>com.google.guava:guava</exclude>
                            <exclude>io.vavr:vavr</exclude>
                        </excludes>
                        <transitiveExcludes>
                            <transitiveExclude>*</transitiveExclude>
                        </transitiveExcludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

Detailed error message (mvn -X depgraph:reactor)

Detailed error message ``` [ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor (default-cli) on project custom-maven-project: Execution default-cli of goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor failed: Cannot invoke "String.equals(Object)" because the return value of "com.github.ferstl.depgraph.dependency.puml.PumlNodeInfo.getStereotype()" is null -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor (default-cli) on project custom-maven-project: Execution default-cli of goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor failed: Cannot invoke "String.equals(Object)" because the return value of "com.github.ferstl.depgraph.dependency.puml.PumlNodeInfo.getStereotype()" is null at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.github.ferstl:depgraph-maven-plugin:4.0.0:reactor failed: Cannot invoke "String.equals(Object)" because the return value of "com.github.ferstl.depgraph.dependency.puml.PumlNodeInfo.getStereotype()" is null at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "com.github.ferstl.depgraph.dependency.puml.PumlNodeInfo.getStereotype()" is null at com.github.ferstl.depgraph.graph.puml.PumlGraphFormatter.writeNodes (PumlGraphFormatter.java:71) at com.github.ferstl.depgraph.graph.puml.PumlGraphFormatter.format (PumlGraphFormatter.java:38) at com.github.ferstl.depgraph.graph.GraphBuilder.toString (GraphBuilder.java:149) at com.github.ferstl.depgraph.dependency.ReactorGraphFactory.createGraph (ReactorGraphFactory.java:45) at com.github.ferstl.depgraph.AbstractGraphMojo.execute (AbstractGraphMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) ```

Best regards, Sergey Vyacheslavovich Brunov.

ferstl commented 2 years ago

@svbrunov Thanks for the report. Bugfix version 4.0.1 should be on Maven Central within the next few hours.

svbrunov commented 2 years ago

Dear Stefan Ferstl (@ferstl),

I have just tried the 4.0.1 version. The depgraph:reactor goal has been executed successfully for my current multi-module Maven project.

Thank you very much for the prompt reply and the release!

Best regards, Sergey Vyacheslavovich Brunov.