Comments (5)
I believe this is a groovy bug. The groovy team seemed to have fixed something when calling static methods, which are defined on interfaces:
However, something has changed on Java 9. I have created a simple example that reproduces the error shown above.
Other projects seems to be having the same problem:
- palantir/gradle-docker#96
- The jshell gradle plugin I am trying to contribute to
Not sure what is the best approach here. Should this be raised as an issue in the Groovy project github?
from gradle.
According to the state of the linked Groovy issue 7879 it should be resolved since Groovy 2.4.11.
But, using
------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------
Build time: 2018-02-28 13:36:36 UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 10-ea ("Oracle Corporation" 10-ea+42)
OS: Windows 10 10.0 amd64
R:\dev\github\junit-team\junit5>gradlew build
with this Java 9 code:
java.util.spi.ToolProvider.findFirst('jar').get()
...it still fails with Method java.util.spi.ToolProvider.findFirst(Ljava/lang/String;)Ljava/util/Optional; must be InterfaceMethodref constant
from gradle.
Happens with Gradle 4.7 (Groovy 2.4.12) as well.
Seems to be fixed with Groovy 3.0-alpha-2, though:
groovy -e "java.util.spi.ToolProvider.findFirst('jar').get().run(System.out, System.err, '--version')"
WARNING: Using incubator modules: jdk.incubator.httpclient
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/../lib/groovy-3.0.0-alpha-2.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
jar 10
from gradle.
Seems to be fixed in 2.4.16: https://issues.apache.org/jira/browse/GROOVY-8528
from gradle.
This works fine with Groovy 2.4.15
from gradle.
Related Issues (20)
- Compiler exceptions should be mapped to problems
- Outdated Isolated Projects documentation page HOT 2
- Implicit dependency error should not be caused when the implicit task is defined as finalizedBy HOT 6
- Autoconfigure the java-gradle-plugin with jvm-test-suite HOT 2
- Isolated Project violations should include a location HOT 1
- gradle/actions/dependency-submission needs to work on tag builds
- Search functionality in gradle docs is not as good as it previously was HOT 9
- Publication with non-ambiguable variants should fail HOT 1
- Please revert the deprecation to declare additional feature variants on the `main` source set HOT 2
- Allow to declare multiple feature variants on the same non-`main` source set HOT 2
- Services that depend on ExecutionEngine might not use build cache with 8.9 HOT 4
- Make ArchUnit tests for Kotlin public APIs understand `internal` visiblity
- Gradle wrapper does not respect the CLI option --gradle-user-home HOT 1
- Enable read-only configuration cache HOT 3
- Gradle 8.8 crashed on MacOS 11.x (8.7 still works as expected) HOT 15
- https://docs.gradle.org/8.8/javadoc/package-list is HTTP/404 but HTTP/200 with 8.7 dokka requires to download this resource HOT 2
- Gradle 8.8 crash on MAC OS HOT 2
- Publish Gradle API
- Instrumentation doesn't intercept calls to super methods
- Publish latest commit included in the nightly build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle.