Fórum

Liferay maven theme merge error

thumbnail
Mario R, modificado 8 Anos atrás.

Liferay maven theme merge error

Junior Member Postagens: 55 Data de Entrada: 06/06/13 Postagens Recentes
Hello everyone!
I am trying to build Liferay Theme using maven plugin. The main idea is create a custom theme based on another custom theme.
Working with Liferay sdk the creation of custom theme based on another custom theme is so simple, we only need to add the reference to parent theme folder in the build.xml file.

I am susing Liferay 6.2..10.15 EE with eclipse (Liferay Studio)


<!--?xml version="1.0"?-->
<project name="custom-child-theme" basedir="." default="deploy">
   <import file="../build-common-theme.xml" />
   <property name="theme.parent" value="../custom-parent-theme" />
</project>


The pom.xml file for the parent theme (the parent theme inherits from _styled theme) is

<!--?xml version="1.0"?-->

<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">
	<modelversion>4.0.0</modelversion>
	<groupid>com.parent</groupid>
	<artifactid>custom-parent-theme</artifactid>
	<packaging>war</packaging>
	<name>custom-parent-theme Theme</name>
	<version>1.0</version>
	<build>
		<plugins>
			<plugin>
				<groupid>com.liferay.maven.plugins</groupid>
				<artifactid>liferay-maven-plugin</artifactid>
				<version>${liferay.maven.plugin.version}</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>theme-merge</goal>
							<goal>build-css</goal>
							<goal>build-thumbnail</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
					<appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
					<appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
					<appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
					<liferayversion>${liferay.version}</liferayversion>
					<parenttheme>${liferay.theme.parent}</parenttheme>
					<plugintype>theme</plugintype>
					<themetype>${liferay.theme.type}</themetype>
				</configuration>
			</plugin>
			<plugin>
				<artifactid>maven-resources-plugin</artifactid>
				<version>2.5</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-compiler-plugin</artifactid>
				<version>3.5.1</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>1.7
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-surefire-plugin</artifactid>
				<version>2.19.1</version>
				<configuration>
					<skiptests>true</skiptests>
				</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>com.liferay.portal</groupid>
			<artifactid>util-bridges</artifactid>
			<version>${liferay.version}</version>
			<scope>provided</scope>
		</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>
			<version>${liferay.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupid>javax.portlet</groupid>
			<artifactid>portlet-api</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>
		<liferay.theme.parent>_styled</liferay.theme.parent>
		<liferay.theme.type>vm</liferay.theme.type>
	</properties>
</project>


The pom.xml for the child theme (Child theme inherits from custom-parent-theme) is

<!--?xml version="1.0"?-->

<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">
	<modelversion>4.0.0</modelversion>
	<groupid>com.child</groupid>
	<artifactid>custom-child-theme</artifactid>
	<packaging>war</packaging>
	<name>custom-child-theme Theme</name>
	<version>1.0</version>
	<build>
		<plugins>
			<plugin>
				<groupid>com.liferay.maven.plugins</groupid>
				<artifactid>liferay-maven-plugin</artifactid>
				<version>${liferay.maven.plugin.version}</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>theme-merge</goal>
							<goal>build-css</goal>
							<goal>build-thumbnail</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
					<appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
					<appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
					<appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
					<liferayversion>${liferay.version}</liferayversion>
					<parenttheme>${liferay.theme.parent}</parenttheme>
					<plugintype>theme</plugintype>
					<themetype>${liferay.theme.type}</themetype>
				</configuration>
			</plugin>
			<plugin>
				<artifactid>maven-resources-plugin</artifactid>
				<version>2.5</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-compiler-plugin</artifactid>
				<version>3.5.1</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>1.7
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-surefire-plugin</artifactid>
				<version>2.19.1</version>
				<configuration>
					<skiptests>true</skiptests>
				</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>com.liferay.portal</groupid>
			<artifactid>util-bridges</artifactid>
			<version>${liferay.version}</version>
			<scope>provided</scope>
		</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>
			<version>${liferay.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupid>javax.portlet</groupid>
			<artifactid>portlet-api</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>
		<liferay.theme.parent>com.parent:custom-parent-theme:1.0</liferay.theme.parent>
		<liferay.theme.type>vm</liferay.theme.type>
	</properties>
</project>


But, when I tried to execute liferay merge(Liferay->Maven-Theme merge), I got the following exception:

[INFO] Building custom-child-theme Theme 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- liferay-maven-plugin:6.2.1:theme-merge (default) @ custom-child-theme ---
[INFO] Parent theme group ID com.parent
[INFO] Parent theme artifact ID custom-parent-theme
[INFO] Parent theme version 1.0
[INFO] Parent theme ID null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.829s
[INFO] Finished at: Thu Apr 14 14:15:32 COT 2016
[INFO] Final Memory: 7M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.1:theme-merge (default) on project custom-child-theme: The source must not be a directory. -&gt; [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.


Some idea? Its my configuration wrong? Some documentation for this case?


Thanks,
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: Liferay maven theme merge error

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Yes, for maven themes your parent theme has to be installed in your local repository. In it's directory, do a "mvn install" then come back to this one and try again.
thumbnail
Mario R, modificado 8 Anos atrás.

RE: Liferay maven theme merge error

Junior Member Postagens: 55 Data de Entrada: 06/06/13 Postagens Recentes
Thanks!

You are right!

Its working fine after mvn install (generate the war fine), but its does not work with eclipse hot deploy using eclipse m2e-liferay plugin (does not copy files in theme-resources folder). I solve this at the moment using File Sync eclipse plugin.
Suyash Bhalekar, modificado 6 Anos atrás.

RE: Liferay maven theme merge error

New Member Postagens: 24 Data de Entrada: 04/09/12 Postagens Recentes
Hi,

When you build child theme with Parent, Does it copy all the folders present in the Parent theme and does it reflect in child theme war?

In our case, we have some custom folders like "fonts" present under webcontent at same level where "css" folder is present.
When I build child theme by setting Parent as a base theme, It only copies "css", "template", "js" and "images" from parent theme. It even ignores the liferay related xml files as we are not mentioning it in child theme.

Regards,
Suyash B