Hi,
Ear plugin generates application.xml with an erroneous ejb module entry containing spring’s beanRefContext.xml file.
My ear project directory listing is:
src
└── main
└── application
├── beanRefContext.xml
└── META-INF
└── jboss-app.xml
my build.gradle is
apply plugin: 'java'
apply plugin: 'ear'
dependencies {
deploy project( path: ':nmcommonDaoClient')
deploy project( path: ':nmcommonDao')
deploy project( path: ':auditEventDaoClient')
deploy project( path: ':auditEventDao')
deploy project( ':auditablerest')
deploy project( ':nmcommonrest')
earlib project( path: ':auditEventDao', configuration: 'unprovided')
earlib project( path: ':nmcommonDao', configuration: 'unprovided')
}
processResources {
expand(project.properties)
}
jar.onlyIf { false }
ear {
deploymentDescriptor {
displayName = project.name
initializeInOrder = true
module("nmcommonDaoClient-${project.version}.jar", 'ejb')
module("nmcommonDao-${project.version}.jar",'ejb')
module("auditEventDaoClient-${project.version}.jar", 'ejb')
module("auditEventDao-${project.version}.jar",'ejb')
webModule("nmcommonrest-${project.version}.war",'/nmcommon.rest')
webModule("auditablerest-${project.version}.war",'/auditable.rest')
withXml { xml ->
xml.asNode().module.removeAll { it.ejb.text().startsWith('beanRef') }
}
}
}
And this is the ear’s application.xml that gradle produces,
<?xml version="1.0"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
<display-name>auditable</display-name>
<module>
<ejb>nmcommonDaoClient-1.0.0.jar</ejb>
</module>
<module>
<ejb>nmcommonDao-1.0.0.jar</ejb>
</module>
<module>
<ejb>auditEventDaoClient-1.0.0.jar</ejb>
</module>
<module>
<ejb>auditEventDao-1.0.0.jar</ejb>
</module>
<module>
<web>
<web-uri>auditablerest-1.0.0.war</web-uri>
<context-root>auditablerest-1.0.0</context-root>
</web>
</module>
<module>
<web>
<web-uri>nmcommonrest-1.0.0.war</web-uri>
<context-root>nmcommonrest-1.0.0</context-root>
</web>
</module>
<module>
<ejb>beanRefContext.xml</ejb>
</module>
<library-directory>lib</library-directory>
</application>