留言板

Maven Bug - must close the portlet-service module

Christophe Noel,修改在10 年前。

Maven Bug - must close the portlet-service module

Junior Member 帖子: 99 加入日期: 12-9-28 最近的帖子
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,修改在10 年前。

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

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Hey Christophe,

How are you launching this maven build? Through Eclipse UI or manually through command line?
Christophe Noel,修改在10 年前。

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

Junior Member 帖子: 99 加入日期: 12-9-28 最近的帖子
hi Greg,

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

Christophe.
thumbnail
Gregory Amerson,修改在10 年前。

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

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
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,修改在9 年前。

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

New Member 发布: 1 加入日期: 14-3-12 最近的帖子
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,修改在9 年前。

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

Junior Member 帖子: 99 加入日期: 12-9-28 最近的帖子
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,修改在9 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在9 年前。

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

Junior Member 帖子: 99 加入日期: 12-9-28 最近的帖子
David,

Yes you're right.
Thanks.
thumbnail
tamallah seifedine,修改在6 年前。

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

New Member 帖子: 13 加入日期: 14-6-15 最近的帖子
Hey,
Deleting the generated content in the xxx\workspaces\liferayIde-2.0\mapViewer\mapViewer-portlet-service\target folder should fix the problem .