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>
  • 相关阅读:
    乱谈服务器编程
    set global slow_query_log引起的MySQL死锁
    一个由string使用不当产生的问题
    Hbase初体验
    浅谈SQLite——查询处理及优化
    ACID、Data Replication、CAP与BASE
    libevent源码分析
    浅析Linux Native AIO的实现
    vim7.2中文乱码解决方法
    伸展树的点点滴滴
  • 原文地址:https://www.cnblogs.com/syscn/p/9975502.html
Copyright © 2011-2022 走看看