scala打包maven配置 带依赖

1.不带依赖

   <build>
        <plugins>
            
            <plugin>
                <groupId>net.alchim31.mavengroupId>
                <artifactId>scala-maven-pluginartifactId>
                <version>3.2.2version>
                <executions>
                    <execution>
                        <id>scala-compile-firstid>
                        <phase>process-resourcesphase>
                        <goals>
                            <goal>add-sourcegoal>
                            <goal>compilegoal>
                        goals>
                    execution>
                executions>
            plugin>

            <plugin>
                <groupId>org.scala-toolsgroupId>
                <artifactId>maven-scala-pluginartifactId>
                <version>2.15.2version>
                <executions>
                    <execution>
                        <id>scala-compile-firstid>
                        <goals>
                            <goal>compilegoal>
                        goals>
                        <configuration>
                            <includes>
                                <include>**/*.scalainclude>
                            includes>
                        configuration>
                    execution>
                    <execution>
                        <goals>
                            <goal>compilegoal>
                            <goal>testCompilegoal>
                        goals>
                        <configuration>
                            <jvmArgs>
                                
                                <jvmArg>-Xss8mjvmArg>
                            jvmArgs>
                        configuration>
                    execution>
                    <execution>
                        <id>scala-test-compileid>
                        <goals>
                            <goal>testCompilegoal>
                        goals>
                    execution>
                executions>
            plugin>
   
        plugins>

        <resources>
            <resource>
                <directory>src/main/resourcesdirectory>
                <includes>
                    <include>*include>
                includes>
                <excludes>
                    <exclude>sample.datexclude>
                excludes>
            resource>
        resources>
    build>

2.带依赖

   <build>
        <plugins>
            
            <plugin>
                <groupId>net.alchim31.mavengroupId>
                <artifactId>scala-maven-pluginartifactId>
                <version>3.2.2version>
                <executions>
                    <execution>
                        <id>scala-compile-firstid>
                        <phase>process-resourcesphase>
                        <goals>
                            <goal>add-sourcegoal>
                            <goal>compilegoal>
                        goals>
                    execution>
                executions>
            plugin>

            <plugin>
                <groupId>org.scala-toolsgroupId>
                <artifactId>maven-scala-pluginartifactId>
                <version>2.15.2version>
                <executions>
                    <execution>
                        <id>scala-compile-firstid>
                        <goals>
                            <goal>compilegoal>
                        goals>
                        <configuration>
                            <includes>
                                <include>**/*.scalainclude>
                            includes>
                        configuration>
                    execution>
                    <execution>
                        <goals>
                            <goal>compilegoal>
                            <goal>testCompilegoal>
                        goals>
                        <configuration>
                            <jvmArgs>
                                
                                <jvmArg>-Xss8mjvmArg>
                            jvmArgs>
                        configuration>
                    execution>
                    <execution>
                        <id>scala-test-compileid>
                        <goals>
                            <goal>testCompilegoal>
                        goals>
                    execution>
                executions>
            plugin>
           <plugin>
                <artifactId>maven-assembly-pluginartifactId>
                <configuration>
                    <appendAssemblyId>falseappendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependenciesdescriptorRef>
                    descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.sunshine.exec.FunnelHiveExecmainClass>
                        manifest>
                    archive>
                configuration>
                <executions>
                    <execution>
                        <id>make-assemblyid>
                        <phase>packagephase>
                        <goals>
                            <goal>singlegoal>
                        goals>
                    execution>
                executions>
            plugin> 
        plugins>

        <resources>
            <resource>
                <directory>src/main/resourcesdirectory>
                <includes>
                    <include>*include>
                includes>
                <excludes>
                    <exclude>sample.datexclude>
                excludes>
            resource>
        resources>
    build>

你可能感兴趣的:(scala,scala)