Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f6046d1
Lift minimum JDK version to 21 and remove SecurityManager
holgerfriedrich Dec 27, 2025
37d0943
disable org.osgi.framework.security in JavaSecurityTest
holgerfriedrich Apr 14, 2026
b10428f
Updated how Java 21 is set in various places
CptBartender Jun 8, 2026
4779531
Fix Subject propagation for shell RBAC on JDK 25
holgerfriedrich Jul 19, 2026
05309b9
Change thread creation for itests
holgerfriedrich Jul 19, 2026
83aa632
Fix typo in ci workflow desc
holgerfriedrich Sep 11, 2026
4c27f01
Replace doAs in newly added KarafMBeanServerGuardTest
holgerfriedrich Sep 11, 2026
38d40ad
Replace java 17 in karaf-light pom
holgerfriedrich Sep 11, 2026
c566cb4
Add Java25 on Ubuntu to build matrix
holgerfriedrich Sep 11, 2026
dccb67a
ubuntu 26.04 public preview for j25
holgerfriedrich Sep 11, 2026
84f747a
mvn-4.0.0-rc-7 for j25
holgerfriedrich Sep 11, 2026
169cd5f
Cleanup
holgerfriedrich Oct 19, 2026
8124134
Cleanup, addresses AI review
holgerfriedrich Oct 30, 2026
aa17c31
Define JRE/EE capabilities for Java 21 to 27 only
holgerfriedrich Nov 14, 2026
c10c32b
Replace {8,11,17}-jre by 21-jre
holgerfriedrich Nov 17, 2026
aa9ad9d
Remove JavaSecurityTest, #2082
holgerfriedrich Nov 17, 2026
9f82fbd
Replace stale Java versions, also in docs
holgerfriedrich Nov 17, 2026
4ea5255
Use session subject for shell invoke/redirect ACL checks
holgerfriedrich Nov 17, 2026
cb77e3f
Implement review suggestions
holgerfriedrich Nov 18, 2026
0c33895
Keep the shell session subject out of user-writable variables
holgerfriedrich Nov 18, 2026
9865cab
Adapt Docker test to J25
holgerfriedrich Nov 18, 2026
efbb7b3
Remove unused karaf-maven-plugin config.properties and AccessControll…
jbonofre Nov 18, 2026
51041a2
Keep default JDK 21 CI job names matching .asf.yaml required checks
jbonofre Nov 18, 2026
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
60 changes: 48 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:

jobs:
build:
name: build (${{ matrix.os }})
name: build (${{ matrix.os }}${{ matrix.java != '21' && format(', jdk {0}', matrix.java) || '' }})

permissions:
contents: read
Expand All @@ -36,29 +36,47 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04, windows-latest, macos-latest ]
java: [ '21' ]
# JDK 25, Linux only, and only on main. The runner image ships Maven 3.9.x,
# so the Maven 4 this entry asks for is installed by the "Set up Maven" step below.
include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25","maven":"4.0.0-rc-7"}]') || fromJSON('[]') }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up JDK 17
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v6
with:
java-version: '17'
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Set up Maven ${{ matrix.maven }}
if: matrix.maven
env:
MAVEN_VERSION: ${{ matrix.maven }}
run: |
url="https://archive.apache.org/dist/maven/maven-4/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
curl -fsSL -o "${RUNNER_TEMP}/maven.tar.gz" "${url}"
echo "$(curl -fsSL "${url}.sha512") ${RUNNER_TEMP}/maven.tar.gz" | sha512sum -c -
tar -xzf "${RUNNER_TEMP}/maven.tar.gz" -C "${RUNNER_TEMP}"
# fails the step if the layout is not what we expect, rather than silently keeping Maven 3
"${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin/mvn" -v
echo "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin" >> "${GITHUB_PATH}"
- name: Build
run: mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true"
run: |
mvn --version
mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true"
- name: Save Maven Local Repository
uses: actions/upload-artifact@v7
with:
name: maven-local-repo-${{ matrix.os }}
name: maven-local-repo-${{ matrix.os }}-jdk${{ matrix.java }}
path: ~/.m2/repository
retention-days: 1

test:
name: test (${{ matrix.os }})
name: test (${{ matrix.os }}${{ matrix.java != '21' && format(', jdk {0}', matrix.java) || '' }})
needs: build

permissions:
Expand All @@ -68,34 +86,52 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04, windows-latest, macos-latest ]
java: [ '21' ]
# JDK 25, Linux only, and only on main. The runner image ships Maven 3.9.x,
# so the Maven 4 this entry asks for is installed by the "Set up Maven" step below.
include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25","maven":"4.0.0-rc-7"}]') || fromJSON('[]') }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up JDK 17
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v6
with:
java-version: '17'
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Restore Maven Local Repository
uses: actions/download-artifact@v8
with:
name: maven-local-repo-${{ matrix.os }}
name: maven-local-repo-${{ matrix.os }}-jdk${{ matrix.java }}
path: ~/.m2/repository
- name: Set up Maven ${{ matrix.maven }}
if: matrix.maven
env:
MAVEN_VERSION: ${{ matrix.maven }}
run: |
url="https://archive.apache.org/dist/maven/maven-4/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
curl -fsSL -o "${RUNNER_TEMP}/maven.tar.gz" "${url}"
echo "$(curl -fsSL "${url}.sha512") ${RUNNER_TEMP}/maven.tar.gz" | sha512sum -c -
tar -xzf "${RUNNER_TEMP}/maven.tar.gz" -C "${RUNNER_TEMP}"
# fails the step if the layout is not what we expect, rather than silently keeping Maven 3
"${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin/mvn" -v
echo "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin" >> "${GITHUB_PATH}"
- name: Test
run: mvn -B -e install -Ptest
run: |
mvn --version
mvn -B -e install -Ptest
timeout-minutes: 180
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}
name: test-results-${{ matrix.os }}-jdk${{ matrix.java }}
path: '**/target/surefire-reports/*.xml'
- name: Upload Event File
if: always()
if: always() && matrix.java == '21'
uses: actions/upload-artifact@v7
with:
name: event-file-${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

## Initial Setup

1. Install J2SE 11 SDK (or later)
1. Install J2SE 21 SDK (or later)

2. Make sure that your JAVA_HOME environment variable is set to the newly installed
JDK location, and that your PATH includes `%JAVA_HOME%\bin` (windows) or
`$JAVA_HOME$/bin` (unix).

3. Install Maven 3.8.0 (or later), which can be downloaded from
3. Install Maven 3.8.8 (or later), which can be downloaded from
http://maven.apache.org/download.html. Make sure that your PATH includes
the `$MVN_HOME/bin` directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<!-- minimal distribution -->
<!--<feature>minimal</feature>-->
</bootFeatures>
<javase>17</javase>
<javase>^javaVersion^</javase>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>21</release>
<source>21</source>
<target>21</target>
<maxmem>256M</maxmem>
</configuration>
</plugin>
Expand Down
5 changes: 3 additions & 2 deletions archetypes/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>${javaVersion}</release>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
<maxmem>256M</maxmem>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>21</release>
<source>21</source>
<target>21</target>
<maxmem>256M</maxmem>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@
<inherited>true</inherited>
<version>3.15.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>21</release>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/apache-karaf-light/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<blacklistedBundles>
<bundle>mvn:org.ops4j.pax.logging/*</bundle>
</blacklistedBundles>
<javase>17</javase>
<javase>${javaVersion}</javase>
<generateConsistencyReport>${project.build.directory}</generateConsistencyReport>
<consistencyReportProjectName>Apache Karaf Light</consistencyReportProjectName>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/apache-karaf-minimal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
!org.apache.karaf.command.acl.*,
*
</pidsToExtract>
<javase>17</javase>
<javase>${javaVersion}</javase>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/apache-karaf-mix/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
</bootFeatures>
<libraries>
</libraries>
<javase>17</javase>
<javase>${javaVersion}</javase>
<generateConsistencyReport>${project.build.directory}</generateConsistencyReport>
<consistencyReportProjectName>Apache Karaf Mix</consistencyReportProjectName>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/apache-karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
</bootFeatures>
<libraries>
</libraries>
<javase>17</javase>
<javase>${javaVersion}</javase>
<generateConsistencyReport>${project.build.directory}</generateConsistencyReport>
<consistencyReportProjectName>Apache Karaf (full)</consistencyReportProjectName>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion assemblies/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.
################################################################################

FROM eclipse-temurin:11-jre
FROM eclipse-temurin:21-jre

# Karaf environment variables
ENV KARAF_INSTALL_PATH /opt
Expand Down
4 changes: 2 additions & 2 deletions assemblies/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht

## Build

Images are based on the Docker official [Eclipse Temurin 11 JRE](https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=11-jre) image. If you want to
Images are based on the Docker official [Eclipse Temurin 21 JRE](https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=21-jre) image. If you want to
build the Karaf image you have the following choices:

1. Create the docker image from a local distribution package
Expand All @@ -50,7 +50,7 @@ Usage:

If the --image-name flag is not used the built image name will be 'karaf'.
Check the supported build platforms; you can verify with this command: docker buildx ls
The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:11-jre](https://hub.docker.com/_/eclipse-temurin).
The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:21-jre](https://hub.docker.com/_/eclipse-temurin).
```

To create the docker image from local distribution) you can execute the command
Expand Down
2 changes: 1 addition & 1 deletion assemblies/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Usage:

If the --image-name flag is not used the built image name will be 'karaf'.
Check the supported build platforms; you can verify with this command: docker buildx ls
The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:11-jre](https://hub.docker.com/_/eclipse-temurin).
The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:21-jre](https://hub.docker.com/_/eclipse-temurin).

HERE
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ locateJava() {
fi

if [ "x${JAVA_HOME}" = "x" ] && [ "${darwin}" = "true" ]; then
JAVA_HOME="`/usr/libexec/java_home -v 1.8`"
JAVA_HOME="`/usr/libexec/java_home -v 21+`"
fi
if [ "x${JAVA_HOME}" = "x" ] && [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
Expand Down Expand Up @@ -243,9 +243,9 @@ checkJvmVersion() {

VERSION=`"${JAVA}" -version 2>&1 | ${AWK} -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;s/-.*//g; s/^[A-Za-z].*//'`

# java must be at least version 11
if [ "${VERSION}" -lt "11" ]; then
die "JVM must be version 11 or greater"
# java must be at least version 21
if [ "${VERSION}" -lt "21" ]; then
die "JVM must be version 21 or greater"
fi
}

Expand Down Expand Up @@ -282,12 +282,6 @@ setupVendorSepcifics() {
setupDefaults() {
DEFAULT_JAVA_OPTS="-XX:+UnlockDiagnosticVMOptions "

if [ "${VERSION}" -gt "11" ]; then
# TODO revisit EventAdminImpl to avoid use of Subject.getSubject(AccessController.getContext());
# -Djava.security.manager=allow is a workaround for SecurityController deprecation in JDK23+
DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -Djava.security.manager=allow "
fi

setupVendorSepcifics

DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} ${JAVA_VENDOR_OPTS}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,14 @@ setupClassPath() {
CLASSPATH="${CLASSPATH}:${file}"
fi
done
if [ "${VERSION}" -gt "8" ] ; then
for file in "${KARAF_HOME}"/lib/jdk9plus/*.jar
do
if [ -z "${CLASSPATH}" ]; then
CLASSPATH="${file}"
else
CLASSPATH="${CLASSPATH}:${file}"
fi
done
fi
for file in "${KARAF_HOME}"/lib/jdk9plus/*.jar
do
if [ -z "${CLASSPATH}" ]; then
CLASSPATH="${file}"
else
CLASSPATH="${CLASSPATH}:${file}"
fi
done
}

checkRootInstance() {
Expand Down Expand Up @@ -183,12 +181,8 @@ run() {
if [ "x$CHECK_ROOT_INSTANCE_RUNNING" = "x" ]; then
CHECK_ROOT_INSTANCE_RUNNING=true
fi
JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed"
JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext"
if ${cygwin}; then
JAVA_HOME=`cygpath --path --windows "${JAVA_HOME}"`
JAVA_ENDORSED_DIRS=`cygpath --path --windows "${JAVA_ENDORSED_DIRS}"`
JAVA_EXT_DIRS=`cygpath --path --windows "${JAVA_EXT_DIRS}"`
fi
convertPaths
cd "${KARAF_BASE}" || exit 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,16 @@ for /f tokens^=2-5^ delims^=.-_+^" %%j in ('"%JAVA%" -fullversion 2^>^&1') do (
if %%j==1 (set JAVA_VERSION=%%k) else (set JAVA_VERSION=%%j)
)

if %JAVA_VERSION% GTR 8 (
pushd "%KARAF_HOME%\lib\jdk9plus"
for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G
popd
rem java must be at least version 21
if %JAVA_VERSION% LSS 21 (
call :warn JVM must be version 21 or greater
goto END
)

pushd "%KARAF_HOME%\lib\jdk9plus"
for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G
popd

:CheckRootInstance
set ROOT_INSTANCE_RUNNING=false
if exist "%KARAF_HOME%\instances\instance.properties" (
Expand Down Expand Up @@ -267,10 +271,6 @@ if not exist "%JAVA_HOME%\bin\server\jvm.dll" (
)
set DEFAULT_JAVA_OPTS=-XX:+UnlockDiagnosticVMOptions

if %JAVA_VERSION% GTR 11 (
set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -Djava.security.manager=allow
)

if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS%

if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END
Expand Down
Loading
Loading