diff --git a/plugin/src/main/java/org/wildfly/plugin/provision/PackageServerMojo.java b/plugin/src/main/java/org/wildfly/plugin/provision/PackageServerMojo.java index 33ea0cdc..5ced9321 100644 --- a/plugin/src/main/java/org/wildfly/plugin/provision/PackageServerMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/provision/PackageServerMojo.java @@ -53,7 +53,9 @@ @Mojo(name = "package", requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE) public class PackageServerMojo extends AbstractProvisionServerMojo { + @Deprecated(forRemoval = true, since = "5.1") public static final String JAR = "jar"; + @Deprecated(forRemoval = true, since = "5.1") public static final String BOOTABLE_JAR_NAME_RADICAL = "server-"; /** @@ -242,11 +244,14 @@ public class PackageServerMojo extends AbstractProvisionServerMojo { /** * When {@code bootable-jar} is set to true, use this parameter to name the generated jar file. - * The jar file is named by default {@code server-bootable.jar}. + *

+ * Note that since 5.1 the default name changed from {@code server-bootable.jar} to + * {@code ${project.artifactId}-bootable.jar}. + *

* * @since 5.0 */ - @Parameter(alias = "bootable-jar-name", required = false, property = PropertyNames.BOOTABLE_JAR_NAME) + @Parameter(alias = "bootable-jar-name", property = PropertyNames.BOOTABLE_JAR_NAME, defaultValue = "${project.artifactId}-bootable.jar") private String bootableJarName; /** @@ -385,12 +390,11 @@ private void attachJar(Path jarFile) { getLog().debug("Attaching bootable jar " + jarFile + " as a project artifact with classifier " + bootableJarInstallArtifactClassifier); } - projectHelper.attachArtifact(project, JAR, bootableJarInstallArtifactClassifier, jarFile.toFile()); + projectHelper.attachArtifact(project, "jar", bootableJarInstallArtifactClassifier, jarFile.toFile()); } private void packageBootableJar(Path jbossHome, GalleonProvisioningConfig activeConfig) throws Exception { - String jarName = bootableJarName == null ? BOOTABLE_JAR_NAME_RADICAL + BootableJarSupport.BOOTABLE_SUFFIX + "." + JAR - : bootableJarName; + String jarName = bootableJarName; Path targetPath = Paths.get(project.getBuild().getDirectory()); Path targetJarFile = targetPath.toAbsolutePath() .resolve(jarName); diff --git a/plugin/src/main/java/org/wildfly/plugin/server/StartJarMojo.java b/plugin/src/main/java/org/wildfly/plugin/server/StartJarMojo.java index 537f8498..cfb9aac2 100644 --- a/plugin/src/main/java/org/wildfly/plugin/server/StartJarMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/server/StartJarMojo.java @@ -22,8 +22,6 @@ import org.wildfly.plugin.common.PropertyNames; import org.wildfly.plugin.common.StandardOutput; import org.wildfly.plugin.common.Utils; -import org.wildfly.plugin.provision.PackageServerMojo; -import org.wildfly.plugin.tools.bootablejar.BootableJarSupport; /** * Starts a WildFly Application Server packaged as Bootable JAR. @@ -62,9 +60,12 @@ public class StartJarMojo extends AbstractStartMojo { /** * When {@code bootable-jar} is set to true, use this parameter to name the generated jar file. - * The jar file is named by default {@code server-bootable.jar}. + *

+ * Note that since 5.1 the default name changed from {@code server-bootable.jar} to + * {@code ${project.artifactId}-bootable.jar}. + *

*/ - @Parameter(alias = "bootable-jar-name", required = false, property = PropertyNames.BOOTABLE_JAR_NAME) + @Parameter(alias = "bootable-jar-name", property = PropertyNames.BOOTABLE_JAR_NAME, defaultValue = "${project.artifactId}-bootable.jar") private String bootableJarName; @Override @@ -131,9 +132,7 @@ public String goal() { @Override protected Path getServerHome() throws MojoExecutionException, MojoFailureException { - String jarName = bootableJarName == null ? PackageServerMojo.BOOTABLE_JAR_NAME_RADICAL + - BootableJarSupport.BOOTABLE_SUFFIX + "." + PackageServerMojo.JAR - : bootableJarName; + String jarName = bootableJarName; Path targetPath = Paths.get(project.getBuild().getDirectory()); Path jarFile = targetPath.toAbsolutePath() .resolve(jarName); @@ -142,4 +141,4 @@ protected Path getServerHome() throws MojoExecutionException, MojoFailureExcepti } return jarFile; } -} \ No newline at end of file +} diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml index ea4b56fb..a0f05890 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml @@ -20,6 +20,7 @@ true packaged-bootable-glow-server true + server-bootable.jar openapi diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml index c3ed9b24..9b1072ad 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml @@ -39,6 +39,7 @@ jaxrs-server test.war + server-bootable.jar true packaged-bootable-server true