Skip to content

Commit fd75377

Browse files
committed
feat: add java-cache-dependency-path
1 parent bb91f64 commit fd75377

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,27 @@ Read more about software distribution in AWS in my [LinkedIn article](https://ww
5757

5858
## Inputs
5959

60-
This action is a combination of few other actions mainly `actions/setup-java` and `aws-actions/configure-aws-credentials`,
61-
hence all parameters have prefix either `java-` (for java-specific settings) or `aws-` (for authorization in aws)
62-
63-
| Name | Required | Default | Description |
64-
|-------------------------------|----------|-----------------------|------------------------------------------------------------------------------------|
65-
| `aws-account` | **Yes** | | AWS account number where the CodeArtifact domain is located |
66-
| `aws-region` | **Yes** | | AWS region where the CodeArtifact domain is located |
67-
| `aws-role` | **Yes** | `ci/builder` | IAM role to assume for CodeArtifact access |
68-
| `aws-codeartifact-domain` | **Yes** | | CodeArtifact domain name |
69-
| `aws-codeartifact-repository` | **Yes** | `maven` | CodeArtifact repository name |
70-
| `aws-login` | No | `true` | Whether to login to AWS. Set to `false` if you handle AWS login separately |
71-
| `java-version` | No | `21` | Java version to use. Default is latest LTS (21 as of June 2025) |
72-
| `java-distribution` | No | `temurin` | Java distribution. Temurin is recommended as it's pre-cached in ubuntu-latest |
73-
| `java-cache` | No | `maven` | Enable Maven dependency caching. Use empty string `""` to disable |
74-
| `settings-mirrors` | No | | Maven settings.xml mirrors section (XML format) |
75-
| `settings-pluginGroups` | No | | Maven settings.xml pluginGroups section (XML format) |
76-
| `settings-pluginRepositories` | No | Maven Central + repo1 | Additional plugin repositories in XML format to be placed in front of CodeArtifact |
77-
| `settings-profile-properties` | No | | Maven settings.xml profile properties section (XML format) |
78-
| `settings-proxies` | No | | Maven settings.xml proxies section (XML format) |
79-
| `settings-repositories` | No | Maven Central + repo1 | Additional Maven repositories in XML format to be placed before CodeArtifact |
60+
This action is a combination of few other actions mainly `actions/setup-java` and `aws-actions/configure-aws-credentials`.
61+
All `java-*` inputs are pass through parameters to `actions/setup-java` action, so please refer to [setup-java documentation](https://github.com/actions/setup-java?tab=readme-ov-file#usage)
62+
63+
| Name | Required | Default | Description |
64+
|-------------------------------|----------|-----------------------|---------------------------------------------------------------------------------------------------------|
65+
| `aws-account` | **Yes** | | AWS account number where the CodeArtifact domain is located |
66+
| `aws-login` | No | `true` | Whether to login to AWS. Set to `false` if you handle AWS login separately |
67+
| `aws-codeartifact-domain` | **Yes** | | CodeArtifact domain name |
68+
| `aws-codeartifact-repository` | **Yes** | `maven` | CodeArtifact repository name |
69+
| `aws-region` | **Yes** | | AWS region where the CodeArtifact domain is located |
70+
| `aws-role` | No | `ci/builder` | IAM role to assume for CodeArtifact access |
71+
| `java-cache` | No | `maven` | Enable Maven dependency caching. Use empty string `""` to disable |
72+
| `java-cache-dependency-path` | No | (see documentation) | See description at [actions/setup-java](https://github.com/actions/setup-java?tab=readme-ov-file#usage) |
73+
| `java-distribution` | No | `temurin` | Java distribution. Default is Temurin as it is pre-cached in ubuntu-latest |
74+
| `java-version` | No | `21` | Java version to use. Default is latest LTS (21 as of June 2025) |
75+
| `settings-mirrors` | No | | Maven settings.xml mirrors section (XML format) |
76+
| `settings-pluginGroups` | No | | Maven settings.xml pluginGroups section (XML format) |
77+
| `settings-pluginRepositories` | No | Maven Central + repo1 | Additional plugin repositories in XML format to be placed in front of CodeArtifact |
78+
| `settings-profile-properties` | No | | Maven settings.xml profile properties section (XML format) |
79+
| `settings-proxies` | No | | Maven settings.xml proxies section (XML format) |
80+
| `settings-repositories` | No | Maven Central + repo1 | Additional Maven repositories in XML format to be placed before CodeArtifact |
8081

8182
Notes:
8283
1. for `aws-account` it is recommended to have a dedicated AWS account (not dev, not prod) to store artifacts (S3 binaries, CodeArtifact, Docker images)

action.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,39 @@ inputs:
44
aws-account:
55
description: 'AWS account number where the CodeArtifact domain is located'
66
required: true
7-
aws-region:
8-
description: 'AWS region where the CodeArtifact domain is located'
9-
required: true
10-
aws-role:
11-
description: 'IAM role to assume, good option is /ci/builder'
12-
default: 'ci/builder' # this role should have permissions to access CodeArtifact
13-
required: true
7+
aws-login:
8+
description: 'Login to AWS. Could be false if you login in AWS outside of this action'
9+
required: false
10+
default: 'true'
1411
aws-codeartifact-domain:
1512
description: 'CodeArtifact domain name'
1613
required: true
1714
aws-codeartifact-repository:
1815
description: 'CodeArtifact repository name'
1916
default: 'maven' # default repository name
2017
required: true
21-
aws-login:
22-
description: 'Login to AWS. Could be false if you login in AWS outside of this action'
18+
aws-region:
19+
description: 'AWS region where the CodeArtifact domain is located'
20+
required: true
21+
aws-role:
22+
description: 'IAM role to assume, good option is /ci/builder'
23+
default: 'ci/builder' # this role should have permissions to access CodeArtifact
2324
required: false
24-
default: 'true'
2525
java-cache:
2626
description: 'Enabled by default, specify empty string to disable caching'
2727
required: false
2828
default: 'maven'
29-
java-version:
30-
description: 'Java version to use'
29+
java-cache-dependency-path:
30+
description: 'see https://github.com/actions/setup-java "cache-dependency-path"'
3131
required: false
32-
default: '21' # latest LTS as of June 2025
3332
java-distribution:
3433
description: 'Java distribution, use Temurin as it is pre-cached in ubuntu-latest'
3534
required: false
3635
default: 'temurin'
36+
java-version:
37+
description: 'Java version to use'
38+
required: false
39+
default: '21' # latest LTS as of June 2025
3740
settings-mirrors:
3841
description: 'settings.xml mirrors section (optional)'
3942
required: false
@@ -87,7 +90,8 @@ runs:
8790
with:
8891
java-version: ${{ inputs.java-version }}
8992
distribution: ${{ inputs.java-distribution }}
90-
cache: ${{ inputs.java-cache }} # this will give cache inheritance and such cache hit and quick builds on feature branches/PRs
93+
cache: ${{ inputs.java-cache }}
94+
cache-dependency-path: ${{ inputs.java-cache-dependency-path }}
9195

9296
- name: Info
9397
shell: bash

0 commit comments

Comments
 (0)