How to override the module name of deployments?
conorroche Nov 28, 2012 6:51 AMWe are migrating from jboss 4.3.2 to jboss 7 - we are using jboss 7.1.3.Final which is built from that tag in the jboss git repo, up until now we have named our ears and wars with a version in the name e.g.
componentA-1.1.0.ear
-- componentA-ejb-1.1.0.jar
the primary reason to name ears and wars with the version name in them is to allow someone see the versions of components by just doing an ls on the deploy dir as opposed to inspecting the manifest (script using jar/unzip -p etc commands can achieve the same but is slower).
I have a different component say applicationB-2.0.war which depends on the componentA-ejb-1.1.0.jar, I can put this in the MANIFEST.MF of the war:
<dependencies>deployment.componentA-1.1.0.ear.componentA-ejb-1.1.0.jar</dependencies>
This works but is not good as it means if somone updates the version of componentA-1.1.0.ear then they would also have to put up a new version of applicationB-2.0.war
I know i can either
a) split out the ejb jar interfaces and related classes into a separate module and then the ejb jar and war can depend on that - this is a fair bit of project restructuring which i would prefer not to do
b) rename the ear and ejb jar NOT to have a version in the file names - which i will go with unless module-alias works..
I had hoped to be able to use the ears jboss-deployment-structure.xml to alias the deployment and sub deployment:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<module-alias name="componentA"/>
</deployment>
<sub-deployment name="componentA-ejb-${project.version}.jar">
<module-alias name="componentA-ejb.jar"/>
</sub-deployment>
</jboss-deployment-structure>
and then refer to the ejb module from the war as:
<dependencies>deployment.componentA.componentA-ejb.jar</dependencies>
But this does not work, i have also tried referring directly to the sub module alias e.g. <dependencies>deployment.componentA-ejb.jar</dependencies> and that doesnt work either.
Can anyone tell me if the deployment/sub-deployment module-alias should affect the modules loaded by the Service Module Loader? I only see module loaded info logs referring to the filename of the ear and ejb jar...
Perhaps this is something that is only implemented in 7.2.0-alpha?