eclipse_m2.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. _quickstart_eclipse_m2:
  2. Eclipse M2 Quickstart
  3. =====================
  4. This guide is designed to get developers up and running as quick as possible. For a more comprehensive guide see the :ref:`eclipse_guide`.
  5. `M2Eclipse <https://www.eclipse.org/m2e/>`_ provides tight integration for Apache Maven into the Eclipse IDE.
  6. .. include:: checkout.txt
  7. Eclipse Maven builder
  8. ---------------------
  9. The maven build supplied with eclipse works with the :file:`pom.xml` files, however it does recognize some of our custom build steps:
  10. #. Go to Preferences and navigate to :menuselection:`Maven --> Errors/Warning`
  11. #. Change the :guilabel:`Plugin execution not covered by lifecycle configuration` to ``Warning``.
  12. .. figure:: img/m2_warning.png
  13. :scale: 50%
  14. java-cc-maven-plugin
  15. --------------------
  16. The Eclipse M2 builder does recognize this plugin, build once on the command line first:
  17. #. Navigate to `:file:`src/wcs1_1``.
  18. #. Compile, to force the code to be generated::
  19. mvn compile
  20. ::
  21. [INFO] --- javacc-maven-plugin:2.3:jjtree (jjtree) @ gs-wcs1_1 ---
  22. Java Compiler Compiler Version 4.0 (Tree Builder)
  23. (type "jjtree" with no arguments for help)
  24. "src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/ASTFieldId.java" does not exist. Will create one.
  25. ...
  26. Annotated grammar generated successfully in src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/rangeset.jj
  27. [INFO]
  28. [INFO] --- javacc-maven-plugin:2.3:javacc (javacc) @ gs-wcs1_1 ---
  29. Java Compiler Compiler Version 4.0 (Parser Generator)
  30. (type "javacc" with no arguments for help)
  31. Reading from file src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/rangeset.jj . . .
  32. File "TokenMgrError.java" does not exist. Will create one.
  33. File "ParseException.java" does not exist. Will create one.
  34. ...
  35. Parser generated successfully.
  36. [INFO]
  37. [INFO] --- fmt-maven-plugin:2.4.0:format (default) @ gs-wcs1_1 ---
  38. [debug] Using AOSP style
  39. [INFO] Processed 47 files (0 reformatted).
  40. [INFO]
  41. Import modules into Eclipse
  42. ---------------------------
  43. #. Use :menuselection:`File --> Import` to open the :guilabel:`Import` wizard.
  44. Select :menuselection:`Maven --> Existing Maven Projects` import wizard, and :guilabel:`Next`.
  45. #. Define the :guilabel:`Root Directory` by browsing to the GeoServer :file:`src` folder.
  46. #. Open :guilabel:`Advanced` options:
  47. * Profiles: :kbd:`release`
  48. * Name template: :kbd:`[groupId].[artifactId]`
  49. .. figure:: img/m2_import.png
  50. :scale: 50%
  51. #. Press :guilabel:`Finish` to start import.
  52. During import use ``Resolve Later``, exclude lifecycle mapping.
  53. .. figure:: img/m2_plugin_connectors.png
  54. :scale: 50%
  55. Run GeoServer from Eclipse
  56. --------------------------
  57. #. From the ``Package Explorer`` select the ``web-app`` module
  58. #. Navigate to the ``org.geoserver.web`` package
  59. #. Right-click the ``Start`` class and navigate to ``Run as``, ``Java Application``
  60. .. figure:: img/eclipse_run1.jpg
  61. :width: 80%
  62. #. After running the first time you can return to the ``Run Configurations`` dialog
  63. to fine tune your launch environment (including setting a GEOSERVER_DATA_DIR).
  64. .. note::
  65. If you already have a server running on localhost:8080 see the :ref:`eclipse_guide` for instructions on changing to a different port.
  66. Access GeoServer front page
  67. ---------------------------
  68. * After a few seconds, GeoServer should be accessible at: `<http://localhost:8080/geoserver>`_
  69. * The default ``admin`` password is ``geoserver``.