郑永安
2023-06-19 c8188c0fc9edf6ea3feda5b6f11dcb014af2a89e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--    <parent>-->
<!--        <artifactId>safe-platform</artifactId>-->
<!--        <groupId>com.gkhy.safePlatfrom</groupId>-->
<!--        <version>1.0-SNAPSHOT</version>-->
<!--    </parent>-->
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
 
    <groupId>com.gkhy.safePlatfrom</groupId>
    <artifactId>commons</artifactId>
    <version>1.0-SNAPSHOT</version>
 
    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
 
        <!-- jib docker config-->
        <!--    jib 版本-->
        <jib.version>3.2.1</jib.version>
        <!--    是否跳过jib打包-->
        <jib.skip>true</jib.skip>
        <!--    启动类-->
        <jib.main.class>com.gkhy.safePlatform.Application</jib.main.class>
    </properties>
 
 
    <dependencies>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.14</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.11</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>5.3.19</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>5.3.19</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.3.19</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>2.6.4</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.3</version>
            <scope>compile</scope>
        </dependency>
 
<!--        下面两个是因为把minio配置文件放到comons中新增的两个依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
            <version>2.7.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.minio</groupId>
            <artifactId>minio</artifactId>
            <version>8.4.2</version>
            <scope>compile</scope>
        </dependency>
 
    </dependencies>
 
    <distributionManagement>
        <!--稳定版本的仓库地址,必须是允许上传的私服地址-->
        <repository>
            <id>nexus-gkhy-releases</id>
            <url>http://121.239.169.27:28080/repository/guotai-release/</url>
        </repository>
        <!--开发版本的仓库地址,必须是允许上传的私服地址-->
        <snapshotRepository>
            <id>nexus-gkhy-snapshots</id>
            <url>http://121.239.169.27:28080/repository/guotai-snapshot/</url>
        </snapshotRepository>
    </distributionManagement>
 
    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/java</source>
                                <!--                                <source>build/generated/source/proto/main/java</source>-->
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 上传源码 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
 
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${jib.version}</version>
                <configuration>
                    <skip>${jib.skip}</skip>
                    <from>
                        <image>openjdk:8-jdk-alpine</image>
                    </from>
                    <to>
                        <!--我这里${project.build.finalName}就叫jib-maven-plugin,所以推送到私服上的镜像名叫jib-maven-plugin-->
                        <image>121.239.169.27:28085/repository/gkhy-docker-repo/${project.artifactId}:${project.version}</image>
                    </to>
                    <container>
                        <!--要暴露的端口(springboot项目配置的端口)-->
                        <ports>
                            <port>8008</port>
                        </ports>
                    </container>
                    <!--                    可以使用http访问-->
                    <allowInsecureRegistries>true</allowInsecureRegistries>
                </configuration>
            </plugin>
        </plugins>
    </build>
 
</project>