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
{{ message }}
Repository navigation
Commit e40a8e0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,8 @@ For more details, see the full release notes on the [releases page](https://git
53
53
54
54
-`set-default`: Set to `false` to install a JDK without making it the default. When `false`, `JAVA_HOME` and `PATH` are not updated, but `JAVA_HOME_<major>_<arch>` is still set so the JDK remains discoverable. Default value: `true`. See [Installing JDK without setting as default](docs/advanced-usage.md#Installing-JDK-without-setting-as-default) for more details.
55
55
56
+
-`problem-matcher`: Set to `false` to disable Java problem matcher annotations (compiler diagnostics and uncaught exceptions). Default value: `true`. See [Java problem matcher](docs/advanced-usage.md#java-problem-matcher-compiler-annotations) for details and annotation limits.
57
+
56
58
-`verify-signature`: Verifies downloaded Java package signatures when supported by the selected distribution. Currently supported for `temurin` and `microsoft`. If set to `true` for unsupported distributions, the action fails.
57
59
58
60
-`verify-signature-public-key`: ASCII-armored GPG public key used to verify the downloaded package signature. Overrides the default bundled key for the selected distribution.
Copy file name to clipboardExpand all lines: action.yml
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,10 @@ inputs:
94
94
description: 'Whether Maven should print artifact download/transfer progress to the build log. When "false" (default) the action sets "-ntp" (--no-transfer-progress) in MAVEN_ARGS to produce cleaner logs. Set to "true" to keep the progress output. Has no effect on non-Maven builds.'
95
95
required: false
96
96
default: false
97
+
problem-matcher:
98
+
description: 'Whether to register the Java problem matcher (compiler errors/warnings and uncaught exceptions). Set to "false" to disable annotations.'
99
+
required: false
100
+
default: true
97
101
outputs:
98
102
distribution:
99
103
description: 'Distribution of Java that has been installed'
Profile-gated plugins, conditionally-active modules, and artifacts a plugin
411
411
fetches at execution time may still be missed. For the most complete cache,
412
412
seed with the fullest goal set your CI actually uses (for example
413
-
`mvn -B verify`with every profile enabled).
413
+
`mvn verify`with every profile enabled).
414
414
- **Multi-module projects:** run the seed at the reactor root so every module's
415
415
plugins are resolved.
416
416
@@ -585,7 +585,7 @@ jobs:
585
585
java-version: '11'
586
586
587
587
- name: Build with Maven
588
-
run: mvn -B package --file pom.xml
588
+
run: mvn package --file pom.xml
589
589
590
590
- name: Publish to GitHub Packages Apache Maven
591
591
run: mvn deploy
@@ -743,7 +743,7 @@ jobs:
743
743
settings-path: ${{ github.workspace }} # location for the settings.xml file
744
744
745
745
- name: Build with Maven
746
-
run: mvn -B package --file pom.xml
746
+
run: mvn package --file pom.xml
747
747
748
748
- name: Publish to GitHub Packages Apache Maven
749
749
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
@@ -773,26 +773,27 @@ jobs:
773
773
show-download-progress: true # keep Maven download/transfer progress in the logs
774
774
775
775
- name: Build with Maven
776
-
run: mvn -B package --file pom.xml
776
+
run: mvn package --file pom.xml
777
777
```
778
778
779
779
***NOTES***:
780
780
- `MAVEN_ARGS`is honored by Maven 3.9.0+ and the Maven Wrapper (`mvnw`). Older Maven versions ignore it, so on those you can pass `--no-transfer-progress` on the command line instead.
781
781
- This setting only affects Maven. It has no effect on Gradle, sbt, or other build tools.
782
-
- `-ntp`only controls transfer/progress output; it does not change whether Maven runs in batch mode. Use `-B`/`--batch-mode` (or `<interactiveMode>false</interactiveMode>` in `settings.xml`) if you also want non-interactive runs.
782
+
- `-ntp` only controls transfer/progress output. The `settings.xml` generated by `setup-java` separately sets `<interactiveMode>false</interactiveMode>`. If you use `overwrite-settings: false`, ensure your existing settings disable interactive mode or pass `-B`/`--batch-mode`.
783
783
784
784
## Java problem matcher (compiler annotations)
785
785
786
-
`setup-java`registers a [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) for Java after installing the JDK. It scans the log output of subsequent steps and turns `javac` diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches two kinds of lines:
786
+
By default, `setup-java` registers a [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) for Java after installing the JDK. It scans the log output of subsequent steps and turns Java diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches three kinds of lines:
787
787
788
788
- Compiler errors and warnings, e.g. `App.java:12: error: cannot find symbol` (owner `javac`).
789
+
- Maven compiler errors and warnings, e.g. `[ERROR] /path/App.java:[12,5] cannot find symbol` (owner `maven-javac`).
789
790
- Uncaught-exception header lines, e.g. `Exception in thread "main" ...`; because these lines have no file or line captures, they appear as log/run-level annotations rather than inline file annotations (owner `java`).
790
791
791
-
This is enabled by default and requires no configuration.
792
+
GitHub Actions limits problem matcher annotations to 10 of each severity per step and 50 annotations per job. Additional diagnostics remain available in the build log. Log grouping does not change these limits because every matched diagnostic still counts as an annotation.
792
793
793
794
### Disabling the problem matcher
794
795
795
-
There is no action input to turn the matcher off, but you can disable it for the rest of the job with the built-in [`remove-matcher`](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md#remove-a-problem-matcher) workflow command. Pass the matcher **owner** (not a file name); the Java matcher defines two owners, `javac` and `java`, so remove both to fully suppress it:
796
+
Set `problem-matcher` to `false` to prevent the matcher from being registered:
796
797
797
798
```yaml
798
799
jobs:
@@ -805,19 +806,13 @@ jobs:
805
806
with:
806
807
distribution: '<distribution>'
807
808
java-version: '21'
808
-
809
-
- name: Disable the Java problem matcher
810
-
run: |
811
-
echo "::remove-matcher owner=javac::"
812
-
echo "::remove-matcher owner=java::"
809
+
problem-matcher: false
813
810
814
811
- name: Build with Maven
815
-
run: mvn -B package --file pom.xml
812
+
run: mvn package --file pom.xml
816
813
```
817
814
818
-
***NOTES***:
819
-
- `remove-matcher`only stops annotations from being created; the underlying compiler output is unchanged, so a failing `javac`/build still fails the step.
820
-
- The command is scoped to the job, so add the step right after `setup-java` (and before your build) in every job where you want the matcher disabled.
815
+
Disabling the matcher only stops annotations from being created. Compiler output remains in the log, and compilation errors still fail the build step.
821
816
822
817
## Publishing using Gradle
823
818
```yaml
@@ -1131,4 +1126,3 @@ Notes and caveats:
1131
1126
- Prefer giving the certificate a stable, descriptive `-alias` so re-runs are idempotent (re-importing the same alias will fail; add `keytool -delete -alias internal-ca ...` first if you re-run within a long-lived runner).
1132
1127
1133
1128
This documents the post-install workflow; there is no dedicated action input for supplying a custom `cacerts` file.
0 commit comments