Pierpaolo Cira
Pierpaolo Cira

Reputation: 1477

Wrong portlet version and deploy problems with Maven

I created a new portlet plugin (build based on Maven) by using Liferay IDE.

If I launch a mvn liferay:deploy, deploy process ends successfully. But if run the same process (deploy) another time, the deploy fails.

Updating my-portlet from version 6.2.5 to version 0.1
Not updating my-portlet because version 6.2.5 is newer than version 0.1

I declared <version>0.1-SNAPSHOT</version> in my pom.xml file, but Liferay tells me (also in control panel) that plugin installed version is 6.2.5.

I'm using Liferay CE 6.2 (ga6), and following settings:

<liferay.version>6.2.5</liferay.version>
<liferay.maven.plugin.version>6.2.5</liferay.maven.plugin.version>

That are used (excluding portal dependecies) only in the following lines:

        <plugin>
            <groupId>com.liferay.maven.plugins</groupId>
            <artifactId>liferay-maven-plugin</artifactId>
            <version>${liferay.maven.plugin.version}</version>
            <executions>...</executions>
            <configuration>
                <liferayVersion>${liferay.version}</liferayVersion>
                ...

Do you have any idea about my problem?

Thank you.

EDIT The problem is the same (portlet version 6.2.5) also by setting liferay.version and/or liferay.maven.plugin.version to 6.2.4...

Upvotes: 1

Views: 919

Answers (2)

Pierpaolo Cira
Pierpaolo Cira

Reputation: 1477

and thanks for comments and reply.

I think I found a solution, and I would like to share it for future readers... because I didn't find it on the web... or better, it is on the web, but isn't related to this issue.

My original (Maven) module name was (due to project original specifications): client-external-customer-portlet, so resulting WAR was client-external-customer-portlet-0.1-SNAPSHOT.war Someone on the web suggested to remove dashes from portlet name - in order to avoid a well-known Spring-mvc-portlet error. I resolved my issue just applying the same suggestion to my portlet name: now it is clientExternalCustomerPortlet and resulting WAR is clientExternalCustomerPortlet-0.1-SNAPSHOT.war. In this way everything works fine.

My 5 cents are that LR deploy system uses dashes as special separators also in the deploy process.

By the way I get this idea when, deploying client-external-theme-0.1-SNAPSHOT.war, logs said that the context name was only client-ext.

I hope it can be useful.

Upvotes: 1

The problem is that liferay starts with version 6.2.5 in your case, and you are trying to deploy a 0.1 version that is older than by default on Liferay.

I would try to deploy the portlet without version, just delete from name-portlet forward.

Portletname-portlet.war

In that case, liferay takes the version 6.2.5 like portlet version and deploy it succesfully.

Upvotes: 0

Related Questions