英文:
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系统库。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论