IDE的Scala Web开发环境(3)

<!-- 必须干掉,否则不编译src/main/java下的代码 -->
    <!-- <sourceDirectory>src/main/scala</sourceDirectory> -->
    <!-- <testSourceDirectory>src/test/scala</testSourceDirectory> -->
    <plugins>
      <plugin>
        <!-- see -->
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.1.6</version>
        <!-- 必须要,否则不能混合编译交叉引用文件 -->
        <executions>
          <execution>
            <id>scala-compile-first</id>
            <phase>process-resources</phase>
            <goals>
              <goal>add-source</goal>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>scala-test-compile</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.13</version>
        <configuration>
          <useFile>false</useFile>
          <disableXmlReport>true</disableXmlReport>
          <!-- If you have classpath issue like NoDefClassError,... -->
          <!-- useManifestOnlyJar>false</useManifestOnlyJar -->
          <includes>
            <include>**/*Test.*</include>
            <include>**/*Suite.*</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <!-- 移除web.xml的依赖,Servlet 3.0可以不要web.xml文件 -->
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>

<!-- jetty6,不支持servlet3 -->
      <!-- <plugin> -->
      <!-- <groupId>org.mortbay.jetty</groupId> -->
      <!-- <artifactId>maven-jetty-plugin</artifactId> -->
      <!-- <version>6.1.26</version> -->
      <!-- <configuration> -->
      <!-- <scanIntervalSeconds>10</scanIntervalSeconds> -->
      <!-- <stopKey>foo</stopKey> -->
      <!-- <stopPort>9999</stopPort> -->
      <!-- </configuration> -->
      <!-- <executions> -->
      <!-- <execution> -->
      <!-- <id>start-jetty</id> -->
      <!-- <phase>pre-integration-test</phase> -->
      <!-- <goals> -->
      <!-- <goal>run</goal> -->
      <!-- </goals> -->
      <!-- <configuration> -->
      <!-- <scanIntervalSeconds>0</scanIntervalSeconds> -->
      <!-- <daemon>true</daemon> -->
      <!-- </configuration> -->
      <!-- </execution> -->
      <!-- <execution> -->
      <!-- <id>stop-jetty</id> -->
      <!-- <phase>post-integration-test</phase> -->
      <!-- <goals> -->
      <!-- <goal>stop</goal> -->
      <!-- </goals> -->
      <!-- </execution> -->
      <!-- </executions> -->
      <!-- </plugin> -->

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/3cee69877ec1186cbe14589fd5d9c1c2.html