0

I am trying to build a SAP Hybris project in Azure DevOps using ant. Sonar cloud is being used for code quality analysis which in turn uses java 11 at least. Our project needs to be built using java 8. So, is there any possible ways to do this in Azure DevOps?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

1 Answers1

0

Yes there is a way, but you can not rely on the ant target of hybris anymore, at least not directly.

We are executing the hybris build process with java 8 and run the analysis detached with gradle in java 11. There are downsides:

  1. you need to setup the whole gradle settings by yourself - or you can abuse the ant target of hybris to generate your properties and use that instead.

  2. depending on your automation level, you might need to put extra effort into this. As said we are using gradle for some functionality, and therefor it was not that hard.

  3. i think by now all JAVA 8 versions of SAP COMMERCE/HYBRIS are not supported anymore - so it is a good time to upgrade ;)

I outline our process here shortly:

  1. Setup JAVA 8
  2. build SAP Commerce with ant
  3. prepare the settings for SONAR and write them to sonar-project.properties file
  4. Setup JAVA 11
  5. Run Sonar-scanner (in our case gradle, but CLI etc is also fine)

The tricky part is within the third point - but as mentioned there is a ant task called sonarcheckmulti or sonarcheck which set up the properties, and can be abused to write the sonar-project.properties depending on the tools you have at hand.

Simon Schrottner
  • 4,146
  • 1
  • 24
  • 36