Liferay use maven to create theme

Source: Internet
Author: User
Tags xmlns

After learning the ant build theme, Liferay theme, we easily ported the theme project to Maven. The following are the specific steps:

Assume:

Because we used the http://supercharles888.blog.51cto.com/609344/890525 development structure as shown in the article, let's assume we put the theme we're developing in D:\WalmartProject.

First: Let's use the Maven Theme Wizard to create a theme:

Once created, because we want our pom.xml to inherit Father Pom, we add <parent> elements to the top of Pom.xml and point to Father Pom, as shown in line 05-10, Since our Liferay.dir and liferay.auto.deploy.dir have already been defined in the father's Pom file, removing the Liferay.dir and Liferay.auto.deploy.dir properties of the wizard generated in line 94-97, the end of our project th The EME pom.xml are as follows:

<?xml version= "1.0"?> <project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= 1/xmlschema-instance "xsi:schemalocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_ 0.xsd "> <parent> <groupId>com.walmart</groupId> <artifactid>walmart- Parent-pom</artifactid> <version>1.0-SNAPSHOT</version> <relativepath> /walmart-parent-pom.xml</relativepath> </parent> <modelversion>4.0.0&lt ;/modelversion> <groupId>com.walmart</groupId> <artifactid>maven-build-theme</artifactid > <packaging>war</packaging> <name>maven-build-theme theme</name> <version&gt ;0.0.1-snapshot</version> <build> <plugins> <plugin> & Lt;groupid>com.liferay.maven.plugins</groupId> <artifactId>liferay-maven-plugin</artifactId> <version>${lifera 
                        Y.version}</version> <executions> <execution> <phase>generate-sources</phase> <goals> <g 
                        Oal>theme-merge</goal> <goal>build-thumbnail</goal> </goals> </execution> </executions> <conf 
                    Iguration> <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir> <liferayVersion>${liferay.version}</liferayVersion> <parenttheme>${liferay.them E.parent}</parenttheme> <pluginType>theme</pluginType> <the Metype>${liferay.theme.type}</themetype> </configuration> </plugin> <plugin> 
                    <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin&gt 
        ; </plugins> </build> <dependencies> <dependency> <groupid>com .liferay.portal</groupid> <artifactId>portal-service</artifactId> <version& 
        Gt;${liferay.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.liferay.portal</groupId> <artifactid>util-b Ridges</artifactid> <version>${liferay.version}</version> <scope>provide D</scope&gT 
            </dependency> <dependency> <groupId>com.liferay.portal</groupId> 
            <artifactId>util-taglib</artifactId> <version>${liferay.version}</version> <scope>provided</scope> </dependency> <dependency> <groupid >com.liferay.portal</groupId> <artifactId>util-java</artifactId> <versio 
        N>${liferay.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.portlet</groupId> <artifactid>portlet-a 
        Pi</artifactid> <version>2.0</version> <scope>provided</scope> 
            </dependency> <dependency> <groupId>javax.servlet</groupId> <artifActid>servlet-api</artifactid> <version>2.4</version> <scope>provided </scope> </dependency> <dependency> <groupid>javax.servlet.jsp</ 
            Groupid> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> </dependencies> &LT;PROPERTIES&G 
        T <liferay.theme.parent>_styled</liferay.theme.parent> <liferay.theme.type>vm</liferay.theme .type> </properties> </project>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.