Reformat code following spring-javaformat upgrade

This commit is contained in:
Phillip Webb
2023-02-21 22:49:23 -08:00
parent b93c9f7fec
commit df5898a146
1878 changed files with 27649 additions and 22403 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ import org.springframework.util.StringUtils;
public class CommandRunner implements Iterable<Command> {
private static final Set<CommandException.Option> NO_EXCEPTION_OPTIONS = EnumSet
.noneOf(CommandException.Option.class);
.noneOf(CommandException.Option.class);
private final String name;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -110,10 +110,14 @@ abstract class ArchiveCommand extends OptionParsingCommand {
protected void doOptions() {
this.includeOption = option("include",
"Pattern applied to directories on the classpath to find files to include in the resulting ")
.withRequiredArg().withValuesSeparatedBy(",").defaultsTo("");
.withRequiredArg()
.withValuesSeparatedBy(",")
.defaultsTo("");
this.excludeOption = option("exclude", "Pattern applied to directories on the classpath to find files to "
+ "exclude from the resulting " + this.type).withRequiredArg().withValuesSeparatedBy(",")
.defaultsTo("");
+ "exclude from the resulting " + this.type)
.withRequiredArg()
.withValuesSeparatedBy(",")
.defaultsTo("");
}
@Override
@@ -150,7 +154,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
private GroovyCompiler createCompiler(OptionSet options) {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();
.createDefaultRepositoryConfiguration();
GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(options, this,
repositoryConfiguration);
GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
@@ -206,8 +210,8 @@ abstract class ArchiveCommand extends OptionParsingCommand {
private void addManifest(JarWriter writer, Class<?>[] compiledClasses) throws IOException {
Manifest manifest = new Manifest();
manifest.getMainAttributes().putValue("Manifest-Version", "1.0");
manifest.getMainAttributes().putValue(PackagedSpringApplicationLauncher.SOURCE_ENTRY,
commaDelimitedClassNames(compiledClasses));
manifest.getMainAttributes()
.putValue(PackagedSpringApplicationLauncher.SOURCE_ENTRY, commaDelimitedClassNames(compiledClasses));
writer.writeManifest(manifest);
}
@@ -226,7 +230,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
addClass(writer, PackagedSpringApplicationLauncher.class);
addClass(writer, SpringApplicationLauncher.class);
Resource[] resources = new PathMatchingResourcePatternResolver()
.getResources("org/springframework/boot/groovy/**");
.getResources("org/springframework/boot/groovy/**");
for (Resource resource : resources) {
String url = resource.getURL().toString();
addResource(writer, resource, url.substring(url.indexOf("org/springframework/boot/groovy/")));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,8 +70,8 @@ public class EncodePasswordCommand extends OptionParsingCommand {
@Override
public Collection<HelpExample> getExamples() {
List<HelpExample> examples = new ArrayList<>();
examples.add(
new HelpExample("To encode a password with the default encoder", "spring encodepassword mypassword"));
examples
.add(new HelpExample("To encode a password with the default encoder", "spring encodepassword mypassword"));
examples.add(new HelpExample("To encode a password with pbkdf2", "spring encodepassword -a pbkdf2 mypassword"));
return examples;
}
@@ -83,7 +83,7 @@ public class EncodePasswordCommand extends OptionParsingCommand {
@Override
protected void options() {
this.algorithm = option(Arrays.asList("algorithm", "a"), "The algorithm to use").withRequiredArg()
.defaultsTo("default");
.defaultsTo("default");
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class GrabCommand extends OptionParsingCommand {
protected ExitStatus run(OptionSet options) throws Exception {
SourceOptions sourceOptions = new SourceOptions(options);
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();
.createDefaultRepositoryConfiguration();
GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(options, this,
repositoryConfiguration);
if (System.getProperty("grape.root") == null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -139,7 +139,7 @@ public class InitCommand extends OptionParsingCommand {
@Override
protected void options() {
this.target = option(Arrays.asList("target"), "URL of the service to use").withRequiredArg()
.defaultsTo(ProjectGenerationRequest.DEFAULT_SERVICE_URL);
.defaultsTo(ProjectGenerationRequest.DEFAULT_SERVICE_URL);
this.listCapabilities = option(Arrays.asList("list"),
"List the capabilities of the service. Use it to discover the "
+ "dependencies and the types that are available");
@@ -149,33 +149,37 @@ public class InitCommand extends OptionParsingCommand {
private void projectGenerationOptions() {
this.groupId = option(Arrays.asList("group-id", "g"), "Project coordinates (for example 'org.test')")
.withRequiredArg();
.withRequiredArg();
this.artifactId = option(Arrays.asList("artifact-id", "a"),
"Project coordinates; infer archive name (for example 'test')").withRequiredArg();
"Project coordinates; infer archive name (for example 'test')")
.withRequiredArg();
this.version = option(Arrays.asList("version", "v"), "Project version (for example '0.0.1-SNAPSHOT')")
.withRequiredArg();
.withRequiredArg();
this.name = option(Arrays.asList("name", "n"), "Project name; infer application name").withRequiredArg();
this.description = option("description", "Project description").withRequiredArg();
this.packageName = option(Arrays.asList("package-name"), "Package name").withRequiredArg();
this.type = option(Arrays.asList("type", "t"),
"Project type. Not normally needed if you use --build "
+ "and/or --format. Check the capabilities of the service (--list) for more details")
.withRequiredArg();
.withRequiredArg();
this.packaging = option(Arrays.asList("packaging", "p"), "Project packaging (for example 'jar')")
.withRequiredArg();
.withRequiredArg();
this.build = option("build", "Build system to use (for example 'maven' or 'gradle')").withRequiredArg()
.defaultsTo("maven");
.defaultsTo("maven");
this.format = option("format", "Format of the generated content (for example 'build' for a build file, "
+ "'project' for a project archive)").withRequiredArg().defaultsTo("project");
+ "'project' for a project archive)")
.withRequiredArg()
.defaultsTo("project");
this.javaVersion = option(Arrays.asList("java-version", "j"), "Language level (for example '1.8')")
.withRequiredArg();
.withRequiredArg();
this.language = option(Arrays.asList("language", "l"), "Programming language (for example 'java')")
.withRequiredArg();
.withRequiredArg();
this.bootVersion = option(Arrays.asList("boot-version", "b"),
"Spring Boot version (for example '1.2.0.RELEASE')").withRequiredArg();
"Spring Boot version (for example '1.2.0.RELEASE')")
.withRequiredArg();
this.dependencies = option(Arrays.asList("dependencies", "d"),
"Comma-separated list of dependency identifiers to include in the generated project")
.withRequiredArg();
.withRequiredArg();
}
private void otherOptions() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ class Installer {
private static GroovyCompilerConfiguration createCompilerConfiguration(OptionSet options,
CompilerOptionHandler compilerOptionHandler) {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();
.createDefaultRepositoryConfiguration();
return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler, repositoryConfiguration) {
@Override
public boolean isAutoconfigure() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,9 +43,11 @@ public class CompilerOptionHandler extends OptionHandler {
this.noGuessImportsOption = option("no-guess-imports", "Do not attempt to guess imports");
this.noGuessDependenciesOption = option("no-guess-dependencies", "Do not attempt to guess dependencies");
this.autoconfigureOption = option("autoconfigure", "Add autoconfigure compiler transformations")
.withOptionalArg().ofType(Boolean.class).defaultsTo(true);
.withOptionalArg()
.ofType(Boolean.class)
.defaultsTo(true);
this.classpathOption = option(Arrays.asList("classpath", "cp"), "Additional classpath entries")
.withRequiredArg();
.withRequiredArg();
doOptions();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -152,7 +152,7 @@ public class OptionHandler {
@Override
public String format(Map<String, ? extends OptionDescriptor> options) {
Comparator<OptionDescriptor> comparator = Comparator
.comparing((optionDescriptor) -> optionDescriptor.options().iterator().next());
.comparing((optionDescriptor) -> optionDescriptor.options().iterator().next());
Set<OptionDescriptor> sorted = new TreeSet<>(comparator);
sorted.addAll(options.values());
for (OptionDescriptor descriptor : sorted) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -99,7 +99,7 @@ public class RunCommand extends OptionParsingCommand {
SourceOptions sourceOptions = new SourceOptions(options);
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();
.createDefaultRepositoryConfiguration();
repositoryConfiguration.add(0,
new RepositoryConfiguration("local", new File("repository").toURI(), true));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -165,7 +165,7 @@ public class SpringApplicationRunner {
synchronized (this.monitor) {
try {
this.applicationContext = new SpringApplicationLauncher(getContextClassLoader())
.launch(this.compiledSources, SpringApplicationRunner.this.args);
.launch(this.compiledSources, SpringApplicationRunner.this.args);
}
catch (Exception ex) {
ex.printStackTrace();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -114,7 +114,7 @@ public class Shell {
this.consoleReader.setBellEnabled(false);
this.consoleReader.setExpandEvents(false);
this.consoleReader
.addCompleter(new CommandCompleter(this.consoleReader, this.argumentDelimiter, this.commandRunner));
.addCompleter(new CommandCompleter(this.consoleReader, this.argumentDelimiter, this.commandRunner));
this.consoleReader.setCompletionHandler(new CandidateListCompletionHandler());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,9 +67,9 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
visitAnnotatedNode(importNode, annotationNodes);
}
module.getStaticImports()
.forEach((name, importNode) -> visitAnnotatedNode(importNode, annotationNodes));
.forEach((name, importNode) -> visitAnnotatedNode(importNode, annotationNodes));
module.getStaticStarImports()
.forEach((name, importNode) -> visitAnnotatedNode(importNode, annotationNodes));
.forEach((name, importNode) -> visitAnnotatedNode(importNode, annotationNodes));
for (ClassNode classNode : module.getClasses()) {
visitAnnotatedNode(classNode, annotationNodes);
classNode.visitContents(classVisitor);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -217,7 +217,7 @@ public class DependencyCustomizer {
public DependencyCustomizer add(String module, String classifier, String type, boolean transitive) {
if (canAdd()) {
ArtifactCoordinatesResolver artifactCoordinatesResolver = this.dependencyResolutionContext
.getArtifactCoordinatesResolver();
.getArtifactCoordinatesResolver();
this.classNode.addAnnotation(createGrabAnnotation(artifactCoordinatesResolver.getGroupId(module),
artifactCoordinatesResolver.getArtifactId(module), artifactCoordinatesResolver.getVersion(module),
classifier, type, transitive));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,8 +71,8 @@ public class DependencyManagementBomTransformation extends AnnotatedNodeASTTrans
public static final int ORDER = Ordered.HIGHEST_PRECEDENCE + 100;
private static final Set<String> DEPENDENCY_MANAGEMENT_BOM_ANNOTATION_NAMES = Collections
.unmodifiableSet(new HashSet<>(Arrays.asList(DependencyManagementBom.class.getName(),
DependencyManagementBom.class.getSimpleName())));
.unmodifiableSet(new HashSet<>(
Arrays.asList(DependencyManagementBom.class.getName(), DependencyManagementBom.class.getSimpleName())));
private final DependencyResolutionContext resolutionContext;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -249,8 +249,10 @@ public class GroovyCompiler {
private int getIndexOfASTTransformationVisitor(List<?> conversionOperations) {
for (int index = 0; index < conversionOperations.size(); index++) {
if (conversionOperations.get(index).getClass().getName()
.startsWith(ASTTransformationVisitor.class.getName())) {
if (conversionOperations.get(index)
.getClass()
.getName()
.startsWith(ASTTransformationVisitor.class.getName())) {
return index;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class ResolveDependencyCoordinatesTransformation extends AnnotatedNodeAST
public static final int ORDER = DependencyManagementBomTransformation.ORDER + 300;
private static final Set<String> GRAB_ANNOTATION_NAMES = Collections
.unmodifiableSet(new HashSet<>(Arrays.asList(Grab.class.getName(), Grab.class.getSimpleName())));
.unmodifiableSet(new HashSet<>(Arrays.asList(Grab.class.getName(), Grab.class.getSimpleName())));
private final DependencyResolutionContext resolutionContext;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public class SpringIntegrationCompilerAutoConfiguration extends CompilerAutoConf
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses("org.springframework.integration.config.EnableIntegration")
.add("spring-boot-starter-integration");
.add("spring-boot-starter-integration");
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses("org.springframework.web.servlet.mvc.Controller")
.add("spring-boot-starter-web");
.add("spring-boot-starter-web");
dependencies.ifAnyMissingClasses("groovy.text.TemplateEngine").add("groovy-templates");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,8 +38,8 @@ public class SpringRetryCompilerAutoConfiguration extends CompilerAutoConfigurat
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses("org.springframework.retry.annotation.EnableRetry").add("spring-retry",
"spring-boot-starter-aop");
dependencies.ifAnyMissingClasses("org.springframework.retry.annotation.EnableRetry")
.add("spring-retry", "spring-boot-starter-aop");
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,20 +38,21 @@ public class SpringSecurityCompilerAutoConfiguration extends CompilerAutoConfigu
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses(
"org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity")
.add("spring-boot-starter-security");
dependencies
.ifAnyMissingClasses(
"org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity")
.add("spring-boot-starter-security");
}
@Override
public void applyImports(ImportCustomizer imports) {
imports.addImports("org.springframework.security.core.Authentication",
"org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity",
"org.springframework.security.core.authority.AuthorityUtils")
.addStarImports("org.springframework.security.config.annotation.web.configuration",
"org.springframework.security.authentication",
"org.springframework.security.config.annotation.web",
"org.springframework.security.config.annotation.web.builders");
imports
.addImports("org.springframework.security.core.Authentication",
"org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity",
"org.springframework.security.core.authority.AuthorityUtils")
.addStarImports("org.springframework.security.config.annotation.web.configuration",
"org.springframework.security.authentication", "org.springframework.security.config.annotation.web",
"org.springframework.security.config.annotation.web.builders");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,12 +62,13 @@ public class SpringTestCompilerAutoConfiguration extends CompilerAutoConfigurati
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addStarImports("org.junit.runner", "org.springframework.boot.test",
"org.springframework.boot.test.context", "org.springframework.boot.test.web.client",
"org.springframework.http", "org.springframework.test.context.junit4",
"org.springframework.test.annotation")
.addImports("org.springframework.boot.test.context.SpringBootTest.WebEnvironment",
"org.springframework.boot.test.web.client.TestRestTemplate");
imports
.addStarImports("org.junit.runner", "org.springframework.boot.test",
"org.springframework.boot.test.context", "org.springframework.boot.test.web.client",
"org.springframework.http", "org.springframework.test.context.junit4",
"org.springframework.test.annotation")
.addImports("org.springframework.boot.test.context.SpringBootTest.WebEnvironment",
"org.springframework.boot.test.web.client.TestRestTemplate");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,16 +39,18 @@ public class SpringWebsocketCompilerAutoConfiguration extends CompilerAutoConfig
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses("org.springframework.web.socket.config.annotation.EnableWebSocket")
.add("spring-boot-starter-websocket").add("spring-messaging");
.add("spring-boot-starter-websocket")
.add("spring-messaging");
}
@Override
public void applyImports(ImportCustomizer imports) {
imports.addStarImports("org.springframework.messaging.handler.annotation",
"org.springframework.messaging.simp.config", "org.springframework.web.socket.handler",
"org.springframework.web.socket.sockjs.transport.handler",
"org.springframework.web.socket.config.annotation")
.addImports("org.springframework.web.socket.WebSocketHandler");
imports
.addStarImports("org.springframework.messaging.handler.annotation",
"org.springframework.messaging.simp.config", "org.springframework.web.socket.handler",
"org.springframework.web.socket.sockjs.transport.handler",
"org.springframework.web.socket.config.annotation")
.addImports("org.springframework.web.socket.WebSocketHandler");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,8 +39,8 @@ public class TransactionManagementCompilerAutoConfiguration extends CompilerAuto
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
dependencies.ifAnyMissingClasses("org.springframework.transaction.annotation.Transactional").add("spring-tx",
"spring-boot-starter-aop");
dependencies.ifAnyMissingClasses("org.springframework.transaction.annotation.Transactional")
.add("spring-tx", "spring-boot-starter-aop");
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ public class SpringBootDependenciesDependencyManagement extends MavenModelDepend
try {
return modelProcessor.read(SpringBootDependenciesDependencyManagement.class
.getResourceAsStream("spring-boot-dependencies-effective-bom.xml"), null);
.getResourceAsStream("spring-boot-dependencies-effective-bom.xml"), null);
}
catch (IOException ex) {
throw new IllegalStateException("Failed to build model from effective pom", ex);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public abstract class AetherGrapeEngineFactory {
RepositorySystem repositorySystem = createServiceLocator().getService(RepositorySystem.class);
DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils.newSession();
ServiceLoader<RepositorySystemSessionAutoConfiguration> autoConfigurations = ServiceLoader
.load(RepositorySystemSessionAutoConfiguration.class);
.load(RepositorySystemSessionAutoConfiguration.class);
for (RepositorySystemSessionAutoConfiguration autoConfiguration : autoConfigurations) {
autoConfiguration.apply(repositorySystemSession, repositorySystem);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,10 +85,10 @@ public class DependencyResolutionContext {
public void addDependencyManagement(DependencyManagement dependencyManagement) {
for (org.springframework.boot.cli.compiler.dependencies.Dependency dependency : dependencyManagement
.getDependencies()) {
.getDependencies()) {
List<Exclusion> aetherExclusions = new ArrayList<>();
for (org.springframework.boot.cli.compiler.dependencies.Dependency.Exclusion exclusion : dependency
.getExclusions()) {
.getExclusions()) {
aetherExclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*"));
}
Dependency aetherDependency = new Dependency(new DefaultArtifact(dependency.getGroupId(),

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public abstract class MavenResolverGrapeEngineFactory {
RepositorySystem repositorySystem = createServiceLocator().getService(RepositorySystem.class);
DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils.newSession();
ServiceLoader<RepositorySystemSessionAutoConfiguration> autoConfigurations = ServiceLoader
.load(RepositorySystemSessionAutoConfiguration.class);
.load(RepositorySystemSessionAutoConfiguration.class);
for (RepositorySystemSessionAutoConfiguration autoConfiguration : autoConfigurations) {
autoConfiguration.apply(repositorySystemSession, repositorySystem);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -114,7 +114,8 @@ public class MavenSettings {
DefaultProxySelector selector = new DefaultProxySelector();
for (Proxy proxy : decryptedSettings.getProxies()) {
Authentication authentication = new AuthenticationBuilder().addUsername(proxy.getUsername())
.addPassword(proxy.getPassword()).build();
.addPassword(proxy.getPassword())
.build();
selector.add(new org.eclipse.aether.repository.Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(),
authentication), proxy.getNonProxyHosts());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -98,7 +98,7 @@ public abstract class ResourceUtils {
private static List<String> getUrlsFromPrefixedWildcardPath(String path, ClassLoader classLoader)
throws IOException {
Resource[] resources = new PathMatchingResourcePatternResolver(new FileSearchResourceLoader(classLoader))
.getResources(path);
.getResources(path);
List<String> result = new ArrayList<>();
for (Resource resource : resources) {
if (resource.exists()) {