springboot 打包成jar
阿新 • • 發佈:2019-02-22
sed pom fig -c lean play targe aps sna
1.pom.xml配置
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</View Codesource> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId><configuration> <maimClass>com.lxp.Application</maimClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <!-- 使用aliyun鏡像 --> <repositories> <repository> <id>aliyun</id> <name>aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </repository> </repositories>
2、Run As-->Maven build-->clean package
3、將target下的xx.jar包復制出來,方便cmd啟動項目
4、打開cmd執行命令:java -jar F:\cppdy\SpringBoot-0.0.1-SNAPSHOT.jar(jar包的路徑)
springboot 打包成jar