added module version to module.xml when applicable
This commit is contained in:
@@ -47,7 +47,7 @@ public class GenerateModuleXmlGoal extends AbstractModuleGoal {
|
||||
@Override
|
||||
protected void executePre() throws MojoExecutionException {
|
||||
try {
|
||||
this.moduleXmlBuilder = new ModuleXmlBuilder(this.moduleId, this.moduleSchemaVersion);
|
||||
this.moduleXmlBuilder = new ModuleXmlBuilder(this.moduleId, this.moduleSchemaVersion, this.moduleVersion);
|
||||
} catch (ParserConfigurationException pce) {
|
||||
throw new MojoExecutionException("This should never happen", pce);
|
||||
}
|
||||
|
@@ -24,8 +24,8 @@ import org.w3c.dom.Element;
|
||||
*/
|
||||
public class DeploymentXmlBuilder extends AbstractXmlBuilder {
|
||||
|
||||
public DeploymentXmlBuilder(String version) throws ParserConfigurationException {
|
||||
super("urn:jboss:deployment-structure:" + version);
|
||||
public DeploymentXmlBuilder(String schemaVersion) throws ParserConfigurationException {
|
||||
super("urn:jboss:deployment-structure:" + schemaVersion);
|
||||
|
||||
Element deploymentElement = this.xmldoc.createElementNS(this.ns, "deployment");
|
||||
deploymentElement.appendChild(this.dependenciesElement);
|
||||
|
@@ -28,13 +28,21 @@ public class ModuleXmlBuilder extends AbstractXmlBuilder {
|
||||
|
||||
private final Element resourcesElement;
|
||||
|
||||
public ModuleXmlBuilder(String id, String version) throws ParserConfigurationException {
|
||||
super("urn:jboss:module:" + version);
|
||||
public ModuleXmlBuilder(String id, String schemaVersion) throws ParserConfigurationException {
|
||||
this(id, schemaVersion, null);
|
||||
}
|
||||
|
||||
public ModuleXmlBuilder(String id, String schemaVersion, String moduleVersion) throws ParserConfigurationException {
|
||||
super("urn:jboss:module:" + schemaVersion);
|
||||
|
||||
this.resourcesElement = this.xmldoc.createElementNS(this.ns, "resources");
|
||||
|
||||
String name = id;
|
||||
if (moduleVersion != null)
|
||||
name += ":" + moduleVersion;
|
||||
|
||||
Element moduleElement = this.xmldoc.createElementNS(this.ns, "module");
|
||||
moduleElement.setAttribute("name", id);
|
||||
moduleElement.setAttribute("name", name);
|
||||
moduleElement.appendChild(this.resourcesElement);
|
||||
moduleElement.appendChild(this.dependenciesElement);
|
||||
|
||||
|
Reference in New Issue
Block a user