Skip to content

Commit fd560c2

Browse files
chore: add local build instructions for newcomers
* Add `.sdkmanrc` for Java version management and update README with build instructions
1 parent 5e523f3 commit fd560c2

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

.sdkmanrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Use `sdk env` (or enable sdkman_auto_env) to switch to this JDK.
2+
# Gradle must be launched with Java 21 (see settings.gradle.kts).
3+
java=21.0.8-tem

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,35 @@ Sigstore Java and Sigstore Maven Plugin are signed with both PGP and sigstore.
119119
| ------------- | --------- | ------ |
120120
| 1.0.0 - 2.X.X | https://token.actions.githubusercontent.com | https://github.com/sigstore/sigstore-java/.github/workflows/release-sigstore-java-from-tag.yaml@refs/tags/X.X.X |
121121

122+
## Building locally
123+
124+
Gradle must be **launched** with Java 21, even though the library targets Java 11
125+
(see `settings.gradle.kts`). Using Java 25+ breaks the Spotless formatter.
126+
127+
If you use [sdkman](https://sdkman.io), run `sdk env` to pick up the pinned JDK from
128+
`.sdkmanrc`. Otherwise point `JAVA_HOME` at any Java 21 install.
129+
130+
Some tests start a local [fulcio](https://github.com/sigstore/fulcio) server, so
131+
install it and make sure it is on your `PATH`:
132+
```
133+
go install github.com/sigstore/fulcio@main # installs to $(go env GOPATH)/bin
134+
```
135+
136+
Then build:
137+
```
138+
./gradlew build
139+
```
140+
141+
### Gotchas
142+
- `Could not find org.gradle.kotlin.kotlin-dsl...`: a Gradle init script (e.g.
143+
`~/.gradle/init.d/*.gradle`) is overriding repositories and hiding the plugin
144+
portal. Remove or scope it.
145+
- Spotless reports `NoSuchMethodError ... getDiagnostics()`: you launched Gradle
146+
with Java 25+. Switch to Java 21, then `./gradlew --stop && ./gradlew clean build`
147+
to clear the cached lint failures.
148+
- `Cannot run program "fulcio"`: the fulcio binary is missing from your `PATH`
149+
(see above).
150+
122151
## Troubleshooting
123152

124153
To ensure maximum compatibility with the public Sigstore infrastructure,

0 commit comments

Comments
 (0)