Skip to content

Commit

Permalink
Draft: Update CI configurations to use Maven phases instead of direct…
Browse files Browse the repository at this point in the history
… plugin goals
  • Loading branch information
GuusLieben committed Dec 20, 2024
1 parent 206ea1c commit 4232488
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/postbuild.docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
java-version: 21
distribution: temurin
- name: Build developer documentation
run: mvn clean antora:antora -P ci -Dantora.skip=false -Dantora.playbook=playbook-local.yml
run: mvn clean site -P ci -Dexecution.antora.skip=false -Dantora.playbook=playbook-local.yml
- name: Build Javadocs
run: mvn javadoc:aggregate -P ci -Djavadoc.skip=false
run: mvn site -P ci -Dexecution.javadoc.skip=false
- name: Archive documentation artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prebuild.codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
java-version: 21
distribution: temurin
- name: Check code style
run: mvn clean install -DskipTests -P ci -Dcheckstyle.skip=false -Derrorprone.skip=false
run: mvn clean verify -DskipTests -P ci -Dexecution.checkstyle.skip=false -Dexecution.errorprone.skip=false
2 changes: 1 addition & 1 deletion .github/workflows/prebuild.dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
shell: bash
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: mvn dependency-check:check -Dowasp.skip=false -DnvdApiKey=$NVD_API_KEY -P ci
run: mvn verify -Dexecution.owasp.skip=false -DnvdApiKey=$NVD_API_KEY -P ci
- name: Archive dependency reports
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prebuild.license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
java-version: 21
distribution: temurin
- name: Check license headers
run: mvn license:check -P ci
run: mvn clean verify -DskipTests -P ci -Dexecution.license.skip=false
2 changes: 1 addition & 1 deletion hartshorn-assembly/pom.assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<jacoco.skip>false</jacoco.skip>
<execution.jacoco.skip>false</execution.jacoco.skip>

<plugin.jacoco.version>0.8.12</plugin.jacoco.version>
</properties>
Expand Down
99 changes: 75 additions & 24 deletions hartshorn-assembly/pom.platform.support.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@
<path.assembly>${maven.multiModuleProjectDirectory}/hartshorn-assembly</path.assembly>

<!--
Feature toggles for CI, defaults to opt-out behavior.
Feature toggles for CI, most default to opt-out behavior.
Use the 'ci' profile to disable by default, making this opt-in instead.
-->
<checkstyle.skip>false</checkstyle.skip>
<javadoc.skip>false</javadoc.skip>
<owasp.skip>false</owasp.skip>
<jacoco.skip>false</jacoco.skip>
<errorprone.skip>false</errorprone.skip>
<coverage.skip>false</coverage.skip>
<antora.skip>false</antora.skip>
<execution.checkstyle.skip>false</execution.checkstyle.skip>
<execution.javadoc.skip>false</execution.javadoc.skip>
<execution.owasp.skip>false</execution.owasp.skip>
<execution.jacoco.skip>false</execution.jacoco.skip>
<execution.license.skip>false</execution.license.skip>
<execution.errorprone.skip>false</execution.errorprone.skip>
<execution.coverage.skip>false</execution.coverage.skip>
<execution.antora.skip>false</execution.antora.skip>
<execution.updates.skip>true</execution.updates.skip> <!-- Only for manual execution -->

<!-- Maven plugin versions, in alphabetical order -->
<plugin.antora.version>1.0.0-alpha.4</plugin.antora.version>
Expand Down Expand Up @@ -196,13 +198,15 @@
<!-- CI profile, so we can opt-in to goals, instead of having to opt-out -->
<id>ci</id>
<properties>
<checkstyle.skip>true</checkstyle.skip>
<javadoc.skip>true</javadoc.skip>
<owasp.skip>true</owasp.skip>
<jacoco.skip>true</jacoco.skip>
<errorprone.skip>true</errorprone.skip>
<coverage.skip>true</coverage.skip>
<antora.skip>true</antora.skip>
<execution.checkstyle.skip>true</execution.checkstyle.skip>
<execution.javadoc.skip>true</execution.javadoc.skip>
<execution.owasp.skip>true</execution.owasp.skip>
<execution.jacoco.skip>true</execution.jacoco.skip>
<execution.license.skip>true</execution.license.skip>
<execution.errorprone.skip>true</execution.errorprone.skip>
<execution.coverage.skip>true</execution.coverage.skip>
<execution.antora.skip>true</execution.antora.skip>
<execution.updates.skip>true</execution.updates.skip>
</properties>
</profile>
</profiles>
Expand Down Expand Up @@ -324,6 +328,7 @@
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<skip>${execution.license.skip}</skip>
<headerDefinitions>
<headerDefinition>${path.assembly}/licenses/JavaBlockStyleHeader.xml</headerDefinition>
</headerDefinitions>
Expand All @@ -350,14 +355,30 @@
<version>${plugin.license.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>license-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
<execution>
<id>license-format</id>
<phase>install</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- OWASP Dependency check, to ensure no vulnerabilities are present in the dependencies -->
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<configuration>
<skip>${owasp.skip}</skip>
<skip>${execution.owasp.skip}</skip>
<failBuildOnCVSS>1</failBuildOnCVSS>
<suppressionFiles>
<suppressionFile>${path.assembly}/dependency-check/dependency-check-suppressions.xml</suppressionFile>
Expand All @@ -366,6 +387,8 @@
</configuration>
<executions>
<execution>
<id>dependency-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
Expand All @@ -378,7 +401,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>${checkstyle.skip}</skip>
<skip>${execution.checkstyle.skip}</skip>
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
Expand All @@ -398,8 +421,8 @@
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<id>checkstyle-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
Expand All @@ -412,21 +435,31 @@
<groupId>org.antora</groupId>
<artifactId>antora-maven-plugin</artifactId>
<configuration>
<skip>${antora.skip}</skip>
<skip>${execution.antora.skip}</skip>
<playbookFile>${path.assembly}/antora/${antora.playbook}</playbookFile>
<packages>
<package>@antora/lunr-extension</package>
<package>@asciidoctor/tabs</package>
<package>asciidoctor-interdoc-reftext</package>
</packages>
</configuration>
<executions>
<execution>
<id>antora-site</id>
<phase>site</phase>
<goals>
<goal>antora</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Dependency version upgrades -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<skip>${execution.updates.skip}</skip>
<ignoredVersions>.*[-_\.](alpha|Alpha|ALPHA|b|beta|Beta|BETA|rc|RC|M|MR|EA)[-_\.]?[0-9]*</ignoredVersions>
<generateBackupPoms>false</generateBackupPoms>

Expand All @@ -444,7 +477,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
<skip>${errorprone.skip}</skip>
<skip>${execution.errorprone.skip}</skip>
<fork>false</fork>
<encoding>UTF-8</encoding>
<compilerArgs>
Expand All @@ -461,14 +494,23 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>errorprone-check</id>
<phase>verify</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Testing -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<skip>${jacoco.skip}</skip>
<skip>${execution.jacoco.skip}</skip>
</configuration>
<executions>
<execution>
Expand All @@ -491,7 +533,7 @@
<goal>check</goal>
</goals>
<configuration>
<skip>${coverage.skip}</skip>
<skip>${execution.coverage.skip}</skip>
<rules>
<rule>
<element>BUNDLE</element>
Expand All @@ -515,8 +557,17 @@
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Remaining configuration present in Platform Build POM, this is purely for the CI toggle -->
<skip>${javadoc.skip}</skip>
<skip>${execution.javadoc.skip}</skip>
</configuration>
<executions>
<execution>
<id>javadoc-site</id>
<phase>site</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 4232488

Please sign in to comment.