警告:注释处理器 'org.apache.openjpa.persistence.meta.AnnotationProcessor6' 小于 -source '1.8'
warning: annotation processor 'org.apache.openjpa.persistence.meta.AnnotationProcessor6' less than -source '1.8'
当我用于处理 Java 8 的 Open JPA 元模型时,我从 maven-processor-plugin 收到下面列出的警告。我的项目实际上构建了,但是有这个版本吗Java 8 那不产生这个警告?我没有看到 Java 8 版本的 org.apache.openjpa.persistence.meta.AnnotationProcessor6。
warning: Supported source version 'RELEASE_6' from annotation
processor 'org.apache.openjpa.persistence.meta.AnnotationProcessor6'
less than -source '1.8'
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<processors>
<processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
</processors>
<optionMap>
<openjpa.metamodel>true</openjpa.metamodel>
<openjpa.source>8</openjpa.source>
</optionMap>
<outputDirectory>target/generated-sources/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<!-- OpenJPA -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>${org.apache.openjpa.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<version>${org.apache.openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
使用这个例子它最终对我有用:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<compilerArguments>-Aopenjpa.source=8 -Aopenjpa.metamodel=true</compilerArguments>
<processors>
<processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
</processors>
<outputDirectory>target/generated-sources/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
当我用于处理 Java 8 的 Open JPA 元模型时,我从 maven-processor-plugin 收到下面列出的警告。我的项目实际上构建了,但是有这个版本吗Java 8 那不产生这个警告?我没有看到 Java 8 版本的 org.apache.openjpa.persistence.meta.AnnotationProcessor6。
warning: Supported source version 'RELEASE_6' from annotation processor 'org.apache.openjpa.persistence.meta.AnnotationProcessor6' less than -source '1.8'
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<processors>
<processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
</processors>
<optionMap>
<openjpa.metamodel>true</openjpa.metamodel>
<openjpa.source>8</openjpa.source>
</optionMap>
<outputDirectory>target/generated-sources/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<!-- OpenJPA -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>${org.apache.openjpa.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<version>${org.apache.openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
使用这个例子它最终对我有用:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<compilerArguments>-Aopenjpa.source=8 -Aopenjpa.metamodel=true</compilerArguments>
<processors>
<processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
</processors>
<outputDirectory>target/generated-sources/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>