我想MANIFEST在構建jar.上下文如下:我有一個gradle基于項目的Spring-boot依賴項。這是一個RESTapi項目。這是我的假設:我嘗試過的所有插件都buildJar被Spring依賴項提供的任務覆蓋。所以我的問題如下,如何通過在項目中定義一個非常簡單的 gradle 任務來將提交哈希添加到清單中?我已經知道如何使用以下任務打印最后一個哈希值task getHash { def p1 = 'git rev-parse HEAD'.execute() p1.waitFor() println p1.text}這是build.gradle詳細信息:buildscript { ext { springBootVersion = '2.0.5.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") }}apply plugin: 'java'apply plugin: 'org.springframework.boot'apply plugin: 'io.spring.dependency-management'group = 'com.foo.bar'version = '0.0.4-SNAPSHOT'sourceCompatibility = 1.8repositories { mavenCentral()}dependencies { // Spring dependencies compile('org.springframework.boot:spring-boot-starter-web') //Clickhouse-jdbc compile group: 'ru.yandex.clickhouse', name: 'clickhouse-jdbc', version: '0.1.40' // Swagger compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2' compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2' // https://mvnrepository.com/artifact/org.json/json compile group: 'org.json', name: 'json', version: '20180813' testCompile('org.springframework.boot:spring-boot-starter-test')}
添加回答
舉報
0/150
提交
取消