1234567891011121314151617181920212223242526272829303132333435363738 |
- plugins {
- id 'java'
- }
-
- group 'org.example'
- version '1.0'
-
- repositories {
- mavenCentral()
- }
-
- dependencies {
- testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
- testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
- compile 'io.undertow:undertow-core:2.1.0.Final'
- }
-
- test {
- useJUnitPlatform()
- }
-
- //create a single Jar with all dependencies
- task fatJar(type: Jar) {
- manifest {
- attributes 'Implementation-Title': 'Gradle Jar File Example',
- 'Implementation-Version': version,
- 'Main-Class': 'Application'
- }
- baseName = project.name + '-all'
- from {
- configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
-
- }
- from('src/main/java'){
- include 'resources/*'
- }
- with jar
- }
|