-
-
Save bbrowning/5a10558174ed50f983e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/web-client/src/main/java/org/wildfly/swarm/booker/Main.java b/web-client/src/main/java/org/wildfly/swarm/booker/Main.java | |
index c3e5448..0b05851 100644 | |
--- a/web-client/src/main/java/org/wildfly/swarm/booker/Main.java | |
+++ b/web-client/src/main/java/org/wildfly/swarm/booker/Main.java | |
@@ -1,7 +1,10 @@ | |
package org.wildfly.swarm.booker; | |
+import org.jboss.shrinkwrap.api.Archive; | |
+import org.jboss.shrinkwrap.api.Filters; | |
import org.jboss.shrinkwrap.api.ShrinkWrap; | |
import org.wildfly.swarm.container.Container; | |
+import org.wildfly.swarm.undertow.DefaultWarDeploymentFactory; | |
import org.wildfly.swarm.undertow.WARArchive; | |
/** | |
@@ -11,9 +14,18 @@ public class Main { | |
public static void main(String... args) throws Exception { | |
Container container = new Container(); | |
container.start(); | |
+ | |
WARArchive war = ShrinkWrap.create(WARArchive.class); | |
- war.staticContent(); | |
war.addAllDependencies(); | |
+ | |
+ // Create an Archive of all resources packaged with this app | |
+ DefaultWarDeploymentFactory factory = new DefaultWarDeploymentFactory(); | |
+ Archive allResources = factory.create(container); | |
+ // Add just the static content from that Archive to our war | |
+ war.merge(allResources, Filters.include(".*\\.(html|js|css|png|json)$")); | |
+ // Also serve up static content from a few | |
+ war.staticContent(); | |
+ | |
container.deploy(war); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment