问题
I'm using gradle-1.7 and trying to create ear with war file from maven repository.
dependencies {
deploy group: 'aaa', name: 'bbb', version: '1.0-SNAPSHOT'
}
This successfully download war file from maven repo and bbb-1.0-SNAPSHOT.war is included in the generated ear file. However, the generated application.xml file is as the following:
<module>
<web>
<web-uri>bbb</web-uri>
...
How can I fix the web-uri node to include full war file name?
回答1:
Using the EAR plugin you can specify the web context for a war file.
ear
{
deploymentDescriptor
{
webModule( "war name", "/context")
}
}
But to know the version number of the war file is not just a property you can lift from the war project. You have to create it yourself.
web = project("war project")
value = web.name + '-' + web.version + ".war"
webModule( value , "/context")
来源:https://stackoverflow.com/questions/21305814/cannot-set-web-uri-with-gradle-ear-plugin-to-inclue-war-from-maven-repository