This document provides:

  • A set of instructions for new developers of Juneau to get their Eclipse workspace up-and-running.

1 - Getting Eclipse

Several of the developers are using Eclipse IDE for Java Developers.  You can find it here:

2 - Load Juneau projects into your workspace

  1. Start up your Eclipse workspace.

  2. Open up Java Perspective
    Window → Perspective → Open Perspective → Java
     
  3. Open up Git Repositories view:
    Window → Show View → Other → Git → Git Repositories 
     
  4. In the view, click the "Clone a Git Repository and add the clone to this view":  

  5. Enter the information for the Juneau Git Repository.  Then click next.


    The URI for the Juneau project is https://gitbox.apache.org/repos/asf/juneau.git
    Use your GitHub user/password.
     
  6. In the Branch Selection page, select only the master branch.  Then click next.


  7. In the Local Destination page, select a location where your local Git repository will reside.  
    Note that this is NOT the same location as your workspace. 
    Make sure to select the checkbox for importing all the projects into your workspace.
    Then click finish.
     
     
  8. After a couple of minutes, you should see various projects loaded into your workspace:
     

  9. If you see the project "my-microservice" in your workspace, you can remove it (but don't delete from the file system!).
    This is being picked up from the .project file inside juneau-microservice-template/build-overlay used to create the starter template project and not a project by itself.

  10. If you see warnings about JavaSE-1.7, you can go to... 
    Preferences → Java → Installed JREs → Execution Environments
    ....and map an existing JVM (e.g. Java 8).
    The core Juneau libraries still support Java 7 as of release 7.2.1.
    The current plan is to prereq Java 8 in Juneau 8.0.

3 - Loading code style preferences (optional)

Various code style preferences are located in the /juneau-root/eclipse-preferences directory.

  • juneau-code-templates.xml - Import via Preferences → Java → Code Style → Code Templates → Import.
  • juneau-formatter.xml - Import via Preferences → Java → Code Style → Formatter → Import.
  • juneau-organize-imports.importorder - Import via Preferences → Java → Code Style → Organize Imports → Import.

4 - Overview of projects

4.1 - juneau-root

The juneau-root project contains the top-level contents of the Git repository.  It contains all the other sub-projects.

  • The contents of the README.md file show up on the GitHub mirror page.
  • The pom.xml file builds the entire project.
  • The launches folder contains launchers that show up in the external-launchers menu:


  • The eclipse-preferences folder contains the Juneau style preferences described previously.

4.2 - juneau-root projects

The juneau-core project holds the non-REST related Juneau projects.

The juneau-doc project contains the code for generating the Javadocs.

The juneau-rest project holds the REST related Juneau projects.

The juneau-microservice project holds the microservice related Juneau projects.

The juneau-examples project hold the Juneau examples projects.

The juneau-releng project holds release-related projects.

4.3 - juneau-releng projects

The juneau-all project holds the assembly instructions for building the Juneau uber-jar.

The juneau-distrib project holds the assembly instructions for building source and binary releases.

4.4 - juneau-core projects

The juneau-config project contains the configuration API support.

The juneau-core-test project contains all the unit tests for the juneau-core projects.

The juneau-dto project contains the predefined Juneau DTO beans such as HTML5 beans and Swagger beans.

The juneau-marshall project contains the majority of the Juneau code.
It includes the core library framework and most of the serializers and parsers.

The juneau-marshall-rdf project contains the RDF serializers and parsers.
These rely on the Apache Jena library and so are defined in a separate module.

The juneau-svl project contains the Simple Variable Language API.

4.5 - juneau-rest projects

The juneau-rest-client project contains the REST client API.

The juneau-rest-server project contains the REST server API.

The juneau-rest-server-jaxrs contains optional JAX-RS providers for Juneau serializers and parsers.

4.6 - juneau-microservice projects

The juneau-microservice-server project contains the code for running Jetty-based microservices.

The juneau-microservice-template project is used to create a template zip that can be loaded into a fresh Eclipse workspace for developers to create their own microservice project.

The juneau-microservice-test project contains tests for the microservice code and also tests that involve both the client and server APIs together.

4.7 - juneau-examples projects

The juneau-examples-core project is used to hold examples for the core component (serializers, parsers, etc...).

The juneau-examples-rest project is a fully-functional REST microservice app containing various REST-related examples.

  • The juneau-examples-rest.launch file is used to run the samples microservice from your Eclipse workspace.  
    It starts up a REST microservice on port 10000 with various samples:

5 - Using Maven to build projects

The project can be built using maven from a command line by running the following in the workspace root:

     mvn clean package

6 - JUnit Tests

JUnit tests are located in the following locations:

    • juneau-core-test/src/test/java
    • juneau-rest-server-test/src/test/java
    • juneau-rest-client-test/src/test/java
    • juneau-microservice-test/src/test/java/.../_TestSuite.java
    • juneau-examples-rest/src/test/java/.../_TestSuite.java

Each of the above locations can be executed via Run As->JUnit Test.

The projects with _TestSuite.java classes are function tests that start/stop the microservice as part of the setup/teardown of the suite class.  The other projects consist solely of unit tests.