From Java8, apt used in slim3-gen is obsolete /view_bug.do?bug_id=7041249).
pom.xml
#Artif related
slim3-gen -> slim3-gen-jsr269
#Switch apt artifacts
org.codehaus.mojo apt-maven-plugin -> com.mysema.maven apt-maven-plugin
#Delete apt related description
By default, the sources are output to target / generated-sources / annotations
.
To change this to $ {generated.src}
, set as follows.
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<!-- Need to disable default annotation processing since apt-maven-plugin takes over -->
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>${generated.src}</outputDirectory>
<processors>
<processor>org.slim3.gen.processor.ModelProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<!-- Need to ensure the generated source folder is added to the project classpath -->
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${generated.src}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
https://github.com/redhat-developer/vscode-java/wiki/Annotation-Processing-support-for-Maven-projects
Recommended Posts