Making a mvc build with SonarQube token for verify project but we got error as import: Entry [ import from realm ClassRealm[maven.api, parent: null]]

huangapple go评论83阅读模式
英文:

Making a mvc build with SonarQube token for verify project but we got error as import: Entry [ import from realm ClassRealm[maven.api, parent: null]]

问题

抱歉,我只会翻译文本内容,不会回答问题。以下是您提供的文本的翻译部分:

在使用SonarQube令牌验证项目进行maven构建时,我遇到了以下错误:

INFO BUILD FAILURE
INFO------------------------------------------------------------------------
INFO Total time:  11.039 s
INFO Finished at: 2023-06-19T16:21:32+05:30
INFO ------------------------------------------------------------------------
ERROR Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project report-service: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
ERROR -----------------------------------------------------
ERROR realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.9.1.2184
ERROR strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
ERROR urls[0] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
ERROR urls[1] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
ERROR urls[2] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
ERROR urls[3] = file:/C:/Users/Pro_ounce/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
ERROR urls[4] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
ERROR urls[5] = file:/C:/Users/Pro_ounce/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
ERROR Number of foreign imports: 1
ERROR import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
ERROR
ERROR ----------------------------------------------------
ERROR :java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @6f4fc83f
ERROR -> [Help 1]
ERROR

我尝试移除了Jetty的依赖并重新测试,问题得以解决。
英文:

While making a maven build using SonarQube token for verifying the project then I got an error as

INFO BUILD FAILURE
INFO------------------------------------------------------------------------
INFO Total time: 11.039 s
INFO Finished at: 2023-06-19T16:21:32+05:30
INFO ------------------------------------------------------------------------
ERROR Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project report-service: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
ERROR -----------------------------------------------------
ERROR realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.9.1.2184
ERROR strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
ERROR urls[0] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
ERROR urls1 = file:/C:/Users/Pro_ounce/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
ERROR urls2 = file:/C:/Users/Pro_ounce/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
ERROR urls[3] = file:/C:/Users/Pro_ounce/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
ERROR urls[4] = file:/C:/Users/Pro_ounce/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
ERROR urls[5] = file:/C:/Users/Pro_ounce/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
ERROR Number of foreign imports: 1
ERROR import: Entry[import from realm ClassRealm[maven.api, parent: null]]
ERROR
ERROR ----------------------------------------------------
ERROR :java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @6f4fc83f
ERROR -> [Help 1]
ERROR

I tried to remove the jetty dependency and again tested but it's work.

答案1

得分: 0

我已找到解决方法,请检查适用于SonarQube版本的Java JDK版本。
检查窗口 -> 首选项 -> 已安装的JRE

以及其他步骤,转到Java(或)Maven项目,点击库,右键点击JRE系统库。

英文:

I got the solution for this,
please check the Java JDK version which is suitable for the SonarQube version.
check-in window -> preferences -> Installed JREs

Making a mvc build with SonarQube token for verify project but we got error as import: Entry [ import from realm ClassRealm[maven.api, parent: null]]

And others also Go to java (or) maven project click on libraries right click on JRE System Library:

Making a mvc build with SonarQube token for verify project but we got error as import: Entry [ import from realm ClassRealm[maven.api, parent: null]]

huangapple
  • 本文由 发表于 2023年6月19日 21:31:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76507127.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定