enhancement
major
minor
defect
critical
major
minor
major
#30244
tl-archetype-deploy: Declare the archetype integration test's dependency on tl-demo
Observation
The PR build tl-ci-pr #1028 (MAVEN_THREADS=4, all databases) fails during the build phase in tl-archetype-deploy:
[ERROR] Failed to execute goal on project tl-demo-deploy: Could not resolve dependencies for project com.top-logic:tl-demo-deploy:jar:8.0.0-SNAPSHOT [ERROR] dependency: com.top-logic:tl-demo:jar:8.0.0-SNAPSHOT (compile) [ERROR] Could not find artifact com.top-logic:tl-demo:jar:8.0.0-SNAPSHOT ... [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:integration-test (default-integration-test) on project tl-archetype-deploy: [ERROR] Archetype IT 'demo-deploy' failed: Execution failure: exit code = 1
A full build (FORCE_FULL=true) with MAVEN_THREADS=4 (tl-ci-pr #1156) doesn't even reach tl-archetype-deploy; instead, it fails in tl-maven-plugin:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.6.1:test (default-test) on project tl-maven-plugin: parallel Maven execution is not compatible with Surefire forkCount 0
Cause
The archetype integration test `demo-deploy ` generates a project with ` appArtifactId=tl-demo ` (tl-archetype-deploy/src/test/resources/projects/demo-deploy/archetype.properties) and builds it against the local repository. It therefore requires the installed tl-demo artifact.
However,tl-archetype-deploy/pom.xml declares only tl-bpe-app as a test dependency, not tl-demo. In the sequential Reactor, tl-demo happens to be built first (position 66 of 130; tl-archetype-deploy is at position 100). In a parallel Reactor (mvn -T <n>, e.g., tl-ci-pr with MAVEN_THREADS > 1), this order is not guaranteed. In that case, the integration test runs before tl-demo is installed.
This affects every parallel build in which tl-archetype-deploy is built, not just the builds with all databases. The regular PR builds run with MAVEN_THREADS=1 and therefore do not show the error.
tl-maven-plugin/pom.xml configures Surefire with forkCount=0 (comment: “Allow debugging test cases.”; this setting predates the Git history). The tests therefore run in Maven’s JVM, which Surefire refuses to do in a parallel Reactor. The partial build builds tl-maven-plugin only as an upstream module with -DskipTests and therefore does not display the error; the full build builds everything in a single Maven run with tests.
Solution
The test dependency in tl-archetype-deploy/pom.xml on tl-bpe-app is replaced with a test dependency on tl-demo. Then the Reactor always builds tl-demo before tl-archetype-deploy.
The dependency on tl-bpe-app is therefore unnecessary: tl-demo itself depends on tl-bpe-app, so the Reactor will continue to build it first. Furthermore, demo-deploy is the archetype’s only integration test.
In tl-maven-plugin/pom.xml, remove `forkCount=0`; the tests run in their own JVM, just like in all other modules. Use `-Dmaven.surefire.debug` for debugging.