Skip to content
Gradle plugin that generates project metadata to META-INF/MANIFEST.MF
Kotlin Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea/codeStyles
.scripts
gradle/wrapper
src
.editorconfig
.gitignore
.travis.yml
build.gradle.kts
gradlew
gradlew.bat
readme.md
settings.gradle.kts

readme.md

Manifest Gradle Plugin

Join the chat at https://gitter.im/coditory/gradle-manifest-plugin Build Status Coverage Status Gradle Plugin Portal

Zero configuration, single responsibility gradle plugin for generating project metadata to jar manifest file.

Enabling the plugin

Add to your build.gradle:

plugins {
  id 'com.coditory.manifest' version '0.1.5'
}

Usage

This plugin automatically adds metadata to manifest file after processResources. There is nothing you need to do.

For debug purposes you can run manifest task with some flags:

# Generates manifest file to build/resources/main/META-INF/MANIFEST.MF
./gradlew manifest

# Generates manifest and prints its content
./gradlew manifest --print

# Generates manifest to src/main/resources/META-INF/MANIFEST.MF
# Sometimes it's useful for debugging
./gradlew manifest --main

Overriding generated attributes

To override generated manifest attributes specify your own values in build.gradle

jar {
  manifest {
    attributes(
      'Implementation-Title': 'hello-world'
      'Main-Class': 'hello.HelloWorld'
    )
  }
}

Generated manifests

Sample generated manifest:

Manifest-Version: 1.0
Main-Class: com.coditory.Application
Implementation-Title: sample-project
Implementation-Group: com.coditory
Implementation-Version: 0.0.1-SNAPSHOT
Built-By: john.doe
Built-Host: john-pc
Built-Date: 2020-03-25T20:46:59Z
Built-OS: Linux 4.15.0-91-generic amd64
Built-JDK: 12.0.2 AdoptOpenJDK
SCM-Repository: git@github.com:coditory/gradle-manifest-plugin.git
SCM-Branch: refs/heads/master
SCM-Commit-Message: Very important commit
SCM-Commit-Hash: ef2c3dcabf1b0a87a90e098d1a6f0341f0ae1adf
SCM-Commit-Author: John Doe <john.doe@acme.com>
SCM-Commit-Date: 2020-03-24T19:46:03Z
You can’t perform that action at this time.