Appengine Modules Maven Error during DevSever Goal Run

两盒软妹~` 提交于 2019-12-06 11:54:13

问题


i have been trying to run a new project with modules support, but am getting following error all the time, unable to debug it,

com.google.apphosting.utils.config.EarHelper reportConfigException [INFO] INFO: Application directory 'path-to-project/DemoEar-1.0.0-SNAPSHOT/DemoWarApp' must exist and be a directory.

my module structure is below

main application.xml contains

 <module>
 <web>
 <web-uri>DemoWarApp</web-uri>
 <context-root>DemoWarApp</context-root>
</web>
</module>

its clearly not pointing to the proper war folder path. does anyone know how to fix it?

Thanks


回答1:


The bundle folder that is created must match the web-uri in your application.xml. So, you either change the bundle folder name with bundleFileName in the maven-ear-plugin

<modules>
        <webModule>
            <groupId>groupId-of-DemoWarApp</groupId>
            <artifactId>artifactId-of-DemoWarApp</artifactId>
            <bundleFileName>DemoWarApp</bundleFileName>
        </webModule>
</modules>

or you change the web-uri to {module-name}-{version} every time to match the created bundle folder name.

I would recommend a version independent bundle bundleFileName (that is the same as your web-uri) so you don't have to bother with it when the version changes.

Complete ear plugin snippet:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.9</version>
    <configuration>
      <modules>
        <webModule>
            <groupId>groupId-of-DemoWarApp</groupId>
            <artifactId>artifactId-of-DemoWarApp</artifactId>
            <bundleFileName>DemoWarApp</bundleFileName>
        </webModule>
      </modules>
      <version>5</version>
      <defaultLibBundleDir>lib</defaultLibBundleDir>
      <unpackTypes>war</unpackTypes>
    </configuration>
</plugin>


来源:https://stackoverflow.com/questions/23047290/appengine-modules-maven-error-during-devsever-goal-run

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