Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/github-actions-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
distribution: 'adopt'

- name: Cache Maven Repo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build Test and Verify
run: mvn -B -U clean install -Dmaven.javadoc.skip=true -Pdisplay-versions
run: mvn -B -U clean install

- name: Set up JDK 17
uses: actions/setup-java@v2
Expand All @@ -39,7 +39,7 @@ jobs:
echo "Sonar secure variables NOT available"
else
echo "Sonar secure variables ARE available"
mvn -B sonar:sonar -Dsonar.projectKey="bordertech-java-common" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io"
mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey="bordertech-java-common" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" -Dsonar.qualitygate.wait=true
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

## Release in-progress

## 1.0.22
* Update bordertech-parent pom.xml plugins:
* org.apache.maven.plugins:maven-jar-plugin from default to 3.5.1
* org.apache.maven.plugins:maven-assembly-plugin from default to 3.8.0
* org.apache.maven.plugins:maven-release-plugin from 2.5.3 to 3.3.1
* org.apache.maven.plugins:maven-compiler-plugin from 3.10.1 to 3.16.0
* org.apache.maven.plugins:maven-javadoc-plugin from 3.4.1 to 3.12.0
* org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.3
* org.codehaus.mojo:extra-enforcer-rules from 1.8.0 to 1.12.1
* org.apache.maven.plugins:maven-source-plugin from 3.2.1 to 3.4.0
* org.apache.maven.plugins:maven-gpg-plugin from 3.0.1 to 3.2.8
* Update qa-parent pom.xml plugins:
* org.junit from 5.11.0 to 5.14.4
* org.jacoco:jacoco-maven-plugin from 0.8.12 to 0.8.15
* org.apache.maven.plugins:maven-surefire-plugin from 3.5.0 to 3.6.0
* org.apache.maven.plugins:maven-checkstyle-plugin from 3.5.0 to 3.6.0
* org.apache.maven.plugins:maven-pmd-plugin from 3.25.0 to 3.28.0
* net.sourceforge.pmd:pmd* from 7.5.0 to 7.27.0
* com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.3 to 4.8.6.8
* org.codehaus.mojo:versions-maven-plugin from 2.17.1 to 2.22.0
* org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.3
* Moved dependency-check-maven plugin into own profile check-dep as it requires JDK11
* Included central-publishing-maven-plugin in release profile to publish to maven central
* Moved javadoc plugin into the release profile so only created when doing a release

## 1.0.21
* Update to latest plugin dependencies
* Latest plugin dependencies now have a minimum maven version of 3.6.3.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Projects should generally use qa-parent as their parent POM:
<parent>
<groupId>com.github.bordertech.common</groupId>
<artifactId>qa-parent</artifactId>
<version>1.0.21</version>
<version>1.0.22</version>
</parent>
....
</project>
Expand Down Expand Up @@ -116,6 +116,12 @@ The qa-parent provides a profile `display-versions` that uses the [Version check

Refer to [Version checker plugin](https://www.mojohaus.org/versions-maven-plugin/) for all override details.

#### check-dep profile

The qa-parent provides a profile `check-dep` that runs the OWASP plugin. This plugin has its own profile as it requires JDK11 and needs to be run seperately from projects built on JDK8.

After building a project on JDK8 the JDK can be switched to JDK11 and then run `mvn verify -Pquick-build -Pcheck-dep`

### build-tools

This is primarily a shared resources module used by qa-parent and potentially other BorderTech maven modules.
Expand Down Expand Up @@ -347,13 +353,7 @@ When adding a custom exclude filter and the module still needs to ignore generat

Refer to [OWASP plugin](https://jeremylong.github.io/DependencyCheck/dependency-check-maven) for all override details.

##### Skip OWASP

``` xml
<property>
<dependency-check.skip>true</dependency-check.skip>
</property>
```
The OWASP plugin is only run in profile `check-dep` as it requires JDK11.

##### Ignore OWASP Rule

Expand Down
17 changes: 11 additions & 6 deletions build-tools/src/main/resources/bordertech/bt-pmd-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
<rule ref="category/java/security.xml"/>

<!-- Downgrade rules from Failure to Warning. -->
<rule ref="category/java/bestpractices.xml/ImplicitFunctionalInterface">
<priority>3</priority>
</rule>
<rule ref="category/java/bestpractices.xml/GuardLogStatement" >
<priority>3</priority>
</rule>
<rule ref="category/java/bestpractices.xml/SystemPrintln">
<priority>3</priority>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions" >
<priority>3</priority>
</rule>
Expand All @@ -42,19 +51,15 @@
<rule ref="category/java/errorprone.xml/SuspiciousEqualsMethodName">
<priority>3</priority>
</rule>
<rule ref="category/java/bestpractices.xml/GuardLogStatement" >
<priority>3</priority>
</rule>
<rule ref="category/java/bestpractices.xml/SystemPrintln">
<rule ref="category/java/errorprone.xml/WrongTestAnnotation">
<priority>3</priority>
</rule>
<rule ref="category/java/performance.xml/AvoidFileStream" >
<priority>3</priority>
</rule>

<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="fieldCommentRequirement" value="Ignored"/>
<property name="fieldCommentRequirement" value="ignored"/>
</properties>
</rule>

Expand Down
102 changes: 62 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<archive>
<manifestEntries>
Expand All @@ -118,7 +119,9 @@

<!-- Assembly -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<archive>
<manifestEntries>
Expand All @@ -132,15 +135,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.3.1</version>
<configuration>
<!-- Prepare defaults -->
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<!-- need this for gpg plugin to work correctly -->
<mavenExecutorId>forked-path</mavenExecutorId>
<!-- Manually push commits created by the release plugin -->
<pushChanges>false</pushChanges>
<!-- Perform defaults -->
<releaseProfiles>release</releaseProfiles>
<localCheckout>true</localCheckout>
</configuration>
</plugin>

</plugins>
</pluginManagement>

Expand All @@ -150,43 +158,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>

<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<archive>
<manifestEntries>
<Built-By /><!-- blank build user in manifest file -->
</manifestEntries>
</archive>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<breakiterator>true</breakiterator>
<version>true</version>
<keywords>true</keywords>
</configuration>
<executions>
<execution>
<!-- A release to Maven Central MUST include javadoc Jars - even if they are dummy jars -->
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<version>3.16.0</version>
</plugin>

<!-- Enforcer -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.3</version>
<executions>
<execution>
<id>enforcer</id>
Expand All @@ -212,7 +191,7 @@
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.8.0</version>
<version>1.12.1</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -229,14 +208,41 @@
<build>

<plugins>
<!--
Create jar of the source files.
This is required for release to Maven repo.
-->

<!-- Javadoc files must be included for Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<archive>
<manifestEntries>
<Built-By /><!-- blank build user in manifest file -->
</manifestEntries>
</archive>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<breakiterator>true</breakiterator>
<version>true</version>
<keywords>true</keywords>
</configuration>
<executions>
<execution>
<!-- A release to Maven Central MUST include javadoc Jars - even if they are dummy jars -->
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Source files must be included for Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down Expand Up @@ -265,10 +271,11 @@
</executions>
</plugin>

<!-- Artifacts must be signed for Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -279,6 +286,21 @@
</execution>
</executions>
</plugin>

<!-- Publish to central -->
<!-- Binds to the deploy phase in the release plugin. -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.11.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<!-- Review and publish manually. Login at https://central.sonatype.com -->
<autoPublish>false</autoPublish>
</configuration>
</plugin>

</plugins>

</build>
Expand Down
Loading
Loading