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
4 changes: 2 additions & 2 deletions .azure/templates/jobs/build_java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ jobs:
# Strategy for the job
strategy:
matrix:
'java-17':
'java-21':
image: 'Ubuntu-22.04'
jdk_version: '17'
jdk_version: '21'
# Set timeout for jobs
timeoutInMinutes: 60
# Base system
Expand Down
4 changes: 2 additions & 2 deletions .azure/templates/jobs/deploy_java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
# Strategy for the job
strategy:
matrix:
'java-17':
'java-21':
image: 'Ubuntu-22.04'
jdk_version: '17'
jdk_version: '21'
# Base system
pool:
vmImage: $(image)
Expand Down
2 changes: 1 addition & 1 deletion .azure/templates/jobs/run_systemtests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
${{ arch }}:
arch: ${{ arch }}
image: 'Ubuntu-22.04'
jdk_version: '17'
jdk_version: '21'
pool:
vmImage: $(image)
variables:
Expand Down
2 changes: 1 addition & 1 deletion .azure/templates/steps/prerequisites/install_java.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Step to configure JAVA on the agent
parameters:
- name: JDK_VERSION
default: '17'
default: '21'
steps:
- task: JavaToolInstaller@0
inputs:
Expand Down
32 changes: 32 additions & 0 deletions .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,38 @@

<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder" />

<!-- Javadocs -->
<module name="MissingJavadocType">
<!-- public types -->
<property name="scope" value="public" />
</module>
<module name="MissingJavadocMethod">
<!-- public methods -->
<property name="scope" value="public" />
</module>
<module name="JavadocType">
<!-- public types -->
<property name="scope" value="public" />
</module>
<module name="JavadocVariable">
<!-- public variables -->
<property name="scope" value="public" />
</module>
<module name="JavadocMethod">
<!-- public methods -->
<property name="accessModifiers" value="public" />
</module>
<module name="JavadocBlockTagLocation" />
<module name="JavadocContentLocation" />
<module name="JavadocLeadingAsteriskAlign" />
<module name="JavadocMissingLeadingAsterisk" />
<module name="JavadocMissingWhitespaceAfterAsterisk" />
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true"/>
<property name="checkFirstSentence" value="false"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
</module>

<module name="SuppressionFilter">
Expand Down
6 changes: 6 additions & 0 deletions .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
In all other cases, you should use the annotations on the methods or classes affected by it. -->
<suppress checks=".*"
files="io[/\\]strimzi[/\\]kafka[/\\]access[/\\]model[/\\].*(Builder|Fluent|FluentImpl)\.java"/>

<!-- Skip Javadoc checks for tests -->
<suppress checks="(JavadocMethod|JavadocType|JavadocVariable|MissingJavadocType|MissingJavadocMethod)" files="src[/\\]test[/\\]java[/\\].*"/>

<!-- Skip Javadoc checks for systemtests -->
<suppress checks="(JavadocMethod|JavadocType|JavadocVariable|MissingJavadocType|MissingJavadocMethod|JavadocStyle)" files="systemtest[/\\]src[/\\]main[/\\]java[/\\].*"/>
</suppressions>
2 changes: 1 addition & 1 deletion .github/actions/build/build-binaries/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
- name: Setup Java
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/setup-java@main
with:
javaVersion: "17"
javaVersion: "21"

- name: Setup Yq
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/install-yq@main
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build/deploy-java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
- name: Setup Java and Maven
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/setup-java@main
with:
javaVersion: "17"
javaVersion: "21"

- name: Restore Maven cache
uses: actions/cache/restore@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build/release-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
- name: Setup Java
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/setup-java@main
with:
javaVersion: "17"
javaVersion: "21"

- name: Install Helm
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/install-helm@main
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build/run-systemtests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
- name: Setup Java
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/setup-java@main
with:
javaVersion: "17"
javaVersion: "21"

- name: Setup Kind
uses: strimzi/strimzi-kafka-operator/.github/actions/dependencies/setup-kind@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup java
uses: actions/setup-java@v5
with:
java-version: 17
java-version: 21
distribution: 'temurin'
cache: 'maven'

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
ARG JAVA_VERSION=17
ARG JAVA_VERSION=21
ARG TARGETPLATFORM

USER root
Expand All @@ -9,7 +9,7 @@ RUN microdnf update -y \
&& microdnf clean all -y

# Set JAVA_HOME env var
ENV JAVA_HOME=/usr/lib/jvm/jre-17
ENV JAVA_HOME=/usr/lib/jvm/jre-${JAVA_VERSION}

# Add strimzi user with UID 1001
# The user is in the group 0 to have access to the mounted volumes and storage
Expand Down
8 changes: 0 additions & 8 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
<name>Strimzi Access Operator - API</name>
<artifactId>api</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<javadoc.fail.on.warnings>false</javadoc.fail.on.warnings>
</properties>

<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public long getObservedGeneration() {
return observedGeneration;
}

/**
* Sets the observed generation of the KafkaAccess resource.
*
* @param observedGeneration The observed generation to set.
*/
public void setObservedGeneration(long observedGeneration) {
this.observedGeneration = observedGeneration;
}
Expand Down
23 changes: 9 additions & 14 deletions development-docs/DEV_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ can do `brew install gnu-sed findutils grep coreutils`.
This command will install the GNU versions as `gcp`, `ggrep`, `gsed` and `gfind` and our `make` build will automatically pick them up and use them.

The `mvn` tool might install the latest version of OpenJDK during the brew install. For builds on macOS to succeed,
OpenJDK version 17 needs to be installed. This can be done by running `brew install openjdk@17`. For maven to read the
OpenJDK version 21 needs to be installed. This can be done by running `brew install openjdk@21`. For maven to read the
new Java version, you will need to edit the `~/.mavenrc` file and paste the following
line `export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home`.
line `export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home`.

You may come across an issue of linking from the above step. To solve this run this command:
`sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk`.
`sudo ln -sfn /usr/local/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk`.
If this throws an error that it cannot find the file or directory, navigate into `/Library/Java/` (or however deep you
can) and create a new folder named `JavaVirtualMachines` followed by creating a file named `openjdk-17.jdk`. The folder
structure after everything is said and done should look like `/Library/Java/JavaVirtualMachines/openjdk-17.jdk`. After
can) and create a new folder named `JavaVirtualMachines` followed by creating a file named `openjdk-21.jdk`. The folder
structure after everything is said and done should look like `/Library/Java/JavaVirtualMachines/openjdk-21.jdk`. After
doing that run the command at the beginning again and this should link the file and allow you to use maven with OpenJDK
version 17.
version 21.

## Run Pre-Requisites

Expand Down Expand Up @@ -173,10 +173,7 @@ the `strimzi` organization with the tag latest).

### Java versions

To use different Java version for the Maven build, you can specify the environment variable `JAVA_VERSION_BUILD` and set
it to the desired Java version. For example, for building with Java 17 you can use `export JAVA_VERSION_BUILD=17`.

> *Note*: Operator currently developed and tested with Java 17.
The operator requires Java 21 for building. The build uses Java 21 by default.

### Java build options

Expand All @@ -192,11 +189,9 @@ example:

When building the Docker images you can use an alternative JRE or use an alternate base image.

#### Alternative Docker image JRE
#### Docker image JRE

The docker images can be built with an alternative Java version by setting the environment variable `JAVA_VERSION`. For
example, to build docker images that have the Java 17 JRE installed use `JAVA_VERSION=17 make docker_build`. If not
present, the container images will use Java **17** by default.
The container images use Java **21**.

#### Alternative `docker` command

Expand Down
6 changes: 0 additions & 6 deletions operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
<name>Strimzi Access Operator</name>
<artifactId>operator</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public class KafkaAccessReconciler implements Reconciler<KafkaAccess> {
public static final String KAFKA_USER_SECRET_EVENT_SOURCE = "KAFKA_USER_SECRET_EVENT_SOURCE";

/**
* Creates a new KafkaAccessReconciler.
*
* @param kubernetesClient The Kubernetes client
*/
public KafkaAccessReconciler(final KubernetesClient kubernetesClient) {
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@
<properties>
<!-- Build dependencies -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.checkstyle.version>3.1.2</maven.checkstyle.version>
<maven.compiler.version>3.8.1</maven.compiler.version>
<checkstyle.version>9.0.1</checkstyle.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.checkstyle.version>3.5.0</maven.checkstyle.version>
<maven.compiler.version>3.13.0</maven.compiler.version>
<checkstyle.version>10.18.1</checkstyle.version>
<maven.surefire.version>3.2.2</maven.surefire.version>
<maven.failsafe.version>3.2.2</maven.failsafe.version>
<maven.license.version>2.11</maven.license.version>
<spotbugs.version>4.5.3</spotbugs.version>
<spotbugs-maven-plugin.version>4.5.3.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.8.6</spotbugs.version>
<spotbugs-maven-plugin.version>4.8.6.4</spotbugs-maven-plugin.version>
<maven.javadoc.version>3.5.0</maven.javadoc.version>
<maven.source.version>3.3.1</maven.source.version>
<maven.shade.version>3.1.0</maven.shade.version>
<maven.dependency.version>3.3.0</maven.dependency.version>
<maven.dependency.version>3.9.0</maven.dependency.version>
<maven.assembly.version>3.3.0</maven.assembly.version>
<maven.gpg.version>3.0.1</maven.gpg.version>
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
Expand Down Expand Up @@ -92,7 +92,7 @@
<helm-client.version>0.0.18</helm-client.version>
<hamcrest.version>2.2</hamcrest.version>

<javadoc.fail.on.warnings>true</javadoc.fail.on.warnings>
<javadoc.fail.on.warnings>false</javadoc.fail.on.warnings>

<!-- failsafe fork-count configuration -->
<failsafe.forkCount>1</failsafe.forkCount>
Expand Down
5 changes: 0 additions & 5 deletions systemtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<artifactId>systemtest</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javadoc.fail.on.warnings>false</javadoc.fail.on.warnings>

<skipTests>true</skipTests>
</properties>

Expand Down
Loading