Use HTTPS for license links

This commit updates the MavenPublishingConventions to use HTTPS to
link to the Apache license. The configuration of NoHTTP has also
been reworked so that it will correctly find usch uses of http://
URLs.

Closes gh-21459
This commit is contained in:
Andy Wilkinson 2020-05-15 15:36:22 +01:00
parent 3f56f97e03
commit ee758fa670
8 changed files with 21 additions and 13 deletions

View File

@ -1,11 +1,17 @@
plugins { plugins {
id "org.jetbrains.kotlin.jvm" apply false // https://youtrack.jetbrains.com/issue/KT-30276 id "org.jetbrains.kotlin.jvm" apply false // https://youtrack.jetbrains.com/issue/KT-30276
id "io.spring.nohttp" version "0.0.3.RELEASE"
} }
description = "Spring Boot Build" description = "Spring Boot Build"
defaultTasks 'build' defaultTasks 'build'
nohttp {
whitelistFile = project.file("src/nohttp/whitelist.lines")
source.exclude "buildSrc/build/**"
}
allprojects { allprojects {
group "org.springframework.boot" group "org.springframework.boot"

View File

@ -164,8 +164,6 @@ class JavaConventions {
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies(); DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
checkstyleDependencies checkstyleDependencies
.add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version)); .add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version));
checkstyleDependencies
.add(project.getDependencies().create("io.spring.nohttp:nohttp-checkstyle:0.0.3.RELEASE"));
} }
void copyLegalFiles(Project project, CopySpec metaInf) { void copyLegalFiles(Project project, CopySpec metaInf) {

View File

@ -90,7 +90,7 @@ class MavenPublishingConventions {
private void customizeLicences(MavenPomLicenseSpec licences) { private void customizeLicences(MavenPomLicenseSpec licences) {
licences.license((licence) -> { licences.license((licence) -> {
licence.getName().set("Apache License, Version 2.0"); licence.getName().set("Apache License, Version 2.0");
licence.getUrl().set("http://www.apache.org/licenses/LICENSE-2.0"); licence.getUrl().set("https://www.apache.org/licenses/LICENSE-2.0");
}); });
} }

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>

View File

@ -1,7 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "https://checkstyle.org/dtds/configuration_1_2.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
<property name="whitelistFileName" value="${main.basedir}/src/checkstyle/nohttp-whitelist.txt"/>
</module>
</module>

13
src/nohttp/checkstyle.xml Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value=""/>
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
<property name="whitelistFileName" value="src/nohttp/whitelist.lines"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="src/nohttp/suppressions.xml"/>
</module>
<module name="SuppressWithPlainTextCommentFilter"/>
</module>

View File

@ -4,10 +4,8 @@
"https://checkstyle.org/dtds/suppressions_1_2.dtd"> "https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions> <suppressions>
<suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" /> <suppress files="[\\/]transaction-logs[\\/]" checks="NoHttp" />
<suppress files="[\\/]target[\\/]" checks="NoHttp" />
<suppress files="[\\/]build.log" checks="NoHttp" /> <suppress files="[\\/]build.log" checks="NoHttp" />
<suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg|svg)" checks="NoHttp" /> <suppress files=".+\.(jar|git|ico|p12|gif|jks|jpg|svg)" checks="NoHttp" />
<suppress files="dependency-reduced-pom.xml" checks="NoHttp" />
<suppress files="jquery.validate.js" checks="NoHttp" /> <suppress files="jquery.validate.js" checks="NoHttp" />
<suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" /> <suppress files="jquery-[0-9]\.[0-9]\.[0-9].js" checks="NoHttp" />
<suppress files="[\\/]spring-boot-project.setup" checks="NoHttp" /> <suppress files="[\\/]spring-boot-project.setup" checks="NoHttp" />