tianyun 2 lat temu
rodzic
commit
9bfb0f9f4b
3 zmienionych plików z 55 dodań i 0 usunięć
  1. 47 0
      cmd/pom.xml
  2. 7 0
      cmd/src/main/java/com/alvin/Main.java
  3. 1 0
      pom.xml

+ 47 - 0
cmd/pom.xml

@@ -0,0 +1,47 @@
+<?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>java-base-maven</artifactId>
+        <groupId>com.alvin</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cmd</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <build>
+        <!--使用Maven编译可执行的jar-->
+        <plugins>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <appendAssemblyId>false</appendAssemblyId>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <archive>
+                        <manifest>
+                            <mainClass>com.alvin.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 7 - 0
cmd/src/main/java/com/alvin/Main.java

@@ -0,0 +1,7 @@
+package com.alvin;
+
+public class Main {
+    public static void main(String[] args) {
+        System.out.println("Hello world!");
+    }
+}

+ 1 - 0
pom.xml

@@ -12,6 +12,7 @@
         <module>test1</module>
         <module>springboot-main</module>
         <module>leetcode</module>
+        <module>cmd</module>
     </modules>
 
     <properties>