Coder Social home page Coder Social logo

guillaumefalourd / maven-cli-jdks-action Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 27 KB

Github Action for Maven CLI using JDKs 8, 11, 13, 14, 15, 16 and 17 ๐Ÿค– โ˜•๏ธ

Home Page: https://github.com/marketplace/actions/maven-cli-jdks-action

License: Apache License 2.0

Dockerfile 28.00% Shell 72.00%
maven-cli jdk github-actions jdk8 jdk11 jdk13 jdk14 jdk15 jdk16 jdk17 utilities useful ubuntu-runners

maven-cli-jdks-action's Introduction

Maven CLI JDKs Action

maven-cli-jdks-action

Github Action wrapping Maven CLI to run any Maven commands using JDK 8, 11, 13, 14, 15, 16 or 17 based on Maven DockerHub.

Those commands can be executed on the current repository directory, or in a specific one using a $DIRECTORY_PATH environment variable.

Workflow Demo

name: CI

on:
  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:

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
fi

echo "Executing command: mvn $1"

sh -c "mvn $1"

How to use a different JDK ?

For OpenJDK 8

uses: GuillaumeFalourd/maven-cli-action@jdk8

For OpenJDK 11 (main)

uses: GuillaumeFalourd/maven-cli-jdks-action@main

For OpenJDK 13

uses: GuillaumeFalourd/maven-cli-jdks-action@jdk13

For OpenJDK 14

uses: GuillaumeFalourd/maven-cli-jdks-action@jdk14

For OpenJDK 15

uses: GuillaumeFalourd/maven-cli-jdks-action@jdk15

For OpenJDK 16

uses: GuillaumeFalourd/maven-cli-jdks-action@jdk16

For OpenJDK 17

uses: GuillaumeFalourd/maven-cli-jdks-action@jdk17

Licensed

This repository uses the Apache License 2.0

maven-cli-jdks-action's People

Contributors

guillaumefalourd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.