1.1 --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrwsrMojo.java Tue May 28 21:49:11 2013 +0200
1.2 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrwsrMojo.java Tue Jun 11 15:11:56 2013 +0200
1.3 @@ -29,6 +29,7 @@
1.4 import java.util.Collection;
1.5 import java.util.List;
1.6 import org.apache.maven.artifact.Artifact;
1.7 +import org.apache.maven.model.Resource;
1.8 import org.apache.maven.plugin.MojoExecutionException;
1.9 import org.apache.maven.plugins.annotations.LifecyclePhase;
1.10 import org.apache.maven.plugins.annotations.Mojo;
1.11 @@ -75,7 +76,6 @@
1.12 if (startpage == null) {
1.13 throw new MojoExecutionException("You have to provide a start page");
1.14 }
1.15 -
1.16 try {
1.17 Closeable httpServer;
1.18 if (directory != null) {
1.19 @@ -83,6 +83,13 @@
1.20 } else {
1.21 URLClassLoader url = buildClassLoader(classes, prj.getArtifacts());
1.22 try {
1.23 + for (Resource r : prj.getResources()) {
1.24 + File f = new File(r.getDirectory(), startpage().replace('/', File.separatorChar));
1.25 + if (f.exists()) {
1.26 + System.setProperty("startpage.file", f.getPath());
1.27 + }
1.28 + }
1.29 +
1.30 httpServer = Launcher.showURL(launcher, url, startpage());
1.31 } catch (Exception ex) {
1.32 throw new MojoExecutionException("Can't open " + startpage(), ex);