You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ Currently, the following distributions are supported:
69
69
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle and maven. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
74
75
@@ -99,6 +100,19 @@ steps:
99
100
run: mvn -B package --file pom.xml
100
101
```
101
102
103
+
#### Caching sbt dependencies
104
+
```yaml
105
+
steps:
106
+
- uses: actions/checkout@v3
107
+
- uses: actions/setup-java@v3
108
+
with:
109
+
distribution: 'temurin'
110
+
java-version: '11'
111
+
cache: 'sbt'
112
+
- name: Build with SBT
113
+
run: sbt package
114
+
```
115
+
102
116
### Check latest
103
117
In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download.
0 commit comments