Skip to content

Commit 06853c6

Browse files
committed
Change the Gradle task from build to assemble in Dockerfile
1 parent 6dc6fee commit 06853c6

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN chmod +x gradlew && \
1010
./gradlew dependencies --no-daemon
1111

1212
COPY src/ ./src/
13-
RUN ./gradlew build -x test --no-daemon
13+
RUN ./gradlew assemble --no-daemon
1414

1515

1616
# Runner stage

build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,20 @@ task archiveServerMainJar(type: Jar) {
7575
}
7676
}
7777

78-
build.dependsOn(archiveServerMainJar)
79-
build.doLast {
80-
copy {
81-
from war.archiveFile
82-
from archiveServerMainJar.archiveFile
83-
from configurations.providedCompile
84-
into appDir
85-
}
78+
task packageApp(type: Copy) {
79+
dependsOn assemble
80+
81+
from war.archiveFile
82+
from archiveServerMainJar.archiveFile
83+
from configurations.providedCompile
84+
into appDir
8685
}
8786

87+
assemble.dependsOn archiveServerMainJar
88+
assemble.finalizedBy packageApp
89+
8890
task runApp(type: Exec) {
89-
dependsOn build
91+
dependsOn assemble
9092

9193
environment PORT: 8080
9294
workingDir appDir.get()

0 commit comments

Comments
 (0)