Skip to content

Commit

Permalink
Project setup for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aragozin committed Aug 13, 2021
1 parent 4856d7d commit 3933fb7
Show file tree
Hide file tree
Showing 13 changed files with 230 additions and 178 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java 11 build
name: CI build

on:
push:
Expand All @@ -10,7 +7,22 @@ on:
branches: [ master ]

jobs:
build:

build8:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml -DdisableToolchain -P RunCliCheckDefaultJava

build11:

runs-on: ubuntu-latest

Expand All @@ -22,4 +34,18 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file pom.xml -DdisableToolchain -P RunCliCheckDefaultJava

build15:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 15
uses: actions/setup-java@v2
with:
java-version: '15'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B help:active-profiles && mvn -B package --file pom.xml -DdisableToolchain -P RunCliCheckDefaultJava
8 changes: 0 additions & 8 deletions bstub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
13 changes: 1 addition & 12 deletions gcflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,5 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>

</project>
13 changes: 1 addition & 12 deletions mxdump/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,5 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>

</project>
156 changes: 132 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,32 +170,9 @@

<build>

<plugins>
<!-- SJK is 1.6 compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>1.6</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -215,11 +192,13 @@
<pushChanges>true</pushChanges>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -233,6 +212,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -246,6 +226,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -254,11 +235,13 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -275,6 +258,7 @@
<artifactId>formatter-maven-plugin</artifactId>
<version>2.11.0</version>
</plugin>

<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
Expand Down Expand Up @@ -313,4 +297,128 @@
</plugins>
</pluginManagement>
</build>

<profiles>

<profile>
<id>spotless-check</id>

<activation>
<property>
<name>!disableToolchain</name>
</property>
</activation>

<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<executions>
<execution>
<id>spotless-check</id>
<goals>
<goal>check</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

</profile>

<profile>
<id>enable-toolchain</id>

<activation>
<property>
<name>!disableToolchain</name>
</property>
</activation>

<build>
<plugins>
<!-- SJK is 1.6 compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>1.6</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>fix-surefire</id>

<activation>
<jdk>[11,1000)</jdk>
</activation>

<build>
<pluginManagement>
<plugins>

<plugin>
<!-- Since Java 11 surefire is broken due to text leaking in std out, here is remedy for that. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
<!-- additional encantation to work around Java 11 nonsense -->
<argLine>-Djdk.attach.allowAttachSelf=true --add-opens java.base/jdk.internal.perf=ALL-UNNAMED --add-opens jdk.attach/sun.tools.attach=ALL-UNNAMED -Dsjk.breakCage=false</argLine>
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>
</profile>

<profile>
<id>fix-post-11-compile</id>

<activation>
<jdk>[12,1000)</jdk>
</activation>

<build>
<pluginManagement>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>

</profile>

</profiles>

</project>
8 changes: 0 additions & 8 deletions sjk-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions sjk-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,4 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 3933fb7

Please sign in to comment.