留言板

Bug? New Liferay Project from IDE does not work (unable to build)

Mikko Torri,修改在12 年前。

Bug? New Liferay Project from IDE does not work (unable to build)

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
When I create a new project from Eclipse (Indigo, IDE 1.5) it fails to build.

I've created a hook with portlet directly from the IDE, when I drag the build.xml to ant window it says: "Default target deploy does not exist in this project"

Deploy gives this:
Buildfile: D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml

BUILD FAILED
D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml:5: Cannot find D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\build-common-portlet.xml imported from D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml

Total time: 244 milliseconds

It says the same when run from command line.

Steps to reproduce:
1) Create New Liferay Project in Eclipse
2) Create a Hook
3) Check Advanced settings>Liferay Plugin>Portlet plugin as
4) Try to deploy

Mikko
thumbnail
Gregory Amerson,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Can you try to right-click your hook project and choose Liferay > SDK > Deploy and see if that works?
Mikko Torri,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
Gregory Amerson:
Can you try to right-click your hook project and choose Liferay > SDK > Deploy and see if that works?


It doesn't work either:
Buildfile: D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml

BUILD FAILED
D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml:5: Cannot find D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\build-common-portlet.xml imported from D:\liferay-6.1\liferay-plugins-sdk-6.1.0-ce-ga1\hooks\sample-hook\build.xml

Total time: 390 milliseconds

Here is the cause of it, build.xml:
<?xml version="1.0"?>
<!DOCTYPE project>

<project name="sample-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
</project>

So selecting portlet from the plugins causes the build.xml to be overwritten with portlet's build.xml. Of course there is no build-common-portlet.xml in the hooks folder of the sdk.

Mikko
thumbnail
Gregory Amerson,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Can you zip up your hook project and send it to me to take a look?
Mikko Torri,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
Mikko Torri,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
And as a follow up, if creating a plugin which would consist of hook and portlet functionalities, which plugin project should be taken as a base? Hook or Portlet?
thumbnail
Gregory Amerson,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
A portlet can contain hook functionality but not the other way around. However, if you deploy a hook.xml file in a portlet with the current 6.1.0 GA using the IDE it will create invokerFilter stackOverflow. so you will need to use the "SDK > Deploy" command to deploy instead of the "run on server" or the "add/remove modules" action in the IDE until 6.1.0 GA2 is released.
Mikko Torri,修改在12 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
Thanks for a quick answer. Then the original Bug is kind of invalid, since I created a hook with portlet functionalities in it.

One could argue though that that kind of configuration should not be possible through the IDE.
Nagalinga Pattar,修改在7 年前。

RE: Bug? New Liferay Project from IDE does not work (unable to build)

New Member 帖子: 2 加入日期: 14-9-24 最近的帖子
One of the following mistake:

1. The portlet one that you want to import should be placed under "portlets of Liferay-plugins-sdk".

2. build-common-portlet might have been missed in the "portlets of Liferay-plugins-sdk".