I'm updating a legacy project using java 8 and enunciate-maven-plugin version 2.13.0. I have updated to jdk 11 and enunciate-maven-plugin 2.15.1 and since this I have encountered problems.
parent-pom
<profile>
<id>jax-rs-api</id>
<dependencies>
<dependency>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-core-annotations</artifactId>
<version>${enunciate-maven-plugin.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
When the plugin is run by maven upon deploy, the following dto is not correctly compiled.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.953 s
[INFO] Finished at: 2023-07-19T10:44:33+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.15.0:docs (default) on project my-project: Compile failed of Java JSON client-side classes. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.15.0:docs (default) on project my-project: Compile failed of Java JSON client-side classes.
dto in question:
public abstract class IdentityView<T> {
private String accountId;
private T profile;
private ConfigurationView configuration;
// setters & getters
}
errors:
C:\...\my-project\target\enunciate\java-json-client\src\com\my-project\data\view\IdentityView.java:21: error: illegal start of type
private ? _profile;
^
C:\...\my-project\target\enunciate\java-json-client\src\com\my-project\data\view\IdentityView.java:21: error: <identifier> expected
private ? _profile;
^
C:\...\my-project\target\enunciate\java-json-client\src\com\my-project\data\view\IdentityView.java:45: error: illegal start of type
public ? getProfile() {
^
C:\...\my-project\target\enunciate\java-json-client\src\com\my-project\data\view\IdentityView.java:45: error: invalid method declaration; return type required
public ? getProfile() {
^
C:\...\my-project\target\enunciate\java-json-client\src\com\my-project\data\view\IdentityView.java:53: error: illegal start of type
public void setProfile(? _profile) {
Any ideas ?
I have no idea why enunciate is ignoring the generic T used at the class level and replacing it with a '?' within the getter and setters that it generates...
Many thanks in advance!