| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <project name="Webapp JSP precompilation and packaging for Maven shade plugin" default="package" basedir="."> |
| |
| <property name="webapp.name" value="examples" /> |
| |
| <typedef name="jasper" classname="org.apache.jasper.JspC"> |
| <classpath> |
| <fileset file="${basedir}/target/tomcat-stuffed-1.0.jar" /> |
| <fileset dir="${basedir}/webapps/${webapp.name}/WEB-INF/lib" includes="*.jar" erroronmissingdir="false" /> |
| </classpath> |
| </typedef> |
| |
| <target name="package"> |
| |
| <!-- Will contain the webapp classes --> |
| <mkdir dir="${basedir}/src/main/java" /> |
| <mkdir dir="${basedir}/src/main/resources" /> |
| |
| <!-- JSP precompilation --> |
| <jasper validateXml="false" package="${webapp.name}.org.apache.jsp" |
| uriroot="${basedir}/webapps/${webapp.name}" |
| webXml="${basedir}/webapps/${webapp.name}/WEB-INF/tomcat-web.xml" |
| outputDir="${basedir}/src/main/java" /> |
| <!-- Copy all webapp classes to the mvn compile location --> |
| <copy todir="${basedir}/src/main/java"> |
| <fileset dir="${basedir}/webapps/${webapp.name}/WEB-INF/classes" includes="**/*.java" erroronmissingdir="false" /> |
| </copy> |
| <copy todir="${basedir}/src/main/resources"> |
| <fileset dir="${basedir}/webapps/${webapp.name}/WEB-INF/classes" includes="**/*.properties" erroronmissingdir="false" /> |
| </copy> |
| |
| </target> |
| |
| </project> |