# HG changeset patch # User Jaroslav Tulach # Date 1401092383 -7200 # Node ID d7c375541fb7d7a37eb7a1a23110badc338584b4 # Parent a41d8697cadfccf9c2a4c1c0927025e71023a66b Don't include provided dependencies diff -r a41d8697cadf -r d7c375541fb7 rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java Mon May 26 10:19:26 2014 +0200 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java Mon May 26 10:19:43 2014 +0200 @@ -35,6 +35,8 @@ import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import java.util.logging.Level; +import java.util.logging.Logger; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; @@ -81,21 +83,33 @@ @Override public void execute() throws MojoExecutionException, MojoFailureException { + URLClassLoader loader; try { - URLClassLoader loader = buildClassLoader(null, prj.getArtifacts()); - for (Artifact a : prj.getArtifacts()) { - if (a.getFile() == null) { - continue; - } - String n = a.getFile().getName(); - if (!n.endsWith(".jar")) { - continue; - } - aot.mkdirs(); - File js = new File(aot, n.substring(0, n.length() - 4) + ".js"); + loader = buildClassLoader(null, prj.getArtifacts()); + } catch (MalformedURLException ex) { + throw new MojoFailureException("Can't initialize classloader"); + } + for (Artifact a : prj.getArtifacts()) { + if (a.getFile() == null) { + continue; + } + String n = a.getFile().getName(); + if (!n.endsWith(".jar")) { + continue; + } + if ("provided".equals(a.getScope())) { + continue; + } + aot.mkdirs(); + File js = new File(aot, n.substring(0, n.length() - 4) + ".js"); + try { aotLibrary(a, js , loader); + } catch (IOException ex) { + throw new MojoFailureException("Can't compile" + a.getFile(), ex); } + } + try { FileWriter w = new FileWriter(vm); Bck2Brwsr.newCompiler(). obfuscation(obfuscation).