EMT4J
EMT4J是一个简化Java版升级的项目,主要侧重于长期版本jdk8、jdk11、jdk17。
1.maven插件
<build>
<plugins>
<plugin>
<groupId>org.eclipse.emt4j</groupId>
<artifactId>emt4j-maven-plugin</artifactId>
<version>0.7.0</version>
<executions>
<execution>
<phase>process-test-classes</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<fromVersion>8</fromVersion>
<toVersion>11</toVersion>
<outputFile>report.html</outputFile>
</configuration>
</plugin>
</plugins>
</build>
- emt4j:check 查找项目中存在的不兼容问题。
- emt4j:check-files 查找文件中存在的不兼容问题
- emt4j:inject-agent 注入 EMT4J 的 java agent。
mvn process-test-classes org.eclipse.emt4j:emt4j-maven-plugin:0.7.0:check -DoutputFile=emt4j-report.html -Dpriority=p1
- fromVersion : 目当前使用的 JDK 版本。支持 8 和 11,默认支持 8。
- toVersion : 目标 JDK 版本。支持 11 和 17,默认为 11。
- outputFile : EMT4J报告的目的地。默认值为报表.html。
- priority : 最低规则优先级。支持 P1、P2、P3 和 P4。未设置默认值。
- verbose : 如果为 true,请打印更详细的消息
2.java-agent
-
Java version from 8 to 11
java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk8-0.7.0.jar=to=11,file=jdk8to11.dat -
Java version from 11 to 17
java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk11-0.7.0.jar=to=17,file=11to17.dat -
Java version from 8 to 17:
java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk8-0.7.0.jar=to=17,file=jdk8to17.dat
3.报告
能摸鱼就很舒服
Show Disqus Comments
扫码关注公众号:纯洁的微笑
发送 290992
即可立即永久解锁本站全部文章