|
@@ -324,62 +324,65 @@
|
|
|
</dependencies>
|
|
|
|
|
|
<!-- 打包(跳过docker):mvn clean package -DskipDocker -->
|
|
|
+<!-- <build>-->
|
|
|
+<!-- <defaultGoal>compile</defaultGoal>-->
|
|
|
+<!-- <plugins>-->
|
|
|
+<!-- <plugin>-->
|
|
|
+<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
|
|
+<!-- <artifactId>maven-compiler-plugin</artifactId>-->
|
|
|
+<!-- <version>3.8.0</version>-->
|
|
|
+<!-- <configuration>-->
|
|
|
+<!-- <compilerVersion>1.8</compilerVersion>-->
|
|
|
+<!-- <source>1.8</source>-->
|
|
|
+<!-- <target>1.8</target>-->
|
|
|
+<!-- </configuration>-->
|
|
|
+<!-- </plugin>-->
|
|
|
+<!-- </plugins>-->
|
|
|
+
|
|
|
+<!-- <resources>-->
|
|
|
+<!-- <resource>-->
|
|
|
+<!-- <directory>src/main/java</directory>-->
|
|
|
+<!-- <includes>-->
|
|
|
+<!-- <include>**/*.properties</include>-->
|
|
|
+<!-- <include>**/*.xml</include>-->
|
|
|
+<!-- <include>**/*.json</include>-->
|
|
|
+<!-- <include>**/*.dict</include>-->
|
|
|
+<!-- </includes>-->
|
|
|
+<!-- <filtering>false</filtering>-->
|
|
|
+<!-- </resource>-->
|
|
|
+<!-- </resources>-->
|
|
|
+
|
|
|
+<!-- <finalName>emrais</finalName>-->
|
|
|
+<!-- </build>-->
|
|
|
<build>
|
|
|
- <pluginManagement>
|
|
|
- <plugins>
|
|
|
- <plugin>
|
|
|
- <groupId>org.springframework.boot</groupId>
|
|
|
- <artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
- </plugin>
|
|
|
- <plugin>
|
|
|
- <groupId>com.spotify</groupId>
|
|
|
- <artifactId>docker-maven-plugin</artifactId>
|
|
|
- <version>${docker-maven-plugin.version}</version>
|
|
|
- <configuration>
|
|
|
- <forceTags>true</forceTags>
|
|
|
- <imageTags>
|
|
|
- <imageTag>latest</imageTag>
|
|
|
- </imageTags>
|
|
|
- <imageName>${registryUrl}/${harbor.folder}/${project.artifactId}</imageName>
|
|
|
- <baseImage>${registryUrl}/java/prijava:latest</baseImage>
|
|
|
- <workdir>/opt</workdir>
|
|
|
- <rm>true</rm>
|
|
|
- <runs>
|
|
|
- <run>chmod -R 777 /wait-for-it.sh</run>
|
|
|
- </runs>
|
|
|
- <cmd>["java", "-version"]</cmd>
|
|
|
- <useGitCommitId>false</useGitCommitId>
|
|
|
- <resources>
|
|
|
- <resource>
|
|
|
- <targetPath>/</targetPath>
|
|
|
- <directory>${project.build.directory}</directory>
|
|
|
- <include>${project.build.finalName}.jar</include>
|
|
|
- </resource>
|
|
|
- <resource>
|
|
|
- <targetPath>/</targetPath>
|
|
|
- <!--suppress UnresolvedMavenProperty -->
|
|
|
- <directory>${pom.parent.basedir}/document/docker</directory>
|
|
|
- <include>wait-for-it.sh</include>
|
|
|
- </resource>
|
|
|
- </resources>
|
|
|
- <pushImageTag>true</pushImageTag>
|
|
|
- <retryPushCount>3</retryPushCount>
|
|
|
- <retryPushTimeout>8</retryPushTimeout>
|
|
|
- <serverId>${serverId}</serverId>
|
|
|
- </configuration>
|
|
|
- <executions>
|
|
|
- <execution>
|
|
|
- <id>build-image</id>
|
|
|
- <phase>package</phase>
|
|
|
- <goals>
|
|
|
- <goal>build</goal>
|
|
|
- </goals>
|
|
|
- </execution>
|
|
|
- </executions>
|
|
|
- </plugin>
|
|
|
- </plugins>
|
|
|
- </pluginManagement>
|
|
|
- <finalName>app</finalName>
|
|
|
+ <plugins>
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
+ </plugin>
|
|
|
+ <!-- 添加docker-maven插件 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>com.spotify</groupId>
|
|
|
+ <artifactId>docker-maven-plugin</artifactId>
|
|
|
+ <version>1.1.1</version>
|
|
|
+ <configuration>
|
|
|
+ <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
|
|
|
+ <forceTags>true</forceTags>
|
|
|
+ <!--镜像的FROM,使用压缩的小镜像-->
|
|
|
+ <baseImage>frolvlad/alpine-oraclejre8:slim</baseImage>
|
|
|
+ <entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>
|
|
|
+ <resources>
|
|
|
+ <resource>
|
|
|
+ <targetPath>/</targetPath>
|
|
|
+ <directory>${project.build.directory}</directory>
|
|
|
+ <include>${project.build.finalName}.jar</include>
|
|
|
+ </resource>
|
|
|
+ </resources>
|
|
|
+ <serverId>docker-registry</serverId>
|
|
|
+ <registryUrl>${registryUrl}</registryUrl>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+ </plugins>
|
|
|
</build>
|
|
|
|
|
|
</project>
|