加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使用来自Scala和sbt的Maven的阴影插件

发布时间:2020-12-16 18:30:47 所属栏目:安全 来源:网络整理
导读:由于某些依赖项中存在一些怪癖,我在使用sbt-assembly方面遇到了麻烦,并且被告知使用 Java并且使用Maven的shade插件获得了良好结果的人. 如何为Scala / sbt使用Maven的阴影插件? 解决方法 您可以将以下内容添加到POM中 plugin groupIdorg.apache.maven.plugi
由于某些依赖项中存在一些怪癖,我在使用sbt-assembly方面遇到了麻烦,并且被告知使用 Java并且使用Maven的shade插件获得了良好结果的人.

如何为Scala / sbt使用Maven的阴影插件?

解决方法

您可以将以下内容添加到POM中

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                        <transformers>
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.group.id.Launcher1</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读