`
michaelee
  • 浏览: 17159 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

使用maven2的jetty插件预编译JSP2009

 
阅读更多


参考文章
http://docs.codehaus.org/display/JETTY/Maven+Jetty+Jspc+Plugin


pom.xml核心配置文件清单如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wgame</groupId>
<artifactId>ln3</artifactId>
<packaging>war</packaging>
<name>ln3</name>
<version>1.0</version>
<build>
<finalName>ln3</finalName>
<pluginManagement>
   <plugins>
    <plugin>
     <artifactId>maven-war-plugin</artifactId>
     <configuration>
      <webappDirectory>
       ${basedir}/web
      </webappDirectory>
      <warSourceDirectory>
       ${basedir}/web
      </warSourceDirectory>
     </configuration>
    </plugin>
    <plugin>
     <artifactId>maven-compiler-plugin</artifactId>
     <configuration>
      <source>1.5</source>
      <target>1.5</target>
     </configuration>
    </plugin>
   </plugins>
</pluginManagement>
</build>
<profiles>
    <profile>
      <id>prod</id>
      <activation>
        <property><name>prod</name></property>
      </activation>
      <build>
      <plugins>
        <plugin>
     <groupId>org.mortbay.jetty</groupId>
     <artifactId>maven-jetty-jspc-plugin</artifactId>
     <version>6.1.16</version>
     <executions>
         <execution>
            <id>jspc</id>
            <goals>
              <goal>jspc</goal>
            </goals>
            <configuration>
             <webAppSourceDirectory>
              ${basedir}/web
             </webAppSourceDirectory>
             <generatedClasses>
              ${basedir}/target/jspc
             </generatedClasses>
            </configuration>
         </execution>
     </executions>
    </plugin>
        <plugin>
     <artifactId>maven-war-plugin</artifactId>
     <configuration>
      <webappDirectory>
       ${basedir}/web
      </webappDirectory>
      <warSourceDirectory>
       ${basedir}/web
      </warSourceDirectory>
      <webXml>
       ${basedir}/web/WEB-INF/web.xml
      </webXml>
     </configuration>
    </plugin>
      </plugins>
      </build>
    </profile>
</profiles>
<dependencies>
</dependencies>
</project>

配置了POM.XML后运行命令:
mvn -Dprod package

就将JSP编译好放置在target/jspc目录下了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics