Several of the developers are using Eclipse Mars with Web Developer Tools. You IDE for Java Developers. You can find them it here:
Luna or Neon can also be used.
2 - Load Juneau projects into your workspace
- Start up your Eclipse workspace.
- Open up Java Perspective:
Window ->Perspective->Open Perspective->Java→ Perspective → Open Perspective → Java
- Open up Git Repositories view:
Window ->Show View->Other->Git->Git Repositories→ 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 now
Use your Apache 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 the following various projects loaded into your workspace:
(sorry....some of the names have changed)
- 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
Various code style preferences are located in the
juneau-code-templates.xml - Import via Properties->Java Preferences → Java → Code Style ->Code → Code Templates → Import.
juneau-formatter.xml - Import via Properties->Java Preferences → Java → Code Style ->Formatter→ Formatter → Import.
juneau-organize-imports.importorder - Import via Properties->Java Preferences → Java → Code Style ->Organize → 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.
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 contains all the serializers and parsers:
- This project contains the vast majority of the code base.
- The Javadoc
overview.html document 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.
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.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:
war/web.xml file is not used, but provides an example for deploying the microservice as a war file.
examples.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.
juneau-rest-test project contains integration testcases for the REST Server and Client APIs:
src/main/java folder contains a microservice that starts up on port 10001 with various test resources.
src/test/java folder 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:
Each of the above locations can be executed via 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.