SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target

Recently I have been involved in Framework Update engagement to bump Commerce Cloud solution from JDK 17 to JDK 21.

Upgrade to Java 21 It has been announced some time ago by SAP as a Framework Update
which bumps Java, Spring and long list of dependenc…


This content originally appeared on DEV Community and was authored by Pawel Wolanski

Recently I have been involved in Framework Update engagement to bump Commerce Cloud solution from JDK 17 to JDK 21.

Upgrade to Java 21 It has been announced some time ago by SAP as a Framework Update
which bumps Java, Spring and long list of dependencies to latest Java LTS.
More information about service you can find on:

One of nice things which has been added by SAP is upgrade automation based on OpenRewrite. More information about whole activity you can find as SAP KBA 3618495 - Using OpenRewrite recipes to support SAP Commerce Cloud JDK21 Framework Update adoption

Issue

At the beginning when you run ant command ant gradle you may get similar error like:

/opt/hybris/hybris/bin/platform/build.xml:204: Cannot invoke "String.startsWith(String)" because the return value of "org.apache.maven.model.Dependency.getVersion()" is null

That error is related to scanning process for Maven dependencies in external-dependencies.xml.

Root cause

In my case one of external-dependencies.xml for custom extension got dependency defined:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.hybris.platform</groupId>
    <artifactId>knackbravaocc</artifactId>
    <version>2211.1</version>
    <packaging>jar</packaging>

    <dependencies>
...
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
...
    </dependencies>
</project>

In order to fix it, I needed to add version explicitly for that dependency.

Solution

Check if your all dependencies have version xml tag defined.


This content originally appeared on DEV Community and was authored by Pawel Wolanski


Print Share Comment Cite Upload Translate Updates
APA

Pawel Wolanski | Sciencx (2026-03-19T12:50:11+00:00) SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target. Retrieved from https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/

MLA
" » SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target." Pawel Wolanski | Sciencx - Thursday March 19, 2026, https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/
HARVARD
Pawel Wolanski | Sciencx Thursday March 19, 2026 » SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target., viewed ,<https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/>
VANCOUVER
Pawel Wolanski | Sciencx - » SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/
CHICAGO
" » SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target." Pawel Wolanski | Sciencx - Accessed . https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/
IEEE
" » SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target." Pawel Wolanski | Sciencx [Online]. Available: https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/. [Accessed: ]
rf:citation
» SAP Commerce Cloud Framework Update JDK 21 – issue with ANT gradle target | Pawel Wolanski | Sciencx | https://www.scien.cx/2026/03/19/sap-commerce-cloud-framework-update-jdk-21-issue-with-ant-gradle-target/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.