This section will walk a developer through the steps of setting up Moves, on Windows or Linux. It does not cover OC4J installation, since that is covered elsewhere in this Wiki.
A machine running Windows or Linux. (This should work for Macs too... but the author does not use a mac).
Get as recent a version of the JDK as MIT IS&T support, and install the Java Cryptography Extension (JCE) Unlimited Strength FOR THAT JDK. Make sure you get the JDK, and not just the JRE. Also make sure that the JDK is the FIRST java found in your path, and that you have the System environment variable JAVA_HOME pointing to that JDK. To install the JCE, simply backup %JAVA_HOME%/jre/lib/security/local_policy.jar and %JAVA_HOME%/jre/lib/security/US_export_policy.jar with the copies in the JCE zip file. For my windows jdk, the location was C:/Program Files/Java/jdk1.6.0_29/jre/lib/security.
The complete setup of an OC4J container for IS&T is available here Environment Setup.
To set up your container for moves, go to Configuring a Moves container
type sudo apt-get install openssh-client
|
Moves does a WHOLE LOT of subversion activity. Unless you set yourself up for password-less authentication, you're gonna spend most of your life typing in your kerb username and password over and over again. Since you probably won't get an ssh private key installed on svn.mit.edu, you're gonna have to set yourself up with Kerberos. When we have Kerberos hooked up with svn, you'll only have to type in your username once per session. (A session lasts for about 10 hours). Sharing a production ssh key is not advisable (though it's been done).
If you weren't authenticated then
If you have 64 bit windows, install the 64 bit kerberos client first, from http://www.secure-endpoints.com/#kfw
For 32 bit AND 64 bit windows, install the 32 bit client from http://web.mit.edu/kerberos/dist/index.html#kfw-3.2
Restart windows if it asks you to
If all went well you should be able to open a (new) command prompt and type
C:/Program Files (x86)/PuTTY/plink svn.mit.edu
This time, instead of asking you at the command line to type in your username, a dialog box will pop up, looking something like this:
The beauty of this is that next time you type C:/Program Files (x86)/PuTTY/plink svn.mit.edu you will not be asked for your password.
Try it and see. You should get this step working before proceeding.
If all is well we should now be able to list subversion repositories without a password (or at least the second time we try listing a repository we should not get asked for a password. Try the following command twice. You should be asked for a password 0 or 1 times only. (0 if you're already authenticated with kerberos, 1 if you're not).
svn ls svn+ssh://svn.mit.edu/sais-sis-common/maven/releases/trunk
Get the latest 2.x version of maven from http://maven.apache.org/download.html (unless MIT IS&T is already on 3.x when you're reading this document).
Now we will export settings.xml into your maven m2 home directory from the bamboo build configuration repository (which should always have the latest/greatest version). If you've never used maven before, you will have to create the folder ${user.home}/.m2 (ie C:/Users/${your-user-name}/.m2 or /home/${your-user-name}/.m2). If this folder already exists, that's cool... but if it contains a file called settings.xml, rename it to settings.xml.backup
In a DOS box (or unix command shell), cd to ${user.home}/.m2
type svn export svn+ssh://svn.mit.edu/sais-sis-common/sais-common-conf/trunk/.m2/settings.xml
There should now be a new file in ${user.home}/.m2 called settings.xml.
You should see the message BUILD SUCCESSFUL in the log.
You should see the message BUILD SUCCESSFUL in the log.
(Currently moves does not run the unit tests, but this will be corrected).
You should see the message BUILD SUCCESSFUL in the log.
Moves can be deployed to any oc4j container, either remote or local. This is accomplished by using the maven-exec-plugin. If you know maven you can look at the pom.xml file to see what's going on. If you don't know maven, you shouldn't be modifying moves... but I will include an overview of how a deployment works.
<properties> ... <oc4j.j2eeHome>${user.home}/servers/oc4j/10.1.3.5/j2ee/home</oc4j.j2eeHome> <!-- this should not need to be changed --> <oc4j.adminJar>admin_client.jar</oc4j.adminJar> <!-- this will only need to be changed if you have changed the default admin name in your oc4j install --> <oc4j.username>oc4jadmin</oc4j.username> <!-- this will usually need to be changed (I believe the default is oc4jadmin) --> <oc4j.password>oc4jadmin</oc4j.password> <!-- this will work for most local installs --> <oc4j.connectionUri>deployer:oc4j:localhost</oc4j.connectionUri> <!-- context root is always '/moves' for moves--> <oc4j.contextRoot>/moves</oc4j.contextRoot> <oc4j.deploymentName>moves</oc4j.deploymentName> <oc4j.siteXml>default-web-site</oc4j.siteXml> </properties> |
The above is the default properties for deploying an app. We have configured the maven-exec-plugin such that when you type mvn exec:exec maven will execute the following command
java -jar ${oc4j.j2eeHome}/${oc4j.adminJar} deployer:oc4j:localhost ${oc4j.username} ${oc4j.password} -deploy -file ${the war file previously built by maven} -deploymentName ${oc4j.deploymentName} -bindAllWebApps ${oc4j.siteXml} -contextRoot ${oc4j.contextRoot} |
So by default calling mvn exec:exec will execute (on my machine)
java -jar C:/Users/eotoole/servers/oc4j/10.1.3.5/j2ee/home\admin_client.jar deployer:oc4j:localhost oc4jadmin oc4jadmin -deploy -file C:/Users/eotoole/WORKSPACE/sais-moves-web/target/sais-moves-web-2.0.2-SNAPSHOT.war -deploymentName moves -bindAllWebApps default-web-site -contextRoot /moves |
If you have installed oc4j into a different folder, or if you have a different oc4j administrative username/password you can specify overrides on the command line. For example, if you type mvn exec:exec -Doc4j.j2eeHome=C:/product/oc4j/j2ee/home -Doc4j.password=changeit then maven will execute
java -jar C:/product/oc4j/j2ee/home\admin_client.jar deployer:oc4j:localhost oc4jadmin changeit -deploy -file C:/Users/eotoole/WORKSPACE/sais-moves-web/taret/sais-moves-web-2.0.2-SNAPSHOT.war -deploymentName moves -bindAllWebApps default-web-site -contextRoot /moves |
If you need to add overrides, consider saving them in a batch file (for example oc4jDeploy.bat in your path). For example, I use:
mvn exec:exec -Doc4j.j2eeHome=C:\product\oc4j_extended_101350\j2ee\home -Doc4j.password=admin |
If you successfully deployed moves, you should be able to navigate to
http://localhost:8888/moves/admin/index.htm