zoukankan      html  css  js  c++  java
  • maven打包成可运行的jar

    在pom.xml添加

    <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <configuration>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.sf</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.dsa</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                    <exclude>META-INF/*.rsa</exclude>
                                    <exclude>META-INF/*.EC</exclude>
                                    <exclude>META-INF/*.ec</exclude>
                                    <exclude>META-INF/MSFTSIG.SF</exclude>
                                    <exclude>META-INF/MSFTSIG.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <transformers>
                                    <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                    <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>com.sys.spring_ks_client.MyTopology</mainClass> //启动类
                                    </transformer>
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source> //jdk版本
                        <target>1.8</target>
                    </configuration>
                </plugin>
    
            </plugins>
        </build>
  • 相关阅读:
    常用数据结构之字符串
    c++知识点总结--友元&运算符重载
    c++知识点总结-模板特化
    c++知识点总结--new的一些用法
    linux socket c/s上传文件
    STL之算法使用简介
    【bzoj2733】 HNOI2012—永无乡
    【bzoj3132】 Sdoi2013—森林
    【bzoj1483】 HNOI2009—梦幻布丁
    【bzoj3091】 城市旅行
  • 原文地址:https://www.cnblogs.com/syscn/p/9975502.html
Copyright © 2011-2022 走看看