Commit 431497b0 authored by Yuri Blankenstein's avatar Yuri Blankenstein
Browse files

Improved license header check configuration

parent a9b2ab72
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2021 Contributors to the Eclipse Foundation
//
......@@ -8,7 +7,6 @@
//
// SPDX-License-Identifier: EPL-2.0
//
//////////////////////////////////////////////////////////////////////////////
pipeline {
agent {
......
......@@ -29,34 +29,4 @@
<module>trace</module>
<module>temporallogic</module>
</modules>
<build>
<defaultGoal>clean verify</defaultGoal>
</build>
<profiles>
<profile>
<id>checkLicenseHeaders</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<executions>
<!-- use the cmd line `mvn license:format` to add headers -->
<execution>
<id>checkLicenseHeaders</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2021 Contributors to the Eclipse Foundation
//
......@@ -8,7 +7,6 @@
//
// SPDX-License-Identifier: EPL-2.0
//
//////////////////////////////////////////////////////////////////////////////
pipeline {
triggers {
......
......@@ -57,11 +57,14 @@
<!-- Eclipse Common Build Infrastructure version. -->
<eclipse.cbi.version>1.3.1</eclipse.cbi.version>
<!-- https://mycila.carbou.me/license-maven-plugin/ -->
<license.maven.plugin.version>4.2.rc2</license.maven.plugin.version>
</properties>
<pluginRepositories>
<!-- Dash license plugin. -->
<!-- Given that this contains snapshots, this must be first. Looking for snapshots on release repos will give an
<!-- Given that this contains snapshots, this must be first. Looking for snapshots on release repos will give an
error, regardless of whether the plugin is present there or not. -->
<pluginRepository>
<id>dash-licenses-snapshots</id>
......@@ -80,7 +83,95 @@
<build>
<defaultGoal>clean verify</defaultGoal>
<plugins>
<!-- Enforce minimum Maven 3.5 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.5,)</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Enable license header check. -->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${license.maven.plugin.version}</version>
<configuration>
<failIfUnknown>true</failIfUnknown>
<mapping>
<ant>XML_STYLE</ant>
<exsd>XML_STYLE</exsd>
<ini>SCRIPT_STYLE</ini>
<mwe2>JAVADOC_STYLE</mwe2>
<product>XML_STYLE</product>
<types>JAVADOC_STYLE</types>
<xtend>JAVADOC_STYLE</xtend>
<xtext>JAVADOC_STYLE</xtext>
<qvto>JAVADOC_STYLE</qvto>
<melk>JAVADOC_STYLE</melk>
<bat>BATCH</bat>
<cmd>BATCH</cmd>
<plantuml>APOSTROPHE_STYLE</plantuml>
<asciidoc>ASCIIDOC_STYLE</asciidoc>
<adoc>ASCIIDOC_STYLE</adoc>
<csv>SCRIPT_STYLE</csv>
<Jenkinsfile>DOUBLESLASH_STYLE</Jenkinsfile>
<etl>JAVADOC_STYLE</etl>
<etf>SCRIPT_STYLE</etf>
</mapping>
<licenseSets>
<licenseSet>
<header>${session.executionRootDirectory}/releng/legal-defaults/license-header.txt</header>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>src-gen/**</exclude>
<exclude>xtend-gen/**</exclude>
<exclude>**/*.e4xmi</exclude>
<exclude>**/*.ecore</exclude>
<exclude>**/*.genmodel</exclude>
<exclude>**/*.launch</exclude>
<exclude>**/*.setup</exclude>
<exclude>**/*.target</exclude>
<exclude>**/*.txt</exclude>
<exclude>.checkstyle</exclude>
<exclude>.META-INF_MANIFEST.MF</exclude>
<exclude>.polyglot.*</exclude>
<exclude>.Xauthority*</exclude>
<exclude>checkstyle.xml</exclude>
<exclude>plugin.xml_gen</exclude>
<exclude>pom.tycho</exclude>
</excludes>
</licenseSet>
</licenseSets>
</configuration>
<executions>
<!-- use the cmd line `./build.sh license:format` to add headers -->
<execution>
<id>checkLicenseHeaders</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Enable Tycho. -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
......@@ -206,52 +297,9 @@
<pluginManagement>
<plugins>
<!-- This configuration prevents errors for m2eclipse.
It affects m2eclipse settings only. It has no influence on the Maven build itself.
It prevents the following error:
"Plugin execution not covered by lifecycle configuration:
org.eclipse.tycho:target-platform-configuration:2.5.0:target-platform
(execution: default-target-platform, phase: initialize)"
Note that according to the documentation of the Tycho Maven plugin:
"This mojo is actually not executable, and is only meant to host configuration."
It is thus safe to set the action to 'ignore' using lifecycle mapping metadata configuration.
-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<versionRange>[1.7.0,)</versionRange>
<goals>
<goal>target-platform</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<versionRange>[3.1.2,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
......@@ -280,52 +328,6 @@
<projectId>technology.trace4cps</projectId>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.2.rc2</version>
<configuration>
<mapping>
<ant>XML_STYLE</ant>
<exsd>XML_STYLE</exsd>
<ini>SCRIPT_STYLE</ini>
<mwe2>JAVADOC_STYLE</mwe2>
<product>XML_STYLE</product>
<types>JAVADOC_STYLE</types>
<xtend>JAVADOC_STYLE</xtend>
<xtext>JAVADOC_STYLE</xtext>
<etl>JAVADOC_STYLE</etl>
<etf>SCRIPT_STYLE</etf>
<bat>BATCH</bat>
<cmd>BATCH</cmd>
<plantuml>APOSTROPHE_STYLE</plantuml>
<asciidoc>ASCIIDOC_STYLE</asciidoc>
<adoc>ASCIIDOC_STYLE</adoc>
</mapping>
<licenseSets>
<licenseSet>
<header>${session.executionRootDirectory}/releng/legal-defaults/license-header.txt</header>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>**/*.txt</exclude>
<exclude>**/*.ecore</exclude>
<exclude>**/*.genmodel</exclude>
<exclude>**/*.setup</exclude>
<exclude>**/*.target</exclude>
<exclude>**/*.launch</exclude>
<exclude>src-gen/**</exclude>
<exclude>xtend-gen/**</exclude>
<exclude>.polyglot.*</exclude>
<exclude>.META-INF_MANIFEST.MF</exclude>
<exclude>.checkstyle</exclude>
<exclude>checkstyle.xml</exclude>
<exclude>plugin.xml_gen</exclude>
</excludes>
</licenseSet>
</licenseSets>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
......@@ -525,5 +527,69 @@
</plugins>
</build>
</profile>
<!-- This profile prevents errors for m2eclipse, only when Eclipse is active. -->
<profile>
<id>eclipse-m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<!--
This configuration prevents errors for m2eclipse.
It affects m2eclipse settings only. It has no influence on the Maven build itself.
It prevents the following error:
"Plugin execution not covered by lifecycle configuration:
org.eclipse.tycho:target-platform-configuration:2.5.0:target-platform
(execution: default-target-platform, phase: initialize)"
Note that according to the documentation of the Tycho Maven plugin:
"This mojo is actually not executable, and is only meant to host configuration."
It is thus safe to set the action to 'ignore' using lifecycle mapping metadata configuration.
-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<versionRange>[1.7.0,)</versionRange>
<goals>
<goal>target-platform</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<versionRange>[3.1.2,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment