001
014
015 package com.liferay.portal.tools.deploy;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.util.InitUtil;
019
020 import java.io.File;
021
022 import java.util.ArrayList;
023 import java.util.List;
024
025
028 public class ExtDeployer extends BaseDeployer {
029
030 public static void main(String[] args) {
031 InitUtil.initWithSpring();
032
033 List<String> wars = new ArrayList<String>();
034 List<String> jars = new ArrayList<String>();
035
036 for (String arg : args) {
037 if (arg.endsWith(".war")) {
038 wars.add(arg);
039 }
040 else if (arg.endsWith(".jar")) {
041 jars.add(arg);
042 }
043 }
044
045 new ExtDeployer(wars, jars);
046 }
047
048 protected ExtDeployer() {
049 }
050
051 protected ExtDeployer(List<String> wars, List<String> jars) {
052 super(wars, jars);
053 }
054
055 protected String getExtraContent(
056 double webXmlVersion, File srcFile, String displayName)
057 throws Exception {
058
059 StringBundler sb = new StringBundler(6);
060
061 String extraContent = super.getExtraContent(
062 webXmlVersion, srcFile, displayName);
063
064 sb.append(extraContent);
065
066
067
068 sb.append("<listener>");
069 sb.append("<listener-class>");
070 sb.append("com.liferay.portal.kernel.servlet.ExtContextListener");
071 sb.append("</listener-class>");
072 sb.append("</listener>");
073
074 return sb.toString();
075 }
076
077 }