Create a Project through Maven over Liferay 6.x

We are going to create a project thru Maven
mvn archetype:generate
the generated maven pom.xml will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <groupId>com.xyz.socialportal.portlet</groupId>
        <artifactId>microblogs</artifactId>
        <version>4.1.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.xyz.socialportal.portlet.microblogs</groupId>
    <artifactId>microblogs-service</artifactId>
    <packaging>jar</packaging>
    <name>microblogs Portlet Service</name>

    <build>
        <plugins>
            <plugin>
                <groupId>com.liferay.maven.plugins</groupId>
                <artifactId>liferay-maven-plugin</artifactId>
                <version>${liferay.maven.version}</version>
                <configuration>
                    <webappBaseDir>${basedir}/../microblogs-portlet</webappBaseDir>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.liferay.portal</groupId>
            <artifactId>portal-service</artifactId>
            <version>${liferay.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.6</version>
        </dependency>

    </dependencies>
</project>

If you neede more details about maven, please go through micha kop's blog
http://www.hascode.com/2011/07/creating-portlets-with-java-server-faces-2-and-liferay/

No comments:

Post a Comment