Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillaumefalourd/maven-cli-jdks-action
Github Action for Maven CLI using JDKs 8, 11, 13, 14, 15, 16 and 17 🤖 ☕️
https://github.com/guillaumefalourd/maven-cli-jdks-action
github-actions jdk jdk11 jdk13 jdk14 jdk15 jdk16 jdk17 jdk8 maven-cli ubuntu-runners useful utilities
Last synced: about 1 month ago
JSON representation
Github Action for Maven CLI using JDKs 8, 11, 13, 14, 15, 16 and 17 🤖 ☕️
- Host: GitHub
- URL: https://github.com/guillaumefalourd/maven-cli-jdks-action
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2021-04-28T13:40:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-14T14:45:16.000Z (over 3 years ago)
- Last Synced: 2024-04-26T09:43:51.289Z (7 months ago)
- Topics: github-actions, jdk, jdk11, jdk13, jdk14, jdk15, jdk16, jdk17, jdk8, maven-cli, ubuntu-runners, useful, utilities
- Language: Shell
- Homepage: https://github.com/marketplace/actions/maven-cli-jdks-action
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Maven CLI JDKs Action
![maven-cli-jdks-action](https://user-images.githubusercontent.com/22433243/116424068-999f4c00-a817-11eb-84ab-3733a2686e0a.png)
Github Action wrapping Maven CLI to run any Maven commands using JDK 8, 11, 13, 14, 15, 16 or 17 based on [Maven DockerHub](https://hub.docker.com/_/maven).
Those commands can be executed on the current repository directory, or in a specific one using a `$DIRECTORY_PATH` environment variable.
## Workflow Demo
```bash
name: CIon:
push:
branches: [ master ]
pull_request:
branches: [ master ]jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout your repository under $GITHUB_WORKSPACE, so your job can access your directories and files
- uses: actions/checkout@v2# Runs a set of commands using the runners shell
- name: Run maven commands
uses: GuillaumeFalourd/maven-cli-jdks-action@main # Default is JDK 11
env:
DIRECTORY_PATH: java # Not mandatory (run on the repo root directory if not informed)
with:
commands: 'clean package test'
```## How does it work?
This workflow use a `Dockerfile` with `Maven` and a specific `JDK` installed to execute a Shell script file `entrypoint.sh` to perfom the following commands:
```bash
if [[ -z $DIRECTORY_PATH ]];
then
echo "DIRECTORY_PATH env isn't set. Running in current directory"
else
echo "Moving to specified directory path"
cd $DIRECTORY_PATH
fiecho "Executing command: mvn $1"
sh -c "mvn $1"
```## How to use a different JDK ?
### For OpenJDK 8
```bash
uses: GuillaumeFalourd/maven-cli-action@jdk8
```### For OpenJDK 11 (`main`)
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@main
```### For OpenJDK 13
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@jdk13
```### For OpenJDK 14
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@jdk14
```### For OpenJDK 15
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@jdk15
```### For OpenJDK 16
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@jdk16
```### For OpenJDK 17
```bash
uses: GuillaumeFalourd/maven-cli-jdks-action@jdk17
```## Licensed
This repository uses the [Apache License 2.0](https://github.com/GuillaumeFalourd/maven-cli-jdks-action/blob/main/LICENSE)