Skip to content

NDViet/test-parent-pom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

250 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a parent POM that is shared across my GitHub repositories.
This is used to centralize versions, plugin setup and common properties to avoid redundancies or duplicate configurations using inheritance between pom files. It helps in easy maintenance in long term.

Dependent repositories

  1. test-automation-fwk
  2. test-java2robot-adapter
  3. test-webdriver-downloader
  4. test-robot-framework
  5. test-testng-framework
  6. test-cucumber-framework

Usage

In the same directory, clone this repository first and after that clone other dependent repositories.

git clone git@github.com:ndviet/test-parent-pom.git

Gradle build, deploy, and release

pom.xml remains the source of truth for the parent POM metadata. Gradle now drives this repository's build and publishing flow by rendering a resolved POM from that template.

Build and verify the generated parent POM:

gradle build

Format Java sources:

gradle formatJava

Install the parent POM to your local Maven cache:

gradle publishToMavenLocal

Deploy a snapshot or release revision to GitHub Packages:

GH_PACKAGES_USERNAME=...
GH_PACKAGES_TOKEN=...
GITHUB_REPOSITORY=ndviet/test-parent-pom
gradle deploy -Prevision=26.3.0-SNAPSHOT

Publish a non-SNAPSHOT release:

GH_PACKAGES_USERNAME=...
GH_PACKAGES_TOKEN=...
GITHUB_REPOSITORY=ndviet/test-parent-pom
gradle release -Prevision=26.3.0

Java base image (for downstream repos)

This repository provides a standalone base image: test-automation-java-base.

It contains:

  • Java 21
  • Maven
  • Gradle CLI
  • Official base image: gradle:jdk21
  • Pre-seeded Maven local repository with the published test-parent-pom artifact
  • Offline-first execution defaults (mvn -o, gradle --offline) to prevent network fetch in downstream runs

Build locally:

./containers/build-java-base-image.sh ghcr.io/ndviet/test-automation-java-base

Tags created:

  • ghcr.io/ndviet/test-automation-java-base:latest
  • ghcr.io/ndviet/test-automation-java-base:<revision> (from <revision> in pom.xml)

GitHub Actions workflow:

  • .github/workflows/publish-java-base-image.yml
  • .github/workflows/publish-maven-github.yml

Workflow tagging behavior:

  • push on master: publishes:
    • ghcr.io/ndviet/test-automation-java-base:latest
    • ghcr.io/ndviet/test-automation-java-base:<revision>-SNAPSHOT
  • push on tag v*: publishes release tags
    • ghcr.io/ndviet/test-automation-java-base:latest
    • ghcr.io/ndviet/test-automation-java-base:<revision-without-SNAPSHOT>

Required repository secrets for publish:

  • GH_PACKAGES_USERNAME
  • GH_PACKAGES_TOKEN

Optional runtime override (if online fetch is intentionally needed):

  • FORCE_MAVEN_OFFLINE=false
  • FORCE_GRADLE_OFFLINE=false

About

Test parent POM is used to structure the entire projects

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors