Skip to content

And 87 fiks maven artifacts publisering#86

Merged
jeeveshmishra merged 21 commits into
mainfrom
AND-87-Fiks-Maven-Artifacts-Publisering
May 15, 2026
Merged

And 87 fiks maven artifacts publisering#86
jeeveshmishra merged 21 commits into
mainfrom
AND-87-Fiks-Maven-Artifacts-Publisering

Conversation

@jeeveshmishra
Copy link
Copy Markdown
Contributor

@jeeveshmishra jeeveshmishra commented May 13, 2026

Denne Pull request innbærer:

  1. Bruk av riktig token for Maven artifacts deploy.
  2. Oppgradering av Java versjon og bruk av riktig maven for devcontainer.

Bumpet opp versjon på alle pom filer.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-java og legger til egen Maven deploy-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.

Comment thread .github/workflows/build.yml Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Copy link
Copy Markdown

@tbitu tbitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@tbitu tbitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan også bumpe til 2.4.1 siden dette skal fikse artifaktpublisering.

@jeeveshmishra
Copy link
Copy Markdown
Contributor Author

vedlikeholde

Bumpet opp versjon som 2.4.1 og bruker bare GITHUB_TOKEN med selskaps navn som server-id.

Copy link
Copy Markdown

@tbitu tbitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devcontainer.json pinner fremdeles maven-version

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TOKEN is exported for the deploy step, but with the current setup-java configuration it isn't referenced by Maven settings (server-password points at GITHUB_TOKEN). Either wire it up via server-password: PACKAGES_TOKEN or 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 }}

Comment thread .github/workflows/build.yml Outdated
Comment thread pom.xml
<artifactId>validator-parent</artifactId>
<packaging>pom</packaging>
<version>2.4.0-SNAPSHOT</version>
<version>2.4.1-SNAPSHOT</version>
Comment thread pom.xml
Copy link
Copy Markdown

@tbitu tbitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selve deploy-prosessen bruker fremdeles secrets.GH_PACKAGES_TOKEN.

@jeeveshmishra
Copy link
Copy Markdown
Contributor Author

devcontainer.json pinner fremdeles maven-version

Da er den også bort fra denne filen.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ... package and then (on main/tags) runs mvn ... deploy, which re-executes the full build lifecycle (including tests) a second time. Consider running a single Maven invocation (conditional deploy vs verify/package), or running verify once and then deploy with 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 Packages is 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 to main only, 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

Comment thread .github/workflows/build.yml
Comment thread .devcontainer/devcontainer.json Outdated
@jeeveshmishra
Copy link
Copy Markdown
Contributor Author

Selve deploy-prosessen bruker fremdeles secrets.GH_PACKAGES_TOKEN.

Denne token er bort nå.

@jeeveshmishra jeeveshmishra requested a review from Copilot May 13, 2026 11:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / -B used 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 }}

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/build.yml Outdated
Comment on lines +33 to +42
# Defaults to GITHUB_ACTOR (the user who triggered the workflow)
server-username: GITHUB_ACTOR
# Defaults to GITHUB_TOKEN
server-password: GITHUB_TOKEN
Comment thread .github/workflows/build.yml Outdated

- 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
Comment thread .github/workflows/build.yml Outdated
Comment on lines +48 to +52
- 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 }}
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/build.yml Outdated
Comment on lines +38 to +42
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INSTALL_MAVEN er gjort om til false, men koden kjører mvn -version senere. Virker det?

@jeeveshmishra jeeveshmishra merged commit a58c9d4 into main May 15, 2026
1 check passed
@jeeveshmishra jeeveshmishra deleted the AND-87-Fiks-Maven-Artifacts-Publisering branch May 15, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants