Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CAS development has traditionally used the Eclipse IDE. Choose the J2EE development configuration because it will come with support for WAR projects. It has been necessary to add support for Subversion and Maven to the base J2EE distribution, and it is recommended that you install the JBoss tools, at least the tool that starts and stops the JBoss server.

An Eclipse has its own project structure, but it will create an Eclipse project from a directory that contains a Maven POM. You just have to tell Eclipse that you are importing a Maven project. Typically Eclipse will create an Eclipse project for the parent directory (cas-server) and then a separate Eclipse project for each subdirectory of the parent that has a POM file. There will be some error messages for features like AspectJ that the JASIG POM uses but that the Eclipse plugin does not directly support. You can ignore such messages, because your actual compile, packaging, and deployment will be done running Maven and Eclipse is just a powerful file editor. When Eclipse does not find its own project files in a directory and therefore creates a project from the POM, it uses some default templates for some project options. If these defaults are wrong (say by choosing Java 1.6 as the compile level when you are running 1.7) then you may have to go back and manually change the options project by project.

In production deployment Jenkins compiles the source to produce JAR and WAR artifacts in the Yale Artifactory server. It then deploys the WAR artifact to the DEV, TEST, and PROD servers. In sandbox development on your desktop machine you create Eclipse shadow versions of the Jenkins Compile and Install jobs by using the Run Configurations ... settings to create Compile CAS and Install CAS Run jobs. Both jobs run Maven under Eclipse to do the same thing that Maven does under Jenkins. You choose an "install" target and the artifacts will be generated and stored in the local repository.

The development sandbox can be a Windows, Mac, or Linux machineproject is a directory with a .project and .classpath file. A Maven project is a directory with a pom.xml. If you check out a directory that has the Eclipse project files, then Eclipse will automatically know what to do. If you check out (or download from JASIG) a directory tree with Maven project files but no Eclipse files, then the M2E Maven plugin for Eclipse will examine the POM files and generate the necessary Eclipse project. Check out the directory into the Eclipse workspace, then do a File - Import - Existing Maven Projects. M2E will create a normal Java Eclipse project for a Maven JAR project, and it will create a J2EE Web Eclipse project for a Maven WAR project.

M2E does not have support for all the Maven plugins available, and CAS typically uses AspectJ and some other features. You can ignore the Maven messages about plugins that M2E doesn't handle because you will be running a real Maven batch build to create CAS rather than relying on the default compilation done by Eclipse every time you save a file.

M2E uses templates to create each type of Eclipse project. The template for a WAR project is configured for Java 1.6. If you want to use 1.7, you may have to change the project configuration manually after the default project is generated.

When CAS is built and then deployed to DEV, TEST, or PROD, the Jenkins Build job checks the source out of Subversion, runs Maven to build the artifacts, and then checks the artifacts into the Yale Artifactory repository server. The Install job then checks the WAR artifact out of Artifactory and copies it to the JBoss deploy directory.

Eclipse has Run Configurations. You can view them by selecting the Run - Run Configurations menu. Normally you think of using Run configurations to run an application, but once you install M2E there is also a Maven Build section. Here you can choose a particular Maven runtime directory, a set of goals ("clean install" for example), and some options to run Maven in a project directory. The recommendation is that on your sandbox machine you create two Maven Run Configurations, one equivalent to the Jenkins "trunk build" that creates the WAR artifact in the local Maven repository on the sandbox machine, and a second Install job that runs Maven to copy the artifact to your local JBoss deploy directory. Then you do the sandbox equivalent of the production Jenkins jobs by using Eclipse to Run the two configured jobs.

CAS development uses the Eclipse IDE (J2EE development configuration) with the Subversion and Maven plugins. On your desktop "sandbox" machine, CAS is deployed to a local copy of the JBoss server. In production, CAS is built and deployed using Jenkins.

...