Foros de discusión

Maven Bug - must close the portlet-service module

Christophe Noel, modificado hace 10 años.

Maven Bug - must close the portlet-service module

Junior Member Mensajes: 99 Fecha de incorporación: 28/09/12 Mensajes recientes
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 hace 10 años.

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

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
Hey Christophe,

How are you launching this maven build? Through Eclipse UI or manually through command line?
Christophe Noel, modificado hace 10 años.

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

Junior Member Mensajes: 99 Fecha de incorporación: 28/09/12 Mensajes recientes
hi Greg,

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

Christophe.
thumbnail
Gregory Amerson, modificado hace 10 años.

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

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
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 hace 9 años.

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

New Member Mensaje: 1 Fecha de incorporación: 12/03/14 Mensajes recientes
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 hace 9 años.

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

Junior Member Mensajes: 99 Fecha de incorporación: 28/09/12 Mensajes recientes
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 hace 9 años.

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

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
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 hace 9 años.

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

Junior Member Mensajes: 99 Fecha de incorporación: 28/09/12 Mensajes recientes
David,

Yes you're right.
Thanks.
thumbnail
tamallah seifedine, modificado hace 6 años.

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

New Member Mensajes: 13 Fecha de incorporación: 15/06/14 Mensajes recientes
Hey,
Deleting the generated content in the xxx\workspaces\liferayIde-2.0\mapViewer\mapViewer-portlet-service\target folder should fix the problem .