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
22
- import com .liferay .portal .kernel .util .FileUtil ;
23
- import com .liferay .portal .tools .WebXMLBuilder ;
24
- =======
25
21
import com .liferay .portal .kernel .util .StringPool ;
26
22
import com .liferay .portal .tools .WebXMLBuilder ;
27
23
import com .liferay .portal .tools .deploy .ExtDeployer ;
28
- >>>>>>> Stashed changes
29
24
import com .liferay .portal .tools .deploy .HookDeployer ;
30
25
import com .liferay .portal .tools .deploy .LayoutTemplateDeployer ;
31
26
import com .liferay .portal .tools .deploy .PortletDeployer ;
32
27
import com .liferay .portal .tools .deploy .ThemeDeployer ;
33
28
import com .liferay .portal .tools .deploy .WebDeployer ;
34
29
import com .liferay .portal .util .InitUtil ;
35
30
import com .liferay .portal .util .PropsUtil ;
36
- import com .liferay .util .ant .CopyTask ;
37
31
38
32
import java .io .File ;
39
33
import java .io .FileNotFoundException ;
@@ -79,21 +73,15 @@ protected void doExecute() throws Exception {
79
73
if (!warFile .exists ()) {
80
74
getLog ().error (warFileName + " does not exist" );
81
75
82
- throw new FileNotFoundException (warFileName + " does not exist" );
76
+ throw new FileNotFoundException (warFileName + " does not exist! " );
83
77
}
84
78
85
79
getLog ().info ("Directly deploying " + warFileName );
86
80
87
81
getLog ().debug ("appServerType: " + appServerType );
88
- // getLog().debug("appServerGlobalLibDir: " + appServerGlobalLibDir.getAbsolutePath());
89
- // getLog().debug("appServerLiferayRootDir: " + appServerLiferayRootDir.getAbsolutePath());
90
82
getLog ().debug ("baseDir: " + baseDir );
91
- <<<<<<< Updated upstream
92
- getLog ().debug ("deployDir: " + appServerDeployDir .getAbsolutePath ());
93
- =======
94
83
getLog ().debug ("deployDir: " + deployDir .getAbsolutePath ());
95
84
getLog ().debug ("extDir: " + extDir .getAbsolutePath ());
96
- >>>>>>> Stashed changes
97
85
getLog ().debug ("jbossPrefix: " + jbossPrefix );
98
86
getLog ().debug ("pluginType: " + pluginType );
99
87
getLog ().debug ("projectName: " + projectName );
@@ -103,8 +91,7 @@ protected void doExecute() throws Exception {
103
91
104
92
System .setProperty ("deployer.app.server.type" , appServerType );
105
93
System .setProperty ("deployer.base.dir" , baseDir );
106
- System .setProperty (
107
- "deployer.dest.dir" , appServerDeployDir .getAbsolutePath ());
94
+ System .setProperty ("deployer.dest.dir" , deployDir .getAbsolutePath ());
108
95
System .setProperty ("deployer.file.pattern" , warFileName );
109
96
System .setProperty ("deployer.unpack.war" , String .valueOf (unpackWar ));
110
97
System .setProperty (
@@ -134,79 +121,20 @@ else if (pluginType.equals("web")) {
134
121
}
135
122
136
123
protected void deployExt () throws Exception {
137
- <<<<<<< Updated upstream
138
- workDir .mkdirs ();
139
-
140
- UnArchiver unArchiver = archiverManager .getUnArchiver (warFile );
141
-
142
- unArchiver .setDestDirectory (workDir );
143
- unArchiver .setSourceFile (warFile );
144
-
145
- unArchiver .extract ();
146
-
147
- CopyTask .copyDirectory (
148
- new File (workDir , "WEB-INF/ext-lib/global" ), appServerLibGlobalDir ,
149
- "*.jar" , null , true , true );
150
-
151
- CopyTask .copyFile (
152
- new File (workDir , "WEB-INF/ext-service/ext-service.jar" ),
153
- appServerLibGlobalDir , "ext-" + pluginName + "-service.jar" , null ,
154
- true , true );
155
-
156
- CopyTask .copyDirectory (
157
- new File (workDir , "WEB-INF/ext-lib/portal" ), appServerLibPortalDir ,
158
- "*.jar" , null , true , true );
159
-
160
- CopyTask .copyFile (
161
- new File (workDir , "WEB-INF/ext-impl/ext-impl.jar" ),
162
- appServerLibGlobalDir , "ext-" + pluginName + "-impl.jar" , null , true ,
163
- true );
164
-
165
- CopyTask .copyFile (
166
- new File (workDir , "WEB-INF/ext-util-bridges/ext-util-bridges.jar" ),
167
- appServerLibGlobalDir , "ext-" + pluginName + "-util-bridges.jar" ,
168
- null , true , true );
169
-
170
- CopyTask .copyFile (
171
- new File (workDir , "WEB-INF/ext-util-java/ext-util-java.jar" ),
172
- appServerLibGlobalDir , "ext-" + pluginName + "-util-java.jar" , null ,
173
- true , true );
174
-
175
- CopyTask .copyFile (
176
- new File (workDir , "WEB-INF/ext-util-taglib/ext-util-taglib.jar" ),
177
- appServerLibGlobalDir , "ext-" + pluginName + "-util-taglib.jar" ,
178
- null , true , true );
179
-
180
- CopyTask .copyDirectory (
181
- new File (workDir , "WEB-INF/ext-web/docroot" ), appServerPortalDir ,
182
- null , "WEB-INF/web.xml" , true , true );
183
-
184
- File webXml = new File (
185
- workDir , "WEB-INF/ext-web/docroot/WEB-INF/web.xml" );
186
-
187
- if (webXml .exists ()) {
188
- File originalWebXml = new File (
189
- appServerPortalDir , "WEB-INF/web.xml" );
190
- File mergedWebXml = new File (
191
- appServerPortalDir , "WEB-INF/web.xml.merged" );
192
-
193
- new WebXMLBuilder (
194
- originalWebXml .getAbsolutePath (), webXml .getAbsolutePath (),
195
- mergedWebXml .getAbsolutePath ());
196
-
197
- FileUtil .move (mergedWebXml , originalWebXml );
124
+
125
+ if (appServerGlobalLibDir == null || appServerGlobalLibDir .equals (StringPool .BLANK )) {
126
+ getLog ().error ("appServerGlobalLibDir configuration is required for ext direct-deploy" );
127
+ System .exit (-1 );
128
+ }
129
+
130
+ if (appServerLiferayRootDir == null || appServerLiferayRootDir .equals (StringPool .BLANK )) {
131
+ getLog ().error ("appServerLiferayRootDir configuration is required for ext direct-deploy" );
132
+ System .exit (-1 );
198
133
}
199
-
200
- CopyTask .copyFile (
201
- new File (workDir , "WEB-INF/ext-" + pluginName + ".xml" ),
202
- appServerPortalDir , null , true , true );
203
-
204
- CopyTask .copyDirectory (
205
- new File (workDir , "WEB-INF/ext-web/docroot/WEB-INF/classes" ),
206
- appServerClassesPortalDir ,
207
- "portal-*.properties,system-*.properties" , null , true , true );
208
- =======
209
134
135
+ getLog ().debug ("appServerGlobalLibDir: " + appServerGlobalLibDir .getAbsolutePath ());
136
+ getLog ().debug ("appServerLiferayRootDir: " + appServerLiferayRootDir .getAbsolutePath ());
137
+
210
138
File appServerLiferayWebInfDir = new File (appServerLiferayRootDir +
211
139
StringPool .FORWARD_SLASH + "WEB-INF" );
212
140
@@ -267,7 +195,6 @@ protected void deployExt() throws Exception {
267
195
new File (appServerLiferayWebInfDir , StringPool .FORWARD_SLASH +
268
196
"ext-" + projectName + ".xml" ));
269
197
270
- >>>>>>> Stashed changes
271
198
}
272
199
273
200
protected void deployHook () throws Exception {
@@ -407,35 +334,6 @@ protected void preparePortalDependencies() throws Exception {
407
334
unArchiver .extract ();
408
335
}
409
336
410
- /**
411
- * @parameter default-value="${appServerPortalDir}/WEB-INF/classes" expression="${appServerClassesPortalDir}"
412
- * @required
413
- */
414
- private File appServerClassesPortalDir ;
415
-
416
- /**
417
- * @parameter default-value="${deployDir}" expression="${appServerDeployDir}"
418
- * @required
419
- */
420
- private File appServerDeployDir ;
421
-
422
- /**
423
- * @parameter expression="${appServerLibGlobalDir}"
424
- * @required
425
- */
426
- private File appServerLibGlobalDir ;
427
-
428
- /**
429
- * @parameter expression="${appServerPortalDir}"
430
- * @required
431
- */
432
- private File appServerPortalDir ;
433
-
434
- /**
435
- * @parameter default-value="${appServerPortalDir}/WEB-INF/lib" expression="${appServerLibPortalDir}"
436
- */
437
- private File appServerLibPortalDir ;
438
-
439
337
/**
440
338
* @parameter default-value="tomcat" expression="${appServerType}"
441
339
* @required
@@ -480,24 +378,19 @@ protected void preparePortalDependencies() throws Exception {
480
378
private boolean customPortletXml ;
481
379
482
380
/**
483
- * @deprecated
484
381
* @parameter expression="${deployDir}"
485
- * @since 6.1.1
382
+ * @required
486
383
*/
487
384
private File deployDir ;
488
385
489
386
/**
490
- <<<<<<< Updated upstream
491
- * @parameter expression="${jbossPrefix}"
492
- =======
493
387
* @parameter expression="${project.build.directory}/${project.build.finalName}"
494
388
* @required
495
389
*/
496
390
private File extDir ;
497
391
498
392
/**
499
393
* @parameter default-value="" expression="${jbossPrefix}"
500
- >>>>>>> Stashed changes
501
394
*/
502
395
private String jbossPrefix ;
503
396
@@ -514,12 +407,6 @@ protected void preparePortalDependencies() throws Exception {
514
407
*/
515
408
private ArtifactRepository localArtifactRepository ;
516
409
517
- /**
518
- * @parameter default-value="${project.artifactId}" expression="${pluginName}"
519
- * @required
520
- */
521
- private String pluginName ;
522
-
523
410
/**
524
411
* @parameter default-value="portlet" expression="${pluginType}"
525
412
* @required
@@ -540,25 +427,25 @@ protected void preparePortalDependencies() throws Exception {
540
427
private List remoteArtifactRepositories ;
541
428
542
429
/**
543
- * @parameter default-value="true" expression="${unpackWar}"
430
+ * @parameter expression="${unpackWar}" default-value="true "
544
431
* @required
545
432
*/
546
433
private boolean unpackWar ;
547
434
548
435
/**
549
- * @parameter default-value ="${project.build.directory}/${project.build.finalName}.war" expression="${warFile} "
436
+ * @parameter expression ="${project.build.directory}/${project.build.finalName}.war"
550
437
* @required
551
438
*/
552
439
private File warFile ;
553
440
554
441
/**
555
- * @parameter default-value ="${project.build.finalName}.war" expression="${warFileName}
442
+ * @parameter expression ="${project.build.finalName}.war"
556
443
* @required
557
444
*/
558
445
private String warFileName ;
559
446
560
447
/**
561
- * @parameter default-value ="${project.build.directory}/liferay-work"
448
+ * @parameter expression ="${project.build.directory}/liferay-work"
562
449
* @required
563
450
*/
564
451
private File workDir ;
0 commit comments