Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document provides:

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

Table of Contents

1 - Getting Eclipse

Several of the developers are using Eclipse Mars with Web Developer Tools.  You IDE for Java Developers.  You can find them it here:

2 - Load Juneau projects into your workspace

  1. Start up your Eclipse workspace.

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

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

    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.
    Image RemovedImage Added 
     
  8. After a couple of minutes, you should see the following 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.

Image RemovedImage Added

  • 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:
    Image Added

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

4.2 - juneau-root projects

The juneau-core project contains all the serializers and parsers:

Image Removed

  • This project contains the vast majority of the code base.  
  • The Javadoc overview.html document is located in src/test/java.
  • Dependencies:
    • Apache Jena 2.7+ (optional) - Used for the RDF serializers and parsers.

The juneau-server project contains the REST Server API:

Image Removed

  • Dependencies:
    • Servlet 2.0+ (required)
    • JAX-RS (optional) - Used for JAX-RS providers in the org.apache.juneau.server.jaxrs package.

The juneau-client project contains the REST Client API:

Image Removed

  • Dependencies:
    • Apache HttpClient 4.5+ (required)

The juneau-microservice project contains the Microservice API:

Image Removed

  • The Dockerfile file is used for creating a docker container for the microservice.
  • Dependencies:
    • Eclipse Jetty 8.1+ (required)
    • Apache Jena 2.7+ (optional) - Needed if you want to use RDF support.
    • Apache HttpClient 4.5+ (optional) - Needed if you want to use the client API.
    • Apache Commons FileUpload 1.3.1+ (optional) - Needed if you want to upload multipart form posts.

holds the non-REST related Juneau projects.

Image Added

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

Image Added

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

Image Added

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

Image Added

The juneau-examples project hold the Juneau examples projects.

Image Added

The juneau-releng project holds release-related projects.

Image Added

4.3 - juneau-releng projects

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

Image Added

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

Image Added

4.4 - juneau-core projects

The juneau-config project contains the configuration API support.

Image Added

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

Image Added

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

Image Added

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

Image Added

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.

Image Added

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

Image Added

4.5 - juneau-rest projects

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

Image Added

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

Image Added

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

Image Added

4.6 - juneau-microservice projects

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

Image Added

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

Image Removed

The juneau-samples project is a microservice project that provides various examples for defining REST resources and custom serializers and parsers.

Image Removed

create their own microservice project.

Image Added

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

Image Added

4.7 - juneau-examples projects

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

Image Added

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

Image Added

  • The juneau-examples-rest.launch file The juneau-samples.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:
    Image Modified
  • The war/web.xml file is not used, but provides an example for deploying the microservice as a war file.
  • The samples.cfg file is the external configuration file for the microservice.  When built, a microservice consists of two files:  an executable jar and this config file.

The juneau-server-test project contains integration testcases for the REST Server and Client APIs:

Image Removed

  • The src/main/java folder contains a microservice that starts up on port 10001 with various test resources.
  • The src/test/java folder contains the JUnit testcases that make REST calls against the microservice.

The juneau-distrib project creates zips that contain the built libraries and source code for a release.

Image Removed

...

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-
  • samples
    • server-test/src/test/java
    • juneau-rest-
  • server
    • client-test/src/test/java
    • juneau

...

juneau-samples contains JUnits that make REST calls against the sample microservice running on port 10000.

...

    • -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.


 


Page properties
hiddentrue


Related issues