【问题标题】:How to get the projectId in pom.xml from GCLOUD_CONFIG for the endpoints-framework-maven-plugin如何从 GCLOUD_CONFIG 获取 pom.xml 中的 projectId 用于端点框架-maven-插件
【发布时间】:2020-09-23 07:22:25
【问题描述】:

对于 Google 端点文档,我需要提供 <hostname>${endpoints.project.id}.appspot.com</hostname>,但我希望它来自 GCLOUD_CONFIG。这怎么可能?

插件配置

 <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>endpoints-framework-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <hostname>${endpoints.project.id}.appspot.com</hostname>
                    <serviceClasses>
                        com.example.pratyum.guice.AllEndpoint
                    </serviceClasses>
                </configuration>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>discoveryDocs</goal>
                            <goal>openApiDocs</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

【问题讨论】:

    标签: maven google-app-engine gcloud


    【解决方案1】:

    目前无法使用 GCLOUD_CONFIG 设置让 SDK 填写服务主机名。

    也不可能将其用作为项目 ID 提供后缀/前缀的方法。

    最常见的用例(替换 projectIdversion)具有非常具体的行为。第一个用项目 ID 替换字符串,第二个生成唯一的版本 ID。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-17
      • 2014-07-27
      • 2014-05-31
      • 2021-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-18
      相关资源
      最近更新 更多