我尝试在非默认模块上运行应用引擎端点,但生成的 JAR 未指向正确的模块。
我的模块名称是:
<module>business-module</module>
我使用以下方式生成 JAR:
business-module:appengineEndpointsInstallClientLibs
当我打开生成的 jar 时,我看到:
public static final String DEFAULT_ROOT_URL = "https://project-id.appspot.com/_ah/api/";
public static final String DEFAULT_SERVICE_PATH = "blahApi/v1/";
public static final String DEFAULT_BASE_URL = "https://project-id.appspot.com/_ah/api/blahApi/v1/";
但从技术上讲它应该是:
public static final String DEFAULT_ROOT_URL = "https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/";
public static final String DEFAULT_SERVICE_PATH = "blahApi/v1/";
public static final String DEFAULT_BASE_URL = "https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/blahApi/v1/";
我可以通过打开 api explorer 来正常运行 api:
编辑
bug tracker 上存在相关问题
最佳答案
好的,已经开始工作了。 基本上,我在构建 Api 时将 rootURL 设置为指向正确的模块:
final BlahApi businessApi = CloudEndPointsUtils.updateBuilder(new BlahApi.Builder(transport, factory, credential)
.setRootUrl("https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/")).build();
关于java - 在非默认模块上运行 appengine 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35294439/