You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

addons-eclipse.asciidoc 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ---
  2. title: Installing Add-ons in Eclipse with Ivy
  3. order: 3
  4. layout: page
  5. ---
  6. // This section is excluded from the print edition
  7. [[addons.eclipse]]
  8. = Installing Add-ons in Eclipse with Ivy
  9. If you have a project that uses Apache Ivy to resolve dependencies, they should be listed in the [filename]#ivy.xml# file in the project root.
  10. Vaadin Directory allows downloading add-ons from a Maven repository, which can also be accessed by Ivy.
  11. You can also use Ivy to resolve dependencies in an Ant script.
  12. . Open the add-on page in Vaadin Directory.
  13. . Select the version. The latest is shown by default, but you can choose another
  14. the version from the dropdown menu in the header of the add-on details page.
  15. . Click the [guilabel]#Maven/Ivy# to display the Ivy dependency declaration, as
  16. illustrated in Figure <<figure.addons.eclipse.ivybutton>>. If the add-on is
  17. available with multiple licenses, you will be prompted to select a license for
  18. the dependency.
  19. +
  20. [[figure.addons.eclipse.ivybutton]]
  21. .Ivy Dependency Declaration
  22. image::img/directory-ivy-dependency.png[]
  23. . Open the [filename]#ivysettings.xml# in your Eclipse project either in the XML
  24. or Ivy Editor (either double-click the file or right-click it and select "Open
  25. With > Ivy Editor").
  26. +
  27. Check that the settings file has the [literal]#++<ibiblio>++# entry given in the
  28. Directory page. It should be, if the file was created by the Vaadin project
  29. wizard in Eclipse. If not, copy it there.
  30. +
  31. ----
  32. <chain name="default">
  33. ...
  34. <ibiblio name="vaadin-addons"
  35. usepoms="true"
  36. m2compatible="true"
  37. root="https://maven.vaadin.com/vaadin-addons"/>
  38. ...
  39. </chain>
  40. ----
  41. +
  42. If you get Vaadin addons from another repository, such as the local repository
  43. if you have compiled them yourself, you need to define a resolver for the
  44. repository in the settings file.
  45. . Open the [filename]#ivy.xml# in your Eclipse project and copy the Ivy dependency
  46. to inside the [literal]#++dependencies++# element. It should be as follows:
  47. +
  48. [subs="normal"]
  49. ----
  50. &lt;dependencies&gt;
  51. ...
  52. &lt;dependency org="**com.vaadin.addon**"
  53. name="**vaadin-charts**"
  54. rev="**1.0.0**"/&gt;
  55. &lt;/dependencies&gt;
  56. ----
  57. +
  58. You can specify either a fixed version number or a dynamic revision tag, such as
  59. [literal]#++latest.release++#. You can find more information about the
  60. link:http://ant.apache.org/ivy/history/2.1.0/ivyfile/dependency.html[dependency
  61. declarations] in Ivy documentation.
  62. +
  63. If the [filename]#ivy.xml# does not have a [literal]#++<configurations
  64. defaultconfmapping="default->default">++# defined, you also need to have
  65. [literal]#++conf="default->default"++# in the dependency to resolve transient
  66. dependencies correctly.
  67. +
  68. IvyIDE immediately resolves the dependencies when you save the file.
  69. . Compile the add-on widget set by clicking the [guilabel]#Compile Vaadin Widgetset# button in the toolbar.
  70. +
  71. [[figure.addons.eclipse.toolbar]]
  72. .Compiling Widget Set in Eclipse
  73. image::img/widgetset-compiling-toolbar.png[width=50%, scaledwidth=60%]
  74. If you experience problems with Ivy, first check all the dependency parameters.
  75. IvyDE can sometimes cause unexpected problems. You can clear the Ivy dependency
  76. cache by right-clicking the project and selecting "Ivy > Clean all caches". To
  77. refresh Ivy configuration, select "Ivy > Refresh". To try resolving again Ivy,
  78. select "Ivy > Resolve".