Is it possible to have the Liferay SDK in a different place than the source code?

I would like to ask you about the best development methods using the Liferay SDK. I have the SDK loaded, Eclipse is ready for me, it works, I can create new portlets and run a local Liferay instance to test it.

Here is my situation - I have all the source code in the Eclipse workspace, at the moment these are only the portlets I'm working on.

Liferay SDK I have a completely different place than the workspace. Let them say ~ / dev / liferay_sdk. The Eclipse workspace is in ~ / workspace.

In the beginning, he did not work like that. Eclipse for some reason cannot find or use the Liferay SDK. When I changed the “Project Verification” in the Eclipse / Liferay configuration to “Ignore”, “Liferay Plugin SDK is invalid”, it started working without problems.

The next problem arises when you have to build a WAR, for example. In the portlet directory in the workspace there is a file called "build.xml". But internally, this refers to another XML file, which should be located in one directory up, and this applies for the most part in relative location, etc.

In short, it assumes that you have portlets, etc. inside the Liferay SDK. Like "~ / dev / liferay_sdk / portlets".

My question is: am I completely wrong, or could you offer me best practices with this?

SDK , .

!

+5
3

, , SDK Liferay Plugins. , Liferay IDE Eclipse, . , , Liferay IDE . Eclipse Liferay SDK, .

Git. . , build.xml, ant . :

<project name="your-portlet" basedir="." default="deploy">
    <property file="build.properties" />

    <property name="project.dir" value="${liferay.sdk.home}" />

    <import file="${project.dir}/build-common-plugin.xml" />
</project>

, "liferay.sdk.home" build.properties SDK Liferay Plugins.

Liferay (, ..), . , :

<import file="${project.dir}/themes/build-common-theme.xml" />

, .:) , - .

+2

Liferay SDK Liferay Plugins, SDK .

-SDK , togather, :

liferay github, -SDK.

, liferay ( IDE), ( , ) , , SDK, portlets, hooks ..

Liferay IDE ( Liferay) IDE SDK , , SDK .settings, .classpath .project . , eclipse .

, , , .

+1

, , :

, . , . Eclipse - , Eclipse , ( - ?) .

Liferay OOTB ant scripts: : SDK. , , , build.xml ( ).

- maven - sdk ( IDE Liferay), , maven .

(, , - ), , : . , , SDK, , , , . , , .

Of course, what you missed with this solution is neat processing, including build. $ {username} .properties - you will need to have your own build.properties, which define $ {liferay.sdk.home}. If you do not work in a team, this is normal. Otherwise, you will have to invent it yourself (and encode it) or rely on global parameters that you need to configure with each member of the team.

0
source

All Articles