留言板

Liferay 6.1 GA 1, Maven Theme Creation not working

Abhishek Dhingra,修改在12 年前。

Liferay 6.1 GA 1, Maven Theme Creation not working

Junior Member 帖子: 51 加入日期: 11-4-8 最近的帖子
Hello All,

I was trying to create a new Theme in Liferay 6.1 GA1. I followed the same steps mentioned in the blog:

http://www.liferay.com/web/mika.koivisto/blog/-/blogs.

When i try to execute 'Maven Package' using Eclipse, i am getting the below error.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:theme-merge (default-cli) on project cip-theme: Execution default-cli of goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:theme-merge failed: A required class was missing while executing com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:theme-merge: Lorg/codehaus/plexus/archiver/manager/ArchiverManager;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Anyone, could you please help me in resolving the same.

Thanks,
Abhishek
Paul Kearney,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

New Member 帖子: 6 加入日期: 11-3-1 最近的帖子
Just tried this myself and did not hit this issue. Any chance that you have missing dependencies? I created the theme project in Eclipse (with Liferay IDE plugin) using the embedded m2eclipse/Maven install so I did this slightly differently from the steps in the blog were the command line is used to invoke maven.

The only changes I made from the pom generated by the archetype goal was to change the following pom properties:
  • liferay.version from 6.1.0-SNAPSHOT to 6.1.0
  • liferay.auto.deploy.dir from ../bundles/deploy to C:\path\to\liferay\6.1.0-ce-ga1\deploy (the location on my machine of the liferay deploy directory

Did you do similar? These where the 2 changes pointed out as being required in the blog post.

In the hope that providing the pom.xml that I ended up with may help here it 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.liferay.sample</groupid>
	<artifactid>sample-theme</artifactid>
	<packaging>war</packaging>
	<name>sample-theme Theme</name>
	<version>0.0.1-SNAPSHOT</version>
	<build>
		<plugins>
			<plugin>
				<groupid>com.liferay.maven.plugins</groupid>
				<artifactid>liferay-maven-plugin</artifactid>
				<version>${liferay.version}</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>theme-merge</goal>
							<goal>build-thumbnail</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
					<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>
				<configuration>
					<encoding>UTF-8</encoding>
				</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.auto.deploy.dir>C:\path\to\liferay\6.1.0-ce-ga1\deploy</liferay.auto.deploy.dir>
		<liferay.theme.parent>_styled</liferay.theme.parent>
		<liferay.theme.type>vm</liferay.theme.type>
		<liferay.version>6.1.0</liferay.version>
	</properties>
</project>
Abhishek Dhingra,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

Junior Member 帖子: 51 加入日期: 11-4-8 最近的帖子
Hello Paul,

Thanks much for the detailed reply. I tried the same steps also using Eclipse IDE and also i compared my POM.xml with the POM.xml provided by you.I didn't find any difference in both.

Also, i checked it is downloading the plexus correctly.

Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:theme-merge (default) on project theme: Execution default of goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:theme-merge failed: Unable to load the mojo 'theme-merge' in the plugin 'com.liferay.maven.plugins:liferay-maven-plugin:6.1.0'. A required class is missing: Lorg/codehaus/plexus/archiver/manager/ArchiverManager;

Please advise.

Thanks,
Abhishek
Paul Kearney,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

New Member 帖子: 6 加入日期: 11-3-1 最近的帖子
Hi Abhishek,

I've had a quick google to see if there are any other references to a problem such as yours and came across this: http://jira.codehaus.org/browse/MNG-2690 Maven bug report. The bug is closed for Maven version 2.10 but does suggest that something similar to this may be happening and as a result you are getting a Maven plugin classpath issue. It is reported as fixed at 2.10 but I can't see anything in the comments that actually points to this having happened so I it may still be an issue.

Unfortunately the bug report suggests that diagnosing which part of the classpath is having issues may not be that simple. When I ran the mvn package goal it took a long time to download the various dependencies. It looks to me like you may have a corrupt repository entry at some level.

The quickest things I can suggest are:

  • If you are on a version of Maven before 2.10 upgrade to the latest and try again - if the bug is truly fixed this should either resolve the issue or at least tell you more about the missing dependency.
  • If your version of Maven is above 2.10 then rename your repository to old i.e for me this would be C:\Users\Paul\.m2\repository -> C:\Users\Paul\.m2\repository-old. Kick off the mvn package goal again and go for a walk whilst Maven downloads the dependencies again - this time hopefully without the same issue.


Suggestion 2 is a bit of a brute force approach but is worth a try. I've worked with Maven a long time and it by and large works well but when you hit some of these issues it is a pain.

Hope one of the above works for you.

Cheers,

Paul
Abhishek Dhingra,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

Junior Member 帖子: 51 加入日期: 11-4-8 最近的帖子
Hello Paul,

Thanks much for the detailed reply. I upgraded my Maven version to the latest one (3.0.4) and tried removing the 'repository' folder but none of the things worked for me.

Regards,
Abhishek
Paul Kearney,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

New Member 帖子: 6 加入日期: 11-3-1 最近的帖子
Hi,

I take it that the failure was the same as before? Can you post your pom file as I can then try that to see if I have a similar issue or not?

Cheers,

Paul
thumbnail
Mika Koivisto,修改在12 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

Liferay Legend 帖子: 1519 加入日期: 06-8-7 最近的帖子
It seems that when you ran that it was unable to download plexus which is required by the plugin. Make sure your maven can download the required dependencies from either Central or a mirror of Central.
thumbnail
Kousik Kumar Das,修改在10 年前。

RE: Liferay 6.1 GA 1, Maven Theme Creation not working

New Member 帖子: 7 加入日期: 11-5-9 最近的帖子
Hi,
The Maven theme creation is failing because the dependencies were not downloaded properly into your local maven repository from Central. Actually, during "liferay:theme-merge" goal execution, maven downloads a portal-web.<liferay-version>.war into your local maven repository, and from that war it extracts the artifacts of parent theme to include into your theme project. Please check that the file is present and/or fully downloaded inside your local maven repository.
portal-web war is available at "<local-maven-repo>/com/liferay/portal/portal-web/<liferay-version>/"

Thanks,
Kousik
Developing Liferay Portal based web since 2010