项目目录结构
一,在pom.xml文件里添加配置
12 3 614 18 19org.apache.maven.plugins 5maven-jar-plugin 67 178 169 10 15com.topsec.ticifs.graph.Main 11true 12../lib/ 13false 1420 32 33org.apache.maven.plugins 21maven-dependency-plugin 2223 3124 30copy-dependencies-lib 25package 2627 29copy-dependencies 2834 53org.apache.maven.plugins 35maven-assembly-plugin 3637 4338 40src/assemble/standalone.xml 39${project.artifactId}-${project.version} 41false 4244 5245 51make-assembly 46package 4748 50single 4954 60org.apache.maven.plugins 55maven-surefire-plugin 5657 59true 58
二,assemble文件配置
14 standalone 56 8zip 7false 设置为false,打包后的目录结构没有工程名 具体详见 :http://blog.51cto.com/supercharles888/981306 910 11 18 1912 17${project.basedir}/target/dependency 13/lib 14755 15644 1620 21 37 3822 27 28 2930 35 36
三,cmd运行jar包
在cmd里运行java -jar
1 C:\Users\sqy\Desktop\sticif测试\ticifs-createTitan-1.0.3-SNAPSHOT\apps>java -jar ticifs-createTitan.jar C:\Users\sqy\Desktop\sticif测试\ticifs-createTitan-1.0.3-SNAPSHOT2 后面的C:\Users\sqy\Desktop\sticif测试\ticifs-createTitan-1.0.3-SNAPSHOT为参数,也可以添加多个参数,用空格隔开
3 参数长度:1 4 参数是: C:\Users\sqy\Desktop\sticif测试\ticifs-createTitan-1.0.3-SNAPSHOT