Java – annotation processor output in maven

I'm using JSR 269 as a compile - time method to analyze code and fail it if necessary

Solution

I think you encountered a maven error or better in the compiler plug-in - mcompiler - 66 When it comes to annotation processing, the compiler plug-in has several problems, such as mcompiler-62 The real best option is to use the annotation processing plug-in of the IMO forbidden compiler and use Maven processor plugin In this blog post, you can see how to use it It looks like this:

<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <compilerArgument>-proc:none</compilerArgument>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <version>1.3.7</version>
        <executions>
            <execution>
                <id>process</id>
                <goals>
                    <goal>process</goal>
                </goals>
                <phase>process-sources</phase>
            </execution>
        </executions>
        <dependencies>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-jpamodelgen</artifactId>
                <version>1.1.0.Final</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </plugin>

Also note how annotation processor dependencies are well limited to plug - ins

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>