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>
    

      

  • 相关阅读:
    yocto添加源码并编译进文件系统
    yocto编译加速及单独编译内核与uboot
    mysql 创建索引
    redis初使用
    mysql修改时区
    linux修改时间
    服务器环境配置安装(mysql+redis+nodejs+nginx)
    由于找不到MSVCP20.dll,无法继续执行代码
    sequelize初使用
    css flex
  • 原文地址:https://www.cnblogs.com/yszzu/p/9395114.html
Copyright © 2011-2022 走看看