11# GitHub Actions Java
22
3- A collection of GitHub actions for Java projects.
3+ A collection of GitHub actions for Java projects with Maven and Gradle support .
44
55## Actions
66
@@ -11,64 +11,73 @@ This action will set up the Java SDK.
1111#### Example:
1212
1313``` yaml
14- - uses : aboutbits/github-actions-java/setup@v3
14+ # Maven
15+ - uses : aboutbits/github-actions-java/setup-with-maven@v4
16+
17+ # Gradle
18+ - uses : aboutbits/github-actions-java/setup-with-gradle@v4
1519` ` `
1620
1721#### Inputs
1822
1923The following inputs can be used as ` step.with` keys:
2024
21- | Name | Required/Default | Description |
22- |---------------------|------------------------|------------------------------------------------------------------|
23- | `working-directory` | `.` | The working directory |
24- | `java-version` | `21` | Java Version |
25- | `distribution` | `corretto` | Java Distribution |
26- | `cache` | `true` | Enable Maven dependency caching. |
27- | `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. |
25+ | Name | Required/Default | Description |
26+ |---------------------|------------------------|------------------------------------------------------------------------------------------------------- |
27+ | `working-directory` | `.` | The working directory |
28+ | `java-version` | `21` | Java Version |
29+ | `distribution` | `corretto` | Java Distribution |
30+ | `cache` | `true` | Enable Maven/Gradle dependency caching. |
31+ | `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. (Not applicable when Gradle is used) |
2832
2933# ### Outputs
3034
3135The following outputs are forwarded from the underlying `setup-java` and `cache` actions :
3236
33- | Name | Description |
34- |----------------|-----------------------------------------------------------------------------|
35- | `distribution` | Distribution of Java that has been installed. |
36- | `version` | Actual version of the java environment that has been installed. |
37- | `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
38- | `cache-hit` | A boolean value to indicate an exact match was found for the primary key. |
37+ | Name | Description |
38+ |----------------|---------------------------------------------------------------------------------------------------------------- |
39+ | `distribution` | Distribution of Java that has been installed. |
40+ | `version` | Actual version of the java environment that has been installed. |
41+ | `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
42+ | `cache-hit` | A boolean value to indicate an exact match was found for the primary key. (Not applicable when Gradle is used) |
3943
4044# ## Setup Java and Install Dependencies
4145
4246This action will set up the Java SDK and install all dependencies.
47+ You can choose between the Maven and Gradle build tool.
4348
4449# ### Example:
4550
4651` ` ` yaml
47- - uses: aboutbits/github-actions-java/setup-and-install@v3
52+ # Maven
53+ - uses: aboutbits/github-actions-java/setup-and-install-with-maven@v4
54+
55+ # Gradle
56+ - uses: aboutbits/github-actions-java/setup-and-install-with-gradle@v4
4857` ` `
4958
5059# ### Inputs
5160
5261The following inputs can be used as `step.with` keys :
5362
54- | Name | Required/Default | Description |
55- |---------------------|------------------------|------------------------------------------------------------------|
56- | `working-directory` | `.` | The working directory |
57- | `java-version` | `21` | Java Version |
58- | `distribution` | `corretto` | Java Distribution |
59- | `cache` | `true` | Enable Maven dependency caching. |
60- | `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. |
63+ | Name | Required/Default | Description |
64+ |---------------------|------------------------|------------------------------------------------------------------------------------------------------- |
65+ | `working-directory` | `.` | The working directory |
66+ | `java-version` | `21` | Java Version |
67+ | `distribution` | `corretto` | Java Distribution |
68+ | `cache` | `true` | Enable Maven/Gradle dependency caching. |
69+ | `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. (Not applicable when Gradle is used) |
6170
6271# ### Outputs
6372
6473The following outputs are forwarded from the underlying `setup-java` and `cache` actions :
6574
66- | Name | Description |
67- |----------------|-----------------------------------------------------------------------------|
68- | `distribution` | Distribution of Java that has been installed. |
69- | `version` | Actual version of the java environment that has been installed. |
70- | `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
71- | `cache-hit` | A boolean value to indicate an exact match was found for the primary key. |
75+ | Name | Description |
76+ |----------------|---------------------------------------------------------------------------------------------------------------- |
77+ | `distribution` | Distribution of Java that has been installed. |
78+ | `version` | Actual version of the java environment that has been installed. |
79+ | `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
80+ | `cache-hit` | A boolean value to indicate an exact match was found for the primary key. (Not applicable when Gradle is used) |
7281
7382# # Versioning
7483
@@ -78,16 +87,16 @@ versions.
7887Creating a new minor release :
7988
8089` ` ` bash
81- git tag v3
90+ git tag v4
8291git push --tags
8392` ` `
8493
8594Replacing an already existing minor release :
8695
8796` ` ` bash
88- git tag -d v3
97+ git tag -d v4
8998git push origin :refs/tags/v3
90- git tag v3
99+ git tag v4
91100git push --tags
92101` ` `
93102
0 commit comments