作者:Eddy  历史版本:1  更新时间:2024-05-13 18:33

编写版本:v3.5.7
适用版本:v3.5.7+

源码打包准备

以全源码打包为例,部分源码打包请自行修改配置。

  • 源代码;
  • OpenJDK11
  • OpenJDK17

修改编译环境(以OpenJDK11为例)

  1. 开发时jre system library -> 还是使用JavaSE-1.8
  2. 配置jdk版本,指定使用OpenJDK11,如何配置可自行百度。
  3. 修改编译版本,修改源码/ibps-starter-parent/pom.xml
    <!-- 修改前/第10行左右 -->
    <properties>
        ...
        <compiler.version>3.3</compiler.version>
        <jdk.version>1.8</jdk.version>
        ...
    </properties>
    <!-- 修改后/第10行左右 -->
    <properties>
        ...
        <compiler.version>3.8.0</compiler.version>
        <jdk.version>11</jdk.version>
        ...
    </properties>
  1. 修改编译插件参数,修改源码/ibps-starter-parent/pom.xml
    <!-- 修改前/最后10行左右 -->
        <build>
            ...
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.version}</version>
                <configuration>
                    <fork>true</fork>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <!-- 修改后/最后10行左右 -->
        <build>
            ...
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.version}</version>
                <configuration>
                    <fork>true</fork>
                    <encoding>UTF-8</encoding>
                    <compilerArgs>
                         <arg>--add-exports=java.base/java.util=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.desktop/com.sun.imageio.plugins.bmp=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.desktop/com.sun.imageio.plugins.gif=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED</arg>
                         <arg>--add-exports=java.desktop/com.sun.imageio.plugins.png=ALL-UNNAMED</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

其余步骤按照jdk8的执行

http://doc.bpmhome.cn/docs/ibps_v3_deploy/ibps_v3_deploy-1bkkjk5f9f8ft

OpenJDK17+启动注意事项

  1. 启动需要添加参数--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED