加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pom.xml 6.02 KB
一键复制 编辑 原始数据 按行查看 历史
林万程 提交于 2021-05-01 22:58 . 直接启动脚本
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.linwancen</groupId>
<artifactId>maven-deploy-tool</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<!-- xml解析 -->
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.3</version>
</dependency>
<!-- 执行命令行 -->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-exec -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
</dependency>
<!-- 多线程 -->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<!-- 日志 -->
<!-- https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl/ -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.9.1</version>
</dependency>
<!-- log4j2 Async -->
<!-- https://repo.maven.apache.org/maven2/com/lmax/disruptor/ -->
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>[7, 8)</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<!-- sonarcloud -->
<sonar.projectKey>LinWanCen_maven-deploy-tool</sonar.projectKey>
<sonar.organization>linwancen</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<finalName>${project.artifactId}</finalName>
<!-- 覆盖参数没设 true 的情况下,后面的不覆盖前面的,即前面的优先级高 -->
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
<testResource>
<directory>${project.basedir}/src/main/resources</directory>
</testResource>
</testResources>
<plugins>
<!-- 拷贝 dependencies 的依赖到 lib 目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<!-- 设置启动类 -->
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>io.github.linwancen.maven.tool.Main</mainClass>
</manifest>
<manifestEntries>
<Class-Path>./</Class-Path>
</manifestEntries>
</archive>
<!-- 打包不带配置文件 -->
<excludes>
<exclude>*.xml</exclude>
<exclude>*.properties</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!-- 拷贝外置配置文件和 lib 并压缩成 zip,使用:antrun:run@zip -->
<execution>
<id>zip</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<!-- http://ant.apache.org/manual/Tasks/ -->
<target>
<copy todir="${project.build.directory}/" overwrite="true">
<fileset dir="${basedir}/src/main/resources"/>
<fileset dir="${project.build.scriptSourceDirectory}"/>
</copy>
<zip destfile="${project.build.directory}/${project.artifactId}.zip">
<fileset dir="${project.basedir}/">
<include name="README.md"/>
</fileset>
<fileset dir="${project.build.directory}/">
<include name="lib/"/>
<include name="*.sh"/>
<include name="*.bat"/>
<include name="*.xml"/>
<include name="*.properties"/>
<include name="${project.artifactId}.jar"/>
<exclude name="${project.artifactId}.zip"/>
</fileset>
</zip>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化