2. Manual Deployment

It is also possible to deploy the web application using the mechanisms provided by the application server being used. But before deploying it is necessary to do some massaging to the WAR file that will allow Liferay Portal to notice that a new portlet application has been deployed. The com.liferay.portal.tools.PortletDeployer should be used to do this. It is recommended that you use this tool within an ant build script. Following is an example target that might be used to invoke it. It has been taken from the portlets directory of the Liferay extension environment. Adapt the paths as needed.

	<target name="deploy">
		<java
			classname="com.liferay.portal.tools.PortletDeployer"
			classpathref="project.classpath"
			fork="true"
			newenvironment="true">

				<!-- Required Arguments -->

				<jvmarg value="-Ddeployer.base.dir=./" />
				<jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />
				<jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />
				<jvmarg value="-Ddeployer.portlet.taglib.dtd=${project.dir}/web-sites/liferay.com-web/docroot/WEB-INF/tld/liferay-portlet.tld" />
				<jvmarg value="-Ddeployer.unpack.war=true" />

				<!-- Optional Arguments -->

				<jvmarg value="-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}" />

				<!-- Dependent Libraries -->

				<arg value="${project.dir}/lib/util-bridges.jar" />
				<arg value="${project.dir}/lib/util-java.jar" />
				<arg value="${project.dir}/web-sites/liferay.com-web/docroot/WEB-INF/lib/util-taglib.jar" />

				<!-- Specific WARs -->

				<arg line="${deploy.specific.wars}" />
		</java>
	</target>