Appengine多个模块本地开发 - Java [英] Appengine multiple modules local dev - Java

查看:140
本文介绍了Appengine多个模块本地开发 - Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个使用Google Appengine标准的java模块:

第一个模块使用Java 7与Servlet 2.5 + web.xml + Spring 4



第二个模块使用Java 8和Servlet 3.1,不使用web.xml + Spring 5,使用WebApplicationInitializer。

前端文件(HTML,CSS)。

我有一个包含每个模块路由的dispatch.yaml。






如果我只运行java8模块:

  mvn appengine:run OR / usr / lib / google-cloud-sdk / bin / java_dev_appserver.sh,

没关系,模块运行。



如果我使用: dev_appserver.py theJava8Module ,会发生以下问题:



'pre> google.appengine.tools.devappserver2.errors.AppConfigNotFoundError: 目标/ theJava8Module / WEB-INF 子目录存在,但缺少的web.xml






在我有这个ja之前VA8模块,I用于与该命令运行:

  dev_appserver.py --max_module_instances = 1 frontendmodule / frontendmodule.yaml调度/ dispatch.yaml java7Module /目标/ java7Module --dev_appserver_log_level =调试

当我使用该命令,它是好吧,这两个模块运行,我可以使用应用程序和调度规则。






我的问题是,有没有办法运行多个模块并使用调度规则?
我可以使用dev_appserver.py(python)来运行没有web.xml的java8应用程序吗?
或者我可以使用mvn:appengine来运行多个模块并使用dispatch.xml或dispatch.yaml吗?



重要:我可以使用mvn运行separete模块: appengine和dev_appserver,问题是端口将不同,所以调度规则将不起作用。



示例:

  dev_appserver.py --max_module_instances = 1 frontendmodule / frontendmodule.yaml调度/ dispatch.yaml java7Module /目标/ java7Module --dev_appserver_log_level =调试(端口8080)
mvn appengine:运行java8module(port 9090)

解决方案

appengine-maven-plugin的用户指南涵盖了运行多个模块。看看它是否有帮助。


I have 3 java modules using Google Appengine Standard:

The first one module uses Java 7 with Servlet 2.5 + web.xml + Spring 4

The second module uses Java 8 with Servlet 3.1 without web.xml + Spring 5 using WebApplicationInitializer.

The third module is just to frontend files (HTML,CSS).

I have a dispatch.yaml that contains route for each module.


If I run only java8 module using:

mvn appengine:run OR /usr/lib/google-cloud-sdk/bin/java_dev_appserver.sh, 

It is ok, the modules run.

If I use: dev_appserver.py theJava8Module, happens the follow problem:

google.appengine.tools.devappserver2.errors.AppConfigNotFoundError: The "target/theJava8Module/WEB-INF" subdirectory exists but is missing web.xml


Before I had this java8 module, I used to run with this command:

dev_appserver.py --max_module_instances=1 frontendmodule/frontendmodule.yaml dispatch/dispatch.yaml java7Module/target/java7Module --dev_appserver_log_level=debug

When I use this command, it is ok, the 2 modules run and I can use the application and dispatch rules.


My question is, is there any way to run more than one module and using dispatch rules? Can I user dev_appserver.py (python) to run java8 application that does not have web.xml? Or Can I user mvn:appengine to run multiple modules and use dispatch.xml or dispatch.yaml?

Important: Could I run separete modules using mvn:appengine and dev_appserver, the problem is that the ports will be different, so the dispatch rules won't work.

Example:

dev_appserver.py --max_module_instances=1 frontendmodule/frontendmodule.yaml dispatch/dispatch.yaml java7Module/target/java7Module --dev_appserver_log_level=debug (port 8080)
mvn appengine:run java8module (port 9090)

解决方案

The User Guide for the appengine-maven-plugin covers running multiple modules. See if it helps.

这篇关于Appengine多个模块本地开发 - Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆