Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Channing K Jackson
Maven?
March 17, 2009 8:58 AM
Answer

Channing K Jackson

Rank: Junior Member

Posts: 67

Join Date: November 13, 2008

Recent Posts

Ant works well, we all know that, but Maven has some features Ant does not -- specifically, dependency management and artifact repositories -- and I am admittedly more familiar with Maven than I am Ant. I'm curious to know whether Liferay intends to move in the direction of Maven anytime soon?
Channing K Jackson
RE: Maven?
March 17, 2009 11:57 AM
Answer

Channing K Jackson

Rank: Junior Member

Posts: 67

Join Date: November 13, 2008

Recent Posts

Since my company uses Maven as its automated build tool, I was interested in creating an Eclipse project that could build a Liferay WAR file using Maven.

Here are the steps I took:

  1. Download the Liferay WAR standalone.
  2. Explode the WAR contents into an empty directory.
  3. Rename all the JAR artifacts in the WEB-INF/lib directory.
  4. Deploy the renamed JAR artifacts to my Maven artifact repository.
  5. Build a Maven project in Eclipse, and create a POM for the project.
  6. Add dependencies.


I did this for both the 5.1.2 and the 5.2.2 versions of the WAR distribution. I found that many of the JARs are identical, but some are different. I found it was prudent to keep redundant copies of identical jars anyway, just for the sake of keeping the versions distinct from each other.

I got the Liferay WAR file from here: Liferay 5.2.2 WAR

I exploded the WAR into a directory on my hard drive.

Then I wrote a small file renaming and copying utility to rename all the JAR files in the WEB-INF/lib directory. The code is as follows, feel free to use it if it is useful at all.

  1
  2import java.io.File;
  3import java.util.ArrayList;
  4import java.util.List;
  5import java.util.StringTokenizer;
  6import java.util.regex.Matcher;
  7import java.util.regex.Pattern;
  8
  9import org.apache.commons.io.FileUtils;
 10
 11public class LiferayJarRenamerUtil {
 12
 13    static final String _LINE = System.getProperty("line.separator");
 14    static final String _PATH = System.getProperty("path.separator");
 15
 16    static List<String> operations = new ArrayList<String>();
 17
 18    private String sourceDir;
 19    private String fileNamePattern;
 20    private String destDir;
 21
 22    static {
 23        operations.add("copy");
 24    }
 25
 26    /**
 27     * @param args
 28     */
 29    public static void main(String[] args) throws Exception {
 30        if(operations.contains(args[0]) == false) {
 31            printUsage();
 32            throw new Exception("Improper usage in command.");
 33        }
 34        if(args[0].equals("copy")) {
 35            LiferayJarRenamerUtil utils = new LiferayJarRenamerUtil();
 36            utils.setSourceDir(args[1]);
 37            utils.setFileNamePattern(args[2]);
 38            utils.setDestDir(args[3]);
 39
 40            String[] nameLiterals = utils.parseFileNamePattern();
 41
 42            File sourceFolder = new File(utils.getSourceDir());
 43            File destFolder = new File(utils.getDestDir());
 44            if(sourceFolder.exists() == false) {
 45                throw new Exception("The source folder specified by " + utils.getSourceDir()
 46                        + " does not exist in the file system.");
 47            }
 48            if(destFolder.exists() == false) {
 49                throw new Exception("The destination folder specified by " + utils.getDestDir()
 50                        + " does not exist in the file system.");
 51            }
 52            if(sourceFolder.isDirectory()) {
 53                for(File dirFile : sourceFolder.listFiles()) {
 54                    if(dirFile.isFile()) {
 55                        String fileName = dirFile.getName();
 56                        StringTokenizer st = new StringTokenizer(fileName, ".");
 57                        String currentName = st.nextToken();
 58                        String suffix = st.nextToken();
 59
 60                        String newFileName = nameLiterals[0] + currentName + nameLiterals[1] + "." + suffix;
 61                        System.out.println("Copying to renamed file: " + newFileName);
 62                        FileUtils.copyFile(dirFile, new File(utils.getDestDir(), newFileName));
 63                    }
 64                }
 65            }
 66        }
 67    }
 68
 69    private static void printUsage() {
 70        StringBuffer sb = new StringBuffer();
 71        sb.append(LiferayJarRenamerUtil.class.getName() + " usage:").append(_LINE);
 72        sb.append("\t").append("java FileUtils <operation> <dir> <newFileNamePattern> <destFolder>").append(_LINE);
 73        sb.append("Where:").append(_LINE);
 74        sb.append("\t").append("<operation> is the operation you wish to perform.  Currently, only 'copy' is supported.").append(
 75                _LINE);
 76        sb.append("\t").append("<dir> is the directory to scan for all files you wish to rename.").append(_LINE);
 77        sb.append("\t").append("<newFileNamePattern> is a pattern you wish to use to rename each file.").append(_LINE);
 78        sb.append("\t\t").append("- Use literal strings to specify a constant to include somewhere in the pattern.").append(_LINE);
 79        sb.append("\t\t").append("- Use [current] to specify the current name of the file, excluding its suffix.").append(_LINE);
 80        sb.append("\t\t").append("- Use [suffix] to specify the suffix of the file.").append(_LINE);
 81        sb.append("\t\t").append("Example:").append(_LINE);
 82        sb.append("\t\t").append("For a folder 'target' containing a file named 'README.txt'...").append(_LINE).append(_LINE);
 83        sb.append("\t\t").append("java FileUtils copy c:\\target DELETEME.[current]-1.1.0.[suffix] c:\\target\\dest").append(_LINE).append(
 84                _LINE);
 85        sb.append("\t\t").append(
 86                "Will place a copy of 'README.txt' in the folder 'c:\\target\\dest' called 'DELETEME.README-1.1.0.txt'").append(
 87                _LINE);
 88        sb.append("\t").append("<destFolder> is the absolute file path of the destination folder").append(_LINE);
 89
 90        System.err.println(sb.toString());
 91    }
 92
 93    public String[] parseFileNamePattern() {
 94        /*
 95         * "(.)\[current\](.)\.\[suffix\]"
 96         */
 97        Pattern regexPattern = Pattern.compile("(.*)\\[current\\](.*)\\.\\[suffix\\]");
 98        Matcher matcher = regexPattern.matcher(getFileNamePattern());
 99        if(matcher.find()) {
100            String[] returnValue = {matcher.group(1), matcher.group(2)};
101            return returnValue;
102        } else {
103            return null;
104        }
105    }
106
107    public String getSourceDir() {
108        return sourceDir;
109    }
110
111    public void setSourceDir(String sourceDir) {
112        this.sourceDir = sourceDir;
113    }
114
115    public String getFileNamePattern() {
116        return fileNamePattern;
117    }
118
119    public void setFileNamePattern(String fileNamePattern) {
120        this.fileNamePattern = fileNamePattern;
121    }
122
123    public String getDestDir() {
124        return destDir;
125    }
126
127    public void setDestDir(String destDir) {
128        this.destDir = destDir;
129    }
130
131}


An example of the command line execution of the file above looks like this:

1java LiferayJarRenamerUtil copy "<path_to_WEB-INF_lib_directory>" cjackson-[current]-5.2.2.[suffix] "<path_to_target_directory>"


The code iterates through the directory, takes each JAR file in there, and adds the "cjackson-" as a prefix to the filename, the "-5.2.2" version number to the end of the filename, and copies the file itself into the directory specified by <path_to_target_directory>. The target directory must be created before the code successfully runs because I'm lazy and I didn't add the code to create that directory on-the-fly if it doesn't already exist. emoticon

The POM file is a pretty standard POM with the following dependencies (these come from the 5.1.2 version):
  1
  2  <dependencies>
  3    <dependency>
  4        <groupId>my.maven.artifact.group.id</groupId>
  5        <artifactId>cjackson-ant</artifactId>
  6        <version>5.1.2</version>
  7    </dependency>
  8    <dependency>
  9        <groupId>my.maven.artifact.group.id</groupId>
 10        <artifactId>cjackson-antlr</artifactId>
 11        <version>5.1.2</version>
 12    </dependency>
 13    <dependency>
 14        <groupId>my.maven.artifact.group.id</groupId>
 15        <artifactId>cjackson-aopalliance</artifactId>
 16        <version>5.1.2</version>
 17    </dependency>
 18    <dependency>
 19        <groupId>my.maven.artifact.group.id</groupId>
 20        <artifactId>cjackson-asm</artifactId>
 21        <version>5.1.2</version>
 22    </dependency>
 23    <dependency>
 24        <groupId>my.maven.artifact.group.id</groupId>
 25        <artifactId>cjackson-asm-attrs</artifactId>
 26        <version>5.1.2</version>
 27    </dependency>
 28    <dependency>
 29        <groupId>my.maven.artifact.group.id</groupId>
 30        <artifactId>cjackson-aspectj-rt</artifactId>
 31        <version>5.1.2</version>
 32    </dependency>
 33    <dependency>
 34        <groupId>my.maven.artifact.group.id</groupId>
 35        <artifactId>cjackson-aspectj-weaver</artifactId>
 36        <version>5.1.2</version>
 37    </dependency>
 38    <dependency>
 39        <groupId>my.maven.artifact.group.id</groupId>
 40        <artifactId>cjackson-axis</artifactId>
 41        <version>5.1.2</version>
 42    </dependency>
 43    <dependency>
 44        <groupId>my.maven.artifact.group.id</groupId>
 45        <artifactId>cjackson-axis-ant</artifactId>
 46        <version>5.1.2</version>
 47    </dependency>
 48    <dependency>
 49        <groupId>my.maven.artifact.group.id</groupId>
 50        <artifactId>cjackson-backport-concurrent</artifactId>
 51        <version>5.1.2</version>
 52    </dependency>
 53    <dependency>
 54        <groupId>my.maven.artifact.group.id</groupId>
 55        <artifactId>cjackson-bsf</artifactId>
 56        <version>5.1.2</version>
 57    </dependency>
 58    <dependency>
 59        <groupId>my.maven.artifact.group.id</groupId>
 60        <artifactId>cjackson-burlap</artifactId>
 61        <version>5.1.2</version>
 62    </dependency>
 63    <dependency>
 64        <groupId>my.maven.artifact.group.id</groupId>
 65        <artifactId>cjackson-casclient</artifactId>
 66        <version>5.1.2</version>
 67    </dependency>
 68    <dependency>
 69        <groupId>my.maven.artifact.group.id</groupId>
 70        <artifactId>cjackson-ccpp</artifactId>
 71        <version>5.1.2</version>
 72    </dependency>
 73    <dependency>
 74        <groupId>my.maven.artifact.group.id</groupId>
 75        <artifactId>cjackson-ccpp-ri</artifactId>
 76        <version>5.1.2</version>
 77    </dependency>
 78    <dependency>
 79        <groupId>my.maven.artifact.group.id</groupId>
 80        <artifactId>cjackson-cglib</artifactId>
 81        <version>5.1.2</version>
 82    </dependency>
 83    <dependency>
 84        <groupId>my.maven.artifact.group.id</groupId>
 85        <artifactId>cjackson-chardet</artifactId>
 86        <version>5.1.2</version>
 87    </dependency>
 88    <dependency>
 89        <groupId>my.maven.artifact.group.id</groupId>
 90        <artifactId>cjackson-commons-beanutils</artifactId>
 91        <version>5.1.2</version>
 92    </dependency>
 93    <dependency>
 94        <groupId>my.maven.artifact.group.id</groupId>
 95        <artifactId>cjackson-commons-codec</artifactId>
 96        <version>5.1.2</version>
 97    </dependency>
 98    <dependency>
 99        <groupId>my.maven.artifact.group.id</groupId>
100        <artifactId>cjackson-commons-collections</artifactId>
101        <version>5.1.2</version>
102    </dependency>
103    <dependency>
104        <groupId>my.maven.artifact.group.id</groupId>
105        <artifactId>cjackson-commons-configuration</artifactId>
106        <version>5.1.2</version>
107    </dependency>
108    <dependency>
109        <groupId>my.maven.artifact.group.id</groupId>
110        <artifactId>cjackson-commons-dbcp</artifactId>
111        <version>5.1.2</version>
112    </dependency>
113    <dependency>
114        <groupId>my.maven.artifact.group.id</groupId>
115        <artifactId>cjackson-commons-digester</artifactId>
116        <version>5.1.2</version>
117    </dependency>
118    <dependency>
119        <groupId>my.maven.artifact.group.id</groupId>
120        <artifactId>cjackson-commons-discovery</artifactId>
121        <version>5.1.2</version>
122    </dependency>
123    <dependency>
124        <groupId>my.maven.artifact.group.id</groupId>
125        <artifactId>cjackson-commons-email</artifactId>
126        <version>5.1.2</version>
127    </dependency>
128    <dependency>
129        <groupId>my.maven.artifact.group.id</groupId>
130        <artifactId>cjackson-commons-fileupload</artifactId>
131        <version>5.1.2</version>
132    </dependency>
133    <dependency>
134        <groupId>my.maven.artifact.group.id</groupId>
135        <artifactId>cjackson-commons-httpclient</artifactId>
136        <version>5.1.2</version>
137    </dependency>
138    <dependency>
139        <groupId>my.maven.artifact.group.id</groupId>
140        <artifactId>cjackson-commons-id</artifactId>
141        <version>5.1.2</version>
142    </dependency>
143    <dependency>
144        <groupId>my.maven.artifact.group.id</groupId>
145        <artifactId>cjackson-commons-io</artifactId>
146        <version>5.1.2</version>
147    </dependency>
148    <dependency>
149        <groupId>my.maven.artifact.group.id</groupId>
150        <artifactId>cjackson-commons-lang</artifactId>
151        <version>5.1.2</version>
152    </dependency>
153    <dependency>
154        <groupId>my.maven.artifact.group.id</groupId>
155        <artifactId>cjackson-commons-logging</artifactId>
156        <version>5.1.2</version>
157    </dependency>
158    <dependency>
159        <groupId>my.maven.artifact.group.id</groupId>
160        <artifactId>cjackson-commons-math</artifactId>
161        <version>5.1.2</version>
162    </dependency>
163    <dependency>
164        <groupId>my.maven.artifact.group.id</groupId>
165        <artifactId>cjackson-commons-pool</artifactId>
166        <version>5.1.2</version>
167    </dependency>
168    <dependency>
169        <groupId>my.maven.artifact.group.id</groupId>
170        <artifactId>cjackson-commons-validator</artifactId>
171        <version>5.1.2</version>
172    </dependency>
173    <dependency>
174        <groupId>my.maven.artifact.group.id</groupId>
175        <artifactId>cjackson-compass</artifactId>
176        <version>5.1.2</version>
177    </dependency>
178    <dependency>
179        <groupId>my.maven.artifact.group.id</groupId>
180        <artifactId>cjackson-concurrent</artifactId>
181        <version>5.1.2</version>
182    </dependency>
183    <dependency>
184        <groupId>my.maven.artifact.group.id</groupId>
185        <artifactId>cjackson-container</artifactId>
186        <version>5.1.2</version>
187    </dependency>
188    <dependency>
189        <groupId>my.maven.artifact.group.id</groupId>
190        <artifactId>cjackson-creolefilter</artifactId>
191        <version>5.1.2</version>
192    </dependency>
193    <dependency>
194        <groupId>my.maven.artifact.group.id</groupId>
195        <artifactId>cjackson-crypt</artifactId>
196        <version>5.1.2</version>
197    </dependency>
198    <dependency>
199        <groupId>my.maven.artifact.group.id</groupId>
200        <artifactId>cjackson-daim</artifactId>
201        <version>5.1.2</version>
202    </dependency>
203    <dependency>
204        <groupId>my.maven.artifact.group.id</groupId>
205        <artifactId>cjackson-displaytag</artifactId>
206        <version>5.1.2</version>
207    </dependency>
208    <dependency>
209        <groupId>my.maven.artifact.group.id</groupId>
210        <artifactId>cjackson-dom4j</artifactId>
211        <version>5.1.2</version>
212    </dependency>
213    <dependency>
214        <groupId>my.maven.artifact.group.id</groupId>
215        <artifactId>cjackson-easyconf</artifactId>
216        <version>5.1.2</version>
217    </dependency>
218    <dependency>
219        <groupId>my.maven.artifact.group.id</groupId>
220        <artifactId>cjackson-ecs</artifactId>
221        <version>5.1.2</version>
222    </dependency>
223    <dependency>
224        <groupId>my.maven.artifact.group.id</groupId>
225        <artifactId>cjackson-ehcache</artifactId>
226        <version>5.1.2</version>
227    </dependency>
228    <dependency>
229        <groupId>my.maven.artifact.group.id</groupId>
230        <artifactId>cjackson-freemarker</artifactId>
231        <version>5.1.2</version>
232    </dependency>
233    <dependency>
234        <groupId>my.maven.artifact.group.id</groupId>
235        <artifactId>cjackson-freshcookies-security</artifactId>
236        <version>5.1.2</version>
237    </dependency>
238    <dependency>
239        <groupId>my.maven.artifact.group.id</groupId>
240        <artifactId>cjackson-friki</artifactId>
241        <version>5.1.2</version>
242    </dependency>
243    <dependency>
244        <groupId>my.maven.artifact.group.id</groupId>
245        <artifactId>cjackson-gif89</artifactId>
246        <version>5.1.2</version>
247    </dependency>
248    <dependency>
249        <groupId>my.maven.artifact.group.id</groupId>
250        <artifactId>cjackson-hessian</artifactId>
251        <version>5.1.2</version>
252    </dependency>
253    <dependency>
254        <groupId>my.maven.artifact.group.id</groupId>
255        <artifactId>cjackson-hibernate3</artifactId>
256        <version>5.1.2</version>
257    </dependency>
258    <dependency>
259        <groupId>my.maven.artifact.group.id</groupId>
260        <artifactId>cjackson-htmlparser</artifactId>
261        <version>5.1.2</version>
262    </dependency>
263    <dependency>
264        <groupId>my.maven.artifact.group.id</groupId>
265        <artifactId>cjackson-ical4j</artifactId>
266        <version>5.1.2</version>
267    </dependency>
268    <dependency>
269        <groupId>my.maven.artifact.group.id</groupId>
270        <artifactId>cjackson-icq</artifactId>
271        <version>5.1.2</version>
272    </dependency>
273    <dependency>
274        <groupId>my.maven.artifact.group.id</groupId>
275        <artifactId>cjackson-icu4j</artifactId>
276        <version>5.1.2</version>
277    </dependency>
278    <dependency>
279        <groupId>my.maven.artifact.group.id</groupId>
280        <artifactId>cjackson-j2ee-management</artifactId>
281        <version>5.1.2</version>
282    </dependency>
283    <dependency>
284        <groupId>my.maven.artifact.group.id</groupId>
285        <artifactId>cjackson-jabsorb</artifactId>
286        <version>5.1.2</version>
287    </dependency>
288    <dependency>
289        <groupId>my.maven.artifact.group.id</groupId>
290        <artifactId>cjackson-jackrabbit-api</artifactId>
291        <version>5.1.2</version>
292    </dependency>
293    <dependency>
294        <groupId>my.maven.artifact.group.id</groupId>
295        <artifactId>cjackson-jackrabbit-core</artifactId>
296        <version>5.1.2</version>
297    </dependency>
298    <dependency>
299        <groupId>my.maven.artifact.group.id</groupId>
300        <artifactId>cjackson-jackrabbit-jcr-commons</artifactId>
301        <version>5.1.2</version>
302    </dependency>
303    <dependency>
304        <groupId>my.maven.artifact.group.id</groupId>
305        <artifactId>cjackson-jackrabbit-spi</artifactId>
306        <version>5.1.2</version>
307    </dependency>
308    <dependency>
309        <groupId>my.maven.artifact.group.id</groupId>
310        <artifactId>cjackson-jackrabbit-spi-commons</artifactId>
311        <version>5.1.2</version>
312    </dependency>
313    <dependency>
314        <groupId>my.maven.artifact.group.id</groupId>
315        <artifactId>cjackson-jackrabbit-text-extractors</artifactId>
316        <version>5.1.2</version>
317    </dependency>
318    <dependency>
319        <groupId>my.maven.artifact.group.id</groupId>
320        <artifactId>cjackson-jai_codec</artifactId>
321        <version>5.1.2</version>
322    </dependency>
323    <dependency>
324        <groupId>my.maven.artifact.group.id</groupId>
325        <artifactId>cjackson-jai_core</artifactId>
326        <version>5.1.2</version>
327    </dependency>
328    <dependency>
329        <groupId>my.maven.artifact.group.id</groupId>
330        <artifactId>cjackson-java-diff</artifactId>
331        <version>5.1.2</version>
332    </dependency>
333    <dependency>
334        <groupId>my.maven.artifact.group.id</groupId>
335        <artifactId>cjackson-jaxen</artifactId>
336        <version>5.1.2</version>
337    </dependency>
338    <dependency>
339        <groupId>my.maven.artifact.group.id</groupId>
340        <artifactId>cjackson-jaxrpc</artifactId>
341        <version>5.1.2</version>
342    </dependency>
343    <dependency>
344        <groupId>my.maven.artifact.group.id</groupId>
345        <artifactId>cjackson-jazzy</artifactId>
346        <version>5.1.2</version>
347    </dependency>
348    <dependency>
349        <groupId>my.maven.artifact.group.id</groupId>
350        <artifactId>cjackson-jcifs</artifactId>
351        <version>5.1.2</version>
352    </dependency>
353    <dependency>
354        <groupId>my.maven.artifact.group.id</groupId>
355        <artifactId>cjackson-jcommon</artifactId>
356        <version>5.1.2</version>
357    </dependency>
358    <dependency>
359        <groupId>my.maven.artifact.group.id</groupId>
360        <artifactId>cjackson-jcr</artifactId>
361        <version>5.1.2</version>
362    </dependency>
363    <dependency>
364        <groupId>my.maven.artifact.group.id</groupId>
365        <artifactId>cjackson-jdom</artifactId>
366        <version>5.1.2</version>
367    </dependency>
368    <dependency>
369        <groupId>my.maven.artifact.group.id</groupId>
370        <artifactId>cjackson-jena</artifactId>
371        <version>5.1.2</version>
372    </dependency>
373    <dependency>
374        <groupId>my.maven.artifact.group.id</groupId>
375        <artifactId>cjackson-jericho-html</artifactId>
376        <version>5.1.2</version>
377    </dependency>
378    <dependency>
379        <groupId>my.maven.artifact.group.id</groupId>
380        <artifactId>cjackson-jets3t</artifactId>
381        <version>5.1.2</version>
382    </dependency>
383    <dependency>
384        <groupId>my.maven.artifact.group.id</groupId>
385        <artifactId>cjackson-jfreechart</artifactId>
386        <version>5.1.2</version>
387    </dependency>
388    <dependency>
389        <groupId>my.maven.artifact.group.id</groupId>
390        <artifactId>cjackson-jgroups</artifactId>
391        <version>5.1.2</version>
392    </dependency>
393    <dependency>
394        <groupId>my.maven.artifact.group.id</groupId>
395        <artifactId>cjackson-jmx-remote</artifactId>
396        <version>5.1.2</version>
397    </dependency>
398    <dependency>
399        <groupId>my.maven.artifact.group.id</groupId>
400        <artifactId>cjackson-jmx-ri</artifactId>
401        <version>5.1.2</version>
402    </dependency>
403    <dependency>
404        <groupId>my.maven.artifact.group.id</groupId>
405        <artifactId>cjackson-jodconverter</artifactId>
406        <version>5.1.2</version>
407    </dependency>
408    <dependency>
409        <groupId>my.maven.artifact.group.id</groupId>
410        <artifactId>cjackson-jrcs-diff</artifactId>
411        <version>5.1.2</version>
412    </dependency>
413    <dependency>
414        <groupId>my.maven.artifact.group.id</groupId>
415        <artifactId>cjackson-jsonrpc</artifactId>
416        <version>5.1.2</version>
417    </dependency>
418    <dependency>
419        <groupId>my.maven.artifact.group.id</groupId>
420        <artifactId>cjackson-jspwiki</artifactId>
421        <version>5.1.2</version>
422    </dependency>
423    <dependency>
424        <groupId>my.maven.artifact.group.id</groupId>
425        <artifactId>cjackson-jsr107cache</artifactId>
426        <version>5.1.2</version>
427    </dependency>
428    <dependency>
429        <groupId>my.maven.artifact.group.id</groupId>
430        <artifactId>cjackson-jstl</artifactId>
431        <version>5.1.2</version>
432    </dependency>
433    <dependency>
434        <groupId>my.maven.artifact.group.id</groupId>
435        <artifactId>cjackson-jstl-impl</artifactId>
436        <version>5.1.2</version>
437    </dependency>
438    <dependency>
439        <groupId>my.maven.artifact.group.id</groupId>
440        <artifactId>cjackson-jug</artifactId>
441        <version>5.1.2</version>
442    </dependency>
443    <dependency>
444        <groupId>my.maven.artifact.group.id</groupId>
445        <artifactId>cjackson-juh</artifactId>
446        <version>5.1.2</version>
447    </dependency>
448    <dependency>
449        <groupId>my.maven.artifact.group.id</groupId>
450        <artifactId>cjackson-jurt</artifactId>
451        <version>5.1.2</version>
452    </dependency>
453    <dependency>
454        <groupId>my.maven.artifact.group.id</groupId>
455        <artifactId>cjackson-log4j</artifactId>
456        <version>5.1.2</version>
457    </dependency>
458    <dependency>
459        <groupId>my.maven.artifact.group.id</groupId>
460        <artifactId>cjackson-lucene</artifactId>
461        <version>5.1.2</version>
462    </dependency>
463    <dependency>
464        <groupId>my.maven.artifact.group.id</groupId>
465        <artifactId>cjackson-lucene-highlighter</artifactId>
466        <version>5.1.2</version>
467    </dependency>
468    <dependency>
469        <groupId>my.maven.artifact.group.id</groupId>
470        <artifactId>cjackson-mirage-api</artifactId>
471        <version>5.1.2</version>
472    </dependency>
473    <dependency>
474        <groupId>my.maven.artifact.group.id</groupId>
475        <artifactId>cjackson-msnm</artifactId>
476        <version>5.1.2</version>
477    </dependency>
478    <dependency>
479        <groupId>my.maven.artifact.group.id</groupId>
480        <artifactId>cjackson-mx4j</artifactId>
481        <version>5.1.2</version>
482    </dependency>
483    <dependency>
484        <groupId>my.maven.artifact.group.id</groupId>
485        <artifactId>cjackson-nekohtml</artifactId>
486        <version>5.1.2</version>
487    </dependency>
488    <dependency>
489        <groupId>my.maven.artifact.group.id</groupId>
490        <artifactId>cjackson-odmg</artifactId>
491        <version>5.1.2</version>
492    </dependency>
493    <dependency>
494        <groupId>my.maven.artifact.group.id</groupId>
495        <artifactId>cjackson-openid4java</artifactId>
496        <version>5.1.2</version>
497    </dependency>
498    <dependency>
499        <groupId>my.maven.artifact.group.id</groupId>
500        <artifactId>cjackson-openxri-client</artifactId>
501        <version>5.1.2</version>
502    </dependency>
503    <dependency>
504        <groupId>my.maven.artifact.group.id</groupId>
505        <artifactId>cjackson-openxri-syntax</artifactId>
506        <version>5.1.2</version>
507    </dependency>
508    <dependency>
509        <groupId>my.maven.artifact.group.id</groupId>
510        <artifactId>cjackson-oro</artifactId>
511        <version>5.1.2</version>
512    </dependency>
513    <dependency>
514        <groupId>my.maven.artifact.group.id</groupId>
515        <artifactId>cjackson-oscache</artifactId>
516        <version>5.1.2</version>
517    </dependency>
518    <dependency>
519        <groupId>my.maven.artifact.group.id</groupId>
520        <artifactId>cjackson-pdfbox</artifactId>
521        <version>5.1.2</version>
522    </dependency>
523    <dependency>
524        <groupId>my.maven.artifact.group.id</groupId>
525        <artifactId>cjackson-poi</artifactId>
526        <version>5.1.2</version>
527    </dependency>
528    <dependency>
529        <groupId>my.maven.artifact.group.id</groupId>
530        <artifactId>cjackson-poi-contrib</artifactId>
531        <version>5.1.2</version>
532    </dependency>
533    <dependency>
534        <groupId>my.maven.artifact.group.id</groupId>
535        <artifactId>cjackson-poi-scratchpad</artifactId>
536        <version>5.1.2</version>
537    </dependency>
538    <dependency>
539        <groupId>my.maven.artifact.group.id</groupId>
540        <artifactId>cjackson-portal-client</artifactId>
541        <version>5.1.2</version>
542    </dependency>
543    <dependency>
544        <groupId>my.maven.artifact.group.id</groupId>
545        <artifactId>cjackson-portal-impl</artifactId>
546        <version>5.1.2</version>
547    </dependency>
548    <dependency>
549        <groupId>my.maven.artifact.group.id</groupId>
550        <artifactId>cjackson-portal-kernel</artifactId>
551        <version>5.1.2</version>
552    </dependency>
553    <dependency>
554        <groupId>my.maven.artifact.group.id</groupId>
555        <artifactId>cjackson-portals-bridges</artifactId>
556        <version>5.1.2</version>
557    </dependency>
558    <dependency>
559        <groupId>my.maven.artifact.group.id</groupId>
560        <artifactId>cjackson-portal-service</artifactId>
561        <version>5.1.2</version>
562    </dependency>
563    <dependency>
564        <groupId>my.maven.artifact.group.id</groupId>
565        <artifactId>cjackson-portlet</artifactId>
566        <version>5.1.2</version>
567    </dependency>
568    <dependency>
569        <groupId>my.maven.artifact.group.id</groupId>
570        <artifactId>cjackson-portletbridge-core</artifactId>
571        <version>5.1.2</version>
572    </dependency>
573    <dependency>
574        <groupId>my.maven.artifact.group.id</groupId>
575        <artifactId>cjackson-portletbridge-portlet</artifactId>
576        <version>5.1.2</version>
577    </dependency>
578    <dependency>
579        <groupId>my.maven.artifact.group.id</groupId>
580        <artifactId>cjackson-portlet-container</artifactId>
581        <version>5.1.2</version>
582    </dependency>
583    <dependency>
584        <groupId>my.maven.artifact.group.id</groupId>
585        <artifactId>cjackson-quartz</artifactId>
586        <version>5.1.2</version>
587    </dependency>
588    <dependency>
589        <groupId>my.maven.artifact.group.id</groupId>
590        <artifactId>cjackson-rdffilter</artifactId>
591        <version>5.1.2</version>
592    </dependency>
593    <dependency>
594        <groupId>my.maven.artifact.group.id</groupId>
595        <artifactId>cjackson-ridl</artifactId>
596        <version>5.1.2</version>
597    </dependency>
598    <dependency>
599        <groupId>my.maven.artifact.group.id</groupId>
600        <artifactId>cjackson-rome</artifactId>
601        <version>5.1.2</version>
602    </dependency>
603    <dependency>
604        <groupId>my.maven.artifact.group.id</groupId>
605        <artifactId>cjackson-saaj-api</artifactId>
606        <version>5.1.2</version>
607    </dependency>
608    <dependency>
609        <groupId>my.maven.artifact.group.id</groupId>
610        <artifactId>cjackson-saaj-impl</artifactId>
611        <version>5.1.2</version>
612    </dependency>
613    <dependency>
614        <groupId>my.maven.artifact.group.id</groupId>
615        <artifactId>cjackson-serializer</artifactId>
616        <version>5.1.2</version>
617    </dependency>
618    <dependency>
619        <groupId>my.maven.artifact.group.id</groupId>
620        <artifactId>cjackson-simplecaptcha</artifactId>
621        <version>5.1.2</version>
622    </dependency>
623    <dependency>
624        <groupId>my.maven.artifact.group.id</groupId>
625        <artifactId>cjackson-slf4j-log4j12</artifactId>
626        <version>5.1.2</version>
627    </dependency>
628    <dependency>
629        <groupId>my.maven.artifact.group.id</groupId>
630        <artifactId>cjackson-soap</artifactId>
631        <version>5.1.2</version>
632    </dependency>
633    <dependency>
634        <groupId>my.maven.artifact.group.id</groupId>
635        <artifactId>cjackson-spring</artifactId>
636        <version>5.1.2</version>
637    </dependency>
638    <dependency>
639        <groupId>my.maven.artifact.group.id</groupId>
640        <artifactId>cjackson-spring-test</artifactId>
641        <version>5.1.2</version>
642    </dependency>
643    <dependency>
644        <groupId>my.maven.artifact.group.id</groupId>
645        <artifactId>cjackson-spring-webmvc</artifactId>
646        <version>5.1.2</version>
647    </dependency>
648    <dependency>
649        <groupId>my.maven.artifact.group.id</groupId>
650        <artifactId>cjackson-stax</artifactId>
651        <version>5.1.2</version>
652    </dependency>
653    <dependency>
654        <groupId>my.maven.artifact.group.id</groupId>
655        <artifactId>cjackson-struts</artifactId>
656        <version>5.1.2</version>
657    </dependency>
658    <dependency>
659        <groupId>my.maven.artifact.group.id</groupId>
660        <artifactId>cjackson-struts-el</artifactId>
661        <version>5.1.2</version>
662    </dependency>
663    <dependency>
664        <groupId>my.maven.artifact.group.id</groupId>
665        <artifactId>cjackson-textmining</artifactId>
666        <version>5.1.2</version>
667    </dependency>
668    <dependency>
669        <groupId>my.maven.artifact.group.id</groupId>
670        <artifactId>cjackson-trove</artifactId>
671        <version>5.1.2</version>
672    </dependency>
673    <dependency>
674        <groupId>my.maven.artifact.group.id</groupId>
675        <artifactId>cjackson-unoil</artifactId>
676        <version>5.1.2</version>
677    </dependency>
678    <dependency>
679        <groupId>my.maven.artifact.group.id</groupId>
680        <artifactId>cjackson-urlrewrite</artifactId>
681        <version>5.1.2</version>
682    </dependency>
683    <dependency>
684        <groupId>my.maven.artifact.group.id</groupId>
685        <artifactId>cjackson-util-bridges</artifactId>
686        <version>5.1.2</version>
687    </dependency>
688    <dependency>
689        <groupId>my.maven.artifact.group.id</groupId>
690        <artifactId>cjackson-util-java</artifactId>
691        <version>5.1.2</version>
692    </dependency>
693    <dependency>
694        <groupId>my.maven.artifact.group.id</groupId>
695        <artifactId>cjackson-util-taglib</artifactId>
696        <version>5.1.2</version>
697    </dependency>
698    <dependency>
699        <groupId>my.maven.artifact.group.id</groupId>
700        <artifactId>cjackson-velocity</artifactId>
701        <version>5.1.2</version>
702    </dependency>
703    <dependency>
704        <groupId>my.maven.artifact.group.id</groupId>
705        <artifactId>cjackson-velocity-tools</artifactId>
706        <version>5.1.2</version>
707    </dependency>
708    <dependency>
709        <groupId>my.maven.artifact.group.id</groupId>
710        <artifactId>cjackson-wsdl4j</artifactId>
711        <version>5.1.2</version>
712    </dependency>
713    <dependency>
714        <groupId>my.maven.artifact.group.id</groupId>
715        <artifactId>cjackson-wstx</artifactId>
716        <version>5.1.2</version>
717    </dependency>
718    <dependency>
719        <groupId>my.maven.artifact.group.id</groupId>
720        <artifactId>cjackson-xalan</artifactId>
721        <version>5.1.2</version>
722    </dependency>
723    <dependency>
724        <groupId>my.maven.artifact.group.id</groupId>
725        <artifactId>cjackson-xbean-spring</artifactId>
726        <version>5.1.2</version>
727    </dependency>
728    <dependency>
729        <groupId>my.maven.artifact.group.id</groupId>
730        <artifactId>cjackson-xercesImpl</artifactId>
731        <version>5.1.2</version>
732    </dependency>
733    <dependency>
734        <groupId>my.maven.artifact.group.id</groupId>
735        <artifactId>cjackson-xml-apis</artifactId>
736        <version>5.1.2</version>
737    </dependency>
738    <dependency>
739        <groupId>my.maven.artifact.group.id</groupId>
740        <artifactId>cjackson-xmlsec</artifactId>
741        <version>5.1.2</version>
742    </dependency>
743    <dependency>
744        <groupId>my.maven.artifact.group.id</groupId>
745        <artifactId>cjackson-xpp3</artifactId>
746        <version>5.1.2</version>
747    </dependency>
748    <dependency>
749        <groupId>my.maven.artifact.group.id</groupId>
750        <artifactId>cjackson-xstream</artifactId>
751        <version>5.1.2</version>
752    </dependency>
753  </dependencies>


To simplify things, I built a parent POM that holds all the dependencies, and then a separate child POM for the actual WAR artifact build. All the contents of the exploded WAR had to be included in the eclipse project for the build to work properly.

Here is an outline of the directory structure for the project:

 1
 2- cjackson-liferay-portal
 3|
 4|-src/main/resources
 5|-src/main/java
 6+-src/main/webapp
 7 |-dtd
 8 |-errors
 9 +-html
10  +-common
11  +-js
12  +-portal
13  +-portlet
14  +-sound
15  +-taglib
16  +-themes
17 |-layouttpl
18 |-META-INF
19 |-WAP
20 +-WEB-INF
21  |-tld


I put the following files (from portal-impl.jar/META-INF) in ~src/main/resources so they end up in WEB-INF/classes after the build:
captcha.properties
cms-redirects.properties
content-types.properties
jspwiki.properties
log4j.properties
logging.properties
portal-developer.properties
portal-ext.properties
portal-properties
system.properties

Short of a few details that can probably be figured out by trial and error, this should result in a project that can be built using Maven in Eclipse that produces a WAR file of Liferay portal that can be deployed to the app container of your choice.
Tomas Polesovsky
RE: Maven?
October 29, 2009 5:57 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Hi,

just not to create duplicate thread - What about Maven 2?

At the European Symposium 2009 I asked Jorge with the same question. He answered, that some developers from Sweden, Finland (I apologize, I can't remember it) should work on it.

I googled: maven site:www.liferay.com which gives me many pages, but there are only few activities that are not dead and created some value.



In our company we are migrating the Plugins SDK into the maven. Too.

I am sorry but I've got lost. I'd like to have mavenized environment and build our project in the standard (=Liferay standard) way, but it seems to me that there is no aimed activity to accomplish the goal in the roadmap above, please correct me! Can I count on this? OR should we continue migrating it ourselves?

Thanks.

-- tom
Jorge Ferrer
RE: Maven?
October 29, 2009 8:03 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Tomas,

The situation is still the same I mentioned during the symposium: several people have volunteered to contribute but we haven't seen any progress yet.

So if you're working on it, please keep doing it. Once it's done it would be great if you could contribute it or make it available so that other people interested can benefit from it (or even contribute).

One of our engineers, Thiago, was also very interested in helping with this, so I'll let him know about this thread.
Thiago Leão Moreira
RE: Maven?
October 29, 2009 9:12 AM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1394

Join Date: October 10, 2007

Recent Posts

Hi all,

Thanks Jorge for letting me know.

We have been talking about Liferay and Maven for a while and definitely we decided to build up an artifact repository. So, any time soon, probably in December we will announce some news about it.

Stay tuned!

Cheers
Jorge Ferrer
RE: Maven?
October 29, 2009 9:26 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hey Thiago,

That's great news. Once we have a maven repository maintained automatically it'll be much easier for Channing, Tomas and others to build tools around it.
Milen Dyankov
RE: Maven?
October 29, 2009 2:53 PM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

Hi, I've been recently working on a project I have called liferay-maven-sdk. It's an attempt to port Liferay SDK to Maven2. I believe I have managed to port most of it (including ServiceBuilder invocation) but it's not very well tested. If Liferay team finds it useful I'll be more than happy to contribute.
Jorge Ferrer
RE: Maven?
October 30, 2009 8:26 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hey Milen,

That sounds great. I've stopped using Maven for a while so I wouldn't be able to judge it, but it would be a good idea if you could make it available to other interested Maven users in this thread and the community.

Once it's fine tunned we can figure out what's the best strategy to maintain it.

BTW, one minor suggestion. What do you think of calling it liferay-plugins-sdk-maven? The goal is to make sure it's not confused with a potential port to maven of the ext environment.
Milen Dyankov
RE: Maven?
October 31, 2009 3:12 AM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

Hey Jorge,

The project is available to anyone to use and/or further extend. The source code is in Github's repository: http://github.com/azzazzel/liferay-maven-sdk. I have already mentioned about it on Liferay forums and Jira.
I understand Maven2 support is not Liferay's biggest concern right now and so I tried to provide as much as I can myself (for 5.2.3 version for now). It wold be nice though if Liferay developers can at least check whether there are major issues with it. Once I find the time I will try to have a look at what is planned/developed for 5.3 release and eventually prepare a new version.
If on the other hand Liferay team is already working on different approach for Maven2 integration I don't mind donating the code (in case it's any useful). If I can help in any other way just let me know.
Jorge Ferrer
RE: Maven?
November 2, 2009 12:51 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Thanks Milen,

Thiago, do you have time to check it out?

Channing, Tomas, it would be great if you two could test it out and share your thoughts with us and Milen.
Tomas Polesovsky
RE: Maven?
November 2, 2009 12:58 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

I've already downloaded the liferay-maven-sdk from the github and now I am looking at it.

I try to prepare some thoughts and post them as soon as I will be able to.

-- tom
Sampsa Sohlman
RE: Maven?
November 2, 2009 1:08 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 218

Join Date: September 27, 2007

Recent Posts

Wonderful!

This was one of the topics that I was also discussing at Symposium.

I will sure check this.

- Sampsa
Tomas Polesovsky
RE: Maven?
November 2, 2009 7:00 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Hi all,

I went through the liferay-maven-sdk and from my point of view - it is GREAT!

Short info about the project:

1, It has almost all the JAR libraries built-in, so it works on the localhost without having Liferay jars in the remote repository. Anyone who has maven can download it and use it now as it goes.
2, It has support for portlets, themes and layouts.
3, It has support for the Service Builder!


I have only a few thoughs:

1, portlet project:
-------------------
- the supporting java code (liferay-maven-plugin) use commons-io in the version 1.4, but Liferay uses 1.3.2. There is a problem when I want to run Service Builder. One of the classes from liferay-maven-plugin (com.commsen.liferay.BuildService) use the FileUtils.deleteQuietly & FileUtils.moveFile methods which are supported only in commons-io 1.4. When I want to run service builder, the commons-io jars get mixed so I've had to rewrite the BuildService to make it work.

- Service Builder is run each time I compile, package, etc. Is it correct?
1
2        <profile>
3            <id>service builder profile</id>
4             <activation>
5                <file>
6                    <exists>src/main/webapp/WEB-INF/service.xml</exists>
7                </file>
8            </activation>


2, themes & layouts
--------------------
- By default there is no web.xml in the archetype (and also in the Ant's Plugins SDK). Ant doesn't need to have web.xml, but maven-war-plugin needs it. I had to change the pom.xml so it looks:
1
2            <plugin>
3                <groupId>org.apache.maven.plugins</groupId>
4                <artifactId>maven-war-plugin</artifactId>
5                <configuration>
6                    <failOnMissingWebXml>false</failOnMissingWebXml>
7                              ...


3, hooks
--------------------------
Where have all the Hooks gone?

4, web
------------------------------
There is no support for the "web plugin". On the other hand, does anyone use them?
But, they should be there, if it should be the alternative for the Ant Plugins SDK.
Lukas Matejka
RE: Maven?
November 2, 2009 2:10 PM
Answer

Lukas Matejka

Rank: New Member

Posts: 4

Join Date: April 6, 2009

Recent Posts

Hi Jorge,

as far as I know Tomas's just managed to use liferay-maven-sdk for one of our application using service builder and it worked pretty fine. So I just want to ask if you're planning or is there any chance to add this directly into Liferay 5.3 in case that it will be working correctly?
Milen Dyankov
RE: Maven?
November 2, 2009 2:19 PM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

Hi Tomas,

Thank you reviewing the code. I'm glad you like it ;) Of course it's not that great but it's the best I could do in couple of sleepless nights ;)

As far as commons-io is concern, can you please describe the problem you have. Since the 4.0 version is only used in liferay-maven-plugin it should be "invisible" for the portlet itself. I assume what you are saying is that Service Builder behaves differently when commons-io v4.0 is on it's classpath. I'm not questioning it, just trying to understand where exactly the problem is.

As for your fixes, please feel free to fork the repo and commit them. If you don't have the time simply mail them to me and I'll update the code. Thanks for you help.

About Service Builder running on each code compilation - I believe this is also the case with Liferay Plugins SDK. To the best of my knowledge Service Builder does nothing unless "service.xml" file is modified and the call does not seem to be too resource consuming. Don't know if this is an issue but I just couldn't figure out any better way to hook the invocation.

Unfortunately, I didn't have the time to deal with hooks and web plug-ins. But from what I see there is no code generation for any of them. There is probably something specific in the build process (I assume the folders in SDK exists for a reason) but I didn't have the time to go through ant build files and investigate it. I was hoping that with some customization a standard maven WAR archetype can be used in the mean time.
Sampsa Sohlman
RE: Maven?
November 2, 2009 2:32 PM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 218

Join Date: September 27, 2007

Recent Posts

Hola Jorge

I also tried the liferay-maven-sdk. I managed to create themes, portlets just under NetBeans-IDE without touching command line. I'm personally quite impressed with this.I still have to try servicebuilder, but as for short test this was much more than I expected.

More important for me would be support for enterprise editions. Of course I can modify this to work with EE too, but it would be easier to get package emoticon

At my world I'm benefiting the maven's dependency management and version handling.

Un saludo

Sampsa
Tomas Polesovsky
RE: Maven?
November 3, 2009 12:40 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Hi Milen,

Milen Dyankov:
Hi Tomas,

As far as commons-io is concern, can you please describe the problem you have. Since the 4.0 version is only used in liferay-maven-plugin it should be "invisible" for the portlet itself. I assume what you are saying is that Service Builder behaves differently when commons-io v4.0 is on it's classpath. I'm not questioning it, just trying to understand where exactly the problem is.


It is not a problem with ServiceBuilder, but with BuildService class:
 1
 2topol@topolik:/work/liferay-maven-sdk/crm-portlets$ mvn package
 3...
 4[INFO] ------------------------------------------------------------------------
 5[ERROR] FATAL ERROR
 6[INFO] ------------------------------------------------------------------------
 7[INFO] org.apache.commons.io.FileUtils.deleteQuietly(Ljava/io/File;)Z
 8[INFO] ------------------------------------------------------------------------
 9[INFO] Trace
10java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.deleteQuietly(Ljava/io/File;)Z
11    at com.commsen.liferay.BuildService.execute(BuildService.java:135)
12    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
13...



Milen Dyankov:
As for your fixes, please feel free to fork the repo and commit them. If you don't have the time simply mail them to me and I'll update the code. Thanks for you help.


I've created a fork, you can see the changes in the commit. I never used GIT, so I hope it is OK. The changes are only in my fork, if you want you can merge them. (I hope the GIT is working this way emoticon )

Milen Dyankov:
About Service Builder running on each code compilation - I believe this is also the case with Liferay Plugins SDK. To the best of my knowledge Service Builder does nothing unless "service.xml" file is modified and the call does not seem to be too resource consuming. Don't know if this is an issue but I just couldn't figure out any better way to hook the invocation.


I understand it, I also don't know the better way of the invocation emoticon The thought was that in the ANT script you can customize the behaviour :/ (The service builder takes additional 14 seconds extra without touching source codes in 7 generated classes.)

Milen Dyankov:
Unfortunately, I didn't have the time to deal with hooks and web plug-ins. But from what I see there is no code generation for any of them. There is probably something specific in the build process (I assume the folders in SDK exists for a reason) but I didn't have the time to go through ant build files and investigate it. I was hoping that with some customization a standard maven WAR archetype can be used in the mean time.


Hooks and webs have additional Liferay descriptors. I can make the archetypes for both types.
Channing K Jackson
RE: Maven?
November 3, 2009 11:44 AM
Answer

Channing K Jackson

Rank: Junior Member

Posts: 67

Join Date: November 13, 2008

Recent Posts

Jorge Ferrer:
Channing, Tomas, it would be great if you two could test it out and share your thoughts with us and Milen.


I am glad this post generated some activity -- or at least drew attention to activity that was already underway.

Since I posted my original stuff, we decided - in the interest of time and maintainability - to preserve all the Ant builds as they were and attempt as little customization to the existing build process as possible. We may be interested in leveraging some of the sdk stuff at a later date, but for now, we're using out-of-box builds.

Thanks.
Milen Dyankov
RE: Maven?
November 3, 2009 2:30 PM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

Tomas Polesovsky:

It is not a problem with ServiceBuilder, but with BuildService class


That's odd. I can not reproduce this. Moreover the "service-builder-portlet" in the examples folder was generated in this way without problems. Could it be the Maven version? I'm using 2.2.1


Tomas Polesovsky:

I've created a fork, you can see the changes in the commit. I never used GIT, so I hope it is OK. The changes are only in my fork, if you want you can merge them. (I hope the GIT is working this way emoticon )


I have merged all your changes. Thanks a lot, for taking the time to fix this issues.

Tomas Polesovsky:

The service builder takes additional 14 seconds extra without touching source codes in 7 generated classes.


Well, there is an option to not activate the profile automatically but let the user do it by -P switch when needed. This would be much like doing "ant build-service". But on the other hand I have the feeling profiles are not one of the very well know Maven features and this may be a bit confusing. May be the best approach is to introduce a system property to disable it. Something similar to how unit tests are skipped. So for example one can do something like "mvn -Dservice.builder.skip=true package". What you think?

Tomas Polesovsky:

Hooks and webs have additional Liferay descriptors. I can make the archetypes for both types


That would be great! ;)
Tomas Polesovsky
RE: Maven?
November 4, 2009 2:32 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Milen Dyankov:
Tomas Polesovsky:

It is not a problem with ServiceBuilder, but with BuildService class


That's odd. I can not reproduce this. Moreover the "service-builder-portlet" in the examples folder was generated in this way without problems. Could it be the Maven version? I'm using 2.2.1


the maven -v output (maybe it is the problem of the version?):
1Maven version: 2.0.8
2Java version: 1.6.0_10
3OS name: "linux" version: "2.6.24-24-generic" arch: "i386" Family: "unix"


Milen Dyankov:
Tomas Polesovsky:

I've created a fork, you can see the changes in the commit. I never used GIT, so I hope it is OK. The changes are only in my fork, if you want you can merge them. (I hope the GIT is working this way emoticon )


I have merged all your changes. Thanks a lot, for taking the time to fix this issues.

Tomas Polesovsky:

The service builder takes additional 14 seconds extra without touching source codes in 7 generated classes.


Well, there is an option to not activate the profile automatically but let the user do it by -P switch when needed. This would be much like doing "ant build-service". But on the other hand I have the feeling profiles are not one of the very well know Maven features and this may be a bit confusing. May be the best approach is to introduce a system property to disable it. Something similar to how unit tests are skipped. So for example one can do something like "mvn -Dservice.builder.skip=true package". What you think?


We (in our company) use the profiles heavily. So I can't tell you if it is unknown feature. But I see it as a better solution than using the system property, the profiles are the maven way of thinking.

If you are using the ANT Plugins SDK, then you have to call the ant build-service explicitly. So I would like the behavior of the maven to be the same. I think it is not a problem.

Milen Dyankov:
Tomas Polesovsky:

Hooks and webs have additional Liferay descriptors. I can make the archetypes for both types


That would be great! ;)


OK, I'll try do my best ;)
Tomas Polesovsky
RE: Maven?
November 4, 2009 7:27 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Hi Milen,

the hook plugin is ready yet. You can merge it into the master tree.

I've already written a Wiki page Creating a Hook (I hope that noone gets confused, that the hooks are is not in the sources yet ;) )

UPDATE:

The web plugin is also ready. So you can merge both changes. I've created also a wiki page Creating Web Plugin

-- tom
Milen Dyankov
RE: Maven?
November 5, 2009 4:52 AM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

Hi Tomas,

thanks for the archetypes and wiki updates. I have merged your changes. I didn't have the time to actually try it out, but I trust you did ;)

I just got back from Liferay Developer training in Frankfurt where I learned about the LangBuilder tool. I'll try to integrate it into liferay-maven-plugin in the next few days.

I'm also thinking on versioning convention for liferay-maven-sdk so users can easily keep track of changes. I thought I would go for something like <liferay_version>-<sdk_version>. So for example 5.2.3-1 would mean version 1 of liferay-maven-sdk compatible with Liferay 5.2.3. This way it would be much easier to provide bundle downloads (now github dynamically packages the master branch on request) and change log.
Tomas Polesovsky
RE: Maven?
November 5, 2009 11:13 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

OK,

I think the next step should be also to include standard maven dependencies and eliminate the jars from the project. The project is too big for download and it is not necessary. There could be only portal core jars and the dependencies that are not in the repositories.

Maybe we could establish some kind of the roadmap for the project.

And I don't know if the Liferay forum,especially this thread, is good for communicating such things emoticon

-- tom
Mika Koivisto
RE: Maven?
December 15, 2009 7:09 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

Just to let everyone know the official Liferay Maven SDK is finally here. Read more from my blog.
Bender Rodriguez
RE: Maven?
June 25, 2012 8:43 AM
Answer

Bender Rodriguez

Rank: New Member

Posts: 7

Join Date: June 21, 2012

Recent Posts


I don't claim to be an expert, so I found links to some experts emoticon
I hope some of these are what you are looking for:

http://i-proving.com/2007/04/04/maven-faq/ Maven FAQ

http://i-proving.com/2007/04/25/how-to-use-maven-on-your-project/ how to use maven on your project

http://i-proving.com/2007/04/27/how-to-mavenize-an-existing-eclipse-project/ How to mavenize an existing eclipse project