Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 323f794

Browse files
snicollsdeleuze
authored andcommitted
Polish Maven Plugin parameters names
This commit harmonizes the parameters of the Maven Plugin used to specify the location of generated sources. Rather than outputDirectory, this commit uses a dedicated attribute for main and test, simpilar to the standard Maven Compiler Plugin
1 parent d945f0a commit 323f794

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

spring-aot-maven-plugin/src/main/java/org/springframework/aot/maven/GenerateMojo.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.aot.maven;
1818

1919
import java.io.File;
20-
import java.nio.file.Files;
2120
import java.nio.file.Path;
2221
import java.nio.file.Paths;
2322
import java.util.Arrays;
@@ -34,7 +33,6 @@
3433
import org.apache.maven.plugins.annotations.ResolutionScope;
3534

3635
import org.springframework.aot.BootstrapCodeGenerator;
37-
import org.springframework.util.FileSystemUtils;
3836

3937
/**
4038
* @author Brian Clozel
@@ -46,10 +44,10 @@
4644
public class GenerateMojo extends AbstractBootstrapMojo {
4745

4846
/**
49-
* The location of the generated bootstrap sources.
47+
* Location of generated source files created by Spring AOT to bootstrap the application.
5048
*/
5149
@Parameter(defaultValue = "${project.build.directory}/generated-sources/spring-aot/")
52-
private File outputDirectory;
50+
private File generatedSourcesDirectory;
5351

5452
@Override
5553
public void execute() throws MojoExecutionException, MojoFailureException {
@@ -58,9 +56,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
5856
// TODO respect includes/excludes
5957
resourceFolders.add(new File(r.getDirectory()).toPath());
6058
}
61-
recreateGeneratedSourcesFolder(this.outputDirectory);
62-
Path sourcesPath = this.outputDirectory.toPath().resolve(Paths.get("src", "main", "java"));
63-
Path resourcesPath = this.outputDirectory.toPath().resolve(Paths.get("src", "main", "resources"));
59+
recreateGeneratedSourcesFolder(this.generatedSourcesDirectory);
60+
Path sourcesPath = this.generatedSourcesDirectory.toPath().resolve(Paths.get("src", "main", "java"));
61+
Path resourcesPath = this.generatedSourcesDirectory.toPath().resolve(Paths.get("src", "main", "resources"));
6462
try {
6563
List<String> runtimeClasspathElements = project.getRuntimeClasspathElements();
6664
BootstrapCodeGenerator generator = new BootstrapCodeGenerator(getAotOptions());

spring-aot-maven-plugin/src/main/java/org/springframework/aot/maven/TestGenerateMojo.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
public class TestGenerateMojo extends AbstractBootstrapMojo {
4545

4646
/**
47-
* The location of the generated bootstrap test sources.
47+
* Location of generated source files created by Spring AOT to bootstrap the test context.
4848
*/
4949
@Parameter(defaultValue = "${project.build.directory}/generated-test-sources/spring-aot/")
50-
private File outputDirectory;
50+
private File generatedTestSourcesDirectory;
5151

5252
@Override
5353
public void execute() throws MojoExecutionException, MojoFailureException {
@@ -56,9 +56,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
5656
// TODO respect includes/excludes
5757
resourceFolders.add(new File(r.getDirectory()).toPath());
5858
}
59-
recreateGeneratedSourcesFolder(this.outputDirectory);
60-
Path sourcesPath = this.outputDirectory.toPath().resolve(Paths.get("src", "test", "java"));
61-
Path resourcesPath = this.outputDirectory.toPath().resolve(Paths.get("src", "test", "resources"));
59+
recreateGeneratedSourcesFolder(this.generatedTestSourcesDirectory);
60+
Path sourcesPath = this.generatedTestSourcesDirectory.toPath().resolve(Paths.get("src", "test", "java"));
61+
Path resourcesPath = this.generatedTestSourcesDirectory.toPath().resolve(Paths.get("src", "test", "resources"));
6262
try {
6363
List<String> testClasspathElements = this.project.getTestClasspathElements();
6464
BootstrapCodeGenerator generator = new BootstrapCodeGenerator(getAotOptions());

0 commit comments

Comments
 (0)