mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-04-15 01:22:17 +08:00
Compare commits
No commits in common. "main" and "v1.0.0" have entirely different histories.
23
.github/workflows/auto-approve.yml
vendored
23
.github/workflows/auto-approve.yml
vendored
@ -1,10 +1,25 @@
|
|||||||
name: Auto Approve
|
name: Auto approve
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target
|
pull_request_target
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-approve:
|
auto-approve:
|
||||||
uses: s4u/.github/.github/workflows/auto-approve.yml@master
|
runs-on: ubuntu-latest
|
||||||
secrets:
|
steps:
|
||||||
TECH_TOKEN: ${{ secrets.TECH_TOKEN }}
|
|
||||||
|
- uses: alexwilson/enable-github-automerge-action@1.0.0
|
||||||
|
if: >
|
||||||
|
github.actor == 'dependabot[bot]'
|
||||||
|
|| github.actor == 'dependabot-preview[bot]'
|
||||||
|
with:
|
||||||
|
merge-method: "REBASE"
|
||||||
|
github-token: "${{ secrets.TECH_TOKEN }}"
|
||||||
|
|
||||||
|
- uses: hmarr/auto-approve-action@v2.1.0
|
||||||
|
if: >
|
||||||
|
github.actor == 'dependabot[bot]'
|
||||||
|
|| github.actor == 'dependabot-preview[bot]'
|
||||||
|
|| github.actor == 'slawekjaranowski'
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.TECH_TOKEN }}"
|
||||||
|
|||||||
14
.github/workflows/release-drafter.yml
vendored
14
.github/workflows/release-drafter.yml
vendored
@ -4,10 +4,18 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'main'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
name: Update Release Draft
|
name: Update Release Draft
|
||||||
uses: s4u/.github/.github/workflows/release-drafter.yml@master
|
runs-on: ubuntu-latest
|
||||||
|
concurrency: release-drafter
|
||||||
|
|
||||||
|
if: >
|
||||||
|
github.repository_owner == 's4u'
|
||||||
|
&& !startsWith(github.event.head_commit.message , '[maven-release-plugin]')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: release-drafter/release-drafter@v5.15.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
@ -2,11 +2,9 @@ name: Test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- 'main'
|
- 'dependabot/**'
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '22 23 * * 5'
|
- cron: '22 23 * * 5'
|
||||||
@ -18,45 +16,21 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||||
java: [ '8', '11', '17', '21', '25' ]
|
java: [ '8', '11', '16' ]
|
||||||
maven: [ '3.8.8', '3.9.14' ]
|
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
|
java-cache: maven
|
||||||
maven-version: ${{ matrix.maven }}
|
maven-version: ${{ matrix.maven }}
|
||||||
cache-prefix: 'test-prefix-'
|
|
||||||
|
|
||||||
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
test-default:
|
|
||||||
name: Test with defaults
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
|
|
||||||
- uses: ./
|
|
||||||
|
|
||||||
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.14
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
test-ok:
|
|
||||||
name: Test OK
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ test, test-default ]
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- run: 'true'
|
|
||||||
if: join(needs.*.result, ',') == 'success,success'
|
|
||||||
|
|
||||||
- run: 'false'
|
|
||||||
if: join(needs.*.result, ',') != 'success,success'
|
|
||||||
|
|||||||
102
README.md
102
README.md
@ -1,94 +1,48 @@
|
|||||||
# Setup Maven Action
|
# Setup Maven with settings.xml
|
||||||
[](https://github.com/s4u/setup-maven-action/actions/workflows/test.yml)
|
[](https://github.com/s4u/setup-maven-action/actions/workflows/test.yml)
|
||||||
|
|
||||||
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
|
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
|
||||||
|
|
||||||
- [actions/checkout](https://github.com/marketplace/actions/checkout)
|
|
||||||
- [actions/setup-java](https://github.com/marketplace/actions/setup-java-jdk)
|
- [actions/setup-java](https://github.com/marketplace/actions/setup-java-jdk)
|
||||||
- [actions/cache](https://github.com/marketplace/actions/cache)
|
|
||||||
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
|
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
|
||||||
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
|
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
|
||||||
|
|
||||||
:exclamation: You **should not** include above actions in your configuration - in other case those will be **called twice**. :exclamation:
|
# Contributions
|
||||||
|
- Contributions are welcome!
|
||||||
|
- Give :star: - if you want to encourage me to work on a project
|
||||||
|
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
|
||||||
|
|
||||||
For default values you only need:
|
# Project versioning
|
||||||
|
This project uses [Semantic Versioning](https://semver.org/).
|
||||||
|
We recommended to use the latest and specific release version.
|
||||||
|
|
||||||
```yml
|
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
|
||||||
steps:
|
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
|
||||||
|
|
||||||
- name: Setup Maven Action
|
|
||||||
uses: s4u/setup-maven-action@< version >
|
|
||||||
|
|
||||||
- run: mvn -V ...
|
|
||||||
```
|
|
||||||
|
|
||||||
# Params mapping for sub actions
|
# Params mapping for sub actions
|
||||||
|
|
||||||
## checkout
|
|
||||||
|
|
||||||
| params | destination | default |
|
|
||||||
|------------------------------|---------------------|--------------------------|
|
|
||||||
| checkout-enabled | enabled | true |
|
|
||||||
| checkout-fetch-depth | fetch-depth | |
|
|
||||||
| checkout-submodules | submodules | |
|
|
||||||
| checkout-path | path | |
|
|
||||||
| checkout-ref | ref | |
|
|
||||||
| checkout-repository | repository | ${{ github.repository }} |
|
|
||||||
| checkout-token | token | ${{ github.token }} |
|
|
||||||
| checkout-ssh-key | ssh-key | |
|
|
||||||
| checkout-persist-credentials | persist-credentials | false |
|
|
||||||
|
|
||||||
## setup-java
|
## setup-java
|
||||||
|
|
||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|-------------------|--------------|---------|
|
| ----------------- |------------- |-------- |
|
||||||
| java-version | java-version | 17 |
|
| java-version | java-version | |
|
||||||
| java-distribution | distribution | zulu |
|
| java-distribution | distribution | temurin |
|
||||||
| java-jdkFile | jdkFile | |
|
| java-cache | cache | |
|
||||||
|
|
||||||
## cache
|
|
||||||
|
|
||||||
A cache action is configured as:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- uses: actions/cache
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ inputs.cache-path }}
|
|
||||||
${{ inputs.cache-path-add }}
|
|
||||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
|
||||||
```
|
|
||||||
|
|
||||||
So we can use for action:
|
|
||||||
|
|
||||||
| params | description |
|
|
||||||
|----------------|----------------------------------------------------------|
|
|
||||||
| cache-enabled | enable cache. Default true |
|
|
||||||
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
|
||||||
| cache-path-add | additional value for cache path |
|
|
||||||
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
|
||||||
|
|
||||||
|
|
||||||
## setup-maven
|
## setup-maven
|
||||||
|
|
||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|---------------|---------------|---------|
|
| ------------- |-------------- |-------- |
|
||||||
| maven-version | maven-version | 3.9.14 |
|
| maven-version | maven-version | 3.8.1 |
|
||||||
|
|
||||||
## maven-settings-action
|
## maven-settings-action
|
||||||
|
|
||||||
| params | destination |
|
| params | destination |
|
||||||
|-----------------------------|--------------------|
|
| -------------------------- |------------------ |
|
||||||
| settings-servers | servers |
|
| settings-servers | servers |
|
||||||
| settings-mirrors | mirrors |
|
| settings-mirrors | mirrors |
|
||||||
| settings-properties | properties |
|
| settings-properties | properties |
|
||||||
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
||||||
| settings-proxies | proxies |
|
|
||||||
| settings-repositories | repositories |
|
|
||||||
| settings-pluginRepositories | pluginRepositories |
|
|
||||||
| settings-githubServer | githubServer |
|
|
||||||
| settings-path | path |
|
|
||||||
|
|
||||||
# Testing against different Maven versions
|
# Testing against different Maven versions
|
||||||
|
|
||||||
@ -100,35 +54,21 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
maven: [ '3.8.8', '3.9.8' ]
|
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||||
|
|
||||||
name: Maven ${{ matrix.maven }} sample
|
name: Maven ${{ matrix.maven }} sample
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Maven Action
|
- name: Setup Maven
|
||||||
uses: s4u/setup-maven-action@< version >
|
uses: setup-maven@v1.0.0
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 8
|
||||||
maven-version: ${{ matrix.maven }}
|
maven-version: ${{ matrix.maven }}
|
||||||
|
|
||||||
- run: mvn -V ...
|
- run: mvn -V ...
|
||||||
```
|
```
|
||||||
|
|
||||||
# Contributions
|
|
||||||
|
|
||||||
- Contributions are welcome!
|
|
||||||
- Give :star: - if you want to encourage me to work on a project
|
|
||||||
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
|
|
||||||
|
|
||||||
# Project versioning
|
|
||||||
|
|
||||||
This project uses [Semantic Versioning](https://semver.org/).
|
|
||||||
We recommended using the latest and specific release version.
|
|
||||||
|
|
||||||
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
|
|
||||||
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
|
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||||
|
|||||||
160
action.yml
160
action.yml
@ -1,5 +1,5 @@
|
|||||||
name: 'Setup Maven Action'
|
name: 'Setup Maven with settings.xml'
|
||||||
description: 'Complete environment configuration for Maven builds'
|
description: 'Setup environment for Maven build'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'settings'
|
icon: 'settings'
|
||||||
@ -7,177 +7,75 @@ branding:
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
|
||||||
# checkout
|
|
||||||
checkout-enabled:
|
|
||||||
description: 'Enable checkout'
|
|
||||||
default: 'true'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-fetch-depth:
|
|
||||||
description: 'Number of commits to fetch'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-submodules:
|
|
||||||
description: 'Whether to fetch submodules'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-path:
|
|
||||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-persist-credentials:
|
|
||||||
description: 'Whether to configure the token or SSH key with the local git config'
|
|
||||||
default: 'false'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-ref:
|
|
||||||
description: 'The branch, tag, or SHA of the repository to clone'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
checkout-repository:
|
|
||||||
description: 'The repository to checkout if not the repository that triggered the action. For use when building GitHub Apps'
|
|
||||||
required: false
|
|
||||||
default: ${{ github.repository }}
|
|
||||||
|
|
||||||
checkout-token:
|
|
||||||
description: 'Token to use for checkout if checking out a repository out of scope for GITHUB_TOKEN'
|
|
||||||
required: false
|
|
||||||
default: ${{ github.token }}
|
|
||||||
|
|
||||||
checkout-ssh-key:
|
|
||||||
description: 'SSH key used to fetch the repository. It allows to run authenticated git commands'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
# java jdk params
|
# java jdk params
|
||||||
|
|
||||||
java-version:
|
java-version:
|
||||||
description: 'The Java version to set up'
|
description: 'The Java version to set up'
|
||||||
default: '17'
|
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
java-distribution:
|
java-distribution:
|
||||||
description: 'Java distribution'
|
description: 'Java distribution'
|
||||||
default: 'zulu'
|
default: 'temurin'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
java-jdkFile:
|
java-cache:
|
||||||
description: 'Java JDK compressed file location'
|
description: 'Name of the build platform to cache dependencies. It should be "maven" or empty.'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
# cache
|
|
||||||
cache-enabled:
|
|
||||||
description: 'Enable cache'
|
|
||||||
default: 'true'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
cache-prefix:
|
|
||||||
description: 'Cache key prefix'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
cache-path:
|
|
||||||
description: 'Cache path'
|
|
||||||
default: '~/.m2/repository'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
cache-path-add:
|
|
||||||
description: 'Additional item for cache path'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
# maven version
|
# maven version
|
||||||
maven-version:
|
maven-version:
|
||||||
description: 'The Maven version to set up'
|
description: 'The Maven version to set up'
|
||||||
default: '3.9.14'
|
default: 3.8.1
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
# maven settings.xml
|
# maven settings.xml
|
||||||
settings-servers:
|
settings-servers:
|
||||||
description: 'servers definition in json array, e.g.: [{"id": "serverId", "username": "username", "password": "password"}]'
|
description: 'servers definition in json array, eg: [{"id": "serverId", "username": "username", "password": "password"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-mirrors:
|
settings-mirrors:
|
||||||
description: 'mirrors definition in json array, e.g.: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
|
description: 'mirrors definition in json array, eg: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-properties:
|
settings-properties:
|
||||||
description: 'json array with properties, e.g.: [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
description: 'json array with properties, eg [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-sonatypeSnapshots:
|
settings-sonatypeSnapshots:
|
||||||
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
|
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-proxies:
|
|
||||||
description: 'proxies definition in json array, e.g.: [{"id": "http-proxy", "active": "true", "protocol": "http", "host": "host", "port": "port", "nonProxyHosts": "host1|host2"}]'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
settings-repositories:
|
|
||||||
description: 'repository settings definition in json array, e.g.: [ { "id": "repoId","name": "repoName","url": "url","snapshots": { "enabled": true } } ]'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
settings-pluginRepositories:
|
|
||||||
description: 'plugin repository settings definition in json array, e.g.: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
settings-githubServer:
|
|
||||||
description: 'add to settings.xml servers server-id: github; username=$GITHUB_ACTOR and password=$GITHUB_TOKEN'
|
|
||||||
default: "true"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
settings-path:
|
|
||||||
description: 'override default path to settings.xml which is $HOME/.m2/settings.xml'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- run: echo "::group::Setup Java"
|
||||||
if: inputs.checkout-enabled == 'true'
|
shell: bash
|
||||||
with:
|
- uses: actions/setup-java@v2.3.0
|
||||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
|
||||||
submodules: '${{ inputs.checkout-submodules }}'
|
|
||||||
path: '${{ inputs.checkout-path }}'
|
|
||||||
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
|
||||||
ref: '${{ inputs.checkout-ref }}'
|
|
||||||
repository: '${{ inputs.checkout-repository }}'
|
|
||||||
token: '${{ inputs.checkout-token }}'
|
|
||||||
ssh-key: '${{ inputs.checkout-ssh-key }}'
|
|
||||||
|
|
||||||
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
|
|
||||||
with:
|
with:
|
||||||
overwrite-settings: false
|
overwrite-settings: false
|
||||||
java-version: '${{ inputs.java-version }}'
|
java-version: '${{ inputs.java-version }}'
|
||||||
distribution: '${{ inputs.java-distribution }}'
|
distribution: '${{ inputs.java-distribution }}'
|
||||||
jdkFile: '${{ inputs.java-jdkFile }}'
|
cache: '${{ inputs.java-cache }}'
|
||||||
|
- run: echo "::endgroup::"
|
||||||
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
||||||
if: inputs.cache-enabled == 'true'
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ inputs.cache-path }}
|
|
||||||
${{ inputs.cache-path-add }}
|
|
||||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
|
||||||
|
|
||||||
- name: Installed Maven version
|
|
||||||
run: echo "version=$(mvn -q -v)" >> $GITHUB_OUTPUT
|
|
||||||
shell: bash
|
shell: bash
|
||||||
id: current-maven
|
|
||||||
|
|
||||||
- uses: stCarolas/setup-maven@12eb41b233df95d49b0c11fc1b5bc8312e5d4ce0 # v5.1
|
- run: echo "::group::Setup Maven Version"
|
||||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
shell: bash
|
||||||
|
- uses: stCarolas/setup-maven@v4.1
|
||||||
with:
|
with:
|
||||||
maven-version: '${{ inputs.maven-version }}'
|
maven-version: '${{ inputs.maven-version }}'
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- uses: s4u/maven-settings-action@894661b3ddae382f1ae8edbeab60987e08cf0788 # v4.0.0
|
- run: echo "::group::Prepare Maven settings.xml"
|
||||||
|
shell: bash
|
||||||
|
- uses: s4u/maven-settings-action@v2.4.1
|
||||||
with:
|
with:
|
||||||
servers: '${{ inputs.settings-servers }}'
|
servers: '${{ inputs.settings-servers}}'
|
||||||
mirrors: '${{ inputs.settings-mirrors }}'
|
mirrors: '${{ inputs.settings-mirrors}}'
|
||||||
properties: '${{ inputs.settings-properties }}'
|
properties: '${{ inputs.settings-properties}}'
|
||||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots }}'
|
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'
|
||||||
proxies: '${{ inputs.settings-proxies }}'
|
- run: echo "::endgroup::"
|
||||||
repositories: '${{ inputs.settings-repositories }}'
|
shell: bash
|
||||||
pluginRepositories: '${{ inputs.settings-pluginRepositories }}'
|
|
||||||
githubServer: '${{ inputs.settings-githubServer }}'
|
|
||||||
path: '${{ inputs.settings-path }}'
|
|
||||||
|
|||||||
34
pom.xml
34
pom.xml
@ -36,6 +36,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<require.maven/>
|
<require.maven/>
|
||||||
<require.java/>
|
<require.java/>
|
||||||
|
<_require.java/>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -43,10 +44,11 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.0.0-M3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
|
<goal>display-info</goal>
|
||||||
<goal>enforce</goal>
|
<goal>enforce</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<phase>validate</phase>
|
<phase>validate</phase>
|
||||||
@ -55,7 +57,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<rules>
|
<rules>
|
||||||
<requireJavaVersion>
|
<requireJavaVersion>
|
||||||
<version>${require.java}</version>
|
<version>${_require.java}</version>
|
||||||
</requireJavaVersion>
|
</requireJavaVersion>
|
||||||
<requireMavenVersion>
|
<requireMavenVersion>
|
||||||
<version>[${require.maven}]</version>
|
<version>[${require.maven}]</version>
|
||||||
@ -65,4 +67,32 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>java8-version-label</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>require.java</name>
|
||||||
|
<value>8</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<_require.java>1.8</_require.java>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>non-java8-version-label</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>require.java</name>
|
||||||
|
<value>!8</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<_require.java>${require.java}</_require.java>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user