Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use springboot-customized-webapp with gradle? #100

Open
MarvinKern opened this issue Aug 31, 2020 · 2 comments
Open

How to use springboot-customized-webapp with gradle? #100

MarvinKern opened this issue Aug 31, 2020 · 2 comments

Comments

@MarvinKern
Copy link

Hi,
I am currently trying to translate the pom.xml to a build.gradle, but I am not sure how to transfer the plugin parts.
Is there already somewhere a springboot customized webapp implemented with gradle?
Thank you :)
Kind regards,
Marvin

@MarvinKern MarvinKern changed the title How to user springboot-customized-webapp with gradle? How to use springboot-customized-webapp with gradle? Aug 31, 2020
@MarvinKern
Copy link
Author

What I got for now:

plugins {
    id 'java'
    id 'maven-publish'
}

repositories {
    mavenLocal()
    maven {
        url = 'http://repo.maven.apache.org/maven2'
    }
}

dependencies {
    implementation 'XXX:XXX:1.0.0'
}

group = 'XXX'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = '1.8'

publishing {
    publications {
        maven(MavenPublication) {
            from(components.java)
        }
    }
}

@marketmi
Copy link

Hi @MarvinKern.
This is what we came up with:

plugins {
    id 'java'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.camunda.bpm.webapp:camunda-webapp:$rootProject.ext.camundaVersion"
    implementation "org.camunda.bpm.webapp:camunda-webapp-webjar:$rootProject.ext.camundaVersion"
}

group = 'XXX'
sourceCompatibility = '11'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

task copyLibs(type: Copy) {
    from {
        configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    }
    include 'META-INF/resources/**'
    exclude '**/user*.css'
    into "$buildDir/resources/main"
}

task copyArtWorkIntoTasklistImages(type: Copy) {
    from "artwork"
    into "$buildDir/resources/main/META-INF/resources/webjars/camunda/app/tasklist/assets/images"
}

task copyArtWorkIntoCockpitImages(type: Copy) {
    from "artwork"
    into "$buildDir/resources/main/META-INF/resources/webjars/camunda/app/cockpit/assets/images"
}

task copyArtWorkIntoAdminImages(type: Copy) {
    from "artwork"
    into "$buildDir/resources/main/META-INF/resources/webjars/camunda/app/admin/assets/images"
}

task copyArtWorkIntoWelcomeImages(type: Copy) {
    from "artwork"
    into "$buildDir/resources/main/META-INF/resources/webjars/camunda/app/welcome/assets/images"
}

processResources {
    dependsOn copyLibs
    dependsOn copyArtWorkIntoAdminImages
    dependsOn copyArtWorkIntoCockpitImages
    dependsOn copyArtWorkIntoTasklistImages
    dependsOn copyArtWorkIntoWelcomeImages
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants