I believe EAR plugin generates wrong deployment for J2EE 1.3 as it causes 3 errors on the file.
- It puts “version” attribute on
<application element> when it should not.
This is what to be expected:
But… this is the reality:
The other thing is, it create invalid element
<library-directory> when it should not.
It generates elements in wrong order.
It should generate:
<display-name>X-interface</display-name> <description>X Interface Desc</description>
But the reality:
<description>X Interface Desc</description> <display-name>X-interface</display-name>
Please fix this 3 errors.
Thanks. Which application container is this failing with?
As a workaround, you can tweak the generated XML:
version = '1.3'
displayName = "foo"
description = "description of foo"
def rootNode = it.asNode()
It is with Oracle WebLogic 10.3.0.0.
By the way. Your workaround is still unable to solve the order problem.
It generates in the “correct” order for me and I would hope it doesn’t really matter.
You can modify the generated XML through this API: https://docs.gradle.org/current/javadoc/org/gradle/plugins/ear/descriptor/DeploymentDescriptor.html
What happens when the elements are in the other order?
Actually, the order is not correct according to the DTD.
This is my final fix:
// Work around bugs in generated application.xml file to comply with J2EE 1.3 spec
def appXml = it.asNode()
// Remove invalid nodes
// Fix wrong order
def desc = appXml.'description'
def disp = appXml.'display-name'
Anyway, thank you for your workaround