Bootstrap

Springboot SAP Docker 镜像打包问题

问题类1,sapjco.jar 未识别到:Caused by: java.lang.NoClassDefFoundError: com/sap/conn/jco/ext/DestinationDataProvider

1./deploy/lib/ 文件下放sapjco3.jar、libsapjco3.so、sapjco3.dll
2.docker文件核心内容:
COPY /deploy/lib/sapjco3.jar $JAVA_HOME/lib/sapjco3.jar
COPY /deploy/lib/libsapjco3.so  $JAVA_HOME/jre/lib/amd64/server/libsapjco3.so
ENV CLASSPATH $JAVA_HOME/lib/sapjco3.jar:$JAVA_HOME/jre/lib
ENV JRE_HOME $JAVA_HOME/jre
ENV LD_LIBRARY_PATH dir:$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/amd64/server

3.配置maven pom.xml:

<!--      引入本地   SAP的jar包依赖 -->
<dependency>
    <groupId>com.sap.conn.jco</groupId>
    <artifactId>sapjco3</artifactId>
    <version>3.1.5</version>
    <scope>system</scope>
    <!-- 如果jar包在本地,则需要指定系统路径 -->
    <systemPath>${project.basedir}/deploy/lib/sapjco3.jar</systemPath>
</dependency>
<!-- 将本地jar 打包进 项目jar -->
<resource>
    <directory>deploy/lib</directory>
    <targetPath>BOOT-INF/lib</targetPath>
    <includes>
        <include>sapjco3.jar</include>
    </includes>
</resource>

;