码迷,mamicode.com
首页 > 其他好文 > 详细

用idea打包

时间:2020-01-18 21:07:11      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:上传   pos   service   自己的   cti   XML   alpha   alt   必须   

idea的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>ciems-service-operation-management</artifactId>
        <groupId>com.gdtnx</groupId>
        <version>1.0.0-Alpha</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>ciems-om-biz</artifactId>
    <properties>
        <start-class>cn.com.gdt.ciems.om.biz.OmApplication</start-class>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.gdtnx</groupId>
            <artifactId>ciems-spring-boot-starter</artifactId>
            <version>1.0.1-Alpha</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>

        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
        </dependency>

        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.2</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.14</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
        <dependency>
            <groupId>com.gdtnx</groupId>
            <artifactId>ks-api</artifactId>
            <version>0.0.1-Alpha</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>${start-class}</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <!--可以把依赖的包都打包到生成的Jar包中-->
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

红色字体为打包必须依赖的:

如果是该包上传到自己的私服那么需要在pom.xml文件中加入:

<distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://192.168.2.211:10890/nexus/content/repositories/releases/</url>
        </repository>
    </distributionManagement>

接下来,在idea里打包,如果是maven父子模块项目,那么在打包时为了防止子模块之间的依赖关系,需要打包父模块的pom.xml文件,具体方式见下图:ciems-service-operation-management就是父模块

技术图片

 

用idea打包

标签:上传   pos   service   自己的   cti   XML   alpha   alt   必须   

原文地址:https://www.cnblogs.com/zhangshitong/p/12210098.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!