Using Maven's shade plugin from Scala and sbt
Asked Answered
C

1

6

Due to some quirks in some dependencies, I'm having trouble with sbt-assembly, and have been told that people working with Java and have had good results with Maven's shade plugin.

How can I use Maven's shade plugin for Scala / sbt?

Christa answered 30/6, 2014 at 3:14 Comment(3)
Elasticsearch shades a lot of artifacts in their Maven build. Have a look at that (search for "shade" for example usage).Bolding
I am in the need for the same answer!!Specular
sbt assembly added support of shading in 0.14Syrup
J
-1

You can add the following to your 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>
Jarmon answered 12/1, 2016 at 0:10 Comment(1)
OP is using SBT, which does not have a pom.xmlAvebury

© 2022 - 2024 — McMap. All rights reserved.