bsorrentino / maven-confluence-plugin

Maven plugin that generates project's documentation directly to confluence allowing to keep in-sync project evolution with its documentation
http://bsorrentino.github.io/maven-confluence-plugin/
Apache License 2.0
69 stars 34 forks source link

NullPointerException // error generating report #260

Closed sebb840 closed 8 months ago

sebb840 commented 3 years ago

Hi !
I use the plugin version 7.3.2 and I've still the nullpointerException like #253 issue

[INFO] --- confluence-reporting-maven-plugin:7.3.2:deploy (confluence-publish) @ SsProjet2 ---
[INFO] executeReport isSnapshot = [false] isRemoveSnapshots = [false]
[WARNING] siteDescriptor is missing!
Site
 Labels
  adk_0_1
  modules
  og-SsProjet2
 template-release.confluence
[WARNING] An error occurred while resolving project dependencies.
java.lang.NullPointerException
    at org.apache.maven.project.artifact.MavenMetadataSource.retrieve (MavenMetadataSource.java:183)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse (DefaultLegacyArtifactCollector.java:551)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect (DefaultLegacyArtifactCollector.java:148)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect (DefaultLegacyArtifactCollector.java:102)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect (DefaultLegacyArtifactCollector.java:804)
    at org.bsc.mojo.ConfluenceDeployMojo.resolveProject (ConfluenceDeployMojo.java:617)
    at org.bsc.mojo.ConfluenceDeployMojo.generateProjectHomeTemplate (ConfluenceDeployMojo.java:426)
    at org.bsc.mojo.ConfluenceDeployMojo.lambda$getHomeContent$3 (ConfluenceDeployMojo.java:539)
    at java.util.concurrent.CompletableFuture.uniComposeStage (CompletableFuture.java:995)
    at java.util.concurrent.CompletableFuture.thenCompose (CompletableFuture.java:2137)
    at org.bsc.mojo.ConfluenceDeployMojo.getHomeContent (ConfluenceDeployMojo.java:531)
    at org.bsc.mojo.ConfluenceDeployMojo.lambda$generateProjectReport$8 (ConfluenceDeployMojo.java:576)
    at org.bsc.mojo.ConfluenceDeployMojo.lambda$generateProjectReport$10 (ConfluenceDeployMojo.java:587)
    at java.util.concurrent.CompletableFuture.uniComposeStage (CompletableFuture.java:995)
    at java.util.concurrent.CompletableFuture.thenCompose (CompletableFuture.java:2137)
    at org.bsc.mojo.ConfluenceDeployMojo.lambda$generateProjectReport$13 (ConfluenceDeployMojo.java:584)
    at java.util.concurrent.CompletableFuture.uniCompose (CompletableFuture.java:966)
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire (CompletableFuture.java:940)
    at java.util.concurrent.CompletableFuture.postComplete (CompletableFuture.java:488)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run (CompletableFuture.java:1609)
    at java.util.concurrent.CompletableFuture$AsyncSupply.exec (CompletableFuture.java:1596)
    at java.util.concurrent.ForkJoinTask.doExec (ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask (ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker (ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run (ForkJoinWorkerThread.java:175)
[INFO] Try to calculate tag name part by currentVersion 0.1.11 and rule LATEST_RELEASE_VERSION

The confluence report has been generated but I've in the dependencies section but no dependencies found : Project Dependencies There are no dependencies for this project. It is a standalone application that does not depend on any other project.

I found the origin of problem. My project structure is like this :

The problem appears when the SsProjet1 and SsProjet2 projects are modified, deployed on nexus server and published on confluence during the same deployment phase.

For example :

SsProjet1 is modified, his version is 1.1, SsProjet2 is modified too and his version is 1.1 too. During the deployment phase, the SsProjet1 is built, deploy and publish a confluence page. Then the SsProjet2 project is built, deploy and publish a confluence page but the dependencies generate the nullPointerexception error. As if he didn't find the SsProjet1 artifact while it is well on nexus server.

If in the second time, I modify only the SsProjet2 project, the dependency section is ok because the SsProject1 1.1 is already generated in the previous built.

I hope that will help you.

Séb

bsorrentino commented 3 years ago

Hi @sebb840

Thanks for valuable feedbacks, I solved the #253 issue simply catching and ignoring the NPE exception.

The real problem there seems related to org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector I've planned to replace it, stay tune on issue #254