diff --git a/.circleci/config.yml b/.circleci/config.yml index caf0a50..f0fb009 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,41 +1,42 @@ -version: 2 -defaults: &defaults - working_directory: ~/repo - environment: - JVM_OPTS: -Xmx3200m - TERM: dumb - CI_NAME: "CircleCI" - -defaults_bld: &defaults_bld - steps: - - checkout - - run: - name: Download the dependencies - command: ./bld download - - run: - name: Run tests with bld - command: ./bld compile test +version: 2.1 +commands: + build_and_test: + parameters: + reports-dir: + type: string + default: "build/reports/test_results" + steps: + - checkout + - run: + name: Download dependencies + command: ./bld download + - run: + name: Compile source + command: ./bld compile + - run: + name: Run tests + command: ./bld jacoco -reports-dir=<< parameters.reports-dir >> + - store_test_results: + path: << parameters.reports-dir >> + - store_artifacts: + path: build/reports/jacoco/test/html jobs: - bld_jdk20: - <<: *defaults - - docker: - - image: cimg/openjdk:20.0 - - <<: *defaults_bld - bld_jdk17: - <<: *defaults - docker: - image: cimg/openjdk:17.0 + steps: + - build_and_test - <<: *defaults_bld + bld_jdk21: + docker: + - image: cimg/openjdk:21.0 + steps: + - build_and_test workflows: - version: 2 bld: jobs: - bld_jdk17 - - bld_jdk20 + - bld_jdk21 + diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 45b3b77..1e81746 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest env: - COVERAGE_SDK: "17" + COVERAGE_JDK: "17" strategy: matrix: @@ -25,28 +25,28 @@ jobs: distribution: "zulu" java-version: ${{ matrix.java-version }} - - name: Grant execute permission for bld - run: chmod +x bld - - - name: Download the dependencies + - name: Download dependencies run: ./bld download - - name: Run tests with bld - run: ./bld compile jacoco + - name: Compile source + run: ./bld compile + + - name: Run tests + run: ./bld jacoco - name: Remove pom.xml - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_JDK run: rm -rf pom.xml - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_JDK env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_JDK env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.idea/bld.xml b/.idea/bld.xml new file mode 100644 index 0000000..6600cee --- /dev/null +++ b/.idea/bld.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index a2969be..5c4010c 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml index 9bd86aa..99cc0c0 100644 --- a/.idea/libraries/compile.xml +++ b/.idea/libraries/compile.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml index 2ae5c4b..d4069f2 100644 --- a/.idea/libraries/runtime.xml +++ b/.idea/libraries/runtime.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml index b80486a..57ed5ef 100644 --- a/.idea/libraries/test.xml +++ b/.idea/libraries/test.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 417e8e4..71f1817 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.vscode/settings.json b/.vscode/settings.json index 51d8e7f..56041cf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-1.9.1.jar", + "${HOME}/.bld/dist/bld-2.1.0.jar", "lib/**/*.jar", ] } diff --git a/README.md b/README.md index 64870d5..cf0d7bb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) -[![bld](https://img.shields.io/badge/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) +[![bld](https://img.shields.io/badge/2.1.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://img.shields.io/github/release/ethauvin/httpstatus.svg)](https://github.com/ethauvin/httpstatus/releases/latest) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/net.thauvin.erik.httpstatus/httpstatus?label=sanpshot&server=https%3A%2F%2Foss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/httpstatus/httpstatus/) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik.httpstatus/httpstatus.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik.httpstatus/httpstatus) diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index bee10dc..f297aa4 100644 Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 6146cc1..40f73c7 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,7 +1,7 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.0.1 -bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5 -bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,MAVEN_LOCAL,RIFE2_SNAPSHOTS bld.downloadLocation= -bld.version=1.9.1 +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8 +bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.5 +bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,MAVEN_LOCAL,RIFE2_SNAPSHOTS +bld.version=2.1.0 diff --git a/pom.xml b/pom.xml index 80d44f9..73cf087 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 net.thauvin.erik.httpstatus httpstatus - 1.1.1 + 1.1.2-SNAPSHOT HttpStatus Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages https://github.com/ethauvin/HttpStatus @@ -18,19 +18,19 @@ jakarta.servlet jakarta.servlet-api - 6.0.0 + 6.1.0 compile jakarta.servlet.jsp jakarta.servlet.jsp-api - 3.1.1 + 4.0.0 compile jakarta.el jakarta.el-api - 6.0.0 + 6.0.1 compile diff --git a/src/bld/java/net/thauvin/erik/httpstatus/HttpStatusBuild.java b/src/bld/java/net/thauvin/erik/httpstatus/HttpStatusBuild.java index 23993e6..ef31c0c 100644 --- a/src/bld/java/net/thauvin/erik/httpstatus/HttpStatusBuild.java +++ b/src/bld/java/net/thauvin/erik/httpstatus/HttpStatusBuild.java @@ -39,8 +39,7 @@ import rife.bld.extension.PmdOperation; import rife.bld.publish.*; import rife.tools.exceptions.FileUtilsErrorException; -import java.io.IOException; -import java.nio.file.Path; +import java.io.File; import java.util.List; import java.util.jar.Attributes; @@ -58,7 +57,7 @@ public class HttpStatusBuild extends Project { public HttpStatusBuild() { pkg = "net.thauvin.erik.httpstatus"; name = "HttpStatus"; - version = version(1, 1, 1); + version = version(1, 1, 2, "SNAPSHOT"); var description = "Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages"; var url = "https://github.com/ethauvin/HttpStatus"; @@ -72,13 +71,13 @@ public class HttpStatusBuild extends Project { repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS); scope(compile) - .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 0, 0))) - .include(dependency("jakarta.servlet.jsp", "jakarta.servlet.jsp-api", version(3, 1, 1))) - .include(dependency("jakarta.el", "jakarta.el-api", version(6, 0, 0))); + .include(dependency("jakarta.servlet", "jakarta.servlet-api", version(6, 1, 0))) + .include(dependency("jakarta.servlet.jsp", "jakarta.servlet.jsp-api", version(4, 0, 0))) + .include(dependency("jakarta.el", "jakarta.el-api", version(6, 0, 1))); scope(test) - .include(dependency("org.assertj", "assertj-core", version(3, 26, 0))) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2))); + .include(dependency("org.assertj", "assertj-core", version(3, 26, 3))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0))); jarOperation().manifestAttribute(Attributes.Name.MAIN_CLASS, pkg + '.' + "Reasons"); @@ -92,6 +91,7 @@ public class HttpStatusBuild extends Project { .withCredentials(property("sonatype.user"), property("sonatype.password")) : repository(SONATYPE_RELEASES_LEGACY.location()) .withCredentials(property("sonatype.user"), property("sonatype.password"))) + .repository(repository("github")) .info(new PublishInfo() .groupId(pkg) .artifactId(name.toLowerCase()) @@ -99,17 +99,15 @@ public class HttpStatusBuild extends Project { .version(version) .description(description) .url(url) - .developer( - new PublishDeveloper() - .id("ethauvin") - .name("Erik C. Thauvin") - .email("erik@thauvin.net") - .url("https://erik.thauvin.net/") + .developer(new PublishDeveloper() + .id("ethauvin") + .name("Erik C. Thauvin") + .email("erik@thauvin.net") + .url("https://erik.thauvin.net/") ) - .license( - new PublishLicense() - .name("The BSD 3-Clause License") - .url("https://opensource.org/licenses/BSD-3-Clause") + .license(new PublishLicense() + .name("The BSD 3-Clause License") + .url("https://opensource.org/licenses/BSD-3-Clause") ) .scm(new PublishScm() .connection("scm:git:" + url + ".git") @@ -124,25 +122,25 @@ public class HttpStatusBuild extends Project { } @BuildCommand(summary = "Generates JaCoCo Reports") - public void jacoco() throws IOException { + public void jacoco() throws Exception { new JacocoReportOperation() .fromProject(this) .execute(); } @BuildCommand(summary = "Runs PMD analysis") - public void pmd() { + public void pmd() throws Exception { pmdOp.execute(); } @BuildCommand(value = "pmd-cli", summary = "Runs PMD analysis (CLI)") - public void pmdCli() { + public void pmdCli() throws Exception { pmdOp.includeLineNumber(false).execute(); } private void pomRoot() throws FileUtilsErrorException { - PomBuilder.generateInto(publishOperation().info(), dependencies(), - Path.of(workDirectory.getPath(), "pom.xml").toFile()); + PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(), + new File(workDirectory, "pom.xml")); } @Override