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< ;/modelversion> <groupId>com.walmart</groupId> <artifactid>maven-build-theme</artifactid > <packaging>war</packaging> <name>maven-build-theme theme</name> <version> ;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>
; </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> <PROPERTIES&G
T <liferay.theme.parent>_styled</liferay.theme.parent> <liferay.theme.type>vm</liferay.theme .type> </properties> </project>