Maven2 compile-time "is a private API of Sun and may be removed in a future release" error resolved

The project uses maven for management, because some functions use sun's special API, during the maven compilation process, an error such as " it is Sun's special API and may be deleted in future versions " will be reported, resulting in the final compilation failure, googled One can use the latest version of the compilation plugin to solve this problem, which is configured in the project's pom file as follows:  

1. The maven-compiler-plugin uses version 2.3.1, and the previous version was 2.0.2;

2. The dependency of plexus-compiler-javac must be specified, and the latest version 1.8.1 solves this problem. Before 1.8.1, there is a problem;

 

The configuration is as follows:

<plugin>

  <artifactId>maven-compiler-plugin</artifactId>

  <version>2.3.1</version>

  <configuration>

    <source>1.6</source>

    <target>1.6</target>

    <encoding>UTF-8</encoding>

  </configuration>

  <dependencies>

    <dependency>

      <groupId>org.codehaus.plexus</groupId>

      <artifactId>plexus-compiler-javac</artifactId>

      <version>1.8.1</version>

    </dependency>

  </dependencies>

</plugin>

 

(Source: http://ruijunsuo.blog.163.com/blog/static/4005963220126910225769/ )

Related Posts