Skip to content

Instantly share code, notes, and snippets.

@navicore
Created May 26, 2014 02:25
Show Gist options
  • Save navicore/fd389bdba4f7942800b1 to your computer and use it in GitHub Desktop.
Save navicore/fd389bdba4f7942800b1 to your computer and use it in GitHub Desktop.
super jar with gradle
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-cli', name: 'commons-cli', version: '1.2'
compile group: 'edu.stanford.nlp', name: 'stanford-corenlp', version: '3.3.1'
runtime(
[group: 'commons-cli', name: 'commons-cli', version: '1.2'],
[group: 'edu.stanford.nlp', name: 'stanford-corenlp', version: '3.3.1']
)
}
sourceCompatibility = 1.7
mainClassName = "hello.Main"
//task superjar(type: Jar) {
jar {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
jar.doFirst {
manifest {
attributes 'Implementation-Title': 'Falkonry Gram',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': mainClassName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment