Exemplo n.º 1
0
  public PomClassLoader(ArtifactRepository localRepo, DependencyNode node, PomLoader pomLoader) {
    super(new URL[] {}, null);

    if (node.getArtifact().getFile() == null) {
      String s = localRepo.getBasedir() + File.separator + localRepo.pathOf(node.getArtifact());
      node.getArtifact().setFile(new File(s));
    }

    jarFile = node.getArtifact().getFile();
    if (jarFile == null) System.out.println("123");
    try {
      addURL(jarFile.toURI().toURL());
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    name =
        node.getArtifact().getGroupId()
            + "-"
            + node.getArtifact().getArtifactId()
            + "-"
            + node.getArtifact().getVersion();
    pomLoader.add(this);

    includeDependency(localRepo, pomLoader, node.getChildren());
    getJSClassLoader();
  }
Exemplo n.º 2
0
  /*
      public PomClassLoader(File file, PomLoader pomLoader) throws IOException, XmlPullParserException {
          super(new URL[]{}, null);
          this.pomLoader = pomLoader;
          if (file.getName().endsWith(".xml") || file.getName().endsWith(".pom"))
              setJarFile(file);
          else {
              haveJSLib = false;
              addURL(file.toURI().toURL());
          }
      }
  */
  public PomClassLoader(
      ArtifactRepository localRepo,
      DependencyNode node,
      File file,
      String name,
      PomLoader pomLoader) {
    super(new URL[] {}, null);
    haveJSLib = false;
    jarFile = file;
    try {
      addURL(jarFile.toURI().toURL());
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    this.name = name;
    pomLoader.add(this);

    includeDependency(localRepo, pomLoader, node.getChildren());
    getJSClassLoader();
  }