added frontend to gradle build
This commit is contained in:
25
build.gradle
25
build.gradle
@@ -10,10 +10,35 @@ sourceCompatibility = '17'
|
|||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
compileTestJava.options.encoding = 'UTF-8'
|
compileTestJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
compileOnly {
|
||||||
|
extendsFrom annotationProcessor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processResources{
|
||||||
|
dependsOn 'copyFrontendToBuild'
|
||||||
|
}
|
||||||
|
|
||||||
|
bootJar{
|
||||||
|
archiveFileName = "app.jar"
|
||||||
|
}
|
||||||
|
|
||||||
|
task copyFrontendToBuild(type: Copy) {
|
||||||
|
dependsOn 'npmBuild'
|
||||||
|
from "$projectDir/frontend/dist/"
|
||||||
|
into "$buildDir/resources/main/static"
|
||||||
|
}
|
||||||
|
|
||||||
|
task npmBuild(type: Exec) {
|
||||||
|
workingDir './frontend/'
|
||||||
|
commandLine 'npm','run', 'build'
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-test'
|
implementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter'
|
implementation 'org.springframework.boot:spring-boot-starter'
|
||||||
|
|||||||
Reference in New Issue
Block a user