fix: copy Maven artifacts into workspace instead of mounting $HOME/.m2

Issue: Docker volume mount from $HOME/.m2 wasn't working in GitHub Actions
- Container couldn't access the locally built SNAPSHOT JARs
- Maven failed with 'Could not find artifact seaweedfs-hadoop3-client:3.80.1-SNAPSHOT'

Solution: Copy Maven repository into workspace
1. In CI: Copy ~/.m2/repository/com/seaweedfs to test/java/spark/.m2/repository/com/
2. docker-compose.yml: Mount ./.m2 (relative path in workspace)
3. .gitignore: Added .m2/ to ignore copied artifacts

Why this works:
- Workspace directory (.) is successfully mounted as /workspace
- ./.m2 is inside workspace, so it gets mounted too
- Container sees artifacts at /root/.m2/repository/com/seaweedfs/...
- Maven finds the 3.80.1-SNAPSHOT JARs with our debug logging!

Next run should finally show the [DEBUG-2024] logs! 🎯
This commit is contained in:
chrislu
2025-11-23 11:07:05 -08:00
parent 052365a627
commit f52d2902b2
3 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ services:
container_name: seaweedfs-spark-tests
volumes:
- .:/workspace
- ${HOME}/.m2:/root/.m2
- ./.m2:/root/.m2
working_dir: /workspace
environment:
- SEAWEEDFS_TEST_ENABLED=true