MavenModule <module_name> is already part of project <project_name>

maven

(Amit Kumar) #1

Hello team,
we have a Java project which fails Sonar validation with the below error:
> Validation of project failed:

  o MavenModule <module_name> is already part of project <project_name>

We have added this module in the sonar.exclusions in the POM file, but still the error is observed.

System details :

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: D:\tools\maven
Java version: 1.8.0_92, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_92\jre
Default locale: en_US, platform encoding: Cp1252
OS name: “windows 7”, version: “6.1”, arch: “amd64”, family: “dos”
SonarQube Version 6.7.3 (build 38370)

Any pointers to solve this issue are highly appreciated.


(Michael Gumowski) #2

Can you provide the stacktrace surrounding the failure? I guess there should be a bit more than just:

MavenModule <module_name> is already part of project <project_name>

Maybe execute your analysis in debug mode to get more info. It will help us to diagnose what is failing during analysis.


(Amit Kumar) #3

thanks for the quick response. I have the log, but the text size is huge
can you let me know a way I can share a big text file here? I did not see an upload button


(Michael Gumowski) #4

You should be able to upload a text file using the upload icon, when writing an answer. image

Just be sure to remove any confidential data from it, this will be public.

However, I think it would be simpler if you could locate in the file the stacktrace surrounding the error message your are getting. It should be only a few dozen line at maximum. We most probably do not need the totality of the analysis log.


(Amit Kumar) #5

Here is some stacktrace:

[INFO] Analysis reports compressed in 3194ms, zip size=5 MB
[INFO] Analysis report uploaded in 1174ms
[INFO] ANALYSIS SUCCESSFUL, you can browse https: / /sonar.intra.redacted.com/dashboard/index/90-noprefix-redacted.msc:redacted.msc.releng
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at https: / /sonar.intra.redacted.com/api/ce/task?id=AWRaD0PH2UHV6s932SMb
[INFO] Executing post-job org.sonar.plugins.buildbreaker.QualityGateBreaker
[INFO] Waiting for report processing to complete…
[INFO] Waiting for report processing to complete…
[INFO] Waiting for report processing to complete…
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] redacted.fl.maven.configuration … SKIPPED
[INFO] redacted.ufl.dlgenerator … SKIPPED
[INFO] redacted.utils … SKIPPED
[INFO] redacted.pl … SKIPPED
[INFO] redacted.crypto … SKIPPED
[INFO] redacted.tools.crypto … SKIPPED
[INFO] redacted.tools.utils … SKIPPED
[INFO] redacted.tools.kv … SKIPPED
[INFO] redacted.tools.kv.xmlvault … SKIPPED
[INFO] redacted.tools.kv.gnupg … SKIPPED
[INFO] redacted.tools.ks … SKIPPED
[INFO] redacted.tools.kv.ksvault … SKIPPED
[INFO] redacted.store … SKIPPED
[INFO] redacted.ci.base … SKIPPED
[INFO] redacted.utils.treeviewer … SKIPPED
[INFO] redacted.utils.validation … SKIPPED
[INFO] redacted.tools.channel … SKIPPED
[INFO] redacted.tools.comm … SKIPPED
[INFO] redacted.tools.apdu.gp … SKIPPED
[INFO] redacted.ufl … SKIPPED
[INFO] redacted.ufl.feature … SKIPPED
[INFO] redacted.keystorage … SKIPPED
[INFO] redacted.comm … SKIPPED
[INFO] redacted.comm.adapter.sys … SKIPPED
[INFO] redacted.comm.gp … SKIPPED
[INFO] redacted.comm.script … SKIPPED
[INFO] redacted.gp.feature … SKIPPED
[INFO] redacted.tf.maven.configuration … SKIPPED
[INFO] org.eclipse.wst.jsdt.core … SKIPPED
[INFO] redacted.test.framework … SKIPPED
[INFO] redacted.utils.ui … SKIPPED
[INFO] redacted.logger … SKIPPED
[INFO] redacted.scripting.lang.unittest … SKIPPED
[INFO] redacted.test.framework.ui … SKIPPED
[INFO] redacted.test.framework.report … SKIPPED
[INFO] redacted.purs … SKIPPED
[INFO] redacted.test.framework.feature … SKIPPED
[INFO] redacted.purs.feature … SKIPPED
[INFO] redacted.msc … SKIPPED
[INFO] com.sun.jna … SKIPPED
[INFO] redacted.msc.branding … SKIPPED
[INFO] redacted.utils.feature … SKIPPED
[INFO] redacted.logger.feature … SKIPPED
[INFO] redacted.msc.feature … SKIPPED
[INFO] javax.comm … SKIPPED
[INFO] javax.comm.feature … SKIPPED
[INFO] redacted.api … SKIPPED
[INFO] redacted.api.feature … SKIPPED
[INFO] net.sourceforge.ehep … SKIPPED
[INFO] redacted.tools.misc.ui … SKIPPED
[INFO] redacted.tools.feature … SKIPPED
[INFO] redacted.crypto.feature … SKIPPED
[INFO] redacted.store.ui … SKIPPED
[INFO] redacted.store.feature … SKIPPED
[INFO] redacted.store.ui.feature … SKIPPED
[INFO] redacted.ci … SKIPPED
[INFO] redacted.ci.ui … SKIPPED
[INFO] redacted.ci.feature … SKIPPED
[INFO] redacted.ci.ui.feature … SKIPPED
[INFO] redacted.ci.directci … SKIPPED
[INFO] redacted.ci.directci.ui … SKIPPED
[INFO] redacted.ci.directci.feature SKIPPED
[INFO] redacted.ci.apiinterface … SKIPPED
[INFO] redacted.ci.apiinterface.ui … SKIPPED
[INFO] redacted.ci.apiinterface.feature . SKIPPED
[INFO] redacted.ci.rminterface … SKIPPED
[INFO] redacted.ci.rminterface.ui … SKIPPED
[INFO] redacted.ci.rminterface.feature … SKIPPED
[INFO] redacted.protocols … SKIPPED
[INFO] redacted.protocols.feature … SKIPPED
[INFO] redacted.pl.ui … SKIPPED
[INFO] redacted.pl.feature … SKIPPED
[INFO] redacted.ufl.ui … SKIPPED
[INFO] redacted.ufl.ui.feature … SKIPPED
[INFO] org.eclipse.wst.jsdt.debug.core … SKIPPED
[INFO] org.eclipse.wst.jsdt.ui … SKIPPED
[INFO] redacted.wst.jsdt.feature … SKIPPED
[INFO] redacted.scripting … SKIPPED
[INFO] redacted.scripting.ui … SKIPPED
[INFO] redacted.scripting.lang.rhino … SKIPPED
[INFO] redacted.scripting.lang.python.py4j … SKIPPED
[INFO] redacted.scripting.lang.rhino.debugger … SKIPPED
[INFO] redacted.scripting.lang.unittest.feature … SKIPPED
[INFO] redacted.scripting.logger … SKIPPED
[INFO] redacted.scripting.ci … SKIPPED
[INFO] redacted.scripting.feature … SKIPPED
[INFO] redacted.scripting.ci.feature … SKIPPED
[INFO] redacted.scripting.crypto … SKIPPED
[INFO] redacted.scripting.crypto.feature … SKIPPED
[INFO] redacted.scripting.api … SKIPPED
[INFO] redacted.scripting.api.feature … SKIPPED
[INFO] redacted.scripting.store … SKIPPED
[INFO] redacted.scripting.store.feature … SKIPPED
[INFO] redacted.net.proxy.feature … SKIPPED
[INFO] redacted.scripting.ufl … SKIPPED
[INFO] redacted.scripting.ufl.feature … SKIPPED
[INFO] redacted.scripting.headless … SKIPPED
[INFO] redacted.scripting.headless.feature … SKIPPED
[INFO] redacted.tools.kv.feature … SKIPPED
[INFO] redacted.tools.crypto.feature … SKIPPED
[INFO] redacted.tools.utils.feature … SKIPPED
[INFO] redacted.ci.cheeta … SKIPPED
[INFO] redacted.ci.cheeta.ui … SKIPPED
[INFO] redacted.ci.cheeta.feature SKIPPED
[INFO] redacted.iso … SKIPPED
[INFO] redacted.iso.ui … SKIPPED
[INFO] redacted.iso.feature … SKIPPED
[INFO] redacted.scripting.iso … SKIPPED
[INFO] redacted.scripting.iso.feature … SKIPPED
[INFO] redacted.ci.mp … SKIPPED
[INFO] redacted.ci.mp.feature SKIPPED
[INFO] redacted.ci.custom.xml … SKIPPED
[INFO] redacted.ci.custom.xml.ui … SKIPPED
[INFO] redacted.ci.custom.xml.feature … SKIPPED
[INFO] redacted.ci.protocolsocketinterface … SKIPPED
[INFO] redacted.ci.protocolsocketinterface.feature SKIPPED
[INFO] redacted.ci.protocolsocketinterface … SKIPPED
[INFO] redacted.ci.protocolsocketinterface.ui … SKIPPED
[INFO] redacted.ci.protocolsocketinterface.feature SKIPPED
[INFO] redacted.ci.aardinterface … SKIPPED
[INFO] redacted.ci.aardinterface.ui … SKIPPED
[INFO] redacted.ci.aardinterface.feature SKIPPED
[INFO] redacted.ci.protocolssocketinterface … SKIPPED
[INFO] redacted.ci.protocolssocketinterface.ui … SKIPPED
[INFO] redacted.ci.protocolssocketinterface.feature SKIPPED
[INFO] redacted.protocolmcompatible … SKIPPED
[INFO] redacted.protocolmcompatible.ui … SKIPPED
[INFO] redacted.protocolmcompatible.feature … SKIPPED
[INFO] redacted.scripting.protocolmcompatible … SKIPPED
[INFO] redacted.scripting.protocolmcompatible.feature … SKIPPED
[INFO] redacted.iso … SKIPPED
[INFO] redacted.iso.feature … SKIPPED
[INFO] redacted.usb.hid … SKIPPED
[INFO] redacted.usb.ui … SKIPPED
[INFO] redacted.usb.ui.feature … SKIPPED
[INFO] de.thesycon.usbio … SKIPPED
[INFO] redacted.ci.usbinterface … SKIPPED
[INFO] redacted.ci.usbinterface.ui … SKIPPED
[INFO] redacted.ci.usbinterface.feature … SKIPPED
[INFO] redacted.ci.genericcomminterface … SKIPPED
[INFO] redacted.ci.genericcomminterface.feature SKIPPED
[INFO] redacted.scripting.usb.hid … SKIPPED
[INFO] redacted.scripting.usb.hid.feature … SKIPPED
[INFO] redacted.ci.tracii … SKIPPED
[INFO] redacted.ci.tracii.ui . SKIPPED
[INFO] redacted.ci.tracii.feature SKIPPED
[INFO] redacted.ci.byte.storm … SKIPPED
[INFO] redacted.ci.byte.storm.feature SKIPPED
[INFO] redacted.ci.socketinterface … SKIPPED
[INFO] redacted.ci.socketinterface.feature . SKIPPED
[INFO] redacted.scripting.lang.rhino.feature … SKIPPED
[INFO] redacted.scripting.pl … SKIPPED
[INFO] redacted.scripting.pl.feature … SKIPPED
[INFO] redacted.scripting.lang.python.py4j.feature … SKIPPED
[INFO] redacted.ci.devSocket … SKIPPED
[INFO] redacted.ci.devSocket.ui … SKIPPED
[INFO] redacted.ci.devSocket.feature SKIPPED
[INFO] redacted.scripting.apdu2device … SKIPPED
[INFO] redacted.scripting.apdu2device.feature … SKIPPED
[INFO] redacted.msc.product … SKIPPED
[INFO] 90-noprefix-redacted.msc.releng … FAILURE [09:37 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:19 min
[INFO] Finished at: 2018-07-02T10:15:40+02:00
[INFO] Final Memory: 398M/1608M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project redacted.msc.releng: Report processing did not complete successfully: FAILED -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project redacted.msc.releng: Report processing did not complete successfully: FAILED
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Report processing did not complete successfully: FAILED
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:67)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
… 20 more
Caused by: java.lang.IllegalStateException: Report processing did not complete successfully: FAILED
at org.sonar.plugins.buildbreaker.QualityGateBreaker.getAnalysisId(QualityGateBreaker.java:173)
at org.sonar.plugins.buildbreaker.QualityGateBreaker.executeOn(QualityGateBreaker.java:115)
at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:66)
at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:94)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy24.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65)
… 23 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http: / /cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :redacted.msc.releng
SonarQube analysis completed: FAILURE
Build step ‘SonarQube’ changed build result to FAILURE
Build step ‘SonarQube’ marked build as failure
[BFA] Scanning build for known causes…
…[BFA] No failure causes found
[BFA] Done. 3s
Notifying upstream projects of job completion
Finished: FAILURE

But the actual error is seen in the “background tasks” in the sonar server


(Michael Gumowski) #6

Well, according to this stacktrace, I cannot see any reference to the error your originally reported:

MavenModule <module_name> is already part of project <project_name>

According to the log, it seems that the analysis completed without any problem. But from my point of view it’s the buildBreaker plugin (not developped by SonarSource) which is currently making your build fail:

I would investigate on your side, and more precisely how the buildbreaker plugin is configured.

Hope this helps,
Michael


(Amit Kumar) #7

Hello,
the analysis is successful, but the report validation fails on Sonarserver:


(Adam Gabryś) #8

I know at least two reason which can cause this error:

  1. somebody manually specified sonar.projectKey parameter, execute an analysis, and finally analized project with different value of sonar.projectKey. The sonar.projectKey parameter changes id only od root module.
  2. somebody analyzed some submodules as standalone projects and now you try to scan those modules again (this time as not standalone projects).

(Amit Kumar) #9

Hi Adam,
thanks for the response.

I think the 2nd reason is valid here. We identified this and that is why we are excluding that particular module from out current project using sonar.exclusions maven property. unfortunately, looks like Sonar is not excluding that module from analysis at all.


(Adam Gabryś) #10

sonar.exclusions allows excluding source code, not modules.

Right now you have the following options:

  • remove the standalone sub-module project and scan everything as together
  • change id of the sub-module project and configure it manually when you scan it as a standalone project (sonar.projectKey).
  • create a profile in pom.xml and add sub-module only when the profile is enabled (you won’t enable it for sonar analysis) ← this is very ugly hack, so better don’t do it