How to use the VAADIN license checker
How to use the VAADIN license checker
Vaadin is an open source code Java framework for building a modern web application.When using Vaadin to create its own application, it is very important to understand the license used by the application.Vaadin license checker is a powerful tool that helps you check the license of a third -party library used in the application to ensure that your application meets the relevant license requirements.
The following steps need to be followed:
1. Add license plug -in dependencies: First, you need to add the VAADIN license checker plug -in to Maven dependencies.In the pom.xml file of your project, add the following code:
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>license-checker-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<licenseFile>${basedir}/licenses/allowed-licenses.xml</licenseFile>
<licenseFileFilter>${basedir}/licenses/allowed-licenses-filter.xml</licenseFileFilter>
<outputDirectory>${project.build.directory}/licenses</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
This will automatically run the license checker plug -in during the construction process.
2. Create "Allowed-Licenses.xml" file: Create a folder called "Licenses" in the project root directory, and create a file called "Allowed-Licenses.xml" in this folder.In this file, the permit you allow you to use in your application.
The following is the content of an example "Allowed-Licenses.xml":
<license-checker-maven-plugin>
<allowedLicenses>
<license>Apache License, Version 2.0</license>
<license>MIT License</license>
<license>BSD 3-Clause License</license>
<!-Add other licenses->
</allowedLicenses>
</license-checker-maven-plugin>
You can add other licenses as needed.
3. Create "Allowed-Licenses-Filter.xml" file (optional): If you want to exclude certain specific licenses in addition to inspection, you can create a file called "Allowed-Licenses-Filter.xml"And list the license you want to exclude.
The following is the content of an example "Allowed-Licenses-Filter.xml":
<license-checker-maven-plugin>
<excludedLicenses>
<license>GNU General Public License (GPL)</license>
<license>GNU Lesser General Public License (LGPL)</license>
<!-Add other licenses to be excluded->
</excludedLicenses>
</license-checker-maven-plugin>
4. Operation license check: Now, you can use the Maven command to run the license checker plug -in.In the command line, navigate to your project root directory and run the following command:
shell
mvn license-checker:check
The license checker will check the third-party library used in the application and compare it with the allowable licenses listed in the "Allowed-Licenses.xml" file.If any permits that do not match the allowable list are found, warnings or errors will be output.
By using the VAADIN license checker, you can ensure that your application meets the requirements of the relevant license to avoid potential legal risks.