/** * Constructs the element containing child elements and only attribute * * @param name The element name * @param attribute The element attribute * @param elements The child elements * @return The Element object */ public static Element element(String name, Attribute attribute, Element... elements) { return new Element(name, new Attributes(attribute), elements); }
/** * Constructs the element with a textual body and attributes * * @param name The element name * @param value The element text value * @param attributes The element attributes * @return The element object */ public static Element element(String name, String value, Attributes attributes) { return new Element(name, value, attributes); }
public Element(String name, String text, Element... children) { this.name = name; this.text = text; this.children = children; this.attributes = new Attributes(); }
public static Plugin getReleasePlugin() { return plugin( groupId(SDKConstants.PLUGIN_RELEASE_GROUP_ID), artifactId(SDKConstants.PLUGIN_RELEASE_ARTIFACT_ID), version(SDKConstants.PLUGIN_RELEASE_VERSION) ); } }
private Element[] createResourcesListElement(String[] resources, String elementName, Element... append) { Element[] elements = new Element[resources.length + append.length]; int index = 0; for (; index < resources.length; ++index) { elements[index] = element(name(elementName), resources[index]); } for (int appendIndex = 0; appendIndex < append.length; appendIndex++, ++index) { elements[index] = append[appendIndex]; } return elements; }
protected Plugin getAspectJPlugin() { return plugin( "org.codehaus.mojo", "aspectj-maven-plugin", "1.4", dependencies( dependency("org.aspectj", "aspectjtools", aspectJVersion) ) ); }
/** * Defines the plugin without its version or dependencies. * * @param groupId The group id * @param artifactId The artifact id * @return The plugin instance */ public static Plugin plugin(String groupId, String artifactId) { return plugin(groupId, artifactId, null); }
protected ExecutionEnvironment getEnvironment(MavenProject project, MavenSession session, BuildPluginManager pluginManager) { if (executionEnvironment == null) { executionEnvironment = executionEnvironment(project, session, pluginManager); } return executionEnvironment; }
/** * Constructs the {@link ExecutionEnvironment} instance fluently * * @param mavenProject The current Maven project * @param mavenSession The current Maven session * @param pluginManager The Build plugin manager * @return The execution environment * @throws NullPointerException if mavenProject, mavenSession or pluginManager are null */ public static ExecutionEnvironment executionEnvironment(MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) { return new ExecutionEnvironment(mavenProject, mavenSession, pluginManager); }
/** * Constructs the attribute * * @param name The attribute name * @param value The attribute value * @return The Attribute object */ public static Attribute attribute(String name, String value) { return new Attribute(name, value); }
/** * Defines the plugin without its version * * @param groupId The group id * @param artifactId The artifact id * @return The plugin instance */ public static Plugin plugin(String groupId, String artifactId) { return plugin(groupId, artifactId, null); }
private ExecutionEnvironment createExecutionEnvironment() throws MojoExecutionException { return executionEnvironment( project, session, pluginManager); }
/** * Constructs the element with a textual body and only attribute * * @param name The element name * @param value The element text value * @param attribute The element attribute * @return The element object */ public static Element element(String name, String value, Attribute attribute) { return new Element(name, value, new Attributes(attribute)); }
/** * Constructs the element containing child elements * * @param name The element name * @param elements The child elements * @return The Element object */ public static Element element(String name, Element... elements) { return new Element(name, elements); }
/** * Constructs the attributes wrapper * * @param attributes The attributes * @return The Attributes object */ public static Attributes attributes(Attribute ... attributes) { return new Attributes(attributes); }
/** * Constructs the element containing child elements and only attribute * * @param name The element name * @param attribute The element attribute * @param elements The child elements * @return The Element object */ public static Element element(String name, Attribute attribute, Element... elements) { return new Element(name, new Attributes(attribute), elements); }
/** * Constructs the element with a textual body and attributes * * @param name The element name * @param value The element text value * @param attributes The element attributes * @return The element object */ public static Element element(String name, String value, Attributes attributes) { return new Element(name, value, attributes); }
/** * Constructs the element with a textual body and only attribute * * @param name The element name * @param value The element text value * @param attribute The element attribute * @return The element object */ public static Element element(String name, String value, Attribute attribute) { return new Element(name, value, new Attributes(attribute)); }
/** * Constructs the element with a textual body * * @param name The element name * @param value The element text value * @return The element object */ public static Element element(String name, String value) { return new Element(name, value); }
/** * Constructs the element containing child elements * * @param name The element name * @param elements The child elements * @return The Element object */ public static Element element(String name, Element... elements) { return new Element(name, elements); }