SAP / cloud-mta-build-tool

Multi-Target Application (MTA) build tool for Cloud Applications https://sap.github.io/cloud-mta-build-tool
Apache License 2.0
141 stars 62 forks source link

Java 21 support, cyclonedx-maven-plugin:2.7.5 #1144

Open D068130 opened 1 month ago

D068130 commented 1 month ago

https://github.com/SAP/cloud-mta-build-tool/blob/c06513ea64d7bda42219103b5e8b7f2c67372360/internal/commands/commands.go#L356

In the line linked above you use the command: mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBo ....

The version 2.7.5 does not support Java 21 as far as I could see. Could you please update that to the newest version of the plugin?

Kind regards Hendrik

yutaoj commented 3 weeks ago

Hello @D068130 , Could you please provide more detailed information? This will help me identify the specific error you're encountering. I've noticed that my simple Java application, which is running on openjdk version "21.0.4" 2024-07-16 LTS, is not throwing any error messages. thanks Yutao

D068130 commented 3 weeks ago

Hi yutaoj,

did you make sure that you configured in your setup that the sbom will be built?

The actual error we get is:

error mtaBuild - [ERROR] Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom (default-cli) on project ts-reader: Execution default-cli of goal org.cyclonedx:cyclonedx-maven-plugin:2.7.5:makeAggregateBom failed: Unsupported class file major version 65 -> [Help 1]

Which for me means the version of the plugin does not support Java21

image
yutaoj commented 3 weeks ago

Hi Hendrik,

Thank you for your input , I got the info "Unsupported class file major version 65", which indicate the jdk Compatibility. Could you please provide additional details, such as the operating system, Maven version, and whether you are using Oracle JDK? This information will be crucial for me to reproduce and address this issue effectively.

Thanks Yutao

D068130 commented 3 weeks ago

Hi yutaoj, we are using azure pipelines and piper with the parameters for the mta build as follows:

mtaBuild:
  mtaBuildTool: cloudMbt
  mtarGroup: 'com.sap.hyperspace'
  dockerImage: 'devxci/mbtci-java21-node20'
  createBOM: true

https://github.wdf.sap.corp/pages/ContinuousDelivery/piper-doc/steps/mtaBuild/#overview-step

D068130 commented 3 weeks ago

Thats the link to the docker image: https://hub.docker.com/layers/devxci/mbtci-java21-node20/latest/images/sha256-856d1da77b3dba007fdcca76ab43d02095ba5aa9d5ce1a326d51ed64d9ec14ef?context=explore

yutaoj commented 2 weeks ago

Hi Hendrik,

I can't reproduce this error with my java/maven case in docker image "devxci/mbtci-java21-node20" , I will continue look into this issue .

thanks Yutao

D068130 commented 2 weeks ago

I think I just found the issue. When trying it for another repository, which is actually a multi module project, it works just fine.

But then I tried it for the repository ts-reader for which I also get the error in the pipeline. It is not a multi module project, but it still tries to call: cyclonedx-maven-plugin:2.7.5:makeAggregateBom

but for a single module project it is supposed to call cyclonedx-maven-plugin:2.7.5:makeBom

Can it be that you always use the makeAggregateBom command? And do not differ between aggregate and non aggregate maven projects?