-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Convention Develocity Maven extension
- Loading branch information
1 parent
7bba437
commit 75f60b7
Showing
22 changed files
with
1,471 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
.github/workflows/convention-gradle-enterprise-maven-extension.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Verify Maven Convention Extension | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build Gradle Enterprise Conventions Maven Extension | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build Gradle Enterprise Conventions Maven Extension | ||
run: ./mvnw clean install -Dgradle.enterprise.url=https://ge.solutions-team.gradle.com | ||
working-directory: convention-gradle-enterprise-maven-extension/extension | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }} | ||
- name: Upload extension | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: convention-gradle-enterprise-maven-extension | ||
path: ~/.m2/repository/com/myorg/convention-gradle-enterprise-maven-extension | ||
verification: | ||
name: Verify Example Build for Maven ${{ matrix.maven-version }} | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
maven-version: ['3.6.3', '3.8.8', '3.9.1'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Download Extension | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: convention-gradle-enterprise-maven-extension | ||
path: ~/.m2/repository/com/myorg/convention-gradle-enterprise-maven-extension | ||
- name: Set Maven Version | ||
run: ./mvnw wrapper:wrapper -Dmaven=${{ matrix.maven-version }} -Dgradle.enterprise.url=https://ge.solutions-team.gradle.com | ||
working-directory: convention-gradle-enterprise-maven-extension/example | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }} | ||
- name: Verify Example Build | ||
run: ./mvnw clean verify -Dgradle.enterprise.url=https://ge.solutions-team.gradle.com | ||
working-directory: convention-gradle-enterprise-maven-extension/example | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target/ | ||
dependency-reduced-pom.xml | ||
**/.mvn/.gradle-enterprise/gradle-enterprise-workspace-id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Convention Gradle Enterprise Maven Extension | ||
|
||
This project demonstrates how a convention extension can share the same Gradle Enterprise build configuration across multiple projects. It | ||
is intended to serve as a starting point for creating your own Maven extension that applies your specific Gradle Enterprise configuration. Note | ||
the inline comments in the build and source code for things to adjust specifically to your needs. | ||
|
||
### Content | ||
|
||
This project is structured as follows: | ||
|
||
* `extension` - Contains the convention extension | ||
* `example` - Contains an example build that applies the convention extension | ||
|
||
### Running the example builds | ||
|
||
Before running the example build, install the convention extension to your local Maven repository. | ||
|
||
```bash | ||
cd extension | ||
./mvnw clean install | ||
``` | ||
|
||
Once the extension is published, you can run the example build under `example`: | ||
|
||
```bash | ||
cd example | ||
./mvnw clean verify | ||
``` | ||
|
||
Note that you would publish your convention extension to your internal artifact provider, e.g., Artifactory or Nexus, for | ||
production usage. The artifact provider must be configured as a [Mirror](https://maven.apache.org/guides/mini/guide-mirror-settings.html) | ||
to Maven Central in order to correctly resolve the extension. | ||
|
||
#### Requirements | ||
|
||
To run the example build, use Java 8. |
1 change: 1 addition & 0 deletions
1
convention-gradle-enterprise-maven-extension/example/.gitattributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.bat text eol=crlf |
9 changes: 9 additions & 0 deletions
9
convention-gradle-enterprise-maven-extension/example/.mvn/extensions.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd"> | ||
<extension> | ||
<groupId>com.myorg</groupId> | ||
<artifactId>convention-gradle-enterprise-maven-extension</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</extension> | ||
</extensions> |
Binary file added
BIN
+61.1 KB
convention-gradle-enterprise-maven-extension/example/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
convention-gradle-enterprise-maven-extension/example/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
Oops, something went wrong.