How to excude exports in deployment module (Wildfly)?

1.2k views Asked by At

I have two war-files: core.war and service.war

Archive core.war includes jboss-deployment-structure.xml:

<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>

        <exclude-subsystems>
            <subsystem name="logging"/>
            <subsystem name="pojo"/>
        </exclude-subsystems>

        <exclusions>
            <module name="org.slf4j"/>
            <module name="org.slf4j.impl"/>
            <module name="org.slf4j.ext"/>
            <module name="org.slf4j.jcl-over-slf4j"/>
            <module name="org.apache.log4j"/>
            <module name="org.apache.commons.logging"/>
            <module name="org.jboss.logging"/>
            <module name="org.jboss.logging.jul-to-slf4j-stub"/>
            <module name="org.jboss.logmanager"/>
            <module name="org.jboss.log4j.logmanager"/>
            <module name="org.jboss.as.logging"/>

            <!-- exclude wildfly logging modules, use slf4j + logback -->

            <module name="org.jboss.logmanager.log4j"/>
        </exclusions>
        <dependencies>
            <module name="deployment.some-dep-1.ear" meta-inf="import"/>
            <module name="deployment.some-dep-2.ear" meta-inf="import" services="import" optional="true"/>
            <module name="deployment.some-dep-3.ear" meta-inf="import"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

service.war includes jboss-deployment-structure.xml:

<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>

        <exclude-subsystems>
            <subsystem name="logging"/>
            <subsystem name="pojo"/>
        </exclude-subsystems>

        <exclusions>
            <module name="org.slf4j"/>
            <module name="org.slf4j.impl"/>
            <module name="org.slf4j.ext"/>
            <module name="org.slf4j.jcl-over-slf4j"/>
            <module name="org.apache.log4j"/>
            <module name="org.apache.commons.logging"/>
            <module name="org.jboss.logging"/>
            <module name="org.jboss.logging.jul-to-slf4j-stub"/>
            <module name="org.jboss.logmanager"/>
            <module name="org.jboss.log4j.logmanager"/>
            <module name="org.jboss.as.logging"/>

            <!-- exclude wildfly logging modules, use slf4j + logback -->

            <module name="org.jboss.logmanager.log4j"/>
        </exclusions>

        <dependencies>
            <module name="deployment.core.war" services="import" meta-inf="import"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

and I have overlays:

standalone.xml:

     ...
     <deployment-overlays>
        <deployment-overlay name="dep-lib">
            <!-- ... -->
            <content path="/WEB-INF/lib/org-springframework-spring-aop-3.2.10.RELEASE.jar" content="77d0b86238df32cb15e469eaa2f7f32c4893dc54"/>
            <content path="/WEB-INF/lib/org-springframework-spring-aspects-3.2.10.RELEASE.jar" content="d5327b3d4a74f224d32c338e83789ae877feb790"/>
            <!-- ... -->
            <deployment name="core.war"/>
        </deployment-overlay>
    </deployment-overlays>
    ...

In this case classLoader in service.war module could not load classes declared in some-dep-1.ear/some-dep-2.ear/some-dep-3.ear becouse attribute export="false" by default in the tag <module/>

Now I want to exclude some overlay dependensies for service.war. I try to use tage <export/> something like this:

<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>

        <exclude-subsystems>
            <subsystem name="logging"/>
            <subsystem name="pojo"/>
        </exclude-subsystems>

        <exclusions>
            <module name="org.slf4j"/>
            <module name="org.slf4j.impl"/>
            <module name="org.slf4j.ext"/>
            <module name="org.slf4j.jcl-over-slf4j"/>
            <module name="org.apache.log4j"/>
            <module name="org.apache.commons.logging"/>
            <module name="org.jboss.logging"/>
            <module name="org.jboss.logging.jul-to-slf4j-stub"/>
            <module name="org.jboss.logmanager"/>
            <module name="org.jboss.log4j.logmanager"/>
            <module name="org.jboss.as.logging"/>

            <!-- exclude wildfly logging modules, use slf4j + logback -->

            <module name="org.jboss.logmanager.log4j"/>
        </exclusions>

        <exports>
            <exclude-set>
                <path name="**"/>
            </exclude-set>
            <include-set>
                <path name="org/slf4j"/>
            </include-set>
        </exports>

        <dependencies>
            <module name="deployment.some-dep-1.ear" meta-inf="import"/>
            <module name="deployment.some-dep-2.ear" meta-inf="import" services="import" optional="true"/>
            <module name="deployment.some-dep-1.ear" meta-inf="import"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

but this not works.

How can I exclude overlay dependences for export?

1

There are 1 answers

0
dhruti On

If you are using master-slave configuration and your slave configuration is EAP 6.3. or older than it is not possible, you need to downgrade your configuration. [https://issues.jboss.org/browse/WFCORE-2899?_sscc=t][1]