You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

350 lines
15 KiB

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.techsor</groupId>
<artifactId>model2d3d-viewer-back</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>model2d3d-viewer-back-controller</artifactId>
<name>model2d3d-viewer-back-controller</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aws.ecr.repository>tokyo-build-admin</aws.ecr.repository>
<aws.ecr.tag>latest</aws.ecr.tag>
<aws.ecr.region>ap-northeast-1</aws.ecr.region>
<aws.ecr.registry.test>923770123186.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registry.test>
<aws.access.key.test>AKIA5OFH5OOZHM3U3KX4</aws.access.key.test>
<aws.secret.access.key.test>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</aws.secret.access.key.test>
<aws.ecr.registry.production>381659385655.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registry.production>
<aws.access.key.production>AKIAVRXFMB43XVQ3GXAL</aws.access.key.production>
<aws.secret.access.key.production>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</aws.secret.access.key.production>
</properties>
<dependencies>
<dependency>
<groupId>com.techsor</groupId>
<artifactId>model2d3d-viewer-back-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.techsor</groupId>
<artifactId>model2d3d-viewer-back-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<!--排除掉下面这个,不然重复导入javax.annotation,amazon-corretto-11下报错java.lang.String javax.annotation.Resource.lookup()-->
<exclusions>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<profiles>
<profile>
<id>only-package</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<!-- 项目的打包配置 -->
<plugins>
<!-- 自定义打zip包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>model2d3d-viewer-back</finalName>
<descriptors>
<descriptor>src/main/resources/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-package</id>
<build>
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
<plugins>
<!-- dockerfile-maven-plugin构建镜像-->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- <goal>push</goal>-->
</goals>
</execution>
</executions>
<configuration>
<repository>registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin</repository>
<tag>${aws.ecr.tag}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<LIB_DIR>target/lib</LIB_DIR>
<CONFIG_DIR>target/config</CONFIG_DIR>
<AURORA_TERRAFORM>target/aurora_terraform</AURORA_TERRAFORM>
<JVM_OPTS>${java.jvm.opts}</JVM_OPTS>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-aliyun</id>
<build>
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
<plugins>
<!-- dockerfile-maven-plugin构建镜像-->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- <goal>push</goal>-->
</goals>
</execution>
</executions>
<configuration>
<repository>registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin</repository>
<tag>${aws.ecr.tag}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<LIB_DIR>target/lib</LIB_DIR>
<CONFIG_DIR>target/config</CONFIG_DIR>
<AURORA_TERRAFORM>target/aurora_terraform</AURORA_TERRAFORM>
<JVM_OPTS>${java.jvm.opts}</JVM_OPTS>
</buildArgs>
</configuration>
</plugin>
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<!--放在package阶段后面执行-->
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Run AWS ECR login command using Ant tasks -->
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="docker login --username=409950420@qq.com registry.cn-shanghai.aliyuncs.com --password=Youqu48bnb1." />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="docker push registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin:${aws.ecr.tag}" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-test</id>
<build>
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
<plugins>
<!-- dockerfile-maven-plugin构建镜像-->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- <goal>push</goal>-->
</goals>
</execution>
</executions>
<configuration>
<repository>${aws.ecr.registry.test}/${aws.ecr.repository}</repository>
<tag>${aws.ecr.tag}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<LIB_DIR>target/lib</LIB_DIR>
<CONFIG_DIR>target/config</CONFIG_DIR>
<AURORA_TERRAFORM>target/aurora_terraform</AURORA_TERRAFORM>
<JVM_OPTS>${java.jvm.opts}</JVM_OPTS>
</buildArgs>
</configuration>
</plugin>
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<!--放在package阶段后面执行-->
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Run AWS ECR login command using Ant tasks -->
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set aws_access_key_id ${aws.access.key.test}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set aws_secret_access_key ${aws.secret.access.key.test}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set default.region ${aws.ecr.region}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set default.output text" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws ecr get-login-password --region ${aws.ecr.region} | docker login --username AWS --password-stdin ${aws.ecr.registry.test}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="docker push ${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag}" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-production</id>
<build>
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
<plugins>
<!-- dockerfile-maven-plugin构建镜像-->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- <goal>push</goal>-->
</goals>
</execution>
</executions>
<configuration>
<repository>${aws.ecr.registry.production}/${aws.ecr.repository}</repository>
<tag>${aws.ecr.tag}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<LIB_DIR>target/lib</LIB_DIR>
<CONFIG_DIR>target/config</CONFIG_DIR>
<AURORA_TERRAFORM>target/aurora_terraform</AURORA_TERRAFORM>
<JVM_OPTS>${java.jvm.opts}</JVM_OPTS>
</buildArgs>
</configuration>
</plugin>
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<!--放在package阶段后面执行-->
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Run AWS ECR login command using Ant tasks -->
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set aws_access_key_id ${aws.access.key.production}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set aws_secret_access_key ${aws.secret.access.key.production}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set default.region ${aws.ecr.region}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws configure set default.output text" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="aws ecr get-login-password --region ${aws.ecr.region} | docker login --username AWS --password-stdin ${aws.ecr.registry.production}" />
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c" />
<arg value="docker push ${aws.ecr.registry.production}/${aws.ecr.repository}:${aws.ecr.tag}" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>