1
14
15 package com.liferay.portal.tools.deploy;
16
17 import com.liferay.portal.kernel.util.StringBundler;
18 import com.liferay.portal.util.InitUtil;
19
20 import java.io.File;
21
22 import java.util.ArrayList;
23 import java.util.List;
24
25
30 public class ExtDeployer extends BaseDeployer {
31
32 public static void main(String[] args) {
33 InitUtil.initWithSpring();
34
35 List<String> wars = new ArrayList<String>();
36 List<String> jars = new ArrayList<String>();
37
38 for (String arg : args) {
39 if (arg.endsWith(".war")) {
40 wars.add(arg);
41 }
42 else if (arg.endsWith(".jar")) {
43 jars.add(arg);
44 }
45 }
46
47 new ExtDeployer(wars, jars);
48 }
49
50 protected ExtDeployer() {
51 }
52
53 protected ExtDeployer(List<String> wars, List<String> jars) {
54 super(wars, jars);
55 }
56
57 protected String getExtraContent(
58 double webXmlVersion, File srcFile, String displayName)
59 throws Exception {
60
61 StringBundler sb = new StringBundler(6);
62
63 String extraContent = super.getExtraContent(
64 webXmlVersion, srcFile, displayName);
65
66 sb.append(extraContent);
67
68
70 sb.append("<listener>");
71 sb.append("<listener-class>");
72 sb.append("com.liferay.portal.kernel.servlet.ExtContextListener");
73 sb.append("</listener-class>");
74 sb.append("</listener>");
75
76 return sb.toString();
77 }
78
79 }