diff --git a/.idea/intellij-javadocs-4.0.1.xml b/.idea/intellij-javadocs-4.0.1.xml new file mode 100644 index 0000000..97b4448 --- /dev/null +++ b/.idea/intellij-javadocs-4.0.1.xml @@ -0,0 +1,204 @@ + + + + + UPDATE + false + true + + METHOD + FIELD + TYPE + + + PUBLIC + DEFAULT + PROTECTED + + + + + + ^.*(public|protected|private)*.+interface\s+\w+.* + /**\n + * The interface ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> + */ + + + ^.*(public|protected|private)*.+enum\s+\w+.* + /**\n + * The enum ${name}.\n + */ + + + ^.*(public|protected|private)*.+class\s+\w+.* + /**\n + * The type ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> + */ + + + .+ + /**\n + * The type ${name}.\n + */ + + + + + .+ + /**\n + * Instantiates a new ${name}.\n +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + + + ^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+ + /**\n + * Gets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${partName}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} if an error occurs\n +</#list> + */ + + + ^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+ + /**\n + * Sets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${partName}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + ^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+ + /**\n + * The entry point of application.\n + + <#if element.parameterList.parameters?has_content> + *\n +</#if> + * @param ${element.parameterList.parameters[0].name} the input arguments\n +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + .+ + /**\n + * ${name}<#if isNotVoid> ${return}</#if>.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${return}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + + + ^.*(public|protected|private)*.+static.*(\w\s\w)+.+ + /**\n + * The constant ${element.getName()}.\n + */ + + + ^.*(public|protected|private)*.*(\w\s\w)+.+ + /**\n + <#if element.parent.isInterface()> + * The constant ${element.getName()}.\n +<#else> + * The ${name}.\n +</#if> */ + + + .+ + /**\n + <#if element.parent.isEnum()> + *${name} ${typeName}.\n +<#else> + * The ${name}.\n +</#if>*/ + + + + + \ No newline at end of file diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index cf75013..be6063a 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -6,6 +6,7 @@ + diff --git a/README.md b/README.md index 655e13e..d1bfa76 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # [bld](https://rife2.com/bld) Extension to Help Create [Spring Boot](https://spring.io/projects/spring-boot) Web Applications - [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) [![bld](https://img.shields.io/badge/1.7.3-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) @@ -22,9 +21,10 @@ public void bootjar() throws Exception { } ``` -```text +```console ./bld compile bootjar ``` + - [View Examples Project](https://github.com/rife2/bld-spring-boot/tree/main/examples) To create a [Spring Boot executable Web Archive](https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#appendix.executable-jar.nested-jars.war-structure) @@ -39,9 +39,10 @@ public void bootwar() throws Exception { } ``` -```text +```console ./bld compile bootwar ``` + - [View Examples Project](https://github.com/rife2/bld-spring-boot/tree/main/examples) Please check the [BootJarOperation documentation](https://rife2.github.io/bld-spring-boot/rife/bld/extension/BootJarOperation.html#method-summary) diff --git a/examples/.idea/.name b/examples/.idea/.name new file mode 100644 index 0000000..7ac15a8 --- /dev/null +++ b/examples/.idea/.name @@ -0,0 +1 @@ +bld-spring-boot-examples \ No newline at end of file diff --git a/examples/.idea/libraries/bld.xml b/examples/.idea/libraries/bld.xml index cf75013..be6063a 100644 --- a/examples/.idea/libraries/bld.xml +++ b/examples/.idea/libraries/bld.xml @@ -6,6 +6,7 @@ + diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..708e5f0 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,17 @@ +# Compile and Run the Web Application + +```console +./bld compile run +``` + +# Compile and Create the Executable JAR + +```console +./bld compile bootjar +``` + +# Compile and Create the Executable WAR + +```console +./bld compile bootwar +``` diff --git a/src/bld/java/rife/bld/extension/SpringBootBuild.java b/src/bld/java/rife/bld/extension/SpringBootBuild.java index b0a067b..194cd23 100644 --- a/src/bld/java/rife/bld/extension/SpringBootBuild.java +++ b/src/bld/java/rife/bld/extension/SpringBootBuild.java @@ -60,13 +60,24 @@ public class SpringBootBuild extends Project { .artifactId("bld-spring-boot") .description("bld Extension for Spring Boot") .url("https://github.com/rife2/bld-spring-boot") - .developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("erik@thauvin.net") - .url("https://erik.thauvin.net/")) - .license(new PublishLicense().name("The Apache License, Version 2.0") - .url("http://www.apache.org/licenses/LICENSE-2.0.txt")) - .scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-spring-boot.git") - .developerConnection("scm:git:git@github.com:rife2/bld-spring-boot.git") - .url("https://github.com/rife2/bld-spring-boot")) + .developer( + new PublishDeveloper() + .id("ethauvin") + .name("Erik C. Thauvin") + .email("erik@thauvin.net") + .url("https://erik.thauvin.net/") + ) + .license( + new PublishLicense() + .name("The Apache License, Version 2.0") + .url("http://www.apache.org/licenses/LICENSE-2.0.txt") + ) + .scm( + new PublishScm() + .connection("scm:git:https://github.com/rife2/bld-spring-boot.git") + .developerConnection("scm:git:git@github.com:rife2/bld-spring-boot.git") + .url("https://github.com/rife2/bld-spring-boot") + ) .signKey(property("sign.key")) .signPassphrase(property("sign.passphrase")); } diff --git a/src/main/java/rife/bld/extension/AbstractBootOperation.java b/src/main/java/rife/bld/extension/AbstractBootOperation.java index 30a1942..4510821 100644 --- a/src/main/java/rife/bld/extension/AbstractBootOperation.java +++ b/src/main/java/rife/bld/extension/AbstractBootOperation.java @@ -38,6 +38,7 @@ import java.util.spi.ToolProvider; * Implements common methods used by Spring Boot operations, such as {@link BootJarOperation} and * {@link BootWarOperation}. * + * @param the type parameter * @author Erik C. Thauvin * @since 1.0 */ @@ -67,6 +68,7 @@ public abstract class AbstractBootOperation> * * @param directory the destination directory * @return this operation instance + * @throws IOException if an error occurs */ public T destinationDirectory(File directory) throws IOException { destinationDirectory_ = directory; @@ -80,6 +82,7 @@ public abstract class AbstractBootOperation> * * @param directory the destination directory * @return this operation instance + * @throws IOException if an error occurs */ public T destinationDirectory(String directory) throws IOException { return destinationDirectory(new File(directory)); @@ -111,6 +114,7 @@ public abstract class AbstractBootOperation> * staging directory. * * @param stagingDirectory the staging directory + * @throws FileUtilsErrorException if an error occurs */ protected void executeCopyBootLoader(File stagingDirectory) throws FileUtilsErrorException { if (launcherLibs_.isEmpty()) { @@ -134,6 +138,7 @@ public abstract class AbstractBootOperation> * Part of the {@link #execute execute} operation, copies the {@code BOOT-INF} or {@code WEB-INF} classes. * * @param stagingInfDirectory Tte staging {@code INF} directory + * @throws IOException if an error occurs */ protected void executeCopyInfClassesFiles(File stagingInfDirectory) throws IOException { var inf_classes_dir = new File(stagingInfDirectory, "classes"); @@ -154,6 +159,7 @@ public abstract class AbstractBootOperation> * Part of the {@link #execute execute} operation, copies the {@code BOOT-INF} or (@code WEB-INF) libs. * * @param stagingInfDirectory the staging {@code INF} directory + * @throws IOException if an error occurs */ protected void executeCopyInfLibs(File stagingInfDirectory) throws IOException { var inf_lib_dir = new File(stagingInfDirectory, "lib"); @@ -173,6 +179,7 @@ public abstract class AbstractBootOperation> * * @param stagingDirectory the staging directory * @return the archive + * @throws IOException if an error occurs */ protected File executeCreateArchive(File stagingDirectory) throws IOException { executeCreateManifest(stagingDirectory); @@ -223,6 +230,7 @@ public abstract class AbstractBootOperation> * Part of the {@link #execute execute} operation, creates the manifest for the archive. * * @param stagingDirectory the staging directory + * @throws IOException if an error occurs */ protected void executeCreateManifest(File stagingDirectory) throws IOException { var meta_inf_dir = new File(stagingDirectory, "META-INF"); @@ -242,6 +250,7 @@ public abstract class AbstractBootOperation> * * @param project the project * @return this operation instance + * @throws IOException if an error occurs */ public abstract T fromProject(Project project) throws IOException; @@ -323,6 +332,7 @@ public abstract class AbstractBootOperation> * * @param jars a collection of Java archives * @return this operation instance + * @throws IOException if an error occurs */ public T launcherLibs(Collection jars) throws IOException { if (!jars.isEmpty()) { @@ -420,6 +430,7 @@ public abstract class AbstractBootOperation> * {@link IllegalArgumentException} otherwise. * * @return {@code true} or an {@link IllegalArgumentException} + * @throws IllegalArgumentException if an error occurs */ @SuppressWarnings("SameReturnValue") protected boolean verifyExecute() throws IllegalArgumentException { diff --git a/src/main/java/rife/bld/extension/BootJarOperation.java b/src/main/java/rife/bld/extension/BootJarOperation.java index c39565d..11591d1 100644 --- a/src/main/java/rife/bld/extension/BootJarOperation.java +++ b/src/main/java/rife/bld/extension/BootJarOperation.java @@ -66,6 +66,7 @@ public class BootJarOperation extends AbstractBootOperation { * * @param stagingDirectory the staging directory * @return the {@code BOOT-INF} directory location + * @throws IOException if an error occurs */ protected File executeCreateBootInfDirectory(File stagingDirectory) throws IOException { var boot_inf = new File(stagingDirectory, "BOOT-INF"); diff --git a/src/main/java/rife/bld/extension/BootUtils.java b/src/main/java/rife/bld/extension/BootUtils.java index 8547896..24a46b4 100644 --- a/src/main/java/rife/bld/extension/BootUtils.java +++ b/src/main/java/rife/bld/extension/BootUtils.java @@ -38,6 +38,7 @@ public final class BootUtils { * Deletes the given directories. * * @param directories one or more directories to delete + * @throws FileUtilsErrorException if an error occurs */ public static void deleteDirectories(File... directories) throws FileUtilsErrorException { for (var d : directories) { @@ -68,6 +69,7 @@ public final class BootUtils { * Makes a directory for the given path, including any necessary but nonexistent parent directories. * * @param path the directory path + * @throws IOException if an error occurs */ public static void mkDirs(File path) throws IOException { if (!path.exists() && !path.mkdirs()) { diff --git a/src/main/java/rife/bld/extension/BootWarOperation.java b/src/main/java/rife/bld/extension/BootWarOperation.java index ba03365..4ab0657 100644 --- a/src/main/java/rife/bld/extension/BootWarOperation.java +++ b/src/main/java/rife/bld/extension/BootWarOperation.java @@ -69,6 +69,7 @@ public class BootWarOperation extends AbstractBootOperation { * Part of the {@link #execute execute} operation, copies the {@code WEB-INF/lib-provided} libraries. * * @param stagingWebInfDirectory the staging {@code WEB-INF/lib-provided} directory + * @throws IOException if an error occurs */ protected void executeCopyWebInfProvidedLib(File stagingWebInfDirectory) throws IOException { var lib_provided_dir = new File(stagingWebInfDirectory, "lib-provided"); @@ -86,7 +87,9 @@ public class BootWarOperation extends AbstractBootOperation { /** * Part of the {@link #execute execute} operation, creates the {@code WEB-INF} staging directory. * + * @param stagingDirectory the staging directory * @return the {@code WEB-INF} directory location + * @throws IOException if an error occurs */ protected File executeCreateWebInfDirectory(File stagingDirectory) throws IOException { var boot_inf = new File(stagingDirectory, "WEB-INF");