Skip to content

Build PhoneBlock immediately after checkout#204

Merged
haumacher merged 3 commits intohaumacher:masterfrom
SchulteDev:refactor/dkim-library
Apr 12, 2026
Merged

Build PhoneBlock immediately after checkout#204
haumacher merged 3 commits intohaumacher:masterfrom
SchulteDev:refactor/dkim-library

Conversation

@SchulteDev
Copy link
Copy Markdown
Contributor

This PR contains minor changes to the project build so that the build can be successfully executed locally immediately after a checkout.

  1. Use of Jitpack to directly use your fix https://github.com/haumacher/java-utils-mail-dkim/tree/fix-automatic-module-name without needed extra building it locally.
  2. Adjustment of the filtering of the .phoneblock file.
    - Remove global <filters> configuration that was applied during process-resources phase
    - Keep filtering in maven-war-plugin for deployment-time configuration injection
    - Allow developers to compile and test without needing environment-specific .phoneblock file
    

Fixes #202

- Remove global <filters> configuration that was applied during process-resources phase
- Keep filtering in maven-war-plugin for deployment-time configuration injection
- Allow developers to compile and test without needing environment-specific .phoneblock file

Fixes haumacher#202
@haumacher haumacher force-pushed the refactor/dkim-library branch from a730ef1 to 0856b31 Compare April 12, 2026 18:58
@haumacher
Copy link
Copy Markdown
Owner

Ich habe den Branch auf den aktuellen master rebased und dabei 2 der 3 Commits verworfen, weil sie nicht mehr aktuell sind:

Verworfen (nicht mehr nötig):

  • chore: Update DKIM library dependency and add JitPack repository — Die java-utils-mail-dkim-Abhängigkeit existiert im aktuellen master nicht mehr. DKIM-Prüfung erfolgt inzwischen ausschließlich über den X-DKIM-Status-Header in MailParser.java, es wird keine externe Bibliothek mehr benötigt. Damit ist auch das JitPack-Repo überflüssig.
  • chore: Fix indentation in pom.xml ... — War nur ein Folge-Fix zum obigen DKIM-Commit und betraf dieselben Zeilen; mit dem Wegfall ebenfalls obsolet.

Behalten (weiterhin relevant):

  • build: Resolve Maven build failure when .phoneblock file is missing — Die globale <filters>.phoneblock</filters>-Konfiguration und das <filtering>true</filtering> auf resources-filtered stehen in master unverändert. Der Fix ist sauber rebased und anwendbar.

Der PR enthält jetzt nur noch diesen einen Commit (force-push mit --force-with-lease).

Restores the resource filtering that injects deployment-time configuration
(database URL, OAuth credentials, SMTP settings) from the .phoneblock file,
and replaces the earlier workaround (removing filtering entirely) with a
maven-enforcer-plugin check that runs in the validate phase.

If .phoneblock is missing, the build now fails early with a clear message
pointing the developer to .phoneblock.template, instead of producing a
confusing resource-filtering error later in the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@haumacher
Copy link
Copy Markdown
Owner

Ich habe einen weiteren Commit ergänzt, der den Ansatz ändert: Die Resource-Filterung wird nicht entfernt, sondern beibehalten — sie wird zum Einweben projekt-spezifischer Werte (DB-URL, OAuth-Credentials, SMTP) ins Build-Artefakt verwendet und ist damit Teil des Deployment-Mechanismus.

Stattdessen prüft jetzt das maven-enforcer-plugin in der validate-Phase, ob .phoneblock existiert, und bricht den Build sonst mit einer klaren Meldung ab, die auf .phoneblock.template als Vorlage verweist:

Configuration file '.phoneblock' is missing.
Copy '.phoneblock.template' to '.phoneblock' and fill in your local values
(database URL, OAuth credentials, SMTP settings). See CLAUDE.md for details.

Damit bleibt das ursprüngliche Problem (unverständlicher Fehler direkt nach Checkout) gelöst, ohne die Deployment-Konfiguration zu verändern.

GitHub Packages requires an authentication token to download artifacts,
which forces every contributor to set up a personal access token before
they can build the project. JitPack serves public Maven artifacts built
on demand from tagged releases without any authentication.

mjSIP is a multi-module Maven project. JitPack builds the whole reactor
and publishes every submodule under the group id com.github.<User>.<Repo>
(note the dot separator between user and repo). Transitive references
between mjsip-ua, mjsip-sip, mjsip-sound, ... are rewritten automatically
by JitPack during the build.

Verified: jitpack.io/com/github/haumacher/mjSIP/2.0.5 builds successfully
and exposes all submodule jars; mvn dependency:resolve pulls mjsip-ua
plus its transitive mjsip-* modules without any credentials.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@haumacher
Copy link
Copy Markdown
Owner

Weiterer Commit ergänzt: Die mjsip-ua-Dependency zieht jetzt über JitPack statt über GitHub Packages — damit entfällt die Notwendigkeit eines GitHub-Tokens für den Build direkt nach dem Checkout (ursprüngliches PR-Ziel).

Trotz Multi-Module-Struktur von haumacher/mjSIP funktioniert das: JitPack baut das komplette Reactor und publiziert jedes Submodul unter com.github.haumacher.mjSIP:<module>. Transitive Referenzen (mjsip-uamjsip-sipmjsip-sound → ...) werden automatisch auf die JitPack-Coordinates umgeschrieben.

Vorab verifiziert über https://jitpack.io/com/github/haumacher/mjSIP/2.0.5 (Build erfolgreich, alle Submodule veröffentlicht) und lokal via mvn dependency:resolve.

@haumacher haumacher merged commit 4d59fb5 into haumacher:master Apr 12, 2026
1 check passed
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.

Cannot build locally because of unavailable dependency org.simplejavamail:utils-mail-dkim:3.2.1-haumacher

2 participants