Gradle Webapp with generated classpath files

Answered

We have a special build process that will generate web resource files on compile and place into the build dir as "generated_classes".  When setting up in Intellij it will only copy the static webapp resources files and does not seem to use the task used in Gradle to generate the generated classes files.

 

Here is an example of the tasks we are using:


task generateClasspath(type: com.example.config.gradle.GenerateClassesTask, dependsOn: collectClasspathSource) {
group "web-source"
description "Generate files for inclusion on a classpath."
from collectClasspathSource
withEnv "${env}"
withEnvDirectory project(':common').files('src/main/resources-package/env')
into files("$buildDir/generateClasspath")
}

task warGenerated(type: War, dependsOn: generateClasspath) {
group "build"
description "Creates a generated WAR with a generated classes dir"
classpath generatedClasspath
classifier "generated"
archiveName = "${project.name}-${classifier}.war"
}

 

1

Please sign in to leave a comment.