Maven是个很好用的管理工具,不经能够管理jar,还能实现打包。
这里讲解Maven 本地打包,服务器打包,可以全部交给jenkins去完成的。
用Maven打包,先在eclipse装Maven插件,然后在pom.xml添加打包插件。
4.0.0 manager manager 0.0.1 war manager UTF-8 UTF-8 1.7 1.7 4.2.4.RELEASE 3.1.1 1.2.17 org.springframework spring-core ${spring.version} org.springframework spring-beans ${spring.version} org.springframework spring-context ${spring.version} org.springframework spring-jdbc ${spring.version} org.springframework spring-orm ${spring.version} org.springframework spring-web ${spring.version} org.springframework spring-webmvc ${spring.version} org.springframework spring-aop ${spring.version} javax.servlet javax.servlet-api provided 4.0.0 org.springframework spring-tx ${spring.version} org.mybatis mybatis ${mybatis.version} org.mybatis mybatis-spring 1.3.0 mysql mysql-connector-java 5.1.34 log4j log4j ${log4j.version} org.slf4j slf4j-log4j12 1.7.21 org.slf4j slf4j-api 1.7.21 redis.clients jedis 2.9.0 org.mongodb mongodb-driver 3.5.0 com.fasterxml.jackson.core jackson-core 2.7.4 com.fasterxml.jackson.core jackson-databind 2.7.4 com.fasterxml.jackson.core jackson-annotations 2.7.4 org.json json 20180130 com.alibaba fastjson 1.2.31 org.thymeleaf thymeleaf 2.1.5.RELEASE org.thymeleaf thymeleaf-spring4 2.1.5.RELEASE org.thymeleaf.extras thymeleaf-extras-springsecurity3 2.1.2.RELEASE net.sourceforge.nekohtml nekohtml 1.9.22 org.apache.maven.plugins maven-compiler-plugin 2.5.1 UTF-8 org.codehaus.plexus plexus-compiler-javac 1.9.2 org.apache.maven.plugins maven-source-plugin 2.2.1 false org.apache.maven.plugins maven-surefire-plugin 2.9 true maven-war-plugin 2.3 manager org.sonarsource.scanner.maven sonar-maven-plugin 3.3.0.603
选择Maven Install 就可以在输出日志看到打包成功的war 文件了。