oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.34k stars 745 forks source link

Build blows up on jacoco step in opengrok-web. Not much info online. #2665

Closed reflectivist closed 5 years ago

reflectivist commented 5 years ago

Been trying everything for a few days to build opengrok. MacOS. Hit and worked around a doclint incompatibility problem in a recently filed and closed issue. Hoped I could find a solution for this online, but there's almost no information about this problem.

BUILD ENVIRONMENT [ Debian GNU/Linux 9 (stretch) ]:

• Using fresh pulled opengrok fork from today. • tomcat version irrelevant at this point in the build AFAICT

mvn --version output:

Picked up JAVA_TOOL_OPTIONS: -DadditionalJOption=-Xdoclint:none Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_201, vendor: Oracle Corporation Java home: /opt/jdk1.8.0_201/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.9.82", arch: "amd64", family: "unix"

[DEBUG] ======================================================================= [INFO] [INFO] --- jacoco-maven-plugin:0.8.2:report (default-cli) @ opengrok-web --- [DEBUG] Configuring mojo org.jacoco:jacoco-maven-plugin:0.8.2:report from plugin realm ClassRealm[plugin>org.jacoco:jacoco-maven-plugin:0.8.2, parent: sun.misc.Launcher$AppClassLoader@7852e922] [DEBUG] Configuring mojo 'org.jacoco:jacoco-maven-plugin:0.8.2:report' with basic configurator --> [DEBUG] (f) dataFile = /work/opengrok-dev/opengrok-web/target/jacoco.exec [DEBUG] (f) outputDirectory = /work/opengrok-dev/opengrok-web/target/site/jacoco [DEBUG] (f) outputEncoding = UTF-8 [DEBUG] (f) project = MavenProject: org.opengrok:opengrok-web:1.1.2 @ /work/opengrok-dev/opengrok-web/pom.xml [DEBUG] (f) skip = false [DEBUG] (f) sourceEncoding = UTF-8 [DEBUG] (f) title = OpenGrok Web [DEBUG] -- end configuration -- [INFO] Loading execution data file /work/opengrok-dev/opengrok-web/target/jacoco.exec [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] OpenGrok ........................................... SUCCESS [ 0.430 s] [INFO] OpenGrok Indexer ................................... SUCCESS [ 5.418 s] [INFO] OpenGrok authorization plugins ..................... SUCCESS [ 0.259 s] [INFO] OpenGrok Suggester ................................. SUCCESS [ 0.407 s] [INFO] OpenGrok Web ....................................... FAILURE [ 0.134 s] [INFO] OpenGrok tools ..................................... SKIPPED [INFO] Distribution ....................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.278 s [INFO] Finished at: 2019-02-03T10:35:45-08:00 [INFO] Final Memory: 12M/465M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.2:report (default-cli) on project opengrok-web: An error has occurred in JaCoCo report generation. Error while creating report: Unknown block type 64. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.2:report (default-cli) on project opengrok-web: An error has occurred in JaCoCo report generation. 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: An error has occurred in JaCoCo report generation. at org.jacoco.maven.AbstractReportMojo.execute(AbstractReportMojo.java:167) 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: org.apache.maven.reporting.MavenReportException: Error while creating report: Unknown block type 64. at org.jacoco.maven.AbstractReportMojo.executeReport(AbstractReportMojo.java:183) at org.jacoco.maven.AbstractReportMojo.execute(AbstractReportMojo.java:165) ... 22 more Caused by: java.io.IOException: Unknown block type 64. at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:118) at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92) at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59) at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:73) at org.jacoco.maven.ReportSupport.loadExecutionData(ReportSupport.java:87) at org.jacoco.maven.ReportMojo.loadExecutionData(ReportMojo.java:60) at org.jacoco.maven.AbstractReportMojo.executeReport(AbstractReportMojo.java:177) ... 23 more

tulinkry commented 5 years ago

A fast workaround is to disable jacoco with adding -Djacoco.skip to your maven run, e. g. mvn -Djacoco.skip package.

vladak commented 5 years ago

Looks like a data corruption of sorts.

http://sonarqube-archive.15.x6.nabble.com/jacoco-exceptions-parsing-exec-file-td4339559.html describes one way this could happen which I believe does not apply to our build however.

tulinkry commented 5 years ago

@vladak second thing I read about it that it can happen when using parallel test execution, however that should be fixed in the 0.8.2 which is in the opengrok and also we don't use parallel test execution.

reflectivist commented 5 years ago

Thanks for the help. I talked to some of the developers online. It turns out that the problem was that my maven was 3.3.x and the Debian 9 repos pull that as the latest version available. Upgrading to maven 3.6 and starting over worked perfectly. Upgrading Java on macOS Mojave, where I also hit problems resolved it there. So maven 3.6 + JDK 8u201 worked for me on both systems. The developer help page originally said one of the early steps is mvn install, but there was no indication of which maven version so having Debian apt-install upgrade tell me I was at the latest made me assume I was okay there. Since then the opengrok guru Adam, with access to the developer page updated to say run 'mvnw install' which theoretically runs the mvnw wrapper in the local workspace. It would be good if someone mentioned to use the one there, because not everyone trying to build opengrok necessarily knows much about maven. For example, last I did much with Java, I was using ant. Hopefully the workspace is the only place someone will find mvnw lying around, or depending on their path and what's installed they could still run into problems they won't be able to figure out how to resolve.