2016년 8월 4일 목요일

Adding properties to manifest file

You can add the manifest properties by using Gradle.

- build.gradle

apply plugin: 'java'
apply plugin: 'spring-boot'

repositories {
    maven { url "http://repo1.maven.org/maven2" }
}

dependencies {
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web'
}

buildscript {
    repositories {
        maven { url "http://repo1.maven.org/maven2" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
    }
}

jar {
    manifest {
        attributes("Implementation-Title": "Gradle",
                "Implementation-Version": "1.0.0",
                "Server-Version": "1.0.0.SNAPSHOT")
    }
}

- result

You can find the properties in MANIFEST.MF file.

Manifest-Version: 1.0
Implementation-Title: Gradle
Implementation-Version: 1.0.0
Start-Class: org.blog.test.GradleTestApplication
Spring-Boot-Classes: BOOT-INF/classes/
Server-Version: 1.0.0.SNAPSHOT
Spring-Boot-Lib: BOOT-INF/lib/
Spring-Boot-Version: 1.4.0.RELEASE
Main-Class: org.springframework.boot.loader.JarLauncher

댓글 없음 :

댓글 쓰기