Skip to content

Commit

Permalink
Make mvn exec:java work with new dev workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Nov 19, 2013
1 parent c201072 commit 3ab5ac3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hawtio-web/src/test/java/io/hawt/sample/Main.java
Expand Up @@ -45,8 +45,9 @@ public static void main(String[] args) {
if (!contextPath.startsWith("/")) {
contextPath = "/" + contextPath;
}
String path = System.getProperty("webapp-outdir", "target/hawtio-web-1.2-SNAPSHOT");
String webXml = path + "/WEB-INF/web.xml";
String sourcePath = "src/main/webapp";
String webappOutdir = System.getProperty("webapp-outdir", "target/hawtio-web-1.2-SNAPSHOT");
String webXml = sourcePath + "/WEB-INF/web.xml";
require(fileExists(webXml), "No web.xml could be found for $webXml");

String pathSeparator = File.pathSeparator;
Expand Down Expand Up @@ -89,7 +90,7 @@ public boolean apply(File file) {
Configuration[] contextConfigs = {new WebXmlConfiguration(), new WebInfConfiguration()};
context.setConfigurations(contextConfigs);
context.setDescriptor(webXml);
context.setResourceBase(path);
context.setResourceBases(new String[] {sourcePath, webappOutdir});
context.setContextPath(contextPath);
context.setParentLoaderPriority(true);

Expand Down Expand Up @@ -158,7 +159,7 @@ public boolean apply(File file) {
// lets connect to fabric
println("");
println("");
println("OPEN: http://localhost:" + port + contextPath + " using web app source path: " + path);
println("OPEN: http://localhost:" + port + contextPath + " using web app source path: " + webappOutdir);
println("");
println("");

Expand Down

0 comments on commit 3ab5ac3

Please sign in to comment.