本地测试时,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>
包所在路径:
配置打包插件
<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