diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f2d90b4277366c3649c8d53fc892127a4b9e4e16..eb9c706ab4eb5aebe4624e655a331d17aba39129 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,7 @@
 image: eclipse-temurin:8
 
 variables:
-  GRADLE_ARGS: --no-daemon --warning-mode=all
+  GRADLE_ARGS: --no-daemon --stacktrace --warning-mode=all
   GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
 
 cache:
diff --git a/tlatools/build.gradle b/tlatools/build.gradle
index 0fd5da00eaebab45c30034ae5fac260f45d2397e..c6120d4d2ff6555090c4a9e1111f8faf59f5e34b 100644
--- a/tlatools/build.gradle
+++ b/tlatools/build.gradle
@@ -53,6 +53,8 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
 	task sourcesJar(type: Jar) {
 		classifier = 'sources'
 		from sourceSets.main.allSource
+		// Ignore duplicates because the same directory is used for sources and resources.
+		duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 	}
 
 	artifacts {