spark 编译包含第三方jar

1. 加插件

<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass></mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>

2. 把spark之类的加上 provided

<dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>

3编译命令用mvn assembly:assembly

http://www.waitingfy.com/archives/4154

4154

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.