`
qingwei201314
  • 浏览: 163219 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

spring boot spring cloud 打包 打jar包 pom.xml文件

 
阅读更多
在pom.xml文件中增加以下内容,将工程打成jar包,执行jar包命令: java -jar xxx.jar
<?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">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>rest</artifactId>
    <name>rest</name>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.36</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.46</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-streaming</artifactId>
            <version>3.1.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>hadoop-common</artifactId>
                    <groupId>org.apache.hadoop</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce-client-core</artifactId>
            <version>3.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-configuration2</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.htrace</groupId>
            <artifactId>htrace-core4</artifactId>
            <version>4.2.0-incubating</version>
        </dependency>
        <dependency>
            <groupId>hadoop-common</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hadoop-common-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>hive-common</groupId>
            <artifactId>hive-common</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hive-common-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>hive-jdbc</groupId>
            <artifactId>hive-jdbc</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hive-jdbc-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>hive-serde</groupId>
            <artifactId>hive-serde</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hive-serde-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>hive-service</groupId>
            <artifactId>hive-service</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hive-service-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>hive-service-rpc</groupId>
            <artifactId>hive-service-rpc</artifactId>
            <version>3.1.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/hive-service-rpc-3.1.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>libthrift</groupId>
            <artifactId>libthrift</artifactId>
            <version>0.9.3</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/lib/libthrift-0.9.3.jar</systemPath>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.2.2.RELEASE</version>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics