mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
Closes gh-30993
This commit is contained in:
commit
d0e55643b1
@ -212,10 +212,10 @@ public class MavenPluginPlugin implements Plugin<Project> {
|
|||||||
File generatedHelpMojoDir = new File(project.getBuildDir(), "generated/sources/helpMojo");
|
File generatedHelpMojoDir = new File(project.getBuildDir(), "generated/sources/helpMojo");
|
||||||
SourceSet mainSourceSet = getMainSourceSet(project);
|
SourceSet mainSourceSet = getMainSourceSet(project);
|
||||||
project.getTasks().withType(Javadoc.class, this::setJavadocOptions);
|
project.getTasks().withType(Javadoc.class, this::setJavadocOptions);
|
||||||
FormatHelpMojoSource copyFormattedHelpMojoSourceTask = createFormatHelpMojoSourceTask(project,
|
FormatHelpMojoSource formattedHelpMojoSource = createFormatHelpMojoSource(project, generateHelpMojoTask,
|
||||||
generateHelpMojoTask, generatedHelpMojoDir);
|
generatedHelpMojoDir);
|
||||||
project.getTasks().getByName(mainSourceSet.getCompileJavaTaskName()).dependsOn(copyFormattedHelpMojoSourceTask);
|
project.getTasks().getByName(mainSourceSet.getCompileJavaTaskName()).dependsOn(formattedHelpMojoSource);
|
||||||
mainSourceSet.java((javaSources) -> javaSources.srcDir(copyFormattedHelpMojoSourceTask));
|
mainSourceSet.java((javaSources) -> javaSources.srcDir(formattedHelpMojoSource));
|
||||||
Sync pluginDescriptorInputs = createSyncPluginDescriptorInputs(project, pluginDescriptorDir, mainSourceSet);
|
Sync pluginDescriptorInputs = createSyncPluginDescriptorInputs(project, pluginDescriptorDir, mainSourceSet);
|
||||||
pluginDescriptorInputs.dependsOn(mainSourceSet.getClassesTaskName());
|
pluginDescriptorInputs.dependsOn(mainSourceSet.getClassesTaskName());
|
||||||
MavenExec task = createGeneratePluginDescriptorTask(project, pluginDescriptorDir);
|
MavenExec task = createGeneratePluginDescriptorTask(project, pluginDescriptorDir);
|
||||||
@ -234,7 +234,7 @@ public class MavenPluginPlugin implements Plugin<Project> {
|
|||||||
options.addMultilineStringsOption("tag").setValue(Arrays.asList("goal:X", "requiresProject:X", "threadSafe:X"));
|
options.addMultilineStringsOption("tag").setValue(Arrays.asList("goal:X", "requiresProject:X", "threadSafe:X"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private FormatHelpMojoSource createFormatHelpMojoSourceTask(Project project, MavenExec generateHelpMojoTask,
|
private FormatHelpMojoSource createFormatHelpMojoSource(Project project, MavenExec generateHelpMojoTask,
|
||||||
File generatedHelpMojoDir) {
|
File generatedHelpMojoDir) {
|
||||||
FormatHelpMojoSource formatHelpMojoSource = project.getTasks().create("formatHelpMojoSource",
|
FormatHelpMojoSource formatHelpMojoSource = project.getTasks().create("formatHelpMojoSource",
|
||||||
FormatHelpMojoSource.class);
|
FormatHelpMojoSource.class);
|
||||||
@ -244,7 +244,7 @@ public class MavenPluginPlugin implements Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Sync createSyncPluginDescriptorInputs(Project project, File destination, SourceSet sourceSet) {
|
private Sync createSyncPluginDescriptorInputs(Project project, File destination, SourceSet sourceSet) {
|
||||||
Sync pluginDescriptorInputs = project.getTasks().create("copyPluginDescriptorInputs", Sync.class);
|
Sync pluginDescriptorInputs = project.getTasks().create("syncPluginDescriptorInputs", Sync.class);
|
||||||
pluginDescriptorInputs.setDestinationDir(destination);
|
pluginDescriptorInputs.setDestinationDir(destination);
|
||||||
File pomFile = new File(project.getProjectDir(), "src/maven/resources/pom.xml");
|
File pomFile = new File(project.getProjectDir(), "src/maven/resources/pom.xml");
|
||||||
pluginDescriptorInputs.from(pomFile, (copy) -> replaceVersionPlaceholder(copy, project));
|
pluginDescriptorInputs.from(pomFile, (copy) -> replaceVersionPlaceholder(copy, project));
|
||||||
|
@ -61,6 +61,7 @@ org.springframework.boot.actuate.autoconfigure.metrics.export.influx.InfluxMetri
|
|||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.jmx.JmxMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.jmx.JmxMetricsExportAutoConfiguration
|
||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.kairos.KairosMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.kairos.KairosMetricsExportAutoConfiguration
|
||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.newrelic.NewRelicMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.newrelic.NewRelicMetricsExportAutoConfiguration
|
||||||
|
org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration
|
||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusMetricsExportAutoConfiguration
|
||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration
|
||||||
org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration
|
org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration
|
||||||
|
@ -30,7 +30,7 @@ import org.springframework.security.oauth2.server.resource.introspection.SpringO
|
|||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures a {@link OpaqueTokenIntrospector} when a token introspection endpoint is
|
* Configures an {@link OpaqueTokenIntrospector} when a token introspection endpoint is
|
||||||
* available. Also configures a {@link SecurityFilterChain} if a
|
* available. Also configures a {@link SecurityFilterChain} if a
|
||||||
* {@link OpaqueTokenIntrospector} bean is found.
|
* {@link OpaqueTokenIntrospector} bean is found.
|
||||||
*
|
*
|
||||||
|
@ -88,7 +88,7 @@ class SpringBootWebSecurityConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the{@link EnableWebSecurity @EnableWebSecurity} annotation if Spring Security
|
* Adds the {@link EnableWebSecurity @EnableWebSecurity} annotation if Spring Security
|
||||||
* is on the classpath. This will make sure that the annotation is present with
|
* is on the classpath. This will make sure that the annotation is present with
|
||||||
* default security auto-configuration and also if the user adds custom security and
|
* default security auto-configuration and also if the user adds custom security and
|
||||||
* forgets to add the annotation. If {@link EnableWebSecurity @EnableWebSecurity} has
|
* forgets to add the annotation. If {@link EnableWebSecurity @EnableWebSecurity} has
|
||||||
|
@ -1324,8 +1324,8 @@ public class SpringApplication {
|
|||||||
* print stack traces of any encountered. Applies the specified
|
* print stack traces of any encountered. Applies the specified
|
||||||
* {@link ExitCodeGenerator ExitCodeGenerators} in addition to any Spring beans that
|
* {@link ExitCodeGenerator ExitCodeGenerators} in addition to any Spring beans that
|
||||||
* implement {@link ExitCodeGenerator}. When multiple generators are available, the
|
* implement {@link ExitCodeGenerator}. When multiple generators are available, the
|
||||||
* first non-zero exit code is used. Generators ordered based on their {@link Ordered}
|
* first non-zero exit code is used. Generators are ordered based on their
|
||||||
* implementation and {@link Order @Order} annotation.
|
* {@link Ordered} implementation and {@link Order @Order} annotation.
|
||||||
* @param context the context to close if possible
|
* @param context the context to close if possible
|
||||||
* @param exitCodeGenerators exit code generators
|
* @param exitCodeGenerators exit code generators
|
||||||
* @return the outcome (0 if successful)
|
* @return the outcome (0 if successful)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -131,7 +131,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
|
|||||||
public static final String LOG_FILE_BEAN_NAME = "springBootLogFile";
|
public static final String LOG_FILE_BEAN_NAME = "springBootLogFile";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the{@link LoggerGroups} bean.
|
* The name of the {@link LoggerGroups} bean.
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*/
|
*/
|
||||||
public static final String LOGGER_GROUPS_BEAN_NAME = "springBootLoggerGroups";
|
public static final String LOGGER_GROUPS_BEAN_NAME = "springBootLoggerGroups";
|
||||||
|
@ -165,7 +165,7 @@ public class OriginTrackedResource implements Resource, OriginProvider {
|
|||||||
* {@link WritableResource}.
|
* {@link WritableResource}.
|
||||||
* @param resource the tracked resource
|
* @param resource the tracked resource
|
||||||
* @param origin the origin of the resource
|
* @param origin the origin of the resource
|
||||||
* @return a {@link OriginTrackedWritableResource} instance
|
* @return an {@link OriginTrackedWritableResource} instance
|
||||||
*/
|
*/
|
||||||
public static OriginTrackedWritableResource of(WritableResource resource, Origin origin) {
|
public static OriginTrackedWritableResource of(WritableResource resource, Origin origin) {
|
||||||
return (OriginTrackedWritableResource) of((Resource) resource, origin);
|
return (OriginTrackedWritableResource) of((Resource) resource, origin);
|
||||||
@ -176,7 +176,7 @@ public class OriginTrackedResource implements Resource, OriginProvider {
|
|||||||
* {@link Resource}.
|
* {@link Resource}.
|
||||||
* @param resource the tracked resource
|
* @param resource the tracked resource
|
||||||
* @param origin the origin of the resource
|
* @param origin the origin of the resource
|
||||||
* @return a {@link OriginTrackedResource} instance
|
* @return an {@link OriginTrackedResource} instance
|
||||||
*/
|
*/
|
||||||
public static OriginTrackedResource of(Resource resource, Origin origin) {
|
public static OriginTrackedResource of(Resource resource, Origin origin) {
|
||||||
if (resource instanceof WritableResource) {
|
if (resource instanceof WritableResource) {
|
||||||
|
@ -24,7 +24,6 @@ import java.security.KeyStoreException;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import org.apache.catalina.LifecycleState;
|
import org.apache.catalina.LifecycleState;
|
||||||
import org.apache.catalina.connector.Connector;
|
import org.apache.catalina.connector.Connector;
|
||||||
@ -160,14 +159,7 @@ class SslConnectorCustomizerTests {
|
|||||||
customizer.customize(connector);
|
customizer.customize(connector);
|
||||||
this.tomcat.start();
|
this.tomcat.start();
|
||||||
SSLHostConfig sslHostConfig = connector.getProtocolHandler().findSslHostConfigs()[0];
|
SSLHostConfig sslHostConfig = connector.getProtocolHandler().findSslHostConfigs()[0];
|
||||||
sslHostConfig.getCertificates(true);
|
|
||||||
SSLHostConfig sslHostConfigWithDefaults = new SSLHostConfig();
|
|
||||||
sslHostConfigWithDefaults.getCertificates(true);
|
|
||||||
assertThat(sslHostConfig.getTruststore()).isEqualTo(trustStore);
|
assertThat(sslHostConfig.getTruststore()).isEqualTo(trustStore);
|
||||||
System.out.println(sslHostConfig.getCertificates(false).stream()
|
|
||||||
.map(SSLHostConfigCertificate::getCertificateFile).collect(Collectors.toList()));
|
|
||||||
System.out.println(sslHostConfigWithDefaults.getCertificates(false).stream()
|
|
||||||
.map(SSLHostConfigCertificate::getCertificateFile).collect(Collectors.toList()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user