maven2预编译JSP
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:37 点击:次
1. 在pom.xml中加入以下代码:
<!-- begin - precompiling jsps -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<configuration>
<injectString><!-- [INSERT FRAGMENT HERE] --></injectString>
<inputWebXml>${basedir}/WebContent/WEB-INF/web.xml</inputWebXml>
<outputWebXml>${basedir}/target/jspweb.xml</outputWebXml>
<warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
<verbose>true</verbose>
<filtering>true</filtering>
<directory>${basedir}/WebContent</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</configuration>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${basedir}/WebContent/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<!-- end - precompiling jsps -->
---------------------------------------------------------------
<!-- begin - precompiling jsps -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<configuration>
<injectString><!-- [INSERT FRAGMENT HERE] --></injectString>
<inputWebXml>${basedir}/WebContent/WEB-INF/web.xml</inputWebXml>
<outputWebXml>${basedir}/target/jspweb.xml</outputWebXml>
<warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
<verbose>true</verbose>
<filtering>true</filtering>
<directory>${basedir}/WebContent</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</configuration>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${basedir}/WebContent/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<!-- end - precompiling jsps -->
---------------------------------------------------------------
相关新闻>>
- 发表评论
-
- 最新评论 更多>>