更新时间:2022-01-08 03:04:12
只需在 build.gradle 文件中添加此插件 ManifestClasspath 并指定清单类路径.ManifestClasspath 插件在 JavaExec 任务的类路径中为 jar 文件创建一个清单 jar,并使用清单 jar 设置类路径.
Just add this plugin ManifestClasspath in your build.gradle file and specify the manifest classpath. ManifestClasspath plugin creates a manifest jar for jar files in the classpath of JavaExec task and sets the classpath with the manifest jar.
plugins {
id 'org.springframework.boot' version '2.1.4.RELEASE'
id 'java'
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}
apply plugin: 'io.spring.dependency-management'
apply plugin: 'application'
mainClassName = 'com.example.demo.Application'
dependencies {
}