Sebastian Stenzel created SUREFIRE-2200:
-------------------------------------------
Summary: JEP 443: Illegal field name "" in class
Key: SUREFIRE-2200
URL: https://issues.apache.org/jira/browse/SUREFIRE-2200
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin
Affects Versions: 3.1.2
Environment: JDK 21 GA
Maven 3.9.4
junit-jupiter 5.10.0
maven-surefire-plugin 3.1.2
maven-compiler-plugin 3.11.0
Reporter: Sebastian Stenzel
When running a test class that makes use of JEP 443, surefire reports an Error,
despite being run with {{{}--enable-preview{}}}.
{quote}[ERROR] Illegal field name "" in class com.example.Demo
{quote}
*Example:*
{code:java}
class Demo {
@Test
public void test() {
Function<Object, Integer> foo = _ -> 1;
// ...
}
}{code}
It is worth noting, that {{compiler:3.11.0:testCompile}} completes just fine.
The {{maven-compiler-plugin}} requires
{{<compilerArg>--enable-preview</compilerArg>}} and {{maven-surefire-plugin}}
require {{{}<argLine>-enable-preview</argLine>{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)