[英]Gradle Spring Boot Dependency: Include for bootRun / Exclude for bootJar
I have a JavaAgent JAR that needs to be:我有一个 JavaAgent JAR 需要:
bootRun
(referenced in bootRun_ManifestJar.jar
MANIFEST Class-Path)包含在bootRun
中(在bootRun_ManifestJar.jar
MANIFEST 类路径中引用)bootJar
(the App.jar BOOT-INF/lib
directory).不包含在bootJar
(App.jar BOOT-INF/lib
目录)中。What I've tried thus far:到目前为止我已经尝试过:
compileOnly "com.quartzdesk:quartzdesk-agent:3.6.0"
This is not including the JAR in either bootRun
or bootJar
这不包括bootRun
或 bootJar 中的bootJar
runtime "com.quartzdesk:quartzdesk-agent:3.6.0"
This is including the JAR in both bootRun
AND bootJar
(surprised it is included in bootJar
).这包括bootRun
和 bootJar 中的bootJar
(很惊讶它包含在bootJar
中)。
Any suggestions would be greatly appreciated.任何建议将不胜感激。 Thank you!谢谢!
surprised it is included in bootJar很惊讶它包含在 bootJar 中
runtime
dependency means that it is not included in classpath in compile time, but it is still packaged in final jar
into libs
and loaded in classpath on application startup. runtime
依赖意味着它在编译时不包含在类路径中,但它仍然在最终的jar
中打包到libs
中,并在应用程序启动时加载到类路径中。
This is much useful for dependencies, which are not used in your application source codes like JDBC-drivers or Liquibase.这对于依赖关系非常有用,这些依赖关系不会在您的应用程序源代码(如 JDBC 驱动程序或 Liquibase)中使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.