-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup maven workflow actions on gitub
- Create maven.yml - Create ubuntu-toolchains.xml
- Loading branch information
Showing
3 changed files
with
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF8"?> | ||
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd"> | ||
<toolchain> | ||
<type>jdk</type> | ||
<provides> | ||
<version>11</version> | ||
</provides> | ||
<configuration> | ||
<jdkHome>${env.JAVA_HOME_11_X64}</jdkHome> | ||
</configuration> | ||
</toolchain> | ||
<toolchain> | ||
<type>jdk</type> | ||
<provides> | ||
<version>1.8</version> | ||
</provides> | ||
<configuration> | ||
<jdkHome>${env.JAVA_HOME_8_X64}</jdkHome> | ||
</configuration> | ||
</toolchain> | ||
</toolchains> |
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,42 @@ | ||
name: Maven GH build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Java ${{ matrix.java }} build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 8, 11 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v1.1.0 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Set up JDK 11 for toolchains | ||
uses: actions/setup-java@v1.3.0 | ||
with: | ||
java-version: 11 | ||
- name: Set up JDK 8 for toolchains | ||
uses: actions/setup-java@v1.3.0 | ||
with: | ||
java-version: 8 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1.3.0 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: Inspect environment | ||
run: | | ||
set | grep JAVA | ||
set | grep MAVEN | ||
cat /home/runner/.m2/settings.xml | ||
- name: Build with Maven | ||
run: mvn -V -B -e package --global-toolchains .github/ubuntu-toolchains.xml | ||
- name: Remove SNAPSHOT jars from repository | ||
run: | | ||
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} |
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