Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem generating PDF with a sonar.branch #18

Open
chris-webb opened this issue Oct 9, 2015 · 1 comment
Open

Problem generating PDF with a sonar.branch #18

chris-webb opened this issue Oct 9, 2015 · 1 comment

Comments

@chris-webb
Copy link

I am using maven to store results in Sonar. We have recently attempted to use the sonar-pdfreport-plugin.

Using sonar-pdfreport-plugin-1.4 with SonarQube 4.5.5 an error is generated when attempting to generate a PDF when using the -Dsonar.branch option. It appears to be appending the the branch twice to the string used to look-up the project info.

Here is an example of the output from maven, in this example I used -Dsonar.branch=local:
[INFO] [11:28:46.613] Retrieving project info for test:myproject:local:local
[INFO] [11:28:47.067] Can't retrieve project info. Have you set username/password in Sonar settings?

Taking the -Dsonar.brach=local option off seems to work, the output instead is like this:
[INFO] [11:28:46.613] Retrieving project info for test:myproject

However we use branches to distinguish different release builds.

@vphad
Copy link

vphad commented Dec 16, 2015

Even we are facing the same issue, we are using the branch for analysis/release.

Here are the environment details,
SonarQube - 4.5.6 LTS
sonar-pdf-report - 1.4
Maven 3.3.3
Sonar maven plugin - 2.7.1
JDK 1.7

Maven Command :
mvn -f PROJECT/pom.xml -Dsonar.branch=995395 sonar:sonar

StackTrace is appended at the end.

From SonarQube page, it says that the plugin is deprecated,
http://docs.sonarqube.org/display/PLUG/Deprecated+Plugins

See "Other deprecated plugins" and that plugin is limited for java maven projects.

Also, compatibility matrix says, it's compatible with 4.5 LTS version,
http://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix

But it's not working, any comments ?

Here's the stack trace,

[INFO] [10:21:16.938] ANALYSIS SUCCESSFUL, you can browse http://XXXX:PORT/dashboard/index/Project:995395
[INFO] [10:21:17.013] Executing post-job class org.sonar.issuesreport.ReportJob
[INFO] [10:21:17.014] Executing post-job class org.sonar.report.pdf.batch.PDFPostJob
[INFO] [10:21:17.014] Executing decorator: PDF Report
[INFO] [10:21:17.019] Branch 995395 selected
[INFO] [10:21:17.019] Team workbook report type selected
[INFO] [10:21:17.159] Retrieving project info for Project:995395:995395
[INFO] [10:21:17.260] Can't retrieve project info. Have you set username/password in Sonar settings?
[ERROR] [10:21:17.260] Internal error: Can't retrieve project info. Parent project node is empty. Authentication?
org.sonar.report.pdf.entity.exception.ReportException: Can't retrieve project info. Parent project node is empty. Authentication?
at org.sonar.report.pdf.builder.ProjectBuilder.initializeProject(ProjectBuilder.java:125)
at org.sonar.report.pdf.PDFReporter.getProject(PDFReporter.java:132)
at org.sonar.report.pdf.PDFReporter.getReport(PDFReporter.java:82)
at org.sonar.report.pdf.batch.PDFGenerator.execute(PDFGenerator.java:109)
at org.sonar.report.pdf.batch.PDFPostJob.executeOn(PDFPostJob.java:70)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:72)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:61)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:132)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:173)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy23.executeOldVersion(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:284)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:153)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:99)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] [10:21:17.274] PDF file not found in local filesystem. Report could not be sent to server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants