diff --git a/src/main/java/org/spdx/maven/utils/SpdxV2FileCollector.java b/src/main/java/org/spdx/maven/utils/SpdxV2FileCollector.java index 0bf5cbe..91e909d 100644 --- a/src/main/java/org/spdx/maven/utils/SpdxV2FileCollector.java +++ b/src/main/java/org/spdx/maven/utils/SpdxV2FileCollector.java @@ -301,14 +301,20 @@ private SpdxFile convertToSpdxFile( File file, String outputFileName, { if ( fileSpdxLicenses.size() == 1 ) { - license = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( fileSpdxLicenses.get( 0 ) ); + license = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( fileSpdxLicenses.get( 0 ), + spdxDoc.getModelStore(), + spdxDoc.getDocumentUri(), + spdxDoc.getCopyManager() ); } else { Set licenseSet = new HashSet<>(); for ( String licenseExpression : fileSpdxLicenses ) { - licenseSet.add( LicenseInfoFactory.parseSPDXLicenseStringCompatV2( licenseExpression ) ); + licenseSet.add( LicenseInfoFactory.parseSPDXLicenseStringCompatV2( licenseExpression, + spdxDoc.getModelStore(), + spdxDoc.getDocumentUri(), + spdxDoc.getCopyManager() ) ); } license = spdxDoc.createConjunctiveLicenseSet( licenseSet ); } @@ -336,8 +342,14 @@ else if ( !licenseComment.isEmpty() ) { try { - license = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( defaultFileInformation.getDeclaredLicense() ); - concludedLicense = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( defaultFileInformation.getConcludedLicense() ); + license = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( defaultFileInformation.getDeclaredLicense(), + spdxDoc.getModelStore(), + spdxDoc.getDocumentUri(), + spdxDoc.getCopyManager() ); + concludedLicense = LicenseInfoFactory.parseSPDXLicenseStringCompatV2( defaultFileInformation.getConcludedLicense(), + spdxDoc.getModelStore(), + spdxDoc.getDocumentUri(), + spdxDoc.getCopyManager() ); } catch ( InvalidSPDXAnalysisException e ) { diff --git a/src/main/java/org/spdx/maven/utils/SpdxV3FileCollector.java b/src/main/java/org/spdx/maven/utils/SpdxV3FileCollector.java index 9b43024..7a73f2e 100644 --- a/src/main/java/org/spdx/maven/utils/SpdxV3FileCollector.java +++ b/src/main/java/org/spdx/maven/utils/SpdxV3FileCollector.java @@ -365,14 +365,16 @@ private SpdxFile convertToSpdxFile( File file, String outputFileName, { if ( fileSpdxLicenses.size() == 1 ) { - license = LicenseInfoFactory.parseSPDXLicenseString( fileSpdxLicenses.get( 0 ) ); + license = LicenseInfoFactory.parseSPDXLicenseString( fileSpdxLicenses.get( 0 ), + spdxDoc.getModelStore(), spdxDoc.getIdPrefix(), spdxDoc.getCopyManager(), customIdToUri ); } else { Set licenseSet = new HashSet<>(); for ( String licenseExpression : fileSpdxLicenses ) { - licenseSet.add( LicenseInfoFactory.parseSPDXLicenseString( licenseExpression ) ); + licenseSet.add( LicenseInfoFactory.parseSPDXLicenseString( licenseExpression, + spdxDoc.getModelStore(), spdxDoc.getIdPrefix(), spdxDoc.getCopyManager(), customIdToUri ) ); } license = spdxDoc.createConjunctiveLicenseSet( spdxDoc.getIdPrefix() + spdxDoc.getModelStore().getNextId( IdType.SpdxId ) ) .addAllMember( licenseSet ) @@ -402,8 +404,10 @@ else if ( !licenseComment.isEmpty() ) { try { - license = LicenseInfoFactory.parseSPDXLicenseString( defaultFileInformation.getDeclaredLicense() ); - concludedLicense = LicenseInfoFactory.parseSPDXLicenseString( defaultFileInformation.getConcludedLicense() ); + license = LicenseInfoFactory.parseSPDXLicenseString( defaultFileInformation.getDeclaredLicense(), + spdxDoc.getModelStore(), spdxDoc.getIdPrefix(), spdxDoc.getCopyManager(), customIdToUri ); + concludedLicense = LicenseInfoFactory.parseSPDXLicenseString( defaultFileInformation.getConcludedLicense(), + spdxDoc.getModelStore(), spdxDoc.getIdPrefix(), spdxDoc.getCopyManager(), customIdToUri ); } catch ( InvalidSPDXAnalysisException e ) {