I am migrating to Java 11 from Java 8. I am getting compile error when doing Maven build.
src
main
com
A.class
test
com
Atest.class
Atest.java {
A a;//compile error
}
Have used plugin in pom.xml
:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>default-compile</id>
</execution>
</executions>
</plugin>
</plugins>
</build>
am getting error like:
[ERROR] symbol: class A
[ERROR] location: class com.Atest
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile)
on project 'ourproject': Compilation failure
I have tried adding <release>11</release>
...but still getting same error.
Anything do we need to add in pom file extra to compile for test classes?