[英]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.