fix(analyzer): Serialize `sharedPackages` ordered by their `id`

Make the serialization more deterministic.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
This commit is contained in:
Frank Viernau 2024-05-17 10:40:14 +02:00 committed by Frank Viernau
parent e074893cd6
commit 4bd380b842
1 changed files with 4 additions and 0 deletions

View File

@ -19,11 +19,14 @@
package org.ossreviewtoolkit.analyzer
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import java.io.File
import org.ossreviewtoolkit.model.DependencyGraph
import org.ossreviewtoolkit.model.Package
import org.ossreviewtoolkit.model.ProjectAnalyzerResult
import org.ossreviewtoolkit.model.utils.PackageSortedSetConverter
/**
* A data class representing the result of the execution of a [PackageManager]. An instance contains the single
@ -48,5 +51,6 @@ data class PackageManagerResult(
* produce a shared [DependencyGraph] typically do not collect packages on a project-level, but globally. Such
* packages can be stored in this property.
*/
@JsonSerialize(converter = PackageSortedSetConverter::class)
val sharedPackages: Set<Package> = emptySet()
)