Skip to content

Developing LARS in Eclipse

Billy edited this page Oct 21, 2019 · 17 revisions

Although you can build, run and test LARS using Gradle, it's also possible to develop LARS using Eclipse. These instructions guide you through the process of creating a LARS development environment in Eclipse.

  • Get Eclipse IDE For Java Developers

  • Install the Buildship Gradle Integration plugin for Eclipse

  • Clone the LARS git repository in Eclipse (if you haven't already cloned the repository through another method)

    • Open the Git perspective (Window -> Show View -> Other... -> Git Repositories)
    • In the toolbar of the Git Repositories view, click the button to "Clone a git repository"
    • Fill out the fields in the wizard
      • The URI for the main LARS repository is https://github.com/WASdev/tool.lars.git, this will then fill in most fields for you
      • The username and password are your github credentials. Note that if you use two-factor authentication, you will need to create a Personal Access Token and use that as your password, or use SSH keys instead.
      • On the next page, choose to clone all branches
      • On the next page, make a note of the destination directory, you'll need it for the next step
      • Do not select "Import all existing Eclipse projects after clone finishes" - we need to import the projects as Gradle projects, not as existing eclipse projects.
  • Import the LARS projects into Eclipse:

    • File -> Import -> Gradle -> Gradle Project
    • Give the root directory of your tool.lars source tree and click Next
    • Select the root project (tool.lars) in the resulting tree to select all projects
    • We don't (yet) have a Gradle wrapper, so you'll need to point to an existing install or select a Specific Gradle Version and use "4.10.2"
    • If you need to specify a particular version of Java, you may set the Java home directory
    • Click Next and then Finish

Note: at this point you will have errors in your workspace because some dependencies are provided by the liberty installation.

  • Configure the location of liberty and mongodb on your system

    • Switch back to the Java perspective
    • In the package explorer, copy /server/gradle.properties.template to gradle.properties, and open it for editing
    • Set libertyRoot to point to the wlp directory of your liberty installation
    • Set mongodExecutable to point to the mongod executable (named mongod.exe on Windows)
  • Run a Gradle refresh to pick up the changes

    • Select all projects -> Right-click -> Gradle -> Refresh Gradle Project
  • Build and test the code

    • Open the Gradle Tasks view (Window -> Show view -> Other... -> Gradle -> Gradle Tasks)
    • Double click on tool.lars/build/build
Clone this wiki locally