diff --git a/.github/workflows/push-and-pull_request.yml b/.github/workflows/push-and-pull_request.yml index f9790d09..de5deea4 100644 --- a/.github/workflows/push-and-pull_request.yml +++ b/.github/workflows/push-and-pull_request.yml @@ -1,7 +1,9 @@ name: Build on Push and Pull Request on: - - push - - pull_request + push: + branches: + - master + pull_request: jobs: build: @@ -9,25 +11,26 @@ jobs: strategy: fail-fast: false matrix: - # Supported versions as of https://en.wikipedia.org/wiki/Java_version_history + # Supported LTS versions as of https://en.wikipedia.org/wiki/Java_version_history java-version: - 8 - 11 - - 16 + - 17 + - 21 name: Build with JDK ${{ matrix.java-version }} steps: - name: Cache Dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: maven-dependencies path: ~/.m2/repository - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: temurin java-version: ${{ matrix.java-version }} gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE @@ -38,6 +41,7 @@ jobs: set +o errexit +o pipefail - id: version name: Evaluate Version + shell: bash {0} run: | project_version=`mvn help:evaluate --quiet --define expression=project.version --define forceStdout` echo "Version: ${project_version}" @@ -95,7 +99,7 @@ jobs: fi - name: Deploy Site if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.java-version == 8 && steps.version.outputs.is-snapshot == 'true' }} - uses: peaceiris/actions-gh-pages@v3.8.0 + uses: peaceiris/actions-gh-pages@v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./target/site diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7a30070..c9c5315f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK and Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: temurin java-version: 8 gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE diff --git a/pom.xml b/pom.xml index 9799cd78..38ce6ab2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.lars-sh parent - 0.9.14 + 0.9.15 diff --git a/src/main/lombok/de/larssh/jes/JesClient.java b/src/main/lombok/de/larssh/jes/JesClient.java index 27eae64e..736d87c4 100644 --- a/src/main/lombok/de/larssh/jes/JesClient.java +++ b/src/main/lombok/de/larssh/jes/JesClient.java @@ -264,7 +264,8 @@ public JesClient() { */ @SuppressWarnings("PMD.ConstructorCallsOverridableMethod") @SuppressJacocoGenerated(justification = "this constructor cannot be mocked nicely") - @SuppressFBWarnings(value = "PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS", justification = "see JavaDoc") + @SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW", "PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" }, + justification = "see JavaDoc") public JesClient(final String hostname, final int port, final String username, final String password) throws IOException, JesException { this(); @@ -842,7 +843,7 @@ protected List throwIfLimitReached(final int limit, final List jobs) t * @throws IOException Technical FTP failure * @throws JesException Logical JES failure */ - @SuppressWarnings("unused") + @SuppressWarnings({ "unused", "PMD.DoNotUseThreads" }) public boolean waitFor(final Job job, final Duration waiting, final Duration timeout) throws InterruptedException, IOException, JesException { return waitFor(job, diff --git a/src/main/lombok/de/larssh/jes/Job.java b/src/main/lombok/de/larssh/jes/Job.java index 4cff0427..7022507e 100644 --- a/src/main/lombok/de/larssh/jes/Job.java +++ b/src/main/lombok/de/larssh/jes/Job.java @@ -13,6 +13,7 @@ import de.larssh.utils.OptionalInts; import de.larssh.utils.text.Strings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -130,6 +131,8 @@ public class Job { * @param owner the jobs owner or an owner filter value * @throws JobFieldInconsistentException on inconsistent field value */ + @SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW", + justification = "Fields are initialized prior throwing exceptions") public Job(final String jobId, final String name, final JobStatus status, final String owner) { this(jobId, name, status, owner, Optional.empty(), OptionalInt.empty(), Optional.empty()); } @@ -149,6 +152,8 @@ public Job(final String jobId, final String name, final JobStatus status, final * @throws JobFieldInconsistentException on inconsistent field value */ @SuppressWarnings("checkstyle:ParameterNumber") + @SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW", + justification = "Fields are initialized prior throwing exceptions") public Job(final String jobId, final String name, final JobStatus status, diff --git a/src/main/lombok/de/larssh/jes/JobOutput.java b/src/main/lombok/de/larssh/jes/JobOutput.java index fcabb613..a0edbd2b 100644 --- a/src/main/lombok/de/larssh/jes/JobOutput.java +++ b/src/main/lombok/de/larssh/jes/JobOutput.java @@ -4,6 +4,7 @@ import de.larssh.utils.annotations.SuppressJacocoGenerated; import de.larssh.utils.text.Strings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -82,6 +83,8 @@ public class JobOutput { * @param outputClass the output class * @throws JobFieldInconsistentException on inconsistent field value */ + @SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW", + justification = "Fields are initialized prior throwing exceptions") protected JobOutput(final Job job, final int index, final String name, diff --git a/src/main/lombok/de/larssh/jes/parser/JesFtpFile.java b/src/main/lombok/de/larssh/jes/parser/JesFtpFile.java index d0bd54c5..81746212 100644 --- a/src/main/lombok/de/larssh/jes/parser/JesFtpFile.java +++ b/src/main/lombok/de/larssh/jes/parser/JesFtpFile.java @@ -8,6 +8,7 @@ import de.larssh.jes.Job; import de.larssh.utils.annotations.SuppressJacocoGenerated; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.Getter; import lombok.ToString; @@ -31,7 +32,7 @@ public class JesFtpFile extends FTPFile { * @param job job details * @param rawListing raw FTP server listing */ - @SuppressWarnings("PMD.CallSuperInConstructor") + @SuppressWarnings("PMD.ConstructorCallsOverridableMethod") public JesFtpFile(final Job job, final String rawListing) { this.job = job; setRawListing(rawListing); @@ -44,6 +45,8 @@ public JesFtpFile(final Job job, final String rawListing) { * @throws NotSerializableException This class cannot be deserialized. */ @SuppressJacocoGenerated(justification = "this is not serializable") + @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_READ_OBJECT", + justification = "Class.getName() cannot be overridden") private void readObject(@SuppressWarnings("unused") final ObjectInputStream stream) throws NotSerializableException { throw new NotSerializableException(JesFtpFile.class.getName());