繁体   English   中英

如何使用外部 jars 运行 spring-boot jar 并使用 maven 依赖系统编译?

[英]How to run a spring-boot jar with external jars which compile with maven dependency system?

第 3 方 jars 不在回购中,可能会不时更新。

我在 maven 中使用依赖项作为

    <dependency>
        <scope>system</scope>
        <systemPath>$path/$name.jar</systemPath>
   </dependency>

编译和 jars 不在我希望的包中。

当spring-boot jar部署到目标机上,如何运行?

有关将jar从路径添加到Spring引导类路径的信息,请参见

Spring Boot的外部库文件夹

这意味着您可以通过回购协议安全地管理pom中的依赖性(避免sytemPath依赖性)。

使用 Maven 构建工具的 SpringBoot 项目,您可以使用:

mvn install:install-file "-DgroupId=org.apache.poi" "-DartifactId=poi-ooxml" "-Dpackaging=jar" "-Dfile={your_path_to_jar_file}"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM