Skip to content

Commit 7fb06f2

Browse files
rpanackalbot-sdk-jsnewtork
authored
Dependency License Compliance Test (#189)
* Partially working - fail disabled * Expected to fail on license compliance check - Fail on missing or licenses not in whitelist * Add 3rd Party Goal in effect - A generated-sources/license/THIRD-PARTY.txt included in build dir - Skip spring-app from license compliance - fail on generate-resources if compliance fails - Skip dependencies in test scope * Formatting * Update pom.xml * Update pom.xml --------- Co-authored-by: Roshin Rajan Panackal <[email protected]> Co-authored-by: SAP Cloud SDK Bot <[email protected]> Co-authored-by: Alexander Dümont <[email protected]>
1 parent 989adfd commit 7fb06f2

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

pom.xml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@
332332
<configuration>
333333
<rules>
334334
<bannedDependencies>
335-
<message>Do not use JUnit 4.X, instead exclusively use Junit Jupiter. JUnit 4 tests will (silently) simply not be executed.</message>
335+
<message>Do not use JUnit 4.X, instead exclusively use Junit Jupiter. JUnit 4 tests will (silently)
336+
simply not be executed.</message>
336337
<excludes>
337338
<exclude>junit:junit</exclude>
338339
</excludes>
@@ -584,6 +585,50 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma
584585
<artifactId>maven-resources-plugin</artifactId>
585586
<version>3.3.1</version>
586587
</plugin>
588+
<plugin>
589+
<groupId>org.codehaus.mojo</groupId>
590+
<artifactId>license-maven-plugin</artifactId>
591+
<version>2.4.0</version>
592+
<configuration>
593+
<acceptPomPackaging>true</acceptPomPackaging>
594+
<licenseName>apache_v2</licenseName>
595+
<failOnBlacklist>true</failOnBlacklist>
596+
<failOnMissing>true</failOnMissing>
597+
<excludedScopes>test</excludedScopes>
598+
<includedLicenses>
599+
<includedLicense>The MIT License</includedLicense>
600+
<includedLicense>Apache Software License - Version 2.0</includedLicense>
601+
<includedLicense>ISC</includedLicense>
602+
<includedLicense>The BSD 3-Clause License</includedLicense>
603+
<includedLicense>WTFPL</includedLicense>
604+
<includedLicense>CC-BY</includedLicense>
605+
<includedLicense>CC0</includedLicense>
606+
<includedLicense>Unlicense</includedLicense>
607+
<includedLicense>Public Domain</includedLicense>
608+
609+
<!-- other licenses as needed -->
610+
<includedLicense>Eclipse Distribution License - v 1.0</includedLicense>
611+
<includedLicense>Bouncy Castle Licence</includedLicense>
612+
</includedLicenses>
613+
<licenseMerges>
614+
<licenseMerge>Apache Software License - Version 2.0|Apache License Version 2.0|Apache 2.0|
615+
The Apache License, Version 2.0|Apache License, Version 2.0|Apache-2.0|
616+
The Apache Software License, Version 2.0</licenseMerge>
617+
<licenseMerge>The MIT License|MIT License|The MIT License (MIT)|MIT</licenseMerge>
618+
<licenseMerge>The BSD 3-Clause License|BSD License 3</licenseMerge>
619+
<licenseMerge>Eclipse Distribution License - v 1.0|EDL 1.0</licenseMerge>
620+
<licenseMerge>Eclipse Public License v2.0|EPL 2.0</licenseMerge>
621+
</licenseMerges>
622+
</configuration>
623+
<executions>
624+
<execution>
625+
<id>add-third-party</id>
626+
<goals>
627+
<goal>add-third-party</goal>
628+
</goals>
629+
</execution>
630+
</executions>
631+
</plugin>
587632
</plugins>
588633
</build>
589634
<profiles>

sample-code/spring-app/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@
184184
<skipTests>${skipTests}</skipTests>
185185
</configuration>
186186
</plugin>
187+
<plugin>
188+
<groupId>org.codehaus.mojo</groupId>
189+
<artifactId>license-maven-plugin</artifactId>
190+
<configuration>
191+
<skipAddThirdParty>true</skipAddThirdParty>
192+
</configuration>
193+
</plugin>
187194
</plugins>
188195
</build>
189196
</project>

0 commit comments

Comments
 (0)