Skip to content

Commit

Permalink
Merge pull request #796 from emmartins/WFLY-18819
Browse files Browse the repository at this point in the history
[WFLY-18819] layer abstract xml snippets and simplification of docume…
  • Loading branch information
emmartins authored Dec 5, 2023
2 parents 673125a + 42e24c7 commit 09d7011
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 56 deletions.
23 changes: 7 additions & 16 deletions shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[[build_and_run_the_quickstart_with_bootable_jar]]
= Building and running the quickstart application in a bootable JAR

You can package a {productName} server and an application inside a bootable JAR. You can then run the application on a {productName} bare-metal platform or on a {productName} Openshift platform.
You can use the WildFly JAR Maven plug-in to build a {productName} bootable JAR to run this quickstart.

You can use the Maven plug-in to build a {productName} bootable JAR, and then you can run the application on a {productName} bare-metal platform. The following example demonstrates a quickstart `pom.xml` file that contains a Maven profile named *bootable-jar*:
The quickstart `pom.xml` file contains a Maven profile named *bootable-jar* which configures the bootable JAR building:

[source,xml,subs="attributes+"]
----
Expand All @@ -16,17 +16,7 @@ You can use the Maven plug-in to build a {productName} bootable JAR, and then yo
<artifactId>wildfly-jar-maven-plugin</artifactId>
<configuration>
<feature-pack-location>wildfly@maven(org.jboss.universe:community-universe)#${version.server}</feature-pack-location>
<layers>
ifndef::custom-bootable-jar-layers[]
<layer>jaxrs-server</layer>
<layer>microprofile-platform</layer>
endif::[]
ifdef::reactive-messaging[]
<layer>cloud-server</layer>
<layer>h2-default-datasource</layer>
<layer>microprofile-reactive-messaging-kafka</layer>
endif::[]
</layers>
<layers>...</layers>
<plugin-options>
<jboss-fork-embedded>true</jboss-fork-embedded>
</plugin-options>
Expand All @@ -39,6 +29,7 @@ endif::[]
</execution>
</executions>
</plugin>
...
</plugins>
</build>
</profile>
Expand All @@ -52,9 +43,9 @@ endif::[]
----
$ mvn clean package -Pbootable-jar
----
+
. Run the quickstart application contained in the bootable JAR:

. Run the quickstart application contained in the bootable JAR:
+
[source,subs="attributes+",options="nowrap"]
----
ifdef::uses-jaeger[]
Expand All @@ -72,5 +63,5 @@ endif::uses-jaeger[]
After the quickstart application is deployed, the bootable JAR includes the application in the root context. Therefore, any URLs related to the application should not have the `/{artifactId}` path segment after `HOST:PORT`.
====

// Bootable Jar Testing with Arquillian
// Bootable Jar Testing
include::../shared-doc/run-integration-tests-with-bootable-jar.adoc[leveloffset=+1]
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ The server provisioning functionality is provided by the WildFly Maven Plugin, a
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
</feature-packs>
<layers>
<!-- layers may be used to customize the provisioned server -->
<layer>cloud-server</layer>
</layers>
<layers>...</layers>
<!-- deploys the quickstart on root web context -->
<name>ROOT.war</name>
</configuration>
Expand All @@ -83,7 +80,7 @@ The server provisioning functionality is provided by the WildFly Maven Plugin, a
</execution>
</executions>
</plugin>
<!-- ... -->
...
</plugins>
</build>
</profile>
Expand All @@ -94,5 +91,5 @@ The server provisioning functionality is provided by the WildFly Maven Plugin, a
Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`.
====

// Testing with Arquillian
// Server Provisioning Testing
include::../shared-doc/run-integration-tests-with-provisioned-server.adoc[leveloffset=+1]
46 changes: 15 additions & 31 deletions shared-doc/build-the-quickstart-for-openshift.adoc
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
[[build-the-quickstart-for-openshift]]
== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment.
You can activate the Maven profile named `openshift` when building the quickstart:

[source,subs="attributes+",options="nowrap"]
----
$ mvn clean package -Popenshift
----

The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution.
ifndef::ProductRelease,EAPXPRelease[]
You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.
endif::[]
ifdef::ProductRelease,EAPXPRelease[]
You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.
endif::[]
On OpenShift, the S2I build with Apache Maven uses an `openshift` Maven profile to provision a {productName} server, deploy and run the quickstart in OpenShift environment.

ifndef::ProductRelease,EAPXPRelease[]
The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`:
endif::[]

ifdef::ProductRelease,EAPXPRelease[]
The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`:
endif::[]
Expand All @@ -35,20 +20,17 @@ ifndef::ProductRelease,EAPXPRelease[]
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
<configuration>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
<feature-pack>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp}</location>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.pack.cloud}</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
</layers>
<filename>ROOT.war</filename>
<layers>...</layers>
<name>ROOT.war</name>
</configuration>
<executions>
<execution>
Expand All @@ -58,6 +40,7 @@ ifndef::ProductRelease,EAPXPRelease[]
</execution>
</executions>
</plugin>
...
</plugins>
</build>
</profile>
Expand All @@ -74,8 +57,8 @@ ifdef::ProductRelease,EAPXPRelease[]
<plugin>
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<version>${version.eap.maven.plugin}</version>
<configuration>
...
<feature-packs>
<feature-pack>
<location>org.jboss.eap:wildfly-ee-galleon-pack</location>
Expand All @@ -84,10 +67,8 @@ ifdef::ProductRelease,EAPXPRelease[]
<location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
</layers>
<filename>ROOT.war</filename>
<layers>...</layers>
<name>ROOT.war</name>
</configuration>
<executions>
<execution>
Expand All @@ -97,13 +78,16 @@ ifdef::ProductRelease,EAPXPRelease[]
</execution>
</executions>
</plugin>
...
</plugins>
</build>
</profile>
----
endif::[]

[NOTE]
====
Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`.
====
ifndef::ProductRelease,EAPXPRelease[]
You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.
endif::[]
ifdef::ProductRelease,EAPXPRelease[]
You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.
endif::[]
4 changes: 1 addition & 3 deletions shared-doc/run-integration-tests-with-bootable-jar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
= Run the Integration Tests with a bootable jar

include::define-standalone-server-attributes.adoc[]
ifndef::server_provisioning_server_host[:server_provisioning_server_host: http://localhost:8080]

The integration tests included with this quickstart, which verify that the quickstart runs correctly, may also be run with a bootable jar.

Expand All @@ -21,9 +22,6 @@ $ mvn clean package -Pbootable-jar
$ mvn wildfly-jar:start -Djar-file-name=target/{artifactId}-bootable.jar
----

ifndef::server_provisioning_server_host[]
:server_provisioning_server_host: http://localhost:8080
endif::server_provisioning_server_host[]
. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property, which for a bootable jar by default is `{server_provisioning_server_host}`.
+
[source,subs="attributes+",options="nowrap"]
Expand Down

0 comments on commit 09d7011

Please sign in to comment.