Cannot set web-uri with gradle ear plugin to inclue war from maven repository

╄→гoц情女王★ 提交于 2021-02-11 18:21:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!