zoukankan      html  css  js  c++  java
  • maven插件: shade, assembly

    shade插件的作用: 

    通过版本的exclution无法解决jar冲突的问题, 

    解决方案是把依赖的包打到本model的jar中,打包的时候由mvn plugin自动修改代码中的依赖jar包名

    relocation配置会强制修改代码中的依赖包名 ==>

    示例配置:

    <build>
    
            <plugins>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.4.3</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
                                <promoteTransitiveDependencies>false</promoteTransitiveDependencies>
                                <createDependencyReducedPom>true</createDependencyReducedPom>
                                <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
                                <minimizeJar>false</minimizeJar>
                                <createSourcesJar>false</createSourcesJar>
                                <artifactSet>
                                    <includes>
                                        <include>io.netty:netty-all</include>
                                    </includes>
                                </artifactSet>
                                <relocations>
                                    <relocation>
                                        <pattern>io.netty</pattern>
                                        <shadedPattern>com.mytest.shade.io.netty</shadedPattern>
                                    </relocation>
                                </relocations>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
    
        </build>
    

      

  • 相关阅读:
    oracle的nvl函数的用法
    简单实用的MD5加密算法
    oracle触发器使用笔记
    Html学习
    连接字符串
    oracle触发器使用笔记2
    oracle中如何给有空值的数据排序
    Zend Frame 添加Smarty模板引擎
    HDU 2464 A Pair of Graph
    POJ 1466 Girls and Boys
  • 原文地址:https://www.cnblogs.com/yszzu/p/9395114.html
Copyright © 2011-2022 走看看