简体   繁体   English

服务名称在 Google Cloud App Engine 标准 spring 启动 java 11 maven 部署中没有改变

[英]Service name isn't changing in Google Cloud App Engine standard spring boot java 11 maven deploy using app.yml configuration

I'm trying to deploy to google cloud App Engine standard, a spring boot java 11 maven microservice using app.yml.我正在尝试使用 app.yml 部署到谷歌云 App Engine 标准,spring 启动 java 11 maven 微服务。 It deploys but it deploys with default as service name.它部署但它使用default作为服务名称进行部署。 I want to deploy it with a custom name.我想用自定义名称部署它。

I tried to put the tag service in the app.yml file but it stills has the same name.我试图将标签service放在app.yml文件中,但它仍然具有相同的名称。

Here is my app.yml file这是我的app.yml文件

runtime: java11
instance_class: F1
env: standard
service: mycustomname
entrypoint: java -noverify -jar helloworld.jar

and here is my pom这是我的pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.cors</groupId>
    <artifactId>cors-example</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>cors-example</name>
    <description>Demo MS for cors</description>

    <properties>
        <java.version>11</java.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>helloworld</finalName>
        <plugins>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>2.4.0</version>
                <configuration>
                    <projectId>miproyecto</projectId>
                    <version>helloworld</version>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

I'm deploying using this command gcloud app deploy target/helloworld.jar我正在使用这个命令gcloud app deploy target/helloworld.jar进行部署

In App Engine there must be always a default service no matter what.在 App Engine 中无论如何都必须有一个默认服务

According to your app.yaml file, your attempting to deploy a service called mycustomname and this will create a new service called like that but you will not be able to rename the service default since this is not possible.根据您的app.yaml文件,您尝试部署名为mycustomname的服务,这将创建一个名为的新服务,但您将无法重命名服务default ,因为这是不可能的。

You will see the new service going to the Cloud Console -> App Engine -> Versions.您将看到新服务转到 Cloud Console -> App Engine -> 版本。 Once there, there is a drop down menu to choose the other services.在那里,有一个下拉菜单可以选择其他服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Spring Boot 和 app.yml 在 actuator/info 中显示应用程序版本? - How to display app version in actuator/info using Spring Boot and app.yml? 不稳定的 Google Cloud Engine - 标准环境 - 延迟(Spring Boot 应用程序) - Erratic Google Cloud Engine - Standard Environment - Latency (Spring Boot App) 使用应用引擎部署本地主机上的谷歌云应用引擎和 Spring Boot 错误 - google cloud app engine and spring boot bug on localhost deploy with app engine 使用 Gitlab CI 将 Spring 引导应用程序部署到 Google App Engine? - Deploy Spring Boot application to Google App Engine using Gitlab CI? 无法部署 Google APP Engine Java /Maven - Failed to deploy Google APP Engine Java /Maven 如何在谷歌云中部署 spring 启动应用程序? - How to deploy a spring boot app in google cloud? Spring 在 Google Cloud App Engine 上启动托管 - Spring Boot hosting on Google Cloud App Engine Spring Boot - 将应用程序部署到 Google Cloud App 引擎但缺少 app.yaml - Spring Boot - Deploy application to Google Cloud App engine but missing app.yaml 无法在 GAE 上部署没有 app.yml 文件的 Java WAR 应用程序 - Cannot deploy Java WAR application without app.yml file on GAE 在 Google App Engine 中部署 Spring boot gradle 应用 - Deploy Spring boot gradle app in Google App Engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM