在Azure开发中构建失败



我是azure devops的初学者。我试图构建与maven,但我得到了以下错误,我不明白:

[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (package-9af52907-6506-4b87-b16a-9883edee41bc) on project gs-spring-boot: Execution package-9af52907-6506-4b87-b16a-9883edee41bc of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/../lib/tools.jar -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/PluginResolutionException

JDK/JRE中缺少tools.jar。确保Azure Pipeline上的JDK版本。Cobertura似乎不支持Java 1.8及更高版本:

  • https://github.com/mojohaus/cobertura-maven-plugin/issues/30
  • https://github.com/mojohaus/cobertura-maven-plugin/issues/21

所以,切换到JaCoCo。

最新更新