|
18 | 18 | import com.liferay.portal.cache.memory.MemoryPortalCacheManager;
|
19 | 19 | import com.liferay.portal.kernel.cache.MultiVMPoolUtil;
|
20 | 20 | import com.liferay.portal.kernel.util.PropsKeys;
|
| 21 | +<<<<<<< Updated upstream |
21 | 22 | import com.liferay.portal.kernel.util.FileUtil;
|
22 | 23 | import com.liferay.portal.tools.WebXMLBuilder;
|
| 24 | +======= |
| 25 | +import com.liferay.portal.kernel.util.StringPool; |
| 26 | +import com.liferay.portal.tools.WebXMLBuilder; |
| 27 | +import com.liferay.portal.tools.deploy.ExtDeployer; |
| 28 | +>>>>>>> Stashed changes |
23 | 29 | import com.liferay.portal.tools.deploy.HookDeployer;
|
24 | 30 | import com.liferay.portal.tools.deploy.LayoutTemplateDeployer;
|
25 | 31 | import com.liferay.portal.tools.deploy.PortletDeployer;
|
|
31 | 37 |
|
32 | 38 | import java.io.File;
|
33 | 39 | import java.io.FileNotFoundException;
|
| 40 | +import java.io.FilenameFilter; |
| 41 | +import java.io.IOException; |
34 | 42 |
|
35 | 43 | import java.util.ArrayList;
|
| 44 | +import java.util.Arrays; |
| 45 | +import java.util.Collection; |
36 | 46 | import java.util.List;
|
37 | 47 |
|
| 48 | +import org.apache.commons.io.FileUtils; |
| 49 | +import org.apache.commons.io.filefilter.FileFilterUtils; |
| 50 | + |
38 | 51 | import org.apache.maven.artifact.Artifact;
|
39 | 52 | import org.apache.maven.artifact.factory.ArtifactFactory;
|
40 | 53 | import org.apache.maven.artifact.repository.ArtifactRepository;
|
@@ -72,10 +85,18 @@ protected void doExecute() throws Exception {
|
72 | 85 | getLog().info("Directly deploying " + warFileName);
|
73 | 86 |
|
74 | 87 | getLog().debug("appServerType: " + appServerType);
|
| 88 | +// getLog().debug("appServerGlobalLibDir: " + appServerGlobalLibDir.getAbsolutePath()); |
| 89 | +// getLog().debug("appServerLiferayRootDir: " + appServerLiferayRootDir.getAbsolutePath()); |
75 | 90 | getLog().debug("baseDir: " + baseDir);
|
| 91 | +<<<<<<< Updated upstream |
76 | 92 | getLog().debug("deployDir: " + appServerDeployDir.getAbsolutePath());
|
| 93 | +======= |
| 94 | + getLog().debug("deployDir: " + deployDir.getAbsolutePath()); |
| 95 | + getLog().debug("extDir: " + extDir.getAbsolutePath()); |
| 96 | +>>>>>>> Stashed changes |
77 | 97 | getLog().debug("jbossPrefix: " + jbossPrefix);
|
78 | 98 | getLog().debug("pluginType: " + pluginType);
|
| 99 | + getLog().debug("projectName: " + projectName); |
79 | 100 | getLog().debug("unpackWar: " + unpackWar);
|
80 | 101 |
|
81 | 102 | preparePortalDependencies();
|
@@ -113,6 +134,7 @@ else if (pluginType.equals("web")) {
|
113 | 134 | }
|
114 | 135 |
|
115 | 136 | protected void deployExt() throws Exception {
|
| 137 | +<<<<<<< Updated upstream |
116 | 138 | workDir.mkdirs();
|
117 | 139 |
|
118 | 140 | UnArchiver unArchiver = archiverManager.getUnArchiver(warFile);
|
@@ -183,6 +205,69 @@ protected void deployExt() throws Exception {
|
183 | 205 | new File(workDir, "WEB-INF/ext-web/docroot/WEB-INF/classes"),
|
184 | 206 | appServerClassesPortalDir,
|
185 | 207 | "portal-*.properties,system-*.properties", null, true, true);
|
| 208 | +======= |
| 209 | + |
| 210 | + File appServerLiferayWebInfDir = new File(appServerLiferayRootDir + |
| 211 | + StringPool.FORWARD_SLASH + "WEB-INF"); |
| 212 | + |
| 213 | + File appServerLiferayWebInfLibDir = new File(appServerLiferayRootDir + |
| 214 | + StringPool.FORWARD_SLASH + "WEB-INF" + |
| 215 | + StringPool.FORWARD_SLASH + "lib"); |
| 216 | + |
| 217 | + FileUtils.copyDirectory(new File(extDir + "/WEB-INF/ext-lib/global"), |
| 218 | + appServerGlobalLibDir, |
| 219 | + FileFilterUtils.suffixFileFilter(".jar")); |
| 220 | + |
| 221 | + FileUtils.copyDirectory(new File(extDir + "/WEB-INF/ext-lib/portal"), |
| 222 | + appServerLiferayWebInfLibDir, |
| 223 | + FileFilterUtils.suffixFileFilter(".jar")); |
| 224 | + |
| 225 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-service/ext-service.jar"), |
| 226 | + new File(appServerGlobalLibDir, StringPool.FORWARD_SLASH + |
| 227 | + "ext-" + projectName + "-service.jar")); |
| 228 | + |
| 229 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-impl/ext-impl.jar"), |
| 230 | + new File(appServerLiferayWebInfLibDir, StringPool.FORWARD_SLASH + |
| 231 | + "ext-" + projectName + "-impl.jar")); |
| 232 | + |
| 233 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-impl/ext-impl.jar"), |
| 234 | + new File(appServerLiferayWebInfLibDir, StringPool.FORWARD_SLASH + |
| 235 | + "ext-" + projectName + "-impl.jar")); |
| 236 | + |
| 237 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-util-bridges/ext-util-bridges.jar"), |
| 238 | + new File(appServerLiferayWebInfLibDir, StringPool.FORWARD_SLASH + |
| 239 | + "ext-" + projectName + "-util-bridges.jar")); |
| 240 | + |
| 241 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-util-java/ext-util-java.jar"), |
| 242 | + new File(appServerLiferayWebInfLibDir, StringPool.FORWARD_SLASH + |
| 243 | + "ext-" + projectName + "-util-java.jar")); |
| 244 | + |
| 245 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-util-taglib/ext-util-taglib.jar"), |
| 246 | + new File(appServerLiferayWebInfLibDir, StringPool.FORWARD_SLASH + |
| 247 | + "ext-" + projectName + "-util-taglib.jar")); |
| 248 | + |
| 249 | + File extWebWorkDir = new File(extDir + "/WEB-INF/ext-web/docroot"); |
| 250 | + |
| 251 | + FileUtils.copyDirectory(extWebWorkDir, appServerLiferayRootDir, |
| 252 | + FileFilterUtils.andFileFilter(FileFilterUtils.trueFileFilter(), |
| 253 | + FileFilterUtils.notFileFilter( |
| 254 | + FileFilterUtils.nameFileFilter("web.xml")))); |
| 255 | + |
| 256 | + WebXMLBuilder webXMLBuilder = new WebXMLBuilder( |
| 257 | + appServerLiferayWebInfDir + "/web.xml", |
| 258 | + extDir + "/WEB-INF/ext-web/docroot/WEB-INF/web.xml", |
| 259 | + appServerLiferayRootDir + "/WEB-INF/web.xml.merged"); |
| 260 | + |
| 261 | + FileUtils.copyFile(new File(appServerLiferayRootDir + "/WEB-INF/web.xml.merged"), |
| 262 | + new File(appServerLiferayWebInfDir + "/web.xml")); |
| 263 | + |
| 264 | + FileUtils.deleteQuietly(new File(appServerLiferayRootDir + "/WEB-INF/web.xml.merged")); |
| 265 | + |
| 266 | + FileUtils.copyFile(new File(extDir + "/WEB-INF/ext-" + projectName + ".xml"), |
| 267 | + new File(appServerLiferayWebInfDir, StringPool.FORWARD_SLASH + |
| 268 | + "ext-" + projectName + ".xml")); |
| 269 | + |
| 270 | +>>>>>>> Stashed changes |
186 | 271 | }
|
187 | 272 |
|
188 | 273 | protected void deployHook() throws Exception {
|
@@ -357,6 +442,16 @@ protected void preparePortalDependencies() throws Exception {
|
357 | 442 | */
|
358 | 443 | private String appServerType;
|
359 | 444 |
|
| 445 | + /** |
| 446 | + * @parameter default-value="" expression="${appServerGlobalLibDir}" |
| 447 | + */ |
| 448 | + private File appServerGlobalLibDir; |
| 449 | + |
| 450 | + /** |
| 451 | + * @parameter default-value="" expression="${appServerLiferayRootDir}" |
| 452 | + */ |
| 453 | + private File appServerLiferayRootDir; |
| 454 | + |
360 | 455 | /**
|
361 | 456 | * @component
|
362 | 457 | */
|
@@ -392,7 +487,17 @@ protected void preparePortalDependencies() throws Exception {
|
392 | 487 | private File deployDir;
|
393 | 488 |
|
394 | 489 | /**
|
| 490 | +<<<<<<< Updated upstream |
395 | 491 | * @parameter expression="${jbossPrefix}"
|
| 492 | +======= |
| 493 | + * @parameter expression="${project.build.directory}/${project.build.finalName}" |
| 494 | + * @required |
| 495 | + */ |
| 496 | + private File extDir; |
| 497 | + |
| 498 | + /** |
| 499 | + * @parameter default-value="" expression="${jbossPrefix}" |
| 500 | +>>>>>>> Stashed changes |
396 | 501 | */
|
397 | 502 | private String jbossPrefix;
|
398 | 503 |
|
@@ -421,6 +526,12 @@ protected void preparePortalDependencies() throws Exception {
|
421 | 526 | */
|
422 | 527 | private String pluginType;
|
423 | 528 |
|
| 529 | + /** |
| 530 | + * @parameter expression="${project.build.finalName}" |
| 531 | + * @required |
| 532 | + */ |
| 533 | + private String projectName; |
| 534 | + |
424 | 535 | /**
|
425 | 536 | * @parameter expression="${project.remoteArtifactRepositories}"
|
426 | 537 | * @readonly
|
|
0 commit comments