mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-13 00:05:10 +08:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57ca7f1a81 | |||
| 41e894b5c6 | |||
| c1ef1c9458 | |||
| fe0723070c | |||
| f416ae1666 | |||
| 428a7bd6a8 | |||
| 7b66d0ca2e | |||
| 2dce5ee2b1 | |||
| e912d59387 | |||
| 721df57437 | |||
| 21adf11259 | |||
| 94605e0cdf | |||
| ff947fe3e9 | |||
| 35afc95be0 | |||
| 4f918ce4df | |||
| e3f10494a8 | |||
| 7cf09e2e6e | |||
| deb771502d | |||
| e5734e3ce7 | |||
| fc8e36b653 | |||
| 8c7ad20804 | |||
| 4e0b434104 | |||
| bb348407a1 | |||
| b185da4934 | |||
| 4fdbe2a6a7 | |||
| 6f549063f4 | |||
| 615b14550f |
12
.github/workflows/release-drafter.yml
vendored
12
.github/workflows/release-drafter.yml
vendored
@ -9,14 +9,4 @@ on:
|
||||
jobs:
|
||||
update_release_draft:
|
||||
name: Update Release Draft
|
||||
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.20.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: s4u/.github/.github/workflows/release-drafter.yml@master
|
||||
|
||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -19,13 +19,13 @@ jobs:
|
||||
matrix:
|
||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||
java: [ '8', '11', '17' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.6' ]
|
||||
maven: [ '3.8.8', '3.9.4' ]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
@ -41,13 +41,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
java-version: 8
|
||||
|
||||
- run: mvn -V validate -Drequire.java=8 -Drequire.maven=3.8.6
|
||||
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.4
|
||||
shell: bash
|
||||
|
||||
test-ok:
|
||||
|
||||
54
README.md
54
README.md
@ -9,37 +9,37 @@ This is composite action which help to prepare GitHub Actions environment for Ma
|
||||
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
|
||||
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
|
||||
|
||||
# Contributions
|
||||
:exclamation: You **should not** include above actions in your configuration - in other case those will be **called twice**. :exclamation:
|
||||
|
||||
- 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
|
||||
```yml
|
||||
steps:
|
||||
|
||||
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).
|
||||
- name: Setup Maven Action
|
||||
uses: s4u/setup-maven-action@< version >
|
||||
|
||||
- run: mvn -V ...
|
||||
```
|
||||
|
||||
# Params mapping for sub actions
|
||||
|
||||
**Notice** when used this action you should not used mentioned below actions again.
|
||||
|
||||
## checkout
|
||||
|
||||
| params | destination | default |
|
||||
|------------------------------|---------------------|---------|
|
||||
| checkout-fetch-depth | fetch-depth | |
|
||||
| checkout-path | path | |
|
||||
| checkout-persist-credentials | persist-credentials | false |
|
||||
| params | destination | default |
|
||||
|------------------------------|---------------------|--------------------------|
|
||||
| checkout-fetch-depth | fetch-depth | |
|
||||
| checkout-path | path | |
|
||||
| checkout-ref | ref | |
|
||||
| checkout-repository | repository | ${{ github.repository }} |
|
||||
| checkout-token | token | ${{ github.token }} |
|
||||
| checkout-persist-credentials | persist-credentials | false |
|
||||
|
||||
## setup-java
|
||||
|
||||
| params | destination | default |
|
||||
|-------------------|--------------|---------|
|
||||
| java-version | java-version | |
|
||||
| java-version | java-version | 17 |
|
||||
| java-distribution | distribution | temurin |
|
||||
|
||||
## cache
|
||||
@ -69,7 +69,7 @@ So we can use for action:
|
||||
|
||||
| params | destination | default |
|
||||
|---------------|---------------|---------|
|
||||
| maven-version | maven-version | 3.8.6 |
|
||||
| maven-version | maven-version | 3.9.4 |
|
||||
|
||||
## maven-settings-action
|
||||
|
||||
@ -90,7 +90,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.6' ]
|
||||
maven: [ '3.8.8', '3.9.4' ]
|
||||
|
||||
name: Maven ${{ matrix.maven }} sample
|
||||
|
||||
@ -105,6 +105,20 @@ jobs:
|
||||
- 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
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
|
||||
27
action.yml
27
action.yml
@ -21,11 +21,25 @@ inputs:
|
||||
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 }}
|
||||
|
||||
# java jdk params
|
||||
|
||||
java-version:
|
||||
description: 'The Java version to set up'
|
||||
default: '17'
|
||||
required: true
|
||||
|
||||
java-distribution:
|
||||
@ -50,7 +64,7 @@ inputs:
|
||||
# maven version
|
||||
maven-version:
|
||||
description: 'The Maven version to set up'
|
||||
default: '3.8.6'
|
||||
default: '3.9.4'
|
||||
required: false
|
||||
|
||||
# maven settings.xml
|
||||
@ -75,11 +89,14 @@ runs:
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
||||
path: '${{ inputs.checkout-path }}'
|
||||
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
||||
ref: '${{ inputs.checkout-ref }}'
|
||||
repository: '${{ inputs.checkout-repository }}'
|
||||
token: '${{ inputs.checkout-token }}'
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
@ -96,16 +113,16 @@ runs:
|
||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
||||
|
||||
- name: Installed Maven version
|
||||
run: echo "::set-output name=version::$(mvn -q -v)"
|
||||
run: echo "version=$(mvn -q -v)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
id: current-maven
|
||||
|
||||
- uses: stCarolas/setup-maven@v4.4
|
||||
- uses: stCarolas/setup-maven@v4.5
|
||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
||||
with:
|
||||
maven-version: '${{ inputs.maven-version }}'
|
||||
|
||||
- uses: s4u/maven-settings-action@v2.6.0
|
||||
- uses: s4u/maven-settings-action@v2.8.0
|
||||
with:
|
||||
servers: '${{ inputs.settings-servers}}'
|
||||
mirrors: '${{ inputs.settings-mirrors}}'
|
||||
|
||||
34
pom.xml
34
pom.xml
@ -36,7 +36,6 @@
|
||||
<properties>
|
||||
<require.maven/>
|
||||
<require.java/>
|
||||
<_require.java/>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@ -44,11 +43,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>display-info</goal>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<phase>validate</phase>
|
||||
@ -57,7 +55,7 @@
|
||||
<configuration>
|
||||
<rules>
|
||||
<requireJavaVersion>
|
||||
<version>${_require.java}</version>
|
||||
<version>${require.java}</version>
|
||||
</requireJavaVersion>
|
||||
<requireMavenVersion>
|
||||
<version>[${require.maven}]</version>
|
||||
@ -67,32 +65,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user