SpringBoot工程打包插件

发布时间:2020-10-18 22:09:04 作者:zcp617504296
来源:网络 阅读:2822

springboot的打包插件的配置文件参考如下:

<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.zcp.springboot</groupId>

    <artifactId>webGateWay</artifactId>

    <version>1.0</version>

    <packaging>jar</packaging>

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>1.5.2.RELEASE</version>

</parent>


<dependencies>

<!-- 测试的时候注释的 -->

<!-- <dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId>

</dependency> -->

<dependency>

<groupId>org.springframework.retry</groupId>

<artifactId>spring-retry</artifactId>

<version>1.1.4.RELEASE</version>

</dependency>

<!-- 连接池 -->

<dependency>

<groupId>com.jolbox</groupId>

<artifactId>bonecp-spring</artifactId>

<version>0.8.0.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>

<dependency>

<groupId>org.springframework.batch</groupId>

<artifactId>spring-batch-core</artifactId>

</dependency>

<!-- MySql -->

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>5.1.34</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-jdbc</artifactId>

<version>1.5.6.RELEASE</version>

</dependency>

<dependency>

<groupId>com.google.code.gson</groupId>

<artifactId>gson</artifactId>

</dependency>


<dependency>

<groupId>com.alibaba</groupId>

<artifactId>fastjson</artifactId>

<version>1.2.29</version>

</dependency>

<dependency>

<groupId>com.alibaba</groupId>

<artifactId>fastjson</artifactId>

<version>1.1.41</version>

</dependency>

<dependency>

<groupId>org.codehaus.jackson</groupId>

<artifactId>jackson-mapper-asl</artifactId>

<version>1.9.13</version>

</dependency>

<dependency>

<groupId>commons-io</groupId>

<artifactId>commons-io</artifactId>

<version>2.2</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-redis</artifactId>

<version>1.3.7.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-jdbc</artifactId>

<version>1.5.6.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-jdbc</artifactId>

<version>4.0.5.RELEASE</version>

</dependency>

<dependency>

<groupId>org.mybatis.spring.boot</groupId>

<artifactId>mybatis-spring-boot-starter</artifactId>

<version>1.2.0</version>

</dependency>

        <dependency>

            <groupId>mysql</groupId>

            <artifactId>mysql-connector-java</artifactId>

            <version>5.1.34</version>

        </dependency>


<!-- <dependency>

            <groupId>org.mybatis.spring.boot</groupId>

            <artifactId>mybatis-spring-boot-starter</artifactId>

            <version>1.1.1</version>

        </dependency> -->

        

      <!--   <dependency>

            <groupId>mysql</groupId>

            <artifactId>mysql-connector-java</artifactId>

        </dependency> -->




        <dependency>

        <groupId>org.apache.ibatis</groupId>

        <artifactId>ibatis-sqlmap</artifactId>

        <version>2.3.4.726</version>

        </dependency>

        

         <dependency>

        <groupId>javax.servlet</groupId>

        <artifactId>servlet-api</artifactId>

        <version>2.5</version>

        </dependency>

        

        <dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-tomcat</artifactId>

<scope>provided</scope>

</dependency>

<!-- 模板引擎 -->

        <!-- <dependency>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter-thymeleaf</artifactId>

        </dependency> -->

        <dependency>

        <groupId>org.apache.tomcat</groupId>

        <artifactId>tomcat-jdbc</artifactId>

        <version>8.0.36</version>

        </dependency>

        <dependency>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter</artifactId>

        </dependency>

</dependencies>

<build>

<finalName>${project.artifactId}</finalName>

<plugins>

<!-- 资源文件拷贝插件 -->

<!-- <plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-resources-plugin</artifactId>

<configuration>

<encoding>UTF-8</encoding>

</configuration>

</plugin> -->

<!-- java编译插件 -->

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<source>1.8</source>

<target>1.8</target>

<encoding>UTF-8</encoding>

</configuration>

</plugin>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

<configuration>

<mainClass>com.dcits.webgateway.Main</mainClass>

</configuration>

</plugin>

</plugins>

<pluginManagement>

<plugins>

<!-- 配置Tomcat插件 -->

<!--

<plugin>

<groupId>org.apache.tomcat.maven</groupId>

<artifactId>tomcat7-maven-plugin</artifactId>

<version>2.2</version>

</plugin> -->

<plugin>  

   <groupId>org.codehaus.mojo</groupId>  

   <artifactId>appassembler-maven-plugin</artifactId>  

   <version>1.10</version>  

   <configuration>  

       <!-- 生成linux, windows两种平台的执行脚本 -->  

       <platforms>  

           <platform>windows</platform>  

           <platform>unix</platform>  

       </platforms>  

       <!-- 根目录 -->  

       <assembleDirectory>${project.build.directory}/WEBGATEWAY</assembleDirectory>  

       <!-- 打包的jar,以及maven依赖的jar放到这个目录里面 -->  

       <repositoryName>lib</repositoryName>  

       <!-- 可执行脚本的目录 -->  

       <binFolder>bin</binFolder>  

       <!-- 配置文件的目标目录 -->  

       <configurationDirectory>conf</configurationDirectory>  

       <!-- 拷贝配置文件到上面的目录中 -->  

       <copyConfigurationDirectory>true</copyConfigurationDirectory>  

       <!-- 从哪里拷贝配置文件 (默认src/main/config) -->  

       <configurationSourceDirectory>src/main/resources</configurationSourceDirectory>  

       <!-- lib目录中jar的存放规则,默认是${groupId}/${artifactId}的目录格式,flat表示直接把jar放到lib目录 -->  

       <repositoryLayout>flat</repositoryLayout>  

       <encoding>UTF-8</encoding>  

       <logsDirectory>logs</logsDirectory>  

       <tempDirectory>tmp</tempDirectory>  

       <programs>  

           <program>  

               <id>start</id>  

               <!-- 启动类 -->  

               <mainClass>com.dcits.webgateway.Main</mainClass>

               <jvmSettings>  

                   <extraArguments>  

                       <extraArgument>-server</extraArgument>  

                       <extraArgument>-Xmx1G</extraArgument>  

                       <extraArgument>-Xms1G</extraArgument>  

                   </extraArguments>  

               </jvmSettings>  

           </program>  

       </programs>  

   </configuration>  

</plugin> 

</plugins>

</pluginManagement>

</build>

</project>



常见打包命令:

clean package

用maven的assassembler插件打包

mvn clean package appassembler:assemble

推荐阅读:
  1. golang工程打包不发布
  2. 详解如何使用webpack打包Vue工程

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

maven 插件打包 bo

上一篇:python时间日期函数与利用pandas进行时间序列处理详解

下一篇:Android编程视频播放API之MediaPlayer用法示例

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》