Last active
June 16, 2024 03:05
-
-
Save antonarhipov/db4f4002c6a1813d349b to your computer and use it in GitHub Desktop.
Gradle build for Java web application with Kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext.kotlin_version = '0.9.976' | |
repositories { | |
mavenCentral() | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots" | |
} | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} | |
apply plugin: 'kotlin' | |
apply plugin: 'java' | |
apply plugin: 'war' | |
sourceCompatibility = 1.5 | |
version = '1.0' | |
repositories { | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots" | |
} | |
mavenCentral() | |
} | |
sourceSets { | |
main { | |
kotlin { | |
srcDir 'src/main/kotlin' | |
} | |
output.resourcesDir = "build/classes/main" | |
} | |
test { | |
kotlin { | |
srcDir 'test/main/kotlin' | |
} | |
} | |
main.java.srcDirs += 'src/main/kotlin' | |
} | |
dependencies { | |
compile group: 'javax', name: 'javaee-api', version: '7.0' | |
testCompile group: 'junit', name: 'junit', version: '4.11' | |
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment