You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by George Allaman <ge...@skyelou.com> on 2003/03/18 19:51:01 UTC

Create the War file out of the TDK structure - SOLUTION

Thanks so much for this Jurgen. It worked like a charm for me. This info 
needs to be somewhere accessible.

I made a few changes. Where you have "<src_dir of your 
project>/<projectname>" I substituted "../.." since this is the relative 
pathname to the app directory from the build directory. This works for 
me and since this is a Turbine-specific solution and the build directory 
is always in the same place relative to the build directory it should 
work for all. Further, no hard-coded directory name change is necessary.

Suggestions for Turbine/Tomcat developers:

* Alter the web.xml distributed with Tomcat as Akmal described, i.e. 
uncomment the following code:

     <servlet-mapping>
         <servlet-name>invoker</servlet-name>
         <url-pattern>/servlet/*</url-pattern>
     </servlet-mapping>

* Add something akin to Jurgen's code to the build.xml in newapp in the 
Turbine distribution; add the "Live" directory as he has shown.

Jürgen Hoffmann wrote:
> Hi,
> 
> Although there is a target in maven to do the necessary steps, we like
> have things under control and to know exactly what i sbeing put into out
> webapp. Plus we have different environments for development and deployed
> apps. So we have added a target to build.xml which is doing the
> necessary steps, and we have the Live Configuration Files under a
> seperate Folder under the conf firectory called live. The Jetspeed way
> to properties Replacement might be an excellent alternative for this
> approach but I have not had the Time to implement it, and this approach
> works just as well.
> 
> Create a "live" Folder underneath the <projectname>/WEB-INF/conf folder.
> Put your livesystem properties file in there i.e.
> TurbineResources.properties, Torque.properties.
> 
> Modify build.xml and add this target...
> 
> <target name="war" depends="compile">
> 	<war destfile="<path/to/webapp/webappname.war>" webxml="<src_dir
> of your project>/<projectname>/WEB-INF/web.xml" update="true">
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/images" prefix="images" />
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/templates" prefix="templates" />
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/resources" prefix="resources" />
>   		<lib dir="<src_dir of your
> project>/<projectname>/WEB-INF/lib" />
>   		<classes dir="<src_dir of your
> project>/<projectname>/WEB-INF/classes" includes="**/*.class" />
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/WEB-INF/conf" prefix="WEB-INF/conf" >
>   			<include name="*.xml" />
>   			<include name="*.dtd" />
>   			<include name="*.properties" />
>   			<exclude name="TurbineResources.properties" />
>   			<exclude name="Torque.properties" />
>   			<exclude name="Fulcrum.properties" />
>   		</zipfileset>
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>" prefix="" >
>   			<include name="*.jsp" />
>   		</zipfileset>
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/WEB-INF/conf/live" prefix="WEB-INF/conf" >
>   			<include name="*.properties" />
>   			<exclude name="log4j.properties" />
>   		</zipfileset>
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/WEB-INF/conf/live" prefix="WEB-INF/classes" >
>   			<include name="log4j.properties" />
>   		</zipfileset>  		
>   		<zipfileset dir="<src_dir of your
> project>/<projectname>/WEB-INF/build" prefix="WEB-INF/build" />
> 	</war>
>   </target> 
> 
> Then run 
> 
> ant war
> 
>>>From your <projectname>/WEB-INF/build folder and put the generated .war
> file into tomcats webapps dir. Restart tomcat and enjoy. Make sure your
> modify tomcats server.xml file the way Akmal proposed it.
> 
> Then you can reference your app under
> <projectname>/servlet/<projectname>
> 
> Again this is not perfect, but it does the job for us.
> 
> Kind regards
>  
> Jürgen Hoffmann
> ByteACTION GmbH
>  
> cert. Perl Programmer
> cert. Linux System Administrator
> cert. Java Programmer
> 
> Besuchen Sie uns doch auf der CeBIT 2003
> in Halle 4/Stand 70
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: b.v.weert@valbosoft.com [mailto:b.v.weert@valbosoft.com] 
> Gesendet: Montag, 17. März 2003 09:45
> An: Turbine Users List
> Betreff: Re: Create the War file out of the TDK structure
> 
> 
> 
> Hello George,
> 
> you're not the only one, I have the TDK working but I was also looking
> for what's needed to deploy it in any Tomcat... There is a deploy-war
> task in the ant script, but it doesn't seem to produce a good war.
>                                                       
>  Bo                                                   
>                                                       
>                                                       
>                                                       
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 


-- 
George Allaman
Denver, Colorado
303 466 2114


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org