Maven运行sonar出错

Maven运行sonar报错 Unable to determine structure of project. Probably you use Maven Advanced Reactor Options, which is not supported by SonarQube and should not be used.

运行命令

mvn clean compile package install sonar:sonar

问题

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:4.5.1:sonar (default-cli) on project A: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options, which is not supported by SonarQube and should not be used. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:4.5.1:sonar (default-cli) on project A: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options, which is not supported by SonarQube and should not be used.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
	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:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	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: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options, which is not supported by SonarQube and should not be used.
	at org.sonar.maven.ExceptionHandling.handle(ExceptionHandling.java:37)
	at org.sonar.maven.SonarMojo.execute(SonarMojo.java:175)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
Caused by: java.lang.IllegalStateException: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options, which is not supported by SonarQube and should not be used.
	at org.sonar.batch.maven.MavenProjectConverter.rebuildModuleHierarchy(MavenProjectConverter.java:94)
	at org.sonar.batch.maven.MavenProjectConverter.configure(MavenProjectConverter.java:68)
	at org.sonar.batch.maven.MavenProjectBootstrapper.bootstrap(MavenProjectBootstrapper.java:59)
	at org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:112)
	at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:86)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:90)
	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
	at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
	at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
	at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
	at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
	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.IsolatedLauncher.execute(IsolatedLauncher.java:48)
	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.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
	at org.sonar.runner.api.Runner.execute(Runner.java:100)
	at org.sonar.maven.SonarMojo.execute(SonarMojo.java:173)
	... 21 more

原因

我们因为需求修改了maven的install插件,改变了project里的pom文件信息。所以这里出现了问题。 如果出现了这个错误,主要就是由自定义插件修改了project的信息引起的。

解决方法

临时方案是去掉了maven的install命令,改为运行以下命令

maven clean compile package sonar:sonar

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏小巫技术博客

Retrofit2 & RxJava2实现单文件和多文件上传

73540
来自专栏码匠的流水账

聊聊tomcat jdbc pool的默认参数及poolSweeper

本文主要研究一下tomcat jdbc pool的默认参数及poolSweeper

34710
来自专栏向治洪

Android 应用安装过程分析

在之前的文章中,我们对PakageManagerService启动流程分析 做了简单的介绍,并对PMS系统的启动流程做了详细的解析。上面只是说到了Android...

91090
来自专栏MasiMaro 的技术博文

windows 驱动开发入门——驱动中的数据结构

最近在学习驱动编程方面的内容,在这将自己的一些心得分享出来,供大家参考,与大家共同进步,本人学习驱动主要是通过两本书——《独钓寒江 windows安全编程》 和...

18620
来自专栏小灰灰

RabbitMQ基础教程之Spring&JavaConfig使用篇

28770
来自专栏Android中高级开发

Android开发之漫漫长途 XI——从I到X的小结

该文章是一个系列文章,是本人在Android开发的漫漫长途上的一点感想和记录,我会尽量按照先易后难的顺序进行编写该系列。该系列引用了《Android开发艺术探索...

14020
来自专栏xingoo, 一个梦想做发明家的程序员

【Hibernate那点事儿】—— Hibernate应该了解的知识

前言: 最近由于有点时间,就像深入的学习一下Hibernate.之前只是简单的使用,并没领会它的妙处。这里就趁着分享的机会,好好整理一下。   这篇主要...

226100
来自专栏一个会写诗的程序员的博客

13.12 Spring Boot集成Security中遇到的问题13.12 Spring Boot集成Security中遇到的问题问题1:Spring Boot集成Security使用数据库用户角色

sql语法手误。1?这地方写错了,应该是?1。这在敲代码的时候,手速一旦稍有不慎,就会导致前后顺序颠倒,而导致输入错误。这个虽然说是“低级错误”,但是错误搞起来...

11620
来自专栏乐沙弥的世界

基于RMAN从活动数据库异机克隆(rman duplicate from active DB)

      Oracle 11g RMAN能够实现基于活动数据库进行异机克隆,从而省去需要先备份再ftp到辅助服务器的过程。这一切可以全部交给Oracle来搞定...

13330
来自专栏个人分享

Spark代码调优(一)

import org.apache.spark.sql.{DataFrame, Row, SQLContext}

32010

扫码关注云+社区

领取腾讯云代金券