码迷,mamicode.com
首页 > 编程语言 > 详细

maven-assembly-plugin打包可执行的jar包

时间:2018-05-30 21:35:28      阅读:455      评论:0      收藏:0      [点我收藏+]

标签:AC   artifact   mpi   build   esc   compile   group   arch   des   

pom.xml添加

<build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.spark.service.SparkStreamingKafka</mainClass>
                <!--project 入口-> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <!-- <goal>assembly</goal> --> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <!--use commend: mvn assembly:assembly -DskipTests --> </plugins> </build>
mvn clean package                      //可生成***-jar-with-dependencies.jar与***.jar,前者即为可执行jar包

mvn clean compile assembly:single //可生成***-jar-with-dependencies.jar,即为可执行jar包

maven-assembly-plugin打包可执行的jar包

标签:AC   artifact   mpi   build   esc   compile   group   arch   des   

原文地址:https://www.cnblogs.com/felixzh/p/9112842.html

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