public MavenEntry getEntry(Pom pom) throws Exception { return getEntry(pom.getGroupId(), pom.getArtifactId(), pom.getVersion()); }
/** * @param parentArtifactId * @param parentGroupId * @param parentVersion * @throws Exception */ private void setNames(Pom pom) throws Exception { if (artifactId == null || artifactId.length() == 0) artifactId = pom.getArtifactId(); if (groupId == null || groupId.length() == 0) groupId = pom.getGroupId(); if (version == null || version.length() == 0) version = pom.getVersion(); if (description == null) description = pom.getDescription(); else description = pom.getDescription() + "\n" + description; }
public String getVersion() throws Exception { if (version == null) return "<not set>"; return replace(version); }
Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2); for ( Pom dep : dependencies ) { System.out.printf( "%20s %-20s %10s\n", dep.getGroupId(), dep.getArtifactId(), dep.getVersion()); a.addClasspath(dep.getArtifact());
public File getLibrary(Scope action, URI... repositories) throws Exception { MavenEntry entry = maven.getEntry(this); File file = new File(entry.dir, action + ".lib"); if (file.isFile() && file.lastModified() >= getPomFile().lastModified()) return file; file.delete(); Writer writer = new FileWriter(file); doEntry(writer, this); try { for (Pom dep : getDependencies(action, repositories)) { doEntry(writer, dep); } } finally { writer.close(); } return file; }
void parse() throws Exception { DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(pomFile); XPath xp = xpf.newXPath(); parse(doc, xp); }
/** * The user selected pom in a path. This will place the pom as well as its * dependencies on the list * * @param strategyx the strategy to use. * @param result The list of result containers * @throws Exception anything goes wrong */ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception { File pomFile = getFile("pom.xml"); if (!pomFile.isFile()) msgs.MissingPom(); else { ProjectPom pom = getWorkspace().getMaven() .createProjectModel(pomFile); if (action == null) action = "compile"; Pom.Scope act = Pom.Scope.valueOf(action); Set<Pom> dependencies = pom.getDependencies(act); for (Pom sub : dependencies) { File artifact = sub.getArtifact(); Container container = new Container(artifact, null); result.add(container); } } }
Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2); for (Pom dep : dependencies) { System.err.printf("%20s %-20s %10s%n", dep.getGroupId(), dep.getArtifactId(), dep.getVersion()); a.addClasspath(dep.getArtifact());
public File getLibrary(Scope action, URI... repositories) throws Exception { MavenEntry entry = maven.getEntry(this); File file = new File(entry.dir, action + ".lib"); if (file.isFile() && file.lastModified() >= getPomFile().lastModified()) return file; IO.delete(file); try (Writer writer = IO.writer(file)) { doEntry(writer, this); for (Pom dep : getDependencies(action, repositories)) { doEntry(writer, dep); } } return file; }
void parse() throws Exception { DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(pomFile); XPath xp = xpf.newXPath(); parse(doc, xp); }
/** * The user selected pom in a path. This will place the pom as well as its * dependencies on the list * * @param strategyx the strategy to use. * @param result The list of result containers * @throws Exception anything goes wrong */ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception { File pomFile = getFile("pom.xml"); if (!pomFile.isFile()) msgs.MissingPom(); else { ProjectPom pom = getWorkspace().getMaven() .createProjectModel(pomFile); if (action == null) action = "compile"; Pom.Scope act = Pom.Scope.valueOf(action); Set<Pom> dependencies = pom.getDependencies(act); for (Pom sub : dependencies) { File artifact = sub.getArtifact(); Container container = new Container(artifact, null); result.add(container); } } }
public MavenEntry getEntry(Pom pom) throws Exception { return getEntry(pom.getGroupId(), pom.getArtifactId(), pom.getVersion()); }
/** * @param parentArtifactId * @param parentGroupId * @param parentVersion * @throws Exception */ private void setNames(Pom pom) throws Exception { if (artifactId == null || artifactId.length() == 0) artifactId = pom.getArtifactId(); if (groupId == null || groupId.length() == 0) groupId = pom.getGroupId(); if (version == null || version.length() == 0) version = pom.getVersion(); if (description == null) description = pom.getDescription(); else description = pom.getDescription() + "\n" + description; }
Set<Pom> dependencies = pom.getDependencies(Scope.compile, urls2); for (Pom dep : dependencies) { System.err.printf("%20s %-20s %10s%n", dep.getGroupId(), dep.getArtifactId(), dep.getVersion()); a.addClasspath(dep.getArtifact());
public File getLibrary(Scope action, URI... repositories) throws Exception { MavenEntry entry = maven.getEntry(this); File file = new File(entry.dir, action + ".lib"); if (file.isFile() && file.lastModified() >= getPomFile().lastModified()) return file; file.delete(); Writer writer = IO.writer(file); try { doEntry(writer, this); for (Pom dep : getDependencies(action, repositories)) { doEntry(writer, dep); } } finally { writer.close(); } return file; }
public String getVersion() throws Exception { if (version == null) return "<not set>"; return replace(version); }
void parse() throws Exception { DocumentBuilder db = dbf.newDocumentBuilder(); System.err.println("Parsing " + pomFile.getAbsolutePath()); Document doc = db.parse(pomFile); XPath xp = xpf.newXPath(); parse(doc, xp); }
/** * The user selected pom in a path. This will place the pom as well as its * dependencies on the list * * @param strategyx * the strategy to use. * @param result * The list of result containers * @param attrs * The attributes * @throws Exception * anything goes wrong */ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception { File pomFile = getFile("pom.xml"); if (!pomFile.isFile()) msgs.MissingPom(); else { ProjectPom pom = getWorkspace().getMaven().createProjectModel(pomFile); if (action == null) action = "compile"; Pom.Scope act = Pom.Scope.valueOf(action); Set<Pom> dependencies = pom.getDependencies(act); for (Pom sub : dependencies) { File artifact = sub.getArtifact(); Container container = new Container(artifact, null); result.add(container); } } }
public MavenEntry getEntry(Pom pom) throws Exception { return getEntry(pom.getGroupId(), pom.getArtifactId(), pom.getVersion()); }
/** * @param parentArtifactId * @param parentGroupId * @param parentVersion * @throws Exception */ private void setNames(Pom pom) throws Exception { if (artifactId == null || artifactId.length() == 0) artifactId = pom.getArtifactId(); if (groupId == null || groupId.length() == 0) groupId = pom.getGroupId(); if (version == null || version.length() == 0) version = pom.getVersion(); if (description == null) description = pom.getDescription(); else description = pom.getDescription() + "\n" + description; }