Note: If the picture is damaged, click on the link to the article: https://www.toutiao.com/i6809285459722633736/
Create Project
Use maven project
Checked, then the next step
Basic Information
Note The change coding and JDK
pom configuration (later attached document)
Introducing jar (this package has been unable to download, so additional import)
Create a class run
Write code
Continue to prepare
The main method of testing, to the windows in the test is completed, it is placed on the linux performed facie, the local test is not tested directly packaged
Package, install execution
Since we introduced another package, so our package will be larger than the other packages, make no mistake
This package is
Copy pom, pay attention to change your main class
Change the name to upload
And then execute the statement packing
java -jar zipexe.jar /usr/local/pimages /data/1.tar.gz
Write a script for next execution
Results of the
<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.xlgl.wzy</groupId> <artifactId>mail</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>commonsIO</groupId> <!--自定义--> <artifactId>commonsIO</artifactId> <!--自定义--> <version>2.5 . 0 </ Version> <-! Custom -> <scope> System </ scope> <-! System, similar provided, after the need to provide an explicit dependency jar, Maven will not find in the Repository it -> <systemPath>} $ {pom.basedir / JAR / commonsIO- 2.5 . 0 .jar </ systemPath> <-! lib files under the root folder item -> </ dependency> <dependency> <the groupId> JUnit </ the groupId> <the artifactId> JUnit </ the artifactId> <Version> 4.10 </ Version> </ dependency> <dependency> <the groupId> log4j </ the groupId> <the artifactId> log4j </ the artifactId> <Version> 1.2 . . 8 </ Version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.5</version> </dependency> <!--邮件发送--> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.7</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>com.xlgl.wzy.zip.ZipExecute</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>