Ivy support in the latest IDE
Table of Contents [-]
- ivy.xml dependencies
- IvyDE enabled projects with Liferay IDE
- Remove the IvyDE toolbar contribution
In the latest version portal 6.2.0 and 6.1.2 versions of Plugins SDK have added support for using Ivy for dependency management. This means that some of the projects created by SDK will have their own ivy.xml file in the project root.
ivy.xml dependencies #
Any project that is created in SDK contains an ivy.xml file(e.g. JSF projects). The ivy.xml file can resolve ivy-module and liferay ivy libraries.
Manually configure IvyDE plugin for projects that have already been created #
- Create a liferay portlet project
- Open Eclipse with Liferay IDE installed
- Open Preferences pag(Go to Window> Properences) for Liferay> Installed Plugin SDKs to install the SDK, Server> Runtime Environments to install the Server
- Create a portlet project(Go to File> New> Liferay Project), add project name, then Finish
- Let us configure IvyDE plugin into the project
- Right click project, go Configure> Add Ivy dependency management. After that you can see "Ivy" in the menu
- Copy an correct ivy.xml file into the project
- Right click project, go Properties> Java Build Path> Libraries> Add Library...> choose IvyDE Managed Dependencies> Next. You can see the default ivy.xml file in the Ivy File part, then Finish.
- Right click project, go Ivy> Refresh
- Then you can see IvyDE plugin already added to the project.
Note: If the ivy.xml file has error, it probably because the revision version in these<dependency name="liferay-faces-X"...> tags are not right. So you need to change the revision first then create the project.
IvyDE enabled projects with Liferay IDE #
Starting with 2.0M1 of Liferay IDE it will come bundled with IvyDE plugin. A project that is created in the SDK contains an ivy.xml file, the New Liferay Wizard will automatically add a Ivy nature, add an Ivy container to use Plugins SDK cache and ivy-settings.xml from the Plugin SDK and will also automatically invoke the resolve for the container.
IvyDE nature #
After the project is created with ivy.xml file in. Open '.project' file in your project's folder. You will see there is a"<nature>org.apache.ivyde.eclipse.ivynature</nature>" tag for IvyDE had been added.
Ivy classpath container settings #
Right click the Ivy library in the project. Go Properties> you can see the Classpath Container,click Settings. In Ivy settngs path part, ivy-settings.xml from the Plugin SDK automatically invoke the resolve for the container.
Dependencies automatically resolved at the end of wizard #
Right click the project, go Ivy> Resolve. The dependencies will automatically resoved. If there is something wrong with ivy.xml file, a popup window would show "Problem Occurred".
Validation/build works on project with no error on xml files #
To make the project correct, the xml file should be no error. If the ivy.xml incorrect, you should modify the revision version first.
Remove the IvyDE toolbar contribution #
In your Eclipse there is an IvyDE toolbar, if you want to remove it, you can go Window> Customize Perspective...> unselect "toolbar"> OK. Then you will see the IvyDE had gone. If you want to add it back, just do the same steps select the "toolbar" then click OK, the toolbar will be back.