Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven update maven-war-plugin and add test case #386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: All Tests
on:
push:
schedule:
- cron: 0 0 1 * *
jobs:
test_maven:
strategy:
max-parallel: 3
matrix:
image:
- eclipse-temurin:8-jdk
- adoptopenjdk/openjdk11:jdk-11.0.11_9-debian
- adoptopenjdk/openjdk16:jdk-16.0.1_9-debian
- eclipse-temurin:20-jdk
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
maven:
- 'maven-examples/**'
- '.github/workflows/test.yml'
- name: Define options
run: |
set -x
if [ -n "${JOB_CONTAINER_NAME}" ]; then
echo "options=--volumes-from=${JOB_CONTAINER_NAME}" >> $GITHUB_ENV
else
echo "options=-v ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}" >> $GITHUB_ENV
fi
shell: bash
id: define-options
- name: Test Maven project updates
uses: addnab/docker-run-action@v3
if: github.event.schedule == '0 0 1 * *' || steps.changed-files-yaml.outputs.maven_any_changed == 'true'
with:
image: ${{ matrix.image }}
options: ${{ env.options || steps.define-options.outputs.options }} --rm
run: |
cd ${{ github.workspace }}/maven-examples/maven-example
./mvnw clean package
17 changes: 17 additions & 0 deletions maven-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Maven Examples

## Prerequisites

Ensure the JDK is installed locally.

Apt example:
```sh
sudo apt install openjdk-21-jdk-headless
```

## Running Locally

```sh
cd ./maven-example
./mvnw package
```
2 changes: 1 addition & 1 deletion maven-examples/maven-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading