This document provides:
- A set of instructions for new developers to get their Eclipse workspace up-and-running.
1 - Getting Eclipse
Several of the developers are using Eclipse Mars with Web Developer Tools. You can find them here:
- https://marketplace.eclipse.org/content/eclipse-web-developer-tools-0 (look for the install button to drag-and-drop to your workspace).
Luna or Neon can also be used.
2 - Load Juneau projects into your workspace
- Start up your Eclipse workspace.
- Open up Java Perspective:
- 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.
- 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 the following projects loaded into your workspace:
(sorry....some of the names have changed)
3 - Loading code style preferences
Various code style preferences are located in the
juneau-code-templates.xml- Import via Properties->Java Code Style->Code Templates.
juneau-formatter.xml- Import via Properties->Java Code Style->Formatter.
juneau-organize-imports.importorder- Import via Properties->Java Code Style->Organize Imports.
4 - Overview of projects
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.
juneau-core project contains all the serializers and parsers:
- This project contains the vast majority of the code base.
- The Javadoc
overview.htmldocument is located in
- Apache Jena 2.7+ (optional) - Used for the RDF serializers and parsers.
juneau-rest project contains the REST Server API:
- Servlet 2.0+ (required)
- JAX-RS (optional) - Used for JAX-RS providers in the org.apache.juneau.server.jaxrs package.
juneau-rest-client project contains the REST Client API:
- Apache HttpClient 4.5+ (required)
juneau-microservice project contains the Microservice API:
- The Dockerfile file is used for creating a docker container for the microservice.
- 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.
juneau-microservice-template project is a template project that is meant for developers to import into their own workspace as a starting point for creating their own microservice.
juneau-examples-rest project is a microservice project that provides various examples for defining REST resources and custom serializers and parsers.
juneau-examples.launchfile is used to run the samples microservice from your Eclipse workspace.
It starts up a REST microservice on port 10000 with various samples:
war/web.xmlfile is not used, but provides an example for deploying the microservice as a war file.
samples.cfgfile is the external configuration file for the microservice. When built, a microservice consists of two files: an executable jar and this config file.
juneau-rest-test project contains integration testcases for the REST Server and Client APIs:
src/main/javafolder contains a microservice that starts up on port 10001 with various test resources.
src/test/javafolder contains the JUnit testcases that make REST calls against the microservice.
juneau-distrib project creates zips that contain the built libraries and source code for a release.
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 contains strict JUnit tests. They can be run as-is.
The easiest way to run these is to right-click on the project and do Run As->JUnit Test.
juneau-examples-rest contains JUnits that make REST calls against the sample microservice running on port 10000.
The easiest way to run these is to right-click on the src/test/java/org.apache.juneau.examples.rest/_TestSuite.java class and do Run As->JUnit Test.
juneau-rest-test contains JUnits that make REST calls against the test microservice running on port 10001.
The easiest way to run these is to right-click on the src/test/java/org.apache.juneau.rest.test/_TestSuite.java class and do Run As->JUnit Test.
Note that you can also run the latter two at the project level too, but it's faster to run the _TestSuite class since it's optimized to only start up the microservice once.