Commit ec41a56
authored
fix: build Docker image from parent directory to resolve dependencies (#28)
# Motivation
The Docker image build is failing with dependency resolution error:
```
Could not transfer artifact fr.aneo:armonik-worker-domain:pom:0.1.0
from/to github (https://maven.pkg.github.com/aneoconsulting/ArmoniK.Api):
status code: 401, reason phrase: Unauthorized (401)
```
This prevents the release workflow from completing successfully.
# Description
## Root Cause
The Docker build step was running from the `worker/armonik-worker`
subdirectory:
```yaml
- name: Build and push Docker image
working-directory: worker/armonik-worker
run: ./mvnw -B -ntp clean package -Pdocker
```
When Maven runs from a subdirectory, it cannot see sibling modules in
the reactor. The `armonik-worker` module depends on
`armonik-worker-domain`, but Maven couldn't find it locally and tried to
download it from external repositories:
1. Looked in GitHub Packages (requires authentication, returns 401)
2. Version `0.1.0` doesn't exist in GitHub Packages yet
3. Build fails
## Solution
Build from the parent `worker` directory instead:
```yaml
- name: Build and push Docker image
working-directory: worker
run: ./mvnw -B -ntp clean package -Pdocker
```
This enables Maven to:
1. See the multi-module reactor (parent + armonik-worker-domain +
armonik-worker)
2. Build `armonik-worker-domain` from local source
3. Build `armonik-worker` with access to the freshly built dependency
4. Execute the Docker profile (only affects armonik-worker, which has
the jib plugin)
No external repository access needed - everything builds from source.
## Changes Made
Changed `working-directory` from `worker/armonik-worker` to `worker` in
the "Build and push Docker image" step.
# Testing
## Expected Behavior
- Maven builds the full reactor from the worker directory
- `armonik-worker-domain` is built first (no download needed)
- `armonik-worker` is built with the Docker profile active
- Docker image is created and pushed successfully1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
0 commit comments