71 lines
2.5 KiB
XML
71 lines
2.5 KiB
XML
|
|
<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>com.example</groupId>
|
||
|
|
<artifactId>cli-example</artifactId>
|
||
|
|
<version>1.0-SNAPSHOT</version>
|
||
|
|
|
||
|
|
<dependencies>
|
||
|
|
<!-- Apache Commons CLI 依赖 -->
|
||
|
|
<dependency>
|
||
|
|
<groupId>commons-cli</groupId>
|
||
|
|
<artifactId>commons-cli</artifactId>
|
||
|
|
<version>1.4</version>
|
||
|
|
</dependency>
|
||
|
|
</dependencies>
|
||
|
|
|
||
|
|
<build>
|
||
|
|
<plugins>
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
||
|
|
<version>3.8.1</version>
|
||
|
|
<configuration>
|
||
|
|
<source>1.8</source>
|
||
|
|
<target>1.8</target>
|
||
|
|
</configuration>
|
||
|
|
</plugin>
|
||
|
|
<!-- 配置 Maven 插件以将项目打包成 JAR 文件 -->
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-jar-plugin</artifactId>
|
||
|
|
<version>3.2.0</version>
|
||
|
|
<configuration>
|
||
|
|
<archive>
|
||
|
|
<manifest>
|
||
|
|
<!-- 指定主类 -->
|
||
|
|
<mainClass>cli.HelloWorldCLI</mainClass>
|
||
|
|
</manifest>
|
||
|
|
</archive>
|
||
|
|
</configuration>
|
||
|
|
</plugin>
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
||
|
|
<version>3.3.0</version>
|
||
|
|
<configuration>
|
||
|
|
<descriptorRefs>
|
||
|
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||
|
|
</descriptorRefs>
|
||
|
|
<archive>
|
||
|
|
<manifest>
|
||
|
|
<mainClass>cli.HelloWorldCLI</mainClass>
|
||
|
|
</manifest>
|
||
|
|
</archive>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<id>make-assembly</id>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>single</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</project>
|