This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant-antlibs-common.git


The following commit(s) were added to refs/heads/master by this push:
     new 08aa3ef  Java 9+ is required to build SBOMs
08aa3ef is described below

commit 08aa3efdbec177de04e5a9d7f9a5ca787d612a4e
Author: Stefan Bodewig <[email protected]>
AuthorDate: Sun Jul 26 18:24:22 2026 +0200

    Java 9+ is required to build SBOMs
---
 build.xml            |  4 ++++
 cyclonedx-common.xml | 22 ++++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index 1f3194c..761c139 100644
--- a/build.xml
+++ b/build.xml
@@ -42,6 +42,10 @@
     <tstamp>
       <format property="artifact.publication.datetime" 
pattern="yyyyMMddHHmmss"/>
     </tstamp>
+
+    <condition property="jdk9+">
+      <javaversion atleast="9"/>
+    </condition>
   </target>
 
   <target name="setup" depends="setup-properties">
diff --git a/cyclonedx-common.xml b/cyclonedx-common.xml
index 6d03b28..41257ef 100644
--- a/cyclonedx-common.xml
+++ b/cyclonedx-common.xml
@@ -22,7 +22,24 @@ under the License.
   <!-- version of CycloneDX Antlib to use -->
   <property name="cyclconedx.antlib.version" value="0.1"/>
 
-  <target name="fetch-cyclonedx" depends="resolve" if="with.ivy">
+  <target name="-check-cyclonedx" depends="setup-properties">
+    <condition property="can.use.cyclonedx">
+      <and>
+        <isset property="with.ivy"/>
+        <isset property="jdk9+"/>
+      </and>
+    </condition>
+    <condition property="add.ant.core.component">
+      <and>
+        <isset property="can.use.cyclonedx"/>
+        <isset property="ant.core.version"/>
+      </and>
+    </condition>
+  </target>
+
+  <target name="fetch-cyclonedx"
+          depends="-check-cyclonedx,resolve"
+          if="can.use.cyclonedx">
     <ivy:cachepath organisation="org.apache.ant"
                    module="ant-cyclonedx"
                    revision="${cyclconedx.antlib.version}"
@@ -37,6 +54,7 @@ under the License.
 
   <target name="define-common-cyclonedx-references"
           depends="fetch-cyclonedx"
+          if="can.use.cyclonedx"
           xmlns:cdx="antlib:org.apache.ant.cyclonedx">
     <!-- common definitions for SBOMs -->
     <cdx:organization
@@ -104,7 +122,7 @@ under the License.
   </target>
 
   <target name="define-core-ant-components"
-          if="ant.core.version"
+          if="add.ant.core.component"
           xmlns:cdx="antlib:org.apache.ant.cyclonedx"
           depends="define-common-cyclonedx-references">
     <cdx:component

Reply via email to