maven 打包可执行jar
在pom中增加
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.5</version> <configuration> <archive> <manifest> <mainClass>GddsParse</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>
打包命令
#这么设置,可以制定Jdk编译版本 set JAVA_HOME=D:\soft\jrockit-jdk1.6.0_33-R28.2.4-4.1.0 set PATH=%JAVA_HOME%/bin;%PATH% mvn package assembly:single bat打
开jar
@echo off java -jar login-1.0-SNAPSHOT-jar-with-dependencies.jar @pause