Skip to content

Commit

Permalink
Fixed licensing report issue
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Apr 19, 2023
1 parent d6de9c9 commit 9bf383d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:
run: mvn install -DskipTests
- name: License XML report
run: |
mvn org.codehaus.mojo:license-maven-plugin:2.0.0:download-licenses -Dlicense.excludedScopes=system,provided -DlicensesConfigFile=.github/workflows/licenses-config-file.xml
mvn org.codehaus.mojo:license-maven-plugin:2.0.0:aggregate-download-licenses
- name: Validate XML report
run: |
ALLOW_LICENSES=`cat .github/workflows/acceptable-licenses.txt | sed "s|<name>|name='|" | sed "s|</name>|' |" | tr -s '\n' '~' | sed 's/\~/or /g' `
find . -name licenses.xml -exec xq "//dependency[count(licenses/license[${ALLOW_LICENSES}])=0]" {} \; > target/license-issues.xml
xq "//dependency[count(licenses/license[${ALLOW_LICENSES}])=0]" target/generated-resources/aggregate-licenses.xml > target/license-issues.xml
LINES_FOUND=`cat target/license-issues.xml | grep "<result>" | wc -l`
if [ $LINES_FOUND -gt 0 ]; then cat target/license-issues.xml ; exit -1; fi
- name: Upload license XML Issues
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/licenses-config-file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<licenseSummary>
<dependencies>
<dependency>
<groupId>\Qorg.openapitool\E</groupId>
<artifactId>\Qjackson-databind-nullable\E</artifactId>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<matchLicenses>
<!-- Match an empty list of licenses -->
</matchLicenses>
Expand Down
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<licensesConfigFile>.github/workflows/licenses-config-file.xml</licensesConfigFile>
<licensesOutputFile>target/generated-resources/aggregate-licenses.xml</licensesOutputFile>
<excludedScopes>provided,system</excludedScopes>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 9bf383d

Please sign in to comment.