/** * Returns list of dependencies or empty list if project doesn't have dependencies. * * <p><b>Note: update methods should not be used on returned list</b> * * @see #dependencies() */ public List<Dependency> getDependencies() { return dependencies().get(); }
/** * Returns list of dependencies or empty list if project doesn't have dependencies. * * <p><b>Note: update methods should not be used on returned list</b> * * @see #dependencies() */ public List<Dependency> getDependencies() { return dependencies().get(); }
/** Get source directories. */ public static List<String> getSourceDirectories(java.io.File pom) throws IOException { return getSourceDirectories(Model.readFrom(pom)); }
/** Get resource directories. */ public static List<String> getResourceDirectories(java.io.File pom) throws IOException { return getResourceDirectories(Model.readFrom(pom)); }
/** * Get version of artifact. If artifact doesn't have version this method checks parent artifact * for version. */ public static String getVersion(Model model) { String version = model.getVersion(); if (version == null) { final Parent parent = model.getParent(); if (parent != null) { version = parent.getVersion(); } } return version; }
/** * Get groupId of artifact. If artifact doesn't have groupId this method checks parent artifact * for groupId. */ public static String getGroupId(Model model) { String groupId = model.getGroupId(); if (groupId == null) { final Parent parent = model.getParent(); if (parent != null) { groupId = parent.getGroupId(); } } return groupId; }
/** * Get description of maven project and all its modules if any as plain list. * * @param sources maven project directory. Note: Must contains pom.xml file. * @return description of maven project * @throws IOException if an i/o error occurs */ public static List<Model> getModules(java.io.File sources) throws IOException { final LinkedList<Model> modules = new LinkedList<>(); addModules(Model.readFrom(sources), modules); return modules; }
@Override public Dependency map(Element element) { return new Dependency(element); } }
/** Returns returns {@link Dependencies} instance which helps to manage project dependencies */ public Dependencies dependencies() { if (dependencies == null) { dependencies = new Dependencies(root); } return dependencies; }
@Override public Repository map(Element element) { return new Repository(element); } }
@Override public Resource map(Element element) { return new Resource(element); } }
@Override public Plugin map(Element element) { return new Plugin(element); } }
@Override public Exclusion map(Element element) { return new Exclusion(element); } }
@Override public Profile map(Element element) { return new Profile(element); } }
@Override public String toString() { return getId(); }
@Override public Dependency map(Element element) { return new Dependency(element); } }
/** Returns returns {@link Dependencies} instance which helps to manage project dependencies */ public Dependencies dependencies() { if (dependencies == null) { dependencies = new Dependencies(dmElement); } return dependencies; }
@Override public Repository map(Element element) { return new Repository(element); } }
@Override public Resource map(Element element) { return new Resource(element); } }
public Profile setDependencies(List<Dependency> dependencies) { this.dependencies = new Dependencies(element, dependencies); return this; }