Skip to content

Commit

Permalink
Add support for Gradle build scans publication
Browse files Browse the repository at this point in the history
  • Loading branch information
jprinet committed Dec 12, 2023
1 parent e226eee commit f4a8a84
Show file tree
Hide file tree
Showing 62 changed files with 122,776 additions and 1,283 deletions.
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ The `MAVEN_HOME` environment variable is used if present, otherwise, the csv lis
| `build-scan-capture-strategy` | *Optional*: Build Scan capture strategy (ALWAYS, ON_FAILURE, ON_DEMAND) | `ALWAYS` |
| `build-scan-capture-unpublished-enabled` | *Optional*: Flag to enable unpublished Build Scan capture | `true` |
| `build-scan-capture-link-enabled` | *Optional*: Flag to enable Build Scan link capture | `true` |
| `wrapper-init` | *Optional*: Flag to enable the Maven wrapper by running it (with `-version`) in order to trigger local installation | `false` |
| `wrapper-path` | *Optional*: Path to mvnw script (used in combination with `wrapper-init`) | `` |

**Usage**:

Expand All @@ -127,26 +129,10 @@ jobs:

When using the Maven wrapper, the Maven extension can't be registered once at the beginning of the build by copying it to `$MAVEN_HOME/lib/ext` as the folder is created on first `mvnw` invocation (and emptied if already present).

There are two options in this situation:
1. Add a minimal `mvnw help` step at the beginning of the job and reference `gradle/github-actions/maven-build-scan-setup` step after
2. Register the Maven extension as a Maven CLI argument (`-Dmaven.ext.class.path`)

In details, the approach 2. which copies the Maven extension in `./maven-build-scan-capture/lib/ext` (using a relative path makes this approach compatible with Windows OS):
```yaml
name: PR Build
jobs:
[...]
build:
[...]
- name: Setup Develocity Build Scan capture
uses: gradle/github-actions/[email protected]
env:
MAVEN_HOME: maven-build-scan-capture
job-name: "Initial JDK 17 Build"
- name: Build with Maven
run: ./mvnw clean package -Dmaven.ext.class.path=maven-build-scan-capture/lib/ext/maven-build-scan-capture-extension.jar
[...]
```
There are three options in this situation (by order of preference):
1. Set `wrapper-init: true` to trigger the installation of Maven when running the `gradle/github-actions/maven-build-scan-setup` step
2. Register the Maven extension as a Maven CLI argument (`-Dmaven.ext.class.path`)
3. Add a previous step calling `mvnw` and reference `gradle/github-actions/maven-build-scan-setup` step after

#### maven-build-scan-publish

Expand Down
File renamed without changes.
Loading

0 comments on commit f4a8a84

Please sign in to comment.