Merge branch 'develop' into stable

This commit is contained in:
2023-02-19 10:56:29 -05:00
3 changed files with 14 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);