Polish the Gradle plugin's javadoc
This commit is contained in:
parent
b6a4056e95
commit
d43b1ae3a5
|
|
@ -33,6 +33,7 @@ import org.springframework.boot.gradle.tasks.buildinfo.BuildInfoProperties;
|
|||
* Entry point to Spring Boot's Gradle DSL.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class SpringBootExtension {
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@ import org.gradle.api.Project;
|
|||
*/
|
||||
interface PluginApplicationAction extends Action<Project> {
|
||||
|
||||
/**
|
||||
* The class of the {@code Plugin} that, when applied, will trigger the execution of
|
||||
* this action.
|
||||
*
|
||||
* @return the plugin class
|
||||
*/
|
||||
Class<? extends Plugin<? extends Project>> getPluginClass();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,26 +39,36 @@ public class SpringBootPlugin implements Plugin<Project> {
|
|||
|
||||
/**
|
||||
* The name of the {@link Configuration} that contains Spring Boot archives.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String BOOT_ARCHIVES_CONFIURATION_NAME = "bootArchives";
|
||||
|
||||
/**
|
||||
* The name of the {@link SoftwareComponent} for a Spring Boot Java application.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String BOOT_JAVA_SOFTWARE_COMPONENT_NAME = "bootJava";
|
||||
|
||||
/**
|
||||
* The name of the {@link SoftwareComponent} for a Spring Boot Web application.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String BOOT_WEB_SOFTWARE_COMPONENT_NAME = "bootWeb";
|
||||
|
||||
/**
|
||||
* The name of the default {@link BootJar} task.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String BOOT_JAR_TASK_NAME = "bootJar";
|
||||
|
||||
/**
|
||||
* The name of the default {@link BootWar} task.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String BOOT_WAR_TASK_NAME = "bootWar";
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class UnresolvedDependenciesAnalyzer {
|
|||
|
||||
private Set<ModuleVersionSelector> dependenciesWithNoVersion = new HashSet<>();
|
||||
|
||||
public void analyze(Set<UnresolvedDependency> unresolvedDependencies) {
|
||||
void analyze(Set<UnresolvedDependency> unresolvedDependencies) {
|
||||
this.dependenciesWithNoVersion = unresolvedDependencies.stream()
|
||||
.map(unresolvedDependency -> unresolvedDependency.getSelector())
|
||||
.filter(this::hasNoVersion).collect(Collectors.toSet());
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import org.gradle.api.tasks.Optional;
|
|||
* A Spring Boot "fat" archive task.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public interface BootArchive extends Task {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import org.gradle.api.tasks.bundling.Jar;
|
|||
* A custom {@link Jar} task that produces a Spring Boot executable jar.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class BootJar extends Jar implements BootArchive {
|
||||
|
||||
|
|
@ -43,6 +44,9 @@ public class BootJar extends Jar implements BootArchive {
|
|||
|
||||
private String mainClass;
|
||||
|
||||
/**
|
||||
* Creates a new {@code BootJar} task.
|
||||
*/
|
||||
public BootJar() {
|
||||
CopySpec bootInf = getRootSpec().addChildBeforeSpec(getMainSpec())
|
||||
.into("BOOT-INF");
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import org.gradle.api.tasks.bundling.War;
|
|||
* A custom {@link War} task that produces a Spring Boot executable war.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class BootWar extends War implements BootArchive {
|
||||
|
||||
|
|
@ -44,6 +45,9 @@ public class BootWar extends War implements BootArchive {
|
|||
|
||||
private FileCollection providedClasspath;
|
||||
|
||||
/**
|
||||
* Creates a new {@code BootWar} task.
|
||||
*/
|
||||
public BootWar() {
|
||||
getWebInf().into("lib-provided",
|
||||
copySpec -> copySpec
|
||||
|
|
@ -92,14 +96,21 @@ public class BootWar extends War implements BootArchive {
|
|||
action.execute(getLaunchScript());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the provided classpath, the contents of which will be included in the
|
||||
* {@code WEB-INF/lib-provided} directory of the war.
|
||||
*
|
||||
* @return the provided classpath
|
||||
*/
|
||||
@Optional
|
||||
public FileCollection getProvidedClasspath() {
|
||||
return this.providedClasspath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds files to the provided classpath to include in the war. The given
|
||||
* {@code classpath} are evaluated as per {@link Project#files(Object...)}.
|
||||
* Adds files to the provided classpath to include in the {@code WEB-INF/lib-provided}
|
||||
* directory of the war. The given {@code classpath} are evaluated as per
|
||||
* {@link Project#files(Object...)}.
|
||||
*
|
||||
* @param classpath the additions to the classpath
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.springframework.boot.loader.tools.FileUtils;
|
|||
* Encapsulates the configuration of the launch script for an executable jar or war.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class LaunchScriptConfiguration implements Serializable {
|
||||
|
||||
|
|
@ -37,26 +38,60 @@ public class LaunchScriptConfiguration implements Serializable {
|
|||
|
||||
private File script;
|
||||
|
||||
/**
|
||||
* Returns whether the launch script is included. Defaults to {@code false}.
|
||||
*
|
||||
* @return {@code true} is the script is included, otherwise {@code false}.
|
||||
*/
|
||||
public boolean isIncluded() {
|
||||
return this.included;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the launch script is included. Defaults to {@code false}.
|
||||
*
|
||||
* @param included {@code true} is the script is included, otherwise {@code false}.
|
||||
*/
|
||||
public void setIncluded(boolean included) {
|
||||
this.included = included;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the properties that are applied to the launch script when it's being
|
||||
* including in the executable archive.
|
||||
*
|
||||
* @return the properties
|
||||
*/
|
||||
public Map<String, String> getProperties() {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the properties that are applied to the launch script when it's being including
|
||||
* in the executable archive.
|
||||
*
|
||||
* @param properties the properties
|
||||
*/
|
||||
public void properties(Map<String, String> properties) {
|
||||
this.properties.putAll(properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the script {@link File} that will be included in the executable archive.
|
||||
* When {@code null}, the default launch script will be used.
|
||||
*
|
||||
* @return the script file
|
||||
*/
|
||||
public File getScript() {
|
||||
return this.script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the script {@link File} that will be included in the executable archive. When
|
||||
* {@code null}, the default launch script will be used.
|
||||
*
|
||||
* @param script the script file
|
||||
*/
|
||||
public void setScript(File script) {
|
||||
this.script = script;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.util.zip.ZipEntry;
|
|||
* An enumeration of supported compression options for an entry in a ZIP archive.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public enum ZipCompression {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.gradle.api.tasks.SourceSetOutput;
|
|||
* Custom {@link JavaExec} task for running a Spring Boot application.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class BootRun extends JavaExec {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue