JDK 11, Groovy 2.5.16, GrEclipse 3.7.1, GrEclipse Batch 2.6.16-02.
An MCVE is here. Just clone it and run mvn test. You will see:
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ Groovy_GrEclipseMavenAmbiguousTypeProxy ---
[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Compiling in a forked process using C:\Users\alexa\.m2\repository\org\codehaus\groovy\groovy-eclipse-batch\2.5.16-02\groovy-eclipse-batch-2.5.16-02.jar
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing groovy-eclipse compiler:
----------
1. ERROR in C:\Users\alexa\Documents\java-src\Groovy_GrEclipseMavenAmbiguousTypeProxy\src\test\groovy\HttpConnectionMockTest.groovy (at line 24)
private Proxy proxy
^^^^^
The type Proxy is ambiguous
----------
2. ERROR in C:\Users\alexa\Documents\java-src\Groovy_GrEclipseMavenAmbiguousTypeProxy\src\test\groovy\HttpConnectionMockTest.groovy (at line 28)
UnderTest(Proxy proxy, ProxySettingDTO proxySettingDTO, ConnectionManager connectionManager) {
^^^^^
The type Proxy is ambiguous
----------
3. ERROR in C:\Users\alexa\Documents\java-src\Groovy_GrEclipseMavenAmbiguousTypeProxy\src\test\groovy\HttpConnectionMockTest.groovy (at line 50)
URLConnection openConnection(URL url, Proxy proxy) {
^^^^^
The type Proxy is ambiguous
----------
3 problems (3 errors)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
The error goes away if I import either of these here
//import java.net.Proxy // <- This is what IntelliJ IDEA resolves
//import groovy.util.Proxy
IntelliJ IDEA shows both of them greyed out and removes the imports, because both seem to be imported by default in Groovy already. Other classes of that name which are visible from JRE or dependencies are net.sf.cglib.proxy.Proxy, org.graalvm.compiler.nodes.spi.Proxy, java.lang.reflect.Proxy, but those are not automatically imported, so they are fine.
I am not sure if this is a Groovy compiler or core problem, but it is kind of suboptimal that two identically named classes are imported by default. The error goes away if I import one of the two on top, but always marked as redundant and removed when reorganising imports, which is dangerous, but understandable, because the IDE correctly identifies them both as available.
JDK 11, Groovy 2.5.16, GrEclipse 3.7.1, GrEclipse Batch 2.6.16-02.
An MCVE is here. Just clone it and run
mvn test. You will see:The error goes away if I import either of these here
IntelliJ IDEA shows both of them greyed out and removes the imports, because both seem to be imported by default in Groovy already. Other classes of that name which are visible from JRE or dependencies are
net.sf.cglib.proxy.Proxy,org.graalvm.compiler.nodes.spi.Proxy,java.lang.reflect.Proxy, but those are not automatically imported, so they are fine.I am not sure if this is a Groovy compiler or core problem, but it is kind of suboptimal that two identically named classes are imported by default. The error goes away if I import one of the two on top, but always marked as redundant and removed when reorganising imports, which is dangerous, but understandable, because the IDE correctly identifies them both as available.