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
- Start up your Eclipse workspace.
- Open up Java Perspective:
Window → Perspective → Open Perspective → Java
- Open up Git Repositories view:
Window → Show View → Other → Git → Git Repositories
- In the view, click the "Clone a Git Repository and add the clone to this view":
- 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.
- In the Branch Selection page, select only the master branch. Then click next.
- 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.
- After a couple of minutes, you should see various projects loaded into your workspace:
- 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.
- 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-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.mdfile show up on the GitHub mirror page.
pom.xmlfile 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.
juneau-examples-rest.launchfile 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:
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.