eclipse-archived / antenna

SW360 Antenna project
Other
22 stars 19 forks source link

ORT Downloader: Update ORT dependency to match latest ORT Analyzer output #632

Open andreaslarfors opened 3 years ago

andreaslarfors commented 3 years ago

Summary of the Bug

It is not currently possible to use analyzer_result.yml files from the latest version of ORT as input to Antenna with the ORT Downloader enabled. When updating the ort.rev value in pom.xml to any recent commit values, we get compilation errors:

2020-11-13T13:56:35.9752136Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project runtime: Compilation failure: Compilation failure: 
2020-11-13T13:56:35.9753046Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[102,50] error: cannot find symbol
2020-11-13T13:56:35.9753528Z [ERROR]   symbol:   method component1()
2020-11-13T13:56:35.9753877Z [ERROR]   location: variable spdxLicenseIdExpression of type SpdxLicenseIdExpression
2020-11-13T13:56:35.9754417Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[103,51] error: cannot find symbol
2020-11-13T13:56:35.9754867Z [ERROR]   symbol:   method component2()
2020-11-13T13:56:35.9755228Z [ERROR]   location: variable spdxLicenseIdExpression of type SpdxLicenseIdExpression
2020-11-13T13:56:35.9755763Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[113,58] error: cannot find symbol
2020-11-13T13:56:35.9756206Z [ERROR]   symbol:   method component1()
2020-11-13T13:56:35.9756562Z [ERROR]   location: variable spdxCompoundExpression of type SpdxCompoundExpression
2020-11-13T13:56:35.9757177Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[114,60] error: cannot find symbol
2020-11-13T13:56:35.9757624Z [ERROR]   symbol:   method component2()
2020-11-13T13:56:35.9757968Z [ERROR]   location: variable spdxCompoundExpression of type SpdxCompoundExpression

This is due to the refactoring of the Kotlin code in ORT: https://github.com/oss-review-toolkit/ort/commit/67db194b225a5eb7ea835954daae020d57fbb570 From data classes to regular classes, which no longer support the component1(), component2(), component3() methods. We also cannot access the fields from Java because the @JvmField has not been used so the fields are private to Java.

The core/runtime/.../antenna/util/LicenseSupport.java logic needs to be updated.

Steps to reproduce

Acceptance Criteria

Definition of Done

sschuberth commented 3 years ago

Thanks for the report @andreaslarfors. We're currently looking at ways to stop this mix between Antenna and the ORT Analyzer altogether. May I ask what you use-case for using Antenna is? Specifically, would you still need to use Antenna if https://github.com/oss-review-toolkit/ort/pull/3313 was implemented?