You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by dl...@apache.org on 2005/08/31 00:16:39 UTC

cvs commit: ws-wsrp4j/sandbox/wsrp4j/producer maven.xml

dlouzan     2005/08/30 15:16:38

  Added:       sandbox/wsrp4j/producer maven.xml
  Log:
  Initial commit.
  
  Revision  Changes    Path
  1.1                  ws-wsrp4j/sandbox/wsrp4j/producer/maven.xml
  
  Index: maven.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <!--
  Copyright 2003-2005 The Apache Software Foundation.
  
  Licensed 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 default="tomcat:deploy"
           xmlns:j="jelly:core"
           xmlns:maven="jelly:maven"
           xmlns:ant="jelly:ant">  
  
      <preGoal name="tomcat:deploy">
          <j:set var="maven.war.final.name" value="wsrp4j-producer.war"/>
      </preGoal>
      
      <goal name="tomcat:init">
          <j:set var="vers" value="${maven.tomcat.version.major}"/>
          <j:if test="${vers==null}">
              <ant:available property="maven.tomcat.version.major"
                             value="5"
                             type="file"
                             file="${maven.tomcat.home}/conf/Catalina/admin.xml"/>
          </j:if>
  
          <j:set var="vers" value="${maven.tomcat.version.major}"/>
          <j:if test="${vers==null}">
              <ant:available property="maven.tomcat.version.major"
                             value="5"
          				   type="file"
                  		   file="${maven.tomcat.home}/webapps/admin.xml"/>
          </j:if>
  
          <j:set var="depl" value="${maven.tomcat.deploy}"/>
          <j:if test="${depl != 'exploded'}">
              <j:set var="maven.tomcat.deploy" value="war"/>
          </j:if>
  
          <echo>Deploying to Tomcat:
                Location:       ${maven.tomcat.home}
                Major Version:  ${maven.tomcat.version.major}
                Hosts:          ${maven.tomcat.host}
                Context Config: ${maven.tomcat.context.config}
                Deploy Type:    ${maven.tomcat.deploy}
                
          </echo>
      </goal>
      
      <goal name="tomcat:deploy">
      
          <attainGoal name="tomcat:init"/>
          
          <!-- ===================== -->
          <!-- Deploy Dependencies   -->
          <!-- ===================== -->
          <j:forEach var="lib" items="${pom.artifacts}">
              <j:set var="dep" value="${lib.dependency}"/>
              <j:if test="${dep.getProperty('tomcat.common')=='true'}">
                  <j:if test="${dep.type =='jar'}">
                      <j:if test="${dep.getProperty('tomcat.common.endorsed')!='true'}">
                          <ant:copy todir="${maven.tomcat.home}/common/lib"
                                    file="${lib.path}"/>
                      </j:if>
                      <j:if test="${dep.getProperty('tomcat.common.endorsed')=='true'}">
                          <ant:copy todir="${maven.tomcat.home}/common/endorsed"
                                    file="${lib.path}"/>
                      </j:if>
                  </j:if>
           
                  <j:if test="${dep.type !='jar'}">
                      <ant:copy todir="${maven.tomcat.home}/common/classes"
                                file="${lib.path}"/>
                  </j:if>
              </j:if>
  
              <j:if test="${dep.getProperty('tomcat.shared')=='true'}">
                  <j:if test="${dep.type =='jar'}">
                      <ant:copy todir="${maven.tomcat.home}/shared/lib"
                                file="${lib.path}"/>
                  </j:if>
           
                  <j:if test="${dep.type !='jar'}">
                      <ant:copy todir="${maven.tomcat.home}/shared/classes"
                                file="${lib.path}"/>
                  </j:if>
              </j:if>
  
          </j:forEach>
          
          <!-- ===================== -->
          <!-- Deploy War            -->
          <!-- ===================== -->
          <j:set var="depType" value="${maven.tomcat.deploy}"/>
          <j:if test="${depType=='exploded'}">
              <unwar src="target/${maven.war.final.name}" 
                     dest="${maven.tomcat.home}/webapps/wsrp4j-producer"/>
          </j:if>
          <j:if test="${depType=='war'}">
              <copy file="target/${maven.war.final.name}" 
                    todir="${maven.tomcat.home}/webapps"/>
          </j:if>
          
          <!-- ===================== -->
          <!-- Deploy Context Config -->
          <!-- ===================== -->
          <j:set var="version" value="${maven.tomcat.version.major}"/>
  
          <!-- If we are in Tomcat4.x-->
          <j:if test="${version==4}">
              <copy file="${maven.tomcat.context.config}"
                    todir="${maven.tomcat.home}/webapps"/>
          </j:if>
  
          <!-- If we are in Tomcat5.x-->
          <j:if test="${version==5}">
              <copy file="${maven.tomcat.context.config}"
                    todir="${maven.tomcat.home}/conf/Catalina/${maven.tomcat.host}"/>
          </j:if>
          
      </goal>
  
  </project>