And 87 fiks maven artifacts publisering#86
Conversation
There was a problem hiding this comment.
Pull request overview
Oppdaterer CI og devcontainer-oppsett for å støtte Maven artifact-publisering mot GitHub Packages, samt moderniserer utviklingsmiljøet til Java 21.
Changes:
- Konfigurerer
actions/setup-javaog legger til egen Mavendeploy-step i GitHub Actions. - Oppgraderer devcontainer-baseimage til Java 21 (Bookworm) og installerer Maven i containeren.
- Justerer devcontainer metadata/innstillinger og verifiserer toolchain ved oppstart.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/build.yml | Legger til Maven publishing-konfig og mvn deploy i CI. |
| .devcontainer/Dockerfile | Bytter til Java 21 devcontainer-image og installerer Maven. |
| .devcontainer/devcontainer.json | Oppdaterer devcontainer-konfig til Java 21 + postCreate verifisering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tbitu
left a comment
There was a problem hiding this comment.
server-id github kommer antakelig ikke til å fungere, det bør vel være anskaffelser siden det står i pom.xml. Tokenet bør også være det innebygde github_token så vi slipper å vedlikeholde et eget, det bør virke? I tillegg bør vi ikke pinne maven-versjon med mindre det er helt nødvendig.
tbitu
left a comment
There was a problem hiding this comment.
Kan også bumpe til 2.4.1 siden dette skal fikse artifaktpublisering.
Bumpet opp versjon som 2.4.1 og bruker bare GITHUB_TOKEN med selskaps navn som server-id. |
tbitu
left a comment
There was a problem hiding this comment.
devcontainer.json pinner fremdeles maven-version
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
.github/workflows/build.yml:52
PACKAGES_TOKENis exported for the deploy step, but with the currentsetup-javaconfiguration it isn't referenced by Maven settings (server-password points atGITHUB_TOKEN). Either wire it up viaserver-password: PACKAGES_TOKENor drop this env var so the workflow doesn’t suggest it’s being used when it isn’t.
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
| <artifactId>validator-parent</artifactId> | ||
| <packaging>pom</packaging> | ||
| <version>2.4.0-SNAPSHOT</version> | ||
| <version>2.4.1-SNAPSHOT</version> |
tbitu
left a comment
There was a problem hiding this comment.
Selve deploy-prosessen bruker fremdeles secrets.GH_PACKAGES_TOKEN.
Da er den også bort fra denne filen. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
.github/workflows/build.yml:50
- The workflow runs
mvn ... packageand then (on main/tags) runsmvn ... deploy, which re-executes the full build lifecycle (including tests) a second time. Consider running a single Maven invocation (conditionaldeployvsverify/package), or runningverifyonce and thendeploywith tests skipped to avoid doubling CI time.
- name: Build with Maven
run: mvn -B --no-transfer-progress package
- name: Publish to GitHub Packages
if: ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: mvn --batch-mode deploy
env:
.github/workflows/build.yml:49
Publish to GitHub Packagesis enabled for release-like tags (*.*.*), but the project version is a-SNAPSHOT. Tag builds will therefore deploy snapshot artifacts, which is usually unexpected for release tags. Either restrict Maven deploy tomainonly, or switch to a non-snapshot version as part of the tag/release process.
- name: Publish to GitHub Packages
if: ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: mvn --batch-mode deploy
Denne token er bort nå. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/build.yml:52
- The deploy step drops
--no-transfer-progress/-Bused in the build step, which can make CI logs noisier and less consistent. Consider using the same Maven flags here as in the build step.
- name: Publish to GitHub Packages
if: ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| # Defaults to GITHUB_ACTOR (the user who triggered the workflow) | ||
| server-username: GITHUB_ACTOR | ||
| # Defaults to GITHUB_TOKEN | ||
| server-password: GITHUB_TOKEN |
|
|
||
| - name: Publish to GitHub Packages | ||
| if: ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | ||
| run: mvn --no-transfer-progress deploy |
| - name: Publish to GitHub Packages | ||
| if: ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | ||
| run: mvn --no-transfer-progress deploy | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
…package skal det være batch basert publisering med option -B.
| server-id: anskaffelser | ||
| # Defaults to GITHUB_ACTOR (the user who triggered the workflow) | ||
| server-username: GITHUB_ACTOR | ||
| # Defaults to GITHUB_TOKEN | ||
| server-password: GITHUB_TOKEN |
…as now the java does not comes from sdkman, however, from microsoft open jdk .
There was a problem hiding this comment.
INSTALL_MAVEN er gjort om til false, men koden kjører mvn -version senere. Virker det?
Denne Pull request innbærer:
Bumpet opp versjon på alle pom filer.