| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- <?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>bnt</artifactId>
- <groupId>cn.reghao.bnt</groupId>
- <version>1.0.0</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>web</artifactId>
- <version>1.0.0</version>
- <packaging>jar</packaging>
- <properties>
- <project.build.outputDir>${project.parent.basedir}/bin/mgr</project.build.outputDir>
- <springboot.version>3.2.1</springboot.version>
- </properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <version>${springboot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>cn.reghao.bnt</groupId>
- <artifactId>common</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>cn.reghao.jutil</groupId>
- <artifactId>web</artifactId>
- <version>jdk17-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-websocket</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.session</groupId>
- <artifactId>spring-session-jdbc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-cache</artifactId>
- </dependency>
- <dependency>
- <groupId>com.github.ben-manes.caffeine</groupId>
- <artifactId>caffeine</artifactId>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version>8.0.31</version>
- </dependency>
- <dependency>
- <groupId>com.zaxxer</groupId>
- <artifactId>HikariCP</artifactId>
- <version>3.3.1</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>jakarta.validation</groupId>
- <artifactId>jakarta.validation-api</artifactId>
- <version>3.0.2</version>
- </dependency>
- <dependency>
- <groupId>jakarta.annotation</groupId>
- <artifactId>jakarta.annotation-api</artifactId>
- <version>2.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate.validator</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>8.0.1.Final</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-freemarker</artifactId>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.34</version>
- </dependency>
- <dependency>
- <groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
- <version>1.7.0</version>
- </dependency>
- <!--########################################################################################################-->
- <!-- 监控报警依赖 -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <dependency>
- <groupId>io.micrometer</groupId>
- <artifactId>micrometer-core</artifactId>
- </dependency>
- <dependency>
- <groupId>io.micrometer</groupId>
- <artifactId>micrometer-registry-prometheus</artifactId>
- </dependency>
- <!--########################################################################################################-->
- <!-- devops 模块依赖 -->
- <dependency>
- <groupId>org.eclipse.jgit</groupId>
- <artifactId>org.eclipse.jgit</artifactId>
- <version>6.4.0.202211300538-r</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jgit</groupId>
- <artifactId>org.eclipse.jgit.ssh.apache</artifactId>
- <version>6.4.0.202211300538-r</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>3.6.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-invoker</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>com.github.mwiede</groupId>
- <artifactId>jsch</artifactId>
- <version>2.27.5</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.6</version>
- </dependency>
- <!-- 阿里云 sdk 依赖 -->
- <dependency>
- <groupId>com.aliyun.oss</groupId>
- <artifactId>aliyun-sdk-oss</artifactId>
- <version>3.8.0</version>
- </dependency>
- <dependency>
- <groupId>com.aliyun</groupId>
- <artifactId>cdn20180510</artifactId>
- <version>3.2.0</version>
- </dependency>
- <dependency>
- <groupId>com.aliyun</groupId>
- <artifactId>sts20150401</artifactId>
- <version>1.1.4</version>
- </dependency>
- </dependencies>
- <profiles>
- <profile>
- <id>dev</id>
- <properties>
- <profile.active>dev</profile.active>
- </properties>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- </profile>
- <profile>
- <id>test</id>
- <properties>
- <profile.active>test</profile.active>
- </properties>
- </profile>
- <profile>
- <id>prod</id>
- <properties>
- <profile.active>prod</profile.active>
- </properties>
- </profile>
- </profiles>
- <build>
- <finalName>bnt${project.artifactId}</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>banner.txt</include>
- <include>application.yml</include>
- <include>application-${profile.active}.yml</include>
- <include>logback-spring.xml</include>
- <include>git.properties</include>
- <!-- 前端静态资源 -->
- <include>static/**</include>
- <include>templates/**</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
- <configuration>
- <compilerArgs>
- <arg>-parameters</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <!-- 让 maven 不处理字体 -->
- <nonFilteredFileExtensions>
- <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
- <nonFilteredFileExtension>woff</nonFilteredFileExtension>
- <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
- <nonFilteredFileExtension>fbx</nonFilteredFileExtension>
- </nonFilteredFileExtensions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${springboot.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!-- 生成的 jar 包输出到指定目录 -->
- <outputDirectory>${project.build.outputDir}</outputDirectory>
- </configuration>
- </plugin>
- <!--git-commit-id-plugin 插件,用于实现打包带git版本信息-->
- <plugin>
- <groupId>pl.project13.maven</groupId>
- <artifactId>git-commit-id-plugin</artifactId>
- <version>2.1.5</version>
- <executions>
- <execution>
- <goals>
- <goal>revision</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!--日期格式;默认值:dd.MM.yyyy '@' HH:mm:ss z;-->
- <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
- <!--,构建过程中,是否打印详细信息;默认值:false;-->
- <verbose>true</verbose>
- <!-- ".git"文件路径;默认值:${project.basedir}/.git;
- 注意: 如果是多模块(多模块)项目,则需要修改到.git文件夹的目录-->
- <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
- <!--若项目打包类型为pom,是否取消构建;默认值:true;-->
- <skipPoms>false</skipPoms>
- <!--是否生成"git.properties"文件;默认值:false;-->
- <generateGitPropertiesFile>true</generateGitPropertiesFile>
- <!--指定"git.properties"文件的存放路径(相对于${project.basedir}的一个路径);
- 注意:该地址决定接口代码是否可以读取到git版本信息,请自行修改-->
- <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
- <!--".git"文件夹未找到时,构建是否失败;若设置true,则构建失败;若设置false,则跳过执行该目标;默认值:true;-->
- <failOnNoGitDirectory>true</failOnNoGitDirectory>
- <!--git描述配置,可选;由JGit提供实现;-->
- <gitDescribe>
- <!--是否生成描述属性-->
- <skip>false</skip>
- <!--提交操作未发现tag时,仅打印提交操作ID,-->
- <always>false</always>
- <!--提交操作ID显式字符长度,最大值为:40;默认值:7;
- 0代表特殊意义;后面有解释;
- -->
- <abbrev>8</abbrev>
- <!--构建触发时,代码有修改时(即"dirty state"),添加指定后缀;默认值:"";-->
- <dirty>-dirty</dirty>
- <!--always print using the "tag-commits_from_tag-g_commit_id-maybe_dirty" format, even if "on" a tag.
- The distance will always be 0 if you're "on" the tag.
- -->
- <forceLongFormat>false</forceLongFormat>
- </gitDescribe>
- </configuration>
- </plugin>
- <!--apache maven插件,用于执行ant脚本函数-->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <!--maven 插件生命周期,我试过用compile 发现打包以后没有git.properties,因为打包的时候,还没有生成
- 注意,这里改成 initialize 的话, 上面 git-commit-id-plugin 插件对应也该添加 phase 配置,并设置为 initialize
- 否则你生成的文件,写入的就不会对应的值,而是变量名-->
- <phase>initialize</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <echo message="写入 git 版本信息"/>
- <!-- concat 常用于把一些信息写入文件,我这里用于把 git-commit-id-plugin 生成的git环境变量写入文件 -->
- <concat destfile="src/main/resources/git.properties">
- repo=${git.remote.origin.url}
- branch=${git.branch}
- commitId=${git.commit.id.abbrev}
- commitTime=${git.commit.time}
- buildTime=${git.build.time}
- </concat>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </project>
|