1.1 --- a/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrswrMojo.java Mon Jan 21 17:04:02 2013 +0100
1.2 +++ b/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrswrMojo.java Wed Jan 30 18:27:57 2013 +0100
1.3 @@ -51,21 +51,28 @@
1.4 /** Root of the class files */
1.5 @Parameter(defaultValue="${project.build.directory}/classes")
1.6 private File classes;
1.7 +
1.8 + /** Root of all pages, and files, etc. */
1.9 + @Parameter
1.10 + private File directory;
1.11
1.12 @Override
1.13 public void execute() throws MojoExecutionException {
1.14 if (startpage == null) {
1.15 throw new MojoExecutionException("You have to provide a start page");
1.16 }
1.17 -
1.18 +
1.19 try {
1.20 - URLClassLoader url = buildClassLoader(classes, prj.getDependencyArtifacts());
1.21 -
1.22 Closeable httpServer;
1.23 - try {
1.24 - httpServer = Launcher.showURL(url, startpage());
1.25 - } catch (Exception ex) {
1.26 - throw new MojoExecutionException("Can't open " + startpage(), ex);
1.27 + if (directory != null) {
1.28 + httpServer = Launcher.showDir(directory, startpage);
1.29 + } else {
1.30 + URLClassLoader url = buildClassLoader(classes, prj.getDependencyArtifacts());
1.31 + try {
1.32 + httpServer = Launcher.showURL(url, startpage());
1.33 + } catch (Exception ex) {
1.34 + throw new MojoExecutionException("Can't open " + startpage(), ex);
1.35 + }
1.36 }
1.37 System.in.read();
1.38 httpServer.close();