Updated Build Instructions (markdown)

master
jricher 2013-04-25 12:32:37 -07:00
parent cc74a946c1
commit 46cb40dc5c
1 changed files with 17 additions and 23 deletions

@ -1,4 +1,4 @@
This project uses Maven as its build system. The project makes use of both Git submodules (to include dependencies on SECOAUTH) and Maven submodules (to organize components), which makes compilation a little tricky. This project is tested to build on Java 6 and Java 7. It uses Maven as its build system, and should run on both Maven 3.0+ and Maven 2.2. The project makes use of Maven submodules to organize components.
# Git Checkout and Initialization # Git Checkout and Initialization
@ -6,16 +6,6 @@ Check out the project using a normal Git clone command:
`git clone https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server.git` `git clone https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server.git`
Change into the newly checked out directory and initialize the Git submodules:
`git submodule update --init --recursive`
This will ensure you have a full checkout of both the OpenID Connect project and the SECOAUTH dependency. This command **must** be re-run whenever the reference to the upstream project changes.
## A Note about Git Submodules
A Git submodule stores not only a reference to a particular Git repository (which is bound to a directory through the .gitmodules file) but also a reference to a **specific revision** of that repository. Therefore, if the reference to the submodule is updated, this shows up as a change in the parent module. If there are any local changes checked in to the submodule, and this reference is pushed up to the repository, this will break the build for anyone pulling down updates since their local copy of the submodule will not have the revision now referenced by the parent project.
# Project Layout # Project Layout
The project has a hierarchical layout: The project has a hierarchical layout:
@ -24,20 +14,24 @@ The project has a hierarchical layout:
+-- openid-connect-common +-- openid-connect-common
+-- openid-connect-client +-- openid-connect-client
+-- openid-connect-server +-- openid-connect-server
\-- spring-security-oauth
+-- spring-security-oauth2
The root of the project contains a pom.xml file that references all sub-modules. The root of the project contains a `pom.xml` file that references all sub-modules and manages dependencies for the entire project.
# Building with Maven # Building with Maven
The project uses the Maven "package" directive to build from the root of the project: The project uses the Maven `package` directive to build from the root of the project:
`mvn package` `mvn package`
By building in the root, Maven automatically builds all dependencies. Building directly in the submodules will likely fail as the cross-dependencies on other portions of the project (such as the server's dependency on common) will not have been built yet. By building in the root, Maven automatically builds all dependencies across. Building directly in the submodules will often fail as the cross-dependencies on other portions of the project (such as the server's dependency on common) will not have been built yet.
This recursively builds the spring-security-oauth library as well as all portions of the project. The build process produces a .jar file for openid-connect-common and openid-connect-client and a .war file for openid-connect-server. The build process produces a .jar file for openid-connect-common and openid-connect-client and a .war file for openid-connect-server in the following directories:
openid-connect-client/target/openid-connect-client-{VERSION}.jar
openid-connect-common/target/openid-connect-common-{VERSION}.jar
openid-connect-server/target/openid-connect-server.war
Where `{VERSION}` is the current build version of the project such as `0.9.3-SNAPSHOT`.
## Common Maven Options ## Common Maven Options
@ -45,7 +39,7 @@ To skip unit tests, add this option:
`mvn -DskipTests package` `mvn -DskipTests package`
To skip JavaDoc generation (which is triggered automatically in SECOAUTH): To skip JavaDoc generation:
`mvn -Dmaven.javadoc.skip=true package` `mvn -Dmaven.javadoc.skip=true package`
@ -55,13 +49,13 @@ To configure an http and https proxy, add this option (especially because Maven
## Data Connection ## Data Connection
The project is configured out of the box to connect to a MySQL server running on localhost with a default database name of "oic", and a default username of "oic" with a password of "oic". To change these, edit the dataContext.xml configuration file (or use an alternative method like MVN War Overlays). Be very careful to not check in any sensitive passwords or other information (such as the connection configuration to any integration or production servers) to the repository. The server is configured out of the box to use an in-memory HyperSQL database (hsqldb). All data that the server stores, such as tokens, clients, and user authorizations, will be lost when the server is shut down. In order to persist data for longer than a single session, it is necessary to change the data source as configured in `openid-connect-server/src/main/webapp/WEB-INF/data-context.xml`.
## JCE The server is auto-configured with one client and four users, which are enumerated in the file `openid-connect-server/src/main/resources/db/clients.sql` and `openid-connect-server/src/main/resources/db/users.sql`. These files are automatically loaded by the hsqldb data source and can be augmented with other clients and users.
The project uses JCE through BouncyCastle. Your system may be set up to handle this already, in which case no further action is needed. ## Java Cryptographic Extensions (JCE)
If you run into javax.crypto.JceSecurity errors, do the following: The project uses JCE through BouncyCastle which may require special installation. If you run into javax.crypto.JceSecurity errors, do the following:
1. Add the BouncyCastle Provider to your JRE/JDK, per instructions at http://www.bouncycastle.org/wiki/display/JA1/Provider+Installation/ 1. Add the BouncyCastle Provider to your JRE/JDK, per instructions at http://www.bouncycastle.org/wiki/display/JA1/Provider+Installation/
@ -71,6 +65,6 @@ If you run into javax.crypto.JceSecurity errors, do the following:
# Deploying with Tomcat # Deploying with Tomcat
To deploy the Server, copy the generated .war file to the tomcat directory, such as: To deploy the Server, copy the generated .war file to the tomcat `webapps` directory, such as:
`cp openid-connect-server/target/openid-connect-server.war /var/lib/tomcat6/webapps` `cp openid-connect-server/target/openid-connect-server.war /var/lib/tomcat6/webapps`