Depuis Java8, l'apt utilisé dans slim3-gen est obsolète /view_bug.do?bug_id=7041249).
pom.xml
#Lié aux artefacts
slim3-gen -> slim3-gen-jsr269
#Changer d'artefacts apt
org.codehaus.mojo apt-maven-plugin -> com.mysema.maven apt-maven-plugin
#Supprimer la description associée à apt
Par défaut, les sources sont sorties vers target / generated-sources / annotations
.
Pour changer cela en $ {generated.src}
, définissez comme suit.
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