gnodet commented on code in PR #26838:
URL: https://github.com/apache/camel/pull/26838#discussion_r4093641410
##########
.github/workflows/dep-check.yml:
##########
@@ -159,9 +160,35 @@ jobs:
# EndpointRouteBuilderLoaderSupport.java against an empty
target/classes directory.
# An empty stub installed here lets any downstream module that
declares
# camel-endpointdsl-support as a dependency resolve it during
graph construction.
+ # • camel-core:test-jar: camel-management, camel-main, and several
components declare
+ # camel-core:test-jar (classifier=tests) as a test-scope
dependency. pilot:dependencies
+ # 0.4.0 resolves all declared artifacts before analysing —
including test-scope ones —
+ # even when -Dpilot.skipTestScope=true is set. The test-jar is
only produced at the
+ # 'package' phase, so it is never present in a clean CI
checkout. An empty stub
+ # satisfies pilot's resolution step; its contents are irrelevant
because test-scope
+ # analysis is skipped entirely.
VERSION=$(mvn help:evaluate -Dexpression=project.version -q
-DforceStdout)
mkdir -p /tmp/stub-classes
jar cf /tmp/stub.jar -C /tmp/stub-classes .
+ # Install camel-core:test-jar stub (classifier=tests).
+ # Uses a separate install-file invocation because the main loop
below handles plain JARs only.
+ cat > /tmp/stub-core-tests.pom << EOF
+ <project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <version>${VERSION}</version>
+ </project>
+ EOF
+ mvn install:install-file \
+ -Dfile=/tmp/stub.jar \
+ -DpomFile=/tmp/stub-core-tests.pom \
+ -DgroupId=org.apache.camel \
+ -DartifactId=camel-core \
+ -Dversion="${VERSION}" \
+ -Dclassifier=tests \
+ -Dpackaging=jar \
+ --no-transfer-progress --batch-mode -q
Review Comment:
Good point — the stub approach was indeed a workaround. The latest commits
take a cleaner path: instead of faking a test-jar, the workflow now runs
`./mvnw package -DskipTests` first (which naturally builds test-jars as part of
the `package` phase), then invokes `pilot:dependencies`. This is the proper
fix: let Maven produce the artifacts it needs rather than synthesizing them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]