2017-10-11 249 views

回答

1

我能夠使用多次執行來解決此問題。

<build> 
    <plugins> 
    <plugin> 
     <groupId>net.alchim31.maven</groupId> 
     <artifactId>scala-maven-plugin</artifactId> 
     <version>3.2.1</version> 
     <executions> 
      <execution> 
       <id>scala-version-2.10</id> 
       <goals> 
       <goal>compile</goal> 
       <goal>testCompile</goal> 
       </goals> 
       <configuration> 
       <scalaVersion>2.10.6</scalaVersion> 
       <outputDir>${project.build.outputDirectory}/scala-2.10</outputDir> 
       </configuration> 
      </execution> 
      <execution> 
       <id>scala-version-2.11</id> 
       <goals> 
       <goal>compile</goal> 
       <goal>testCompile</goal> 
       </goals> 
       <configuration> 
       <scalaVersion>2.11.8</scalaVersion> 
       <outputDir>${project.build.outputDirectory}/scala-2.11</outputDir> 
       </configuration> 
      </execution> 
     </executions> 
    </plugin> 
    <plugin> 
     <artifactId>maven-jar-plugin</artifactId> 
     <executions> 
      <execution> 
       <id>scala-2.10</id> 
       <goals> 
       <goal>jar</goal> 
       </goals> 
       <phase>package</phase> 
       <configuration> 
       <classifier>scala-2.10</classifier> 
       <excludes> 
        <exclude>scala-2.11/**</exclude> 
        <exclude>sparkScala/**</exclude> 
        <exclude>sparksql/**</exclude> 
        <exclude>*.timestamp</exclude> 
       </excludes> 
       </configuration> 
      </execution> 
      <execution> 
       <id>scala-2.11</id> 
       <goals> 
       <goal>jar</goal> 
       </goals> 
       <phase>package</phase> 
       <configuration> 
       <classifier>scala-2.11</classifier> 
       <excludes> 
        <exclude>scala-2.10/**</exclude> 
        <exclude>sparkScala/**</exclude> 
        <exclude>sparksql/**</exclude> 
        <exclude>*.timestamp</exclude> 
       </excludes> 
       </configuration> 
      </execution> 
     </executions> 
    </plugin> 
    </plugins> 

相關問題