Installing Add-ons in Eclipse with Ivy

If you have a project that uses Apache Ivy to resolve dependencies, they should be listed in the ivy.xml file in the project root. Vaadin Directory allows downloading add-ons from a Maven repository, which can also be accessed by Ivy.

You can also use Ivy to resolve dependencies in an Ant script.

  1. Open the add-on page in Vaadin Directory.

  2. Select the version. The latest is shown by default, but you can choose another the version from the dropdown menu in the header of the add-on details page.

  3. Click the Maven/Ivy to display the Ivy dependency declaration, as illustrated in Figure Ivy Dependency Declaration. If the add-on is available with multiple licenses, you will be prompted to select a license for the dependency.

    directory ivy dependency

    Ivy Dependency Declaration

  4. Open the ivysettings.xml in your Eclipse project either in the XML or Ivy Editor (either double-click the file or right-click it and select Open With Ivy Editor).

    Check that the settings file has the <ibiblio> entry given in the Directory page. It should be, if the file was created by the Vaadin project wizard in Eclipse. If not, copy it there.

  1. ```
  2. <chain name="default">
  3. ...
  4. <ibiblio name="vaadin-addons"
  5. usepoms="true"
  6. m2compatible="true"
  7. root="https://maven.vaadin.com/vaadin-addons"/>
  8. ...
  9. </chain>
  10. ```
  11. If you get Vaadin addons from another repository, such as the local repository if you have compiled them yourself, you need to define a resolver for the repository in the settings file.
  1. Open the ivy.xml in your Eclipse project and copy the Ivy dependency to inside the dependencies element. It should be as follows:
  1. ```
  2. <dependencies>
  3. …​
  4. <dependency org="com.vaadin.addon"
  5. name="vaadin-charts"
  6. rev="1.0.0"/>
  7. </dependencies>
  8. ```
  9. You can specify either a fixed version number or a dynamic revision tag, such as latest.release. You can find more information about the [dependency declarations](http://ant.apache.org/ivy/history/2.1.0/ivyfile/dependency.html) in Ivy documentation.
  10. If the ivy.xml does not have a &lt;configurations defaultconfmapping="default-&gt;default"&gt; defined, you also need to have conf="default-&gt;default" in the dependency to resolve transient dependencies correctly.
  11. IvyIDE immediately resolves the dependencies when you save the file.
  1. Compile the add-on widget set by clicking the Compile Vaadin Widgetset button in the toolbar.

    widgetset compiling toolbar

    Compiling Widget Set in Eclipse

If you experience problems with Ivy, first check all the dependency parameters. IvyDE can sometimes cause unexpected problems. You can clear the Ivy dependency cache by right-clicking the project and selecting Ivy Clean all caches. To refresh Ivy configuration, select Ivy Refresh. To try resolving again Ivy, select Ivy Resolve.