Foren

Maven?

thumbnail
Channing K Jackson, geändert vor 15 Jahren.

Maven?

Junior Member Beiträge: 67 Beitrittsdatum: 13.11.08 Neueste Beiträge
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?
thumbnail
Channing K Jackson, geändert vor 15 Jahren.

RE: Maven?

Junior Member Beiträge: 67 Beitrittsdatum: 13.11.08 Neueste Beiträge
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:

  • Download the Liferay WAR standalone.
  • Explode the WAR contents into an empty directory.
  • Rename all the JAR artifacts in the WEB-INF/lib directory.
  • Deploy the renamed JAR artifacts to my Maven artifact repository.
  • Build a Maven project in Eclipse, and create a POM for the project.
  • 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.


import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.io.FileUtils;

public class LiferayJarRenamerUtil {

    static final String _LINE = System.getProperty("line.separator");
    static final String _PATH = System.getProperty("path.separator");

    static List<string> operations = new ArrayList<string>();

    private String sourceDir;
    private String fileNamePattern;
    private String destDir;

    static {
        operations.add("copy");
    }

    /**
     * @param args
     */
    public static void main(String[] args) throws Exception {
        if(operations.contains(args[0]) == false) {
            printUsage();
            throw new Exception("Improper usage in command.");
        }
        if(args[0].equals("copy")) {
            LiferayJarRenamerUtil utils = new LiferayJarRenamerUtil();
            utils.setSourceDir(args[1]);
            utils.setFileNamePattern(args[2]);
            utils.setDestDir(args[3]);

            String[] nameLiterals = utils.parseFileNamePattern();

            File sourceFolder = new File(utils.getSourceDir());
            File destFolder = new File(utils.getDestDir());
            if(sourceFolder.exists() == false) {
                throw new Exception("The source folder specified by " + utils.getSourceDir()
                        + " does not exist in the file system.");
            }
            if(destFolder.exists() == false) {
                throw new Exception("The destination folder specified by " + utils.getDestDir()
                        + " does not exist in the file system.");
            }
            if(sourceFolder.isDirectory()) {
                for(File dirFile : sourceFolder.listFiles()) {
                    if(dirFile.isFile()) {
                        String fileName = dirFile.getName();
                        StringTokenizer st = new StringTokenizer(fileName, ".");
                        String currentName = st.nextToken();
                        String suffix = st.nextToken();

                        String newFileName = nameLiterals[0] + currentName + nameLiterals[1] + "." + suffix;
                        System.out.println("Copying to renamed file: " + newFileName);
                        FileUtils.copyFile(dirFile, new File(utils.getDestDir(), newFileName));
                    }
                }
            }
        }
    }

    private static void printUsage() {
        StringBuffer sb = new StringBuffer();
        sb.append(LiferayJarRenamerUtil.class.getName() + " usage:").append(_LINE);
        sb.append("\t").append("java FileUtils <operation> </operation></string></string> <newfilenamepattern> <destfolder>").append(_LINE);
        sb.append("Where:").append(_LINE);
        sb.append("\t").append("<operation> is the operation you wish to perform.  Currently, only 'copy' is supported.").append(
                _LINE);
        sb.append("\t").append("<dir> is the directory to scan for all files you wish to rename.").append(_LINE);
        sb.append("\t").append("<newfilenamepattern> is a pattern you wish to use to rename each file.").append(_LINE);
        sb.append("\t\t").append("- Use literal strings to specify a constant to include somewhere in the pattern.").append(_LINE);
        sb.append("\t\t").append("- Use [current] to specify the current name of the file, excluding its suffix.").append(_LINE);
        sb.append("\t\t").append("- Use [suffix] to specify the suffix of the file.").append(_LINE);
        sb.append("\t\t").append("Example:").append(_LINE);
        sb.append("\t\t").append("For a folder 'target' containing a file named 'README.txt'...").append(_LINE).append(_LINE);
        sb.append("\t\t").append("java FileUtils copy c:\\target DELETEME.[current]-1.1.0.[suffix] c:\\target\\dest").append(_LINE).append(
                _LINE);
        sb.append("\t\t").append(
                "Will place a copy of 'README.txt' in the folder 'c:\\target\\dest' called 'DELETEME.README-1.1.0.txt'").append(
                _LINE);
        sb.append("\t").append("<destfolder> is the absolute file path of the destination folder").append(_LINE);

        System.err.println(sb.toString());
    }

    public String[] parseFileNamePattern() {
        /*
         * "(.)\[current\](.)\.\[suffix\]"
         */
        Pattern regexPattern = Pattern.compile("(.*)\\[current\\](.*)\\.\\[suffix\\]");
        Matcher matcher = regexPattern.matcher(getFileNamePattern());
        if(matcher.find()) {
            String[] returnValue = {matcher.group(1), matcher.group(2)};
            return returnValue;
        } else {
            return null;
        }
    }

    public String getSourceDir() {
        return sourceDir;
    }

    public void setSourceDir(String sourceDir) {
        this.sourceDir = sourceDir;
    }

    public String getFileNamePattern() {
        return fileNamePattern;
    }

    public void setFileNamePattern(String fileNamePattern) {
        this.fileNamePattern = fileNamePattern;
    }

    public String getDestDir() {
        return destDir;
    }

    public void setDestDir(String destDir) {
        this.destDir = destDir;
    }

}
</destfolder></newfilenamepattern></dir></operation></destfolder></newfilenamepattern>


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

java LiferayJarRenamerUtil copy "<path_to_web-inf_lib_directory>" cjackson-[current]-5.2.2.[suffix] "<path_to_target_directory>"
</path_to_target_directory></path_to_web-inf_lib_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):

  <dependencies>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ant</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-antlr</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-aopalliance</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-asm</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-asm-attrs</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-aspectj-rt</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-aspectj-weaver</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-axis</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-axis-ant</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-backport-concurrent</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-bsf</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-burlap</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-casclient</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ccpp</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ccpp-ri</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-cglib</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-chardet</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-beanutils</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-codec</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-collections</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-configuration</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-dbcp</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-digester</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-discovery</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-email</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-fileupload</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-httpclient</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-id</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-io</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-lang</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-logging</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-math</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-pool</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-commons-validator</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-compass</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-concurrent</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-container</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-creolefilter</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-crypt</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-daim</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-displaytag</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-dom4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-easyconf</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ecs</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ehcache</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-freemarker</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-freshcookies-security</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-friki</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-gif89</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-hessian</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-hibernate3</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-htmlparser</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ical4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-icq</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-icu4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-j2ee-management</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jabsorb</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-api</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-core</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-jcr-commons</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-spi</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-spi-commons</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jackrabbit-text-extractors</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jai_codec</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jai_core</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-java-diff</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jaxen</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jaxrpc</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jazzy</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jcifs</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jcommon</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jcr</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jdom</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jena</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jericho-html</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jets3t</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jfreechart</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jgroups</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jmx-remote</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jmx-ri</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jodconverter</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jrcs-diff</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jsonrpc</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jspwiki</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jsr107cache</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jstl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jstl-impl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jug</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-juh</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-jurt</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-log4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-lucene</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-lucene-highlighter</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-mirage-api</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-msnm</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-mx4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-nekohtml</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-odmg</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-openid4java</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-openxri-client</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-openxri-syntax</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-oro</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-oscache</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-pdfbox</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-poi</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-poi-contrib</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-poi-scratchpad</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portal-client</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portal-impl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portal-kernel</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portals-bridges</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portal-service</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portlet</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portletbridge-core</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portletbridge-portlet</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-portlet-container</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-quartz</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-rdffilter</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-ridl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-rome</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-saaj-api</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-saaj-impl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-serializer</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-simplecaptcha</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-slf4j-log4j12</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-soap</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-spring</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-spring-test</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-spring-webmvc</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-stax</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-struts</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-struts-el</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-textmining</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-trove</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-unoil</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-urlrewrite</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-util-bridges</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-util-java</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-util-taglib</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-velocity</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-velocity-tools</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-wsdl4j</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-wstx</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xalan</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xbean-spring</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xercesImpl</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xml-apis</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xmlsec</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xpp3</artifactid>
    	<version>5.1.2</version>
    </dependency>
    <dependency>
    	<groupid>my.maven.artifact.group.id</groupid>
    	<artifactid>cjackson-xstream</artifactid>
    	<version>5.1.2</version>
    </dependency>
  </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:


- cjackson-liferay-portal
|
|-src/main/resources
|-src/main/java
+-src/main/webapp
 |-dtd
 |-errors
 +-html
  +-common
  +-js
  +-portal
  +-portlet
  +-sound
  +-taglib
  +-themes
 |-layouttpl
 |-META-INF
 |-WAP
 +-WEB-INF
  |-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.
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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
thumbnail
Jorge Ferrer, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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.
thumbnail
Thiago Moreira, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 1449 Beitrittsdatum: 10.10.07 Neueste Beiträge
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
thumbnail
Jorge Ferrer, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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.
thumbnail
Milen Dyankov, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 171 Beitrittsdatum: 23.09.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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.
thumbnail
Milen Dyankov, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 171 Beitrittsdatum: 23.09.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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.
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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
thumbnail
Lukas Matejka, geändert vor 14 Jahren.

RE: Maven?

New Member Beiträge: 4 Beitrittsdatum: 07.04.09 Neueste Beiträge
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?
thumbnail
Sampsa Sohlman, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 230 Beitrittsdatum: 27.09.07 Neueste Beiträge
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
thumbnail
Channing K Jackson, geändert vor 14 Jahren.

RE: Maven?

Junior Member Beiträge: 67 Beitrittsdatum: 13.11.08 Neueste Beiträge
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.
thumbnail
Sampsa Sohlman, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 230 Beitrittsdatum: 27.09.07 Neueste Beiträge
Wonderful!

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

I will sure check this.

- Sampsa
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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?

        <profile>
			<id>service builder profile</id>
 			<activation>
				<file>
					<exists>src/main/webapp/WEB-INF/service.xml</exists>
				</file>
			</activation>
</profile>


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:

			<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-war-plugin</artifactid>
				<configuration>
					<failonmissingwebxml>false</failonmissingwebxml> 
                              ...
</configuration></plugin>


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.
thumbnail
Milen Dyankov, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 171 Beitrittsdatum: 23.09.09 Neueste Beiträge
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.
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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:

topol@topolik:/work/liferay-maven-sdk/crm-portlets$ mvn package
...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.apache.commons.io.FileUtils.deleteQuietly(Ljava/io/File;)Z
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.deleteQuietly(Ljava/io/File;)Z
	at com.commsen.liferay.BuildService.execute(BuildService.java:135)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
...



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.
thumbnail
Milen Dyankov, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 171 Beitrittsdatum: 23.09.09 Neueste Beiträge
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! ;)
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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?):
Maven version: 2.0.8
Java version: 1.6.0_10
OS 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 ;)
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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
thumbnail
Milen Dyankov, geändert vor 14 Jahren.

RE: Maven?

Regular Member Beiträge: 171 Beitrittsdatum: 23.09.09 Neueste Beiträge
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.
thumbnail
Tomas Polesovsky, geändert vor 14 Jahren.

RE: Maven?

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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
thumbnail
Mika Koivisto, geändert vor 14 Jahren.

RE: Maven?

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
Just to let everyone know the official Liferay Maven SDK is finally here. Read more from my blog.
Ben R, geändert vor 11 Jahren.

RE: Maven?

New Member Beiträge: 7 Beitrittsdatum: 21.06.12 Neueste Beiträge

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