I am linking Vue to the Spark Java interface.
Both modules are built independently, which works great with the following structure:
project
+
| +
| | +
| | +
| | +
| +
| +
+
+
On the backend, Gradle binds backend/src/main/resources/publicto the Jar /public. Therefore, I copied from ui/distin backend/src/main/resources/publicas a dependency of the task jar.
task copyUI(type: Copy) {
from( '../ui/dist')
into( 'src/main/resources/public')
}
jar.dependsOn( copyUI)
Gradle copies the files, but then creates a jar.
In other words, I have to create a jar twice so that everything is correct.
How can I instruct Gradle to wait for the copy to complete before packing / publishing
My build.gradlejar section looks like this:
jar {
manifest {
attributes(
'Main-Class': 'tld.domain.MainClass'
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
}
}
source
share