本地测试时,maven项目,使用spring-boot打包,如果需要将外部jar包打入到最终的app.jar目录中(app.jar\BOOT-INF\lib),然后可以使用java -jar app.jar启动项目。

引入本地包

        <dependency>
            <groupId>com.yonghui.or.algo</groupId>
            <artifactId>or-simulation-engine</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>${pom.basedir}/src/main/resources/lib/or-simulation-engine-modify.jar</systemPath>
        </dependency>

包所在路径:

image-20230227164447074

配置打包插件

		  <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

打包并查看打包后的路径

执行 mvn clean package

image-20230227164857634

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐