Fórum

Maven Bug - must close the portlet-service module

Christophe Noel, modificado 10 Anos atrás.

Maven Bug - must close the portlet-service module

Junior Member Postagens: 99 Data de Entrada: 28/09/12 Postagens Recentes
Dear all,

When trying to compile a Maven project including Liferay Service (created using the IDE wizard), I always get a strange issue: maven complains about portlet-service access rights, EXCEPTED if I close the "portlet-service" module in Eclipse.

I have tried to uncheck "Resolve dependancies from Workspace projects" in all modules, but the error remains.
Can you explain me what happens ?

Thanks for your help!

Here below is the exception message:

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project mapViewer-portlet: Failed to copy file for artifact [xxx.plugins:mapViewer-portlet-service:jar:1.0.0-SNAPSHOT:compile]: xxx\workspaces\liferayIde-2.0\mapViewer\mapViewer-portlet-service\target\classes (Access is denied) -> [Help 1]
[ERROR]
thumbnail
Gregory Amerson, modificado 10 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Hey Christophe,

How are you launching this maven build? Through Eclipse UI or manually through command line?
Christophe Noel, modificado 10 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Junior Member Postagens: 99 Data de Entrada: 28/09/12 Postagens Recentes
hi Greg,

Yes, through Eclise UI, I'm using the "Liferay/Maven/liferay:deploy".

Christophe.
thumbnail
Gregory Amerson, modificado 10 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Hey Christophe,

Can you create a small standalone example? Zip up the projects and attach them here? If we can reproduce the issue we can try to find a fix (or workaround until a fix is ready). Thanks.
thumbnail
Joel Cruz, modificado 9 Anos atrás.

RE: Maven Bug - must close the portlet-service module

New Member Mensagem: 1 Data de Entrada: 12/03/14 Postagens Recentes
Hello Everyone,

I think I have a solution for this as I experienced a similar situation. I believed the problem is that Maven when no build finalName is specified it defaults to artifactName + artifactVersion. When Liferay deploys the portlet it strips the version from the un-packaged directory. To resolved it I simply explicitly declared a build final names in all pom.xml. For example: <finalName>${project.artifactId}</finalName>. As a result when referencing the project build ROOT the name will always be the same. This also applies to the service.jar, the reference dir is $project.artifactid but maven looks for dir is $project.artifactid + $project.version.

Regards,
Joel
Christophe Noel, modificado 9 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Junior Member Postagens: 99 Data de Entrada: 28/09/12 Postagens Recentes
This simply occurs on any Maven project of a Liferay Service.

I have found that when using the Run as / Maven install (as shown below), I don't have any problem anymore :


Instead of using Liferay / Maven / deploy(shown below) which leads to the error :


I would like to understand the difference between Maven install and Liferay / Maven / Deploy if anyone may help me.
Thanks,

Christophe.
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Christophe Noel:
I would like to understand the difference between Maven install and Liferay / Maven / Deploy if anyone may help me.


Well maven install just installs the artifact in your local repository.

Liferay maven deploy is supposed to copy the artifact to the "deploy" folder of your bundle so Liferay will pick it up and install it.

Personally, I'm old school. I still run maven and ant from the command line. May seem old fashioned, but it eliminates possible sources of problems, such as eclipse in this case. If your command works at the command line, that points to an IDE issue. If it fails on the command line, well that points to a Maven issue.
Christophe Noel, modificado 9 Anos atrás.

RE: Maven Bug - must close the portlet-service module

Junior Member Postagens: 99 Data de Entrada: 28/09/12 Postagens Recentes
David,

Yes you're right.
Thanks.
thumbnail
tamallah seifedine, modificado 6 Anos atrás.

RE: Maven Bug - must close the portlet-service module

New Member Postagens: 13 Data de Entrada: 15/06/14 Postagens Recentes
Hey,
Deleting the generated content in the xxx\workspaces\liferayIde-2.0\mapViewer\mapViewer-portlet-service\target folder should fix the problem .