Commit b599914d authored by hanbing's avatar hanbing

[update] 优化Maven生命周期

parent f7b4d1cc
...@@ -19,7 +19,7 @@ pipeline { ...@@ -19,7 +19,7 @@ pipeline {
stage('编译构建') { stage('编译构建') {
steps { steps {
sh ''' sh '''
mvn clean install -Dmaven.test.skip=true com.google.cloud.tools:jib-maven-plugin:build -DsendCredentialsOverHttp=true mvn clean install -Dmaven.test.skip=true -DsendCredentialsOverHttp=true
''' '''
} }
} }
......
...@@ -199,6 +199,16 @@ ...@@ -199,6 +199,16 @@
<groupId>com.google.cloud.tools</groupId> <groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId> <artifactId>jib-maven-plugin</artifactId>
<version>2.5.2</version> <version>2.5.2</version>
<!-- 将jib与mvn构建的生命周期绑定 -->
<executions>
<execution>
<id>build-image</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration> <configuration>
<!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字--> <!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字-->
<from> <from>
......
...@@ -283,6 +283,14 @@ ...@@ -283,6 +283,14 @@
<!--可以进行HTTP--> <!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries> <allowInsecureRegistries>true</allowInsecureRegistries>
</configuration> </configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
......
...@@ -236,6 +236,14 @@ ...@@ -236,6 +236,14 @@
<!--可以进行HTTP--> <!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries> <allowInsecureRegistries>true</allowInsecureRegistries>
</configuration> </configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
......
...@@ -241,6 +241,14 @@ ...@@ -241,6 +241,14 @@
<!--可以进行HTTP--> <!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries> <allowInsecureRegistries>true</allowInsecureRegistries>
</configuration> </configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment