Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit c67b755

Browse files
committed
📄 JAVA-3653 Add License Configuration
Add Apache 2 License configuration to Maven build.
1 parent 9a56226 commit c67b755

File tree

2 files changed

+159
-43
lines changed

2 files changed

+159
-43
lines changed

Diff for: ‎LICENSE

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright 2021 Contrast Security, Inc.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+

Diff for: ‎pom.xml

+145-43
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,26 @@
1515
<version>2.13-SNAPSHOT</version>
1616
<packaging>maven-plugin</packaging>
1717

18+
<name>Contrast Maven Plugin</name>
19+
<description>Maven plugin to test for vulnerabilities when running integration tests for a Java
20+
application
21+
</description>
22+
<url>https://docs.contrastsecurity.com/en/maven.html</url>
23+
1824
<organization>
19-
<name>Contrast Security</name>
25+
<name>Contrast Security, Inc.</name>
2026
<url>https://contrastsecurity.com</url>
2127
</organization>
2228

29+
<licenses>
30+
<license>
31+
<name>Apache License, Version 2.0</name>
32+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
33+
<distribution>repo</distribution>
34+
<comments>A business-friendly OSS license</comments>
35+
</license>
36+
</licenses>
37+
2338
<distributionManagement>
2439
<snapshotRepository>
2540
<id>ossrh</id>
@@ -41,12 +56,6 @@
4156
<tag>HEAD</tag>
4257
</scm>
4358

44-
<name>Contrast Maven Plugin</name>
45-
<description>Maven plugin to test for vulnerabilities when running integration tests for a Java
46-
application
47-
</description>
48-
<url>https://docs.contrastsecurity.com/en/maven.html</url>
49-
5059
<properties>
5160
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5261
<contrast.test-repository>${project.build.directory}/test-repository</contrast.test-repository>
@@ -151,41 +160,6 @@
151160
</resources>
152161

153162
<plugins>
154-
<plugin>
155-
<groupId>com.diffplug.spotless</groupId>
156-
<artifactId>spotless-maven-plugin</artifactId>
157-
<version>2.12.0</version>
158-
<configuration>
159-
<formats>
160-
<format>
161-
<includes>
162-
<include>pom.xml</include>
163-
<include>README.md</include>
164-
<include>.github/workflows/**/*.yml</include>
165-
<include>src/**/*.java</include>
166-
<include>src/**/*.xml</include>
167-
<include>src/**/*.properties</include>
168-
</includes>
169-
<trimTrailingWhitespace/>
170-
<endWithNewline/>
171-
</format>
172-
</formats>
173-
<java>
174-
<googleJavaFormat>
175-
<version>1.9</version>
176-
</googleJavaFormat>
177-
<removeUnusedImports/>
178-
</java>
179-
</configuration>
180-
<executions>
181-
<execution>
182-
<goals>
183-
<goal>check</goal>
184-
</goals>
185-
<phase>test-compile</phase>
186-
</execution>
187-
</executions>
188-
</plugin>
189163
<plugin>
190164
<artifactId>maven-compiler-plugin</artifactId>
191165
<configuration>
@@ -200,6 +174,23 @@
200174
</annotationProcessorPaths>
201175
</configuration>
202176
</plugin>
177+
<plugin>
178+
<groupId>org.codehaus.mojo</groupId>
179+
<artifactId>license-maven-plugin</artifactId>
180+
<executions>
181+
<execution>
182+
<!-- Always automatically add license file to generated sources -->
183+
<id>update-generated-sources</id>
184+
<goals>
185+
<goal>update-file-header</goal>
186+
</goals>
187+
<phase>process-test-sources</phase>
188+
<configuration>
189+
<roots>${project.build.directory}/generated-sources</roots>
190+
</configuration>
191+
</execution>
192+
</executions>
193+
</plugin>
203194
<plugin>
204195
<artifactId>maven-plugin-plugin</artifactId>
205196
<configuration>
@@ -360,7 +351,8 @@
360351
<!-- never use legacy JUnit tests for new integration tests -->
361352
<classpathDependencyExcludes>
362353
<classpathDependencyExclude>junit:junit</classpathDependencyExclude>
363-
<classpathDependencyExclude>org.junit.vintage:junit-vintage-engine</classpathDependencyExclude>
354+
<classpathDependencyExclude>org.junit.vintage:junit-vintage-engine
355+
</classpathDependencyExclude>
364356
</classpathDependencyExcludes>
365357
</configuration>
366358
</plugin>
@@ -404,6 +396,42 @@
404396
<artifactId>maven-scm-plugin</artifactId>
405397
<version>1.11.2</version>
406398
</plugin>
399+
<plugin>
400+
<groupId>com.diffplug.spotless</groupId>
401+
<artifactId>spotless-maven-plugin</artifactId>
402+
<version>2.12.0</version>
403+
<configuration>
404+
<formats>
405+
<format>
406+
<includes>
407+
<include>pom.xml</include>
408+
<include>README.md</include>
409+
<include>.github/workflows/**/*.yml</include>
410+
<include>src/**/*.java</include>
411+
<include>src/**/*.xml</include>
412+
<include>src/**/*.properties</include>
413+
</includes>
414+
<trimTrailingWhitespace/>
415+
<endWithNewline/>
416+
</format>
417+
</formats>
418+
<java>
419+
<googleJavaFormat>
420+
<version>1.9</version>
421+
</googleJavaFormat>
422+
<removeUnusedImports/>
423+
</java>
424+
</configuration>
425+
</plugin>
426+
<plugin>
427+
<groupId>org.codehaus.mojo</groupId>
428+
<artifactId>license-maven-plugin</artifactId>
429+
<version>2.0.0</version>
430+
<configuration>
431+
<licenseName>apache_v2</licenseName>
432+
<inceptionYear>2021</inceptionYear>
433+
</configuration>
434+
</plugin>
407435
<plugin>
408436
<groupId>org.sonatype.plugins</groupId>
409437
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -414,6 +442,80 @@
414442

415443
</build>
416444
<profiles>
445+
<profile>
446+
<id>developer</id>
447+
<activation>
448+
<activeByDefault>true</activeByDefault>
449+
</activation>
450+
<build>
451+
<plugins>
452+
<plugin>
453+
<groupId>org.codehaus.mojo</groupId>
454+
<artifactId>license-maven-plugin</artifactId>
455+
<executions>
456+
<execution>
457+
<goals>
458+
<goal>update-file-header</goal>
459+
</goals>
460+
<phase>process-test-sources</phase>
461+
</execution>
462+
</executions>
463+
</plugin>
464+
<plugin>
465+
<groupId>com.diffplug.spotless</groupId>
466+
<artifactId>spotless-maven-plugin</artifactId>
467+
<executions>
468+
<execution>
469+
<goals>
470+
<goal>apply</goal>
471+
</goals>
472+
<phase>process-test-sources</phase>
473+
</execution>
474+
</executions>
475+
</plugin>
476+
</plugins>
477+
</build>
478+
</profile>
479+
<profile>
480+
<id>ci</id>
481+
<activation>
482+
<property>
483+
<name>env.CI</name>
484+
</property>
485+
</activation>
486+
<build>
487+
<plugins>
488+
<plugin>
489+
<groupId>org.codehaus.mojo</groupId>
490+
<artifactId>license-maven-plugin</artifactId>
491+
<executions>
492+
<execution>
493+
<goals>
494+
<goal>check-file-header</goal>
495+
</goals>
496+
<phase>process-test-sources</phase>
497+
<configuration>
498+
<failOnMissingHeader>true</failOnMissingHeader>
499+
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
500+
</configuration>
501+
</execution>
502+
</executions>
503+
</plugin>
504+
<plugin>
505+
<groupId>com.diffplug.spotless</groupId>
506+
<artifactId>spotless-maven-plugin</artifactId>
507+
<executions>
508+
<execution>
509+
<goals>
510+
<goal>check</goal>
511+
</goals>
512+
<phase>process-test-sources</phase>
513+
</execution>
514+
</executions>
515+
</plugin>
516+
</plugins>
517+
</build>
518+
</profile>
417519
<profile>
418520
<id>end-to-end-test</id>
419521
<!--

0 commit comments

Comments
 (0)