This repository was archived by the owner on Sep 26, 2023. It is now read-only.
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
Gradle build fails in Open-JDK-11 bcoz google-java-format plugin and jacoco #865
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. Description
Gradle build for latest checkout is failing in OpenJDK-11 because of an older version of gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6. This version is not compatible with Java-11.
Once fixing the formatting plugin, the build fails again due to a bug in the default version of Jacoco. we would have to manually increment it's version to "0.8.2+".
Environment
rahulk@:~/gax-java$ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
-
Log caused by google-java-format-gradle-plugin
Reference: #858's Java-11 Build log
/tmpfs/src/github/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/ApiMessageHttpRequestTest.java: failed to process file
java.lang.NoClassDefFoundError: javax/lang/model/element/Modifier
at com.google.googlejavaformat.java.ModifierOrderer.getModifier(ModifierOrderer.java:45)
at com.google.googlejavaformat.java.ModifierOrderer.asModifier(ModifierOrderer.java:153)
at com.google.googlejavaformat.java.ModifierOrderer.reorderModifiers(ModifierOrderer.java:100)
at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:180)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:163)
at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:149)
at com.google.googlejavaformat.java.Formatter$formatSource.call(Unknown Source)
at com.github.sherter.googlejavaformatgradleplugin.format.OneDotOneFactory$_create_closure1.doCall(OneDotOneFactory.groovy:31)
at jdk.internal.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
at com.sun.proxy.$Proxy81.format(Unknown Source)
at com.github.sherter.googlejavaformatgradleplugin.VerifyFileCallable.call(VerifyFileCallable.java:29)
at com.github.sherter.googlejavaformatgradleplugin.VerifyFileCallable.call(VerifyFileCallable.java:11)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
> Task :verifyGoogleJavaFormat FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':verifyGoogleJavaFormat'.
> Problems: I/O errors
* Try:
Run with --stacktrace
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
2 actionable tasks: 1 executed, 1 up-to-date
option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
cleanup
rahulk@:~/gax-java$ ./gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :gax:test
Exception in thread "main" FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.RuntimeException: Class java/lang/UnknownError could not be instrumented.
at org.jacoco.agent.rt.internal_c13123e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:140)
at org.jacoco.agent.rt.internal_c13123e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:101)
at org.jacoco.agent.rt.internal_c13123e.PreMain.createRuntime(PreMain.java:55)
at org.jacoco.agent.rt.internal_c13123e.PreMain.premain(PreMain.java:47)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jxacocoAccess
at java.base/java.lang.Class.getField(Class.java:1999)
at org.jacoco.agent.rt.internal_c13123e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
... 9 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at line: 422
...
...
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at line: 422
<=======------> 56% EXECUTING [10s]
> :gax:test > 0 tests completed
^Crahulk@:~/gax-java$ Activity
rahulKQL commented on Feb 4, 2020
ContributorAuthor
More actions
It seems google-java-format-gradle-plugin:0.8 internally uses com.google.googlejavaformat:google-java-format:1.6, With absence of root repositories it fails to find this particular dependencies.
$ ./gradlew build
> Task :verifyGoogleJavaFormat FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':verifyGoogleJavaFormat'.
> Could not resolve all files for configuration ':googleJavaFormat1.6'.
> Cannot resolve external dependency com.google.googlejavaformat:google-java-format:1.6 because no repositories are de
fined.
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with -
-scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warningsadded a commit that references this issue
on Feb 4, 2020This issue will close once commit 7d9002d is merged into the 'master' branch.7d9002d changed the title
[-]Java-11 build fails bcoz google-java-format plugin[/-] [+]Gradle build fails in Open-JDK-11 bcoz google-java-format plugin and jacoco[/+] on Feb 4, 2020added
priority: p2Moderately-important priority. Fix may not be included in next release. type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed
🚨This issue needs some love. on Feb 19, 2020rahulKQL commented on Feb 27, 2020
ContributorAuthor
More actions
This is addressed via #868 and #883, Hence closing the issue.
Metadata
Metadata
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. Development
No branches or pull requestsIssue actions