Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massive updates for Dropwizard 4.x, Hibernate 6, Spring 6, etc. #1009

Merged
merged 1 commit into from
Aug 6, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['11', '17', '20']
java_version: ['17', '20']
steps:
# Check out the project
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
# Cache all the things
- name: Cache SonarCloud packages
uses: actions/cache@v3
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '17' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
Expand Down Expand Up @@ -61,16 +61,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: mvn -B -V compile

# Run tests when Java version > 11 (Sonar runs tests and analysis on JDK 11)
# Run tests when Java version > 17 (Sonar runs tests and analysis on JDK 17)
- name: Run tests
if: ${{ matrix.java_version != '11' }}
if: ${{ matrix.java_version != '17' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: mvn -B -V verify

# Run Sonar Analysis (on Java version 11 only)
# Run Sonar Analysis (on Java version 17 only)
- name: Analyze with SonarCloud
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '17' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>org.kiwiproject</groupId>
<artifactId>kiwi-parent</artifactId>
<version>2.0.20</version>
<version>3.0.0</version>
</parent>

<artifactId>kiwi</artifactId>
<version>2.7.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand All @@ -29,10 +29,10 @@

<properties>
<!-- Versions for required dependencies -->
<kiwi-bom.version>1.1.1</kiwi-bom.version>
<kiwi-bom.version>2.0.0</kiwi-bom.version>

<!-- Versions for provided dependencies -->
<retrying-again.version>1.0.18</retrying-again.version>
<retrying-again.version>2.0.0</retrying-again.version>

<!-- Versions for test dependencies -->
<test-containers.version>1.18.3</test-containers.version>
Expand Down Expand Up @@ -115,7 +115,7 @@
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.kiwiproject.base.KiwiPreconditions.requireNotBlank;

import jakarta.validation.constraints.NotBlank;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;

/**
* Configuration class for creating ansible-vault commands. Can be constructed via the no-arg constructor, the all-args
* constructor, or the builder. The builder is the preferred way to create an instance if done programmatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class VaultEncryptedVariable {
private static final String INVALID_VARIABLE_NAME_DECLARATION =
"First line does not have a valid variable name declaration";

private static final String INVALID_ANSIBLE_VAULT_DECLARATION = "" +
private static final String INVALID_ANSIBLE_VAULT_DECLARATION =
"Second line does not have a valid $ANSIBLE_VAULT declaration";

private static final String INVALID_SPACING_IN_ENCRYPTED_CONTENT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import static org.apache.commons.lang3.math.NumberUtils.isDigits;
import static org.kiwiproject.config.EndpointUriBuilder.stripLeadingAndTrailingSlashes;

import jakarta.ws.rs.core.UriBuilder;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.kiwiproject.base.KiwiStrings;

import javax.ws.rs.core.UriBuilder;
import java.net.URI;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static org.kiwiproject.base.KiwiPreconditions.checkArgumentNotNull;

import io.dropwizard.client.ssl.TlsConfiguration;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -15,8 +17,6 @@
import org.kiwiproject.security.KeyStoreType;
import org.kiwiproject.security.SSLContextProtocol;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.net.Socket;
import java.util.List;
Expand Down Expand Up @@ -133,10 +133,10 @@ public class TlsContextConfiguration implements KeyAndTrustStoreConfigProvider {
*
* @implNote Yes, this is null by default. This is due to the Dropwizard {@link TlsConfiguration} which has this
* same property null by default; I suspect this is ultimately due to the (unfortunate) way in which Apache
* HttpClient's {@link org.apache.http.conn.ssl.SSLConnectionSocketFactory} accepts {@code supportedProtocols}
* HttpClient's {@link org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory} accepts {@code supportedProtocols}
* in its constructors as arrays that are supposed to be null if you aren't specifying a specific list of them.
* The HttpClient code does an explicit null check on the {@code supportedProtocols} in
* {@link org.apache.http.conn.ssl.SSLConnectionSocketFactory#createLayeredSocket(Socket, String, int, org.apache.http.protocol.HttpContext)}.
* {@link org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory#createLayeredSocket(Socket, String, int, org.apache.hc.core5.http.protocol.HttpContext)}.
* You will need to look at the source code, as the JavaDoc doesn't mention this tidbit, nor do the constructors
* since they don't have any documentation regarding their arguments. If you don't like reading source code of the
* open source tools you rely on, then please close this file, log out, and change careers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
import static org.kiwiproject.base.KiwiStrings.format;

import com.google.common.base.CaseFormat;
import io.dropwizard.setup.Environment;
import io.dropwizard.core.setup.Environment;
import io.dropwizard.util.Duration;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.kiwiproject.dropwizard.metrics.health.TimeBasedDirectoryCleanerHealthCheck;
import org.kiwiproject.io.TimeBasedDirectoryCleaner;
import org.slf4j.event.Level;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import static java.util.function.Predicate.not;
import static org.kiwiproject.base.KiwiPreconditions.checkArgumentNotNull;

import io.dropwizard.core.setup.Environment;
import io.dropwizard.db.ManagedDataSource;
import io.dropwizard.db.PooledDataSourceFactory;
import io.dropwizard.jdbi3.JdbiFactory;
import io.dropwizard.setup.Environment;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import org.jdbi.v3.core.Jdbi;
Expand Down
166 changes: 0 additions & 166 deletions src/main/java/org/kiwiproject/hibernate/CriteriaQueries.java

This file was deleted.

Loading