Moving Glast to maven2

compared with
Current by Massimiliano Turri
on Jul 10, 2009 09:22.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 7 changes. View first change.

 h1. Goal
  
 The goal is to develop a strategy to migrate all existing Glast projects from Maven1 to Maven2 is as unobtrusive a way as possible. The reasons to switch to maven2 are
  
 * Support for maven1 is fading away
 * Netbeans6, due to be released before end-of-year, has support for maven2 built-in (but not maven1)
 * Maven2 has many improvements, including simpler dependency management
  
 We will not be able to move all projects over-night, so we need a strategy for which order to move projects, and how projects which have moved can continue to co-exist with projects which have not moved. We will need to provide clear instructions to developers to allow them to move their projects.
  
 We should start with some simple projects, like org-glast-groupmanager.
  
 h2. Requirements
  
 * We need to maintain the features we have in maven1, including
 ** Ability to check projects out and build them in Netbeans
 ** Ability to deploy projects using the built-in netbeans tomcat server (Netbeans deploy)
 ** Ability to use in-place deploy so that JSP pages can be edited and the effects seen immediately without the need to redeploy
 ** Ability to deploy projects from netbeans to the development (tomcat03) and production (tomcat*) tomcat servers.
 * Ability for cruise-control to build projects. This should not be too hard since cruise-control has support for maven2
 * Ability to deploy snapshots and releases to a central Glast maven2 repository
 * Ability to deploy sites to [http://glast-ground.slac.stanford.edu/docs]
  
 h2. Possible additional features
  
 * Right now there is a lot of boiler-plate code which has to be copied into each new Glast project. For freehep Mark set things up so their was a master project which other projects inherited from so that we didn't have to repeat the same information in each sub-project. A maven "archetype" for Glast projects might also be a good way to achieve this.
 * Now that we have 12 tomcat servers it is difficult to remember which server each application should be deploy to. It would be nice to be able to do something like mvn \-Dmode=prod tomcat:deploy and have the application automatically deploy to the correct location. This would require some type of custom maven plugin which would talk to the glastgen database.
  
  
 h1. For Developers
  
 h2. Developing Projects
  
 h3. Parent Repository
  
 All projects have to specify in the pom file the repositories where to find the parent. So the following code is required in every project:
  
 {code:xml}
  <repositories>
  <repository>
  <id>glast-maven2</id>
  <name>GLAST Maven 2 central repository</name>
  <url>http://glast-ground.slac.stanford.edu/maven2</url>
  </repository>
  <repository>
  <id>glast-maven2-snapshots</id>
  <name>GLAST Maven2 central SNAPSHOTS repository</name>
  <url>http://glast-ground.slac.stanford.edu/maven2/SNAPSHOTS</url>
  </repository>
  </repositories>
 {code}
  
 h3. JAR
  
 h4. Parent
  
 A jar project should inherit from *org-glast-maven-jar-project*; so in your pom add:
  
 {code:xml}
  <parent>
  <groupId>glast</groupId>
  <artifactId>org-glast-maven-jar-project</artifactId>
  <version>1.2</version>
  </parent>
 {code}
  
 h3. WAR
  
 h4. Parent
  
 A jar project should inherit from *org-glast-maven-war-project*; so in your pom add:
  
 {code:xml}
  <parent>
  <groupId>glast</groupId>
  <artifactId>org-glast-maven-war-project</artifactId>
  <version>1.2</version>
  </parent>
 {code}
  
 h4. Final Name
  
 The final name of the war file is to be set in the pom file as:
  
 {code:xml}
  <build>
  <finalName>ServerMapping</finalName>
  </build>
 {code}
  
 This name is the name of the produced war file and it must be identical to the Application's context. It is also used by the Maven Tomcat Deploy plugin to find the production deployment server.
  
 h4. Source Location
  
 Maven2 expects the source files to be located in _src/main/webapp_. Some of our projects have the source code in _src/webapp_. To tell maven2 to look in the latter location add the following to your pom file:
  
 {code:xml}
  <build>
  <plugins>
  <plugin>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
  <warSourceDirectory>${basedir}/src/webapp</warSourceDirectory>
  </configuration>
  </plugin>
  </plugins>
  </build>
 {code}
  
 h3. SCM Plugin
  
 CVS repositories cannot be inherited by the parent pom, so each project will have to add the following lines to their pom file:
  
 {code:xml}
  <scm>
  <connection>scm:cvs:pserver:anoncvs@glast-java.slac.stanford.edu:/cvs/java:${artifactId}</connection>
  <developerConnection>scm:cvs:ext:@glast-java.slac.stanford.edu:/cvs/java:${artifactId}</developerConnection>
  <url>http://www-glast.stanford.edu/cgi-bin/viewcvs/${artifactId}/?root=java</url>
  </scm>
 {code}
  
 h3. Tomcat manager authentification
  
 To be able to deploy to a tomcat server it is necessary to provide the manager's username and password. This can be done in a file called *settings.xml* located in your *HOME\.m2* directory.
  
 For GLAST you have to add the *glastServer* server element as shown below:
  
 {code:xml}
 <?xml version="1.0" encoding="UTF-8"?>
 <settings>
  <servers>
  <server>
  <id>glastServer</id>
  <username>glast</username>
  <password>GammaRay</password>
  </server>
  </servers>
 </settings>
 {code}
  
 h3. Automatic version
  
 To have the version number picked up automatically from the pom file add the following lines to web.xml
  
 {code:xml}
  <context-param>
  <param-name>
  version
  </param-name>
  <param-value>
  ${pom.version}
  </param-value>
  </context-param>
 {code}
  
 and the following to the jsp:
  
 {code:xml}
 Version: ${initParam.version}
 {code}
  
 h1. List of Modules in javacvs
  
 h2. Current Projects
  
 || Module Name || Converted || In Hudson || Comments || Contact ||
 | org-glast-dataportal-history | (x) | | | tony |
 | org-glast-dataportal-portal | (x) | | | tony |
 | org-glast-asp-skimmer | (x) | | | tony |
 | org-glast-dataportal-skimmer-fits | (x) | | | tony |
 | org-glast-dataportal-wired | (x) | | | tony |
 | org-glast-skimmer-web | (x) | | Obsolete? | tony |
 | org-glast-dataportal-xroot-gateway | (x) | | Obsolete? | tony |
 | org-glast-dataserver-portal | (x) | | | tony |
 | org-glast-dataserver-web | (x) | | | tony |
 | org-glast-downloadmanager | (x) | | | tony |
 | org-glast-confluence | (x) | | | tony |
 | org-glast-countdown-clock | (x) | | | tony |
 | org-glast-pipeline-server | (x) | | | dan |
 | org-glast-pipeline-web | (x) | | | tony |
 | org-glast-groupmanager-example | (x) | | | tony |
 | org-glast-elog-web | (x) | | | Tony |
 | org-glast-glossary | (x) | | | Chuck |
 | org-glast-elog-base | (x) | | | Tony |
 | org-glast-clock | (x) | | | tony |
 | org-glast-maven-project | (/) | (/) \\ | | max |
 | org-glast-maven-jar-project | (/) | (/) \\ | | max |
 | org-glast-maven-jar-archetype | (/) | (/) \\ | | max |
 | org-glast-maven-war-project | (/) | (/) | | max |
 | org-glast-maven-war-archetype | (/) | (/) | | max |
 | org-glast-maven-aida-project | (/) | (/) | | max |
 | org-glast-tomcat-deploy-maven-plugin | (/) | (/) | | max |
 | org-glast-base-web | (/) | (/) | | max |
 | org-glast-base-application | (/) | (/) | | max |
 | org-glast-servermapping | (/) | (/) | | max |
 | org-glast-groupmanager | (/) | (/) \\ | Unnecessary dependence on aidatld. Still on branch \\ | tony |
 | org-glast-dataportal-astro-model | (/) | (/) \\ | | tony |
 | org-glast-datahandling-common | (/) | (/) | | tony |
 | org-glast-telemetry-trending | (/) | (/) | | max |
 | org-glast-telemetry-trending-web | (/) | (/) | | max |
 | org-glast-resources | (/) | (/) | | charlotte |
 | org-glast-shiftschedule-web | (/) | (/) | | charlotte |
 | org-glast-runquality | (/) | (/) | | karen |
 | org-glast-historyprocessing | (/) | (/) | | karen |
 | org-glast-speakersbureau-web | (/) | (/) | | karen |
 | org-glast-latba-web | (/) | (/) | | dan k |
 | org-glast-dataportal-model | (/) | (/) | Version 1.8 but depends on SNAPSHOTs | tony |
 | org-glast-jobcontrol | (/) | (/) | Version 1.8 | tony |
 | org-glast-servermon-web | (/) | (/) | | max |
 | org-glast-dataportal-simpleskimmer | (/) | (/) | Unnecessary dependence on aidatld | tony |
 | org-glast-latcatalog-web | (/) | (/) | | roberto |
 | org-glast-aspdataviewer-web | (/) | (/) | | roberto |
 | org-glast-dataprocessing-web | (/) | (/) | | max |
 | org-glast-pipeline-client | (/) | (/) | | tony |
 | org-glast-commons-web | (/) | (/) | | max |
 | org-glast-datacat-client | (/) | | Version is 2.3.2 but depends on SNAPSHOTs. Test do not work | dan |
 | org-glast-datacat-sp | (/) | (/) | Version is 2.2.1, but depends on SNAPSHOTs | dan|
 | org-glast-isoc-cfgwebbrowser | (/) | (/) | | jim |
 | org-glast-fcwebview | (/) | (/) | | jim |
 | org-glast-telemetry-apidstats | (/) | (/) | | jim |
 | org-glast-telemetry-monitor-web | (/) | (/) | | jim |
 | org-glast-telemetry-rtdisplay-web | (/) | (/) | | jim |
 | org-glast-reports-web | (/) | (/) | Depends on SNAPSHOT version of jas-plotter on a branch. | max |
 | org-glast-releasemanager | (/) | (/) | Contains both new *rm2* and old *releasemanager* application | karen |
 | org-glast-dataportal-astro | (/) | | | tony |
| org-glast-dataportal-history | (x) | | | tony |
 | org-glast-dataportal-portal | (x) | | | tony |
 | org-glast-asp-skimmer | (x) | | | tony |
 | org-glast-dataportal-skimmer-fits | (x) | | | tony |
 | org-glast-dataportal-wired | (x) | | | tony |
 | org-glast-skimmer-web | (x) | | Obsolete? | tony |
 | org-glast-dataportal-xroot-gateway | (x) | | Obsolete? | tony |
 | org-glast-dataqualitymonitoring | (/) | (/) | | max |
 | org-glast-dataqualitymonitoring-web | (/) | (/) | | max |
 | org-glast-systemtests-web | (/) | (/) | | max |
| org-glast-dataserver-portal | (x) | | | tony |
 | org-glast-dataserver-web | (x) | | | tony |
 | org-glast-cas-server | (/) |(/) | | tony |
| org-glast-downloadmanager | (x) | | | tony |
 | org-glast-confluence | (x) | | | tony |
 | org-glast-countdown-clock | (x) | | | tony |
 | org-glast-pipeline-server | (x) | | | dan |
 | org-glast-pipeline-web | (x) | | | tony |
 | org-glast-datacatalog-web | (/) | | | tony |
 | org-silicondetecor-web | (/) | | | karen |
| org-glast-groupmanager-example | (x) | | | tony |
 | org-glast-datacat-server | (/) | | crawler | tony |
 | org-glast-isoc-mpwebview | (/) | (/) | | jim |
| org-glast-elog-web | (x) | | | Tony |
 | org-glast-visitor-web | (/) | (/) | | Karen |
 | org-glast-glossary | (x) | | | Chuck |
 | org-glast-elog-base | (x) | | | Tony |
 | org-glast-clock | (x) | | | tony |
  
 h3. Not to be converted
  
 || Module Name || Comments || Contact ||
 | tomcat | Doesnt need to be converted | tony |
 | org-glast-installer-gui | Ant Project | tony |
 | TomcatConfigurationBuilder | Netbeans project | tony |
 | oracle | Doesnt need converting | tony |
  
 h2. Unknown Projects
  
 These should be either upgraded to current projects or demoted to obsolete.
  
 || Module Name || Converted || In Hudson || Comments || Contact ||
 | org-glast-isoc-common | (x) | | | steve (?) |
 | org-glast-logging | (x) | | Is this a duplicate of _org-glast-isoc-logging_? | steve (?) |
 | org-glast-isoc-logging | (x) | | | steve, jim, max (?) |
 | org-glast-calibrationtrending | (x) | | Obsolete (?) | max |
 | org-glast-calibrationtrending-web | (x) | | Obsolete (?) | max |
 | org-glast-util-grep | (x) | | | tony (?) |
 | org-glast-dataflow-web | (x) | | | (?) |
 | org-glast-monitor | (x) | | | (?) |
  
  
 h2. Obsolete Projects
  
 They will be moved to a different directory (*obsolete*) in the cvs repository.
  
 || Module Name || || Moved || Comments || Contact ||
 | org-glast-tld-timeline | (!) | | *Obsolete* Used to be standalone application but now it is in MPWebView | jim, steve |
 | org-glast-cas-client-example | (!) | | *Obsolete* first Matt's example using ageci | tony |
 | org-glast-fcmonitor | (!) | | *Obsolete* | bryson (?) |
 | org-glast-fcwebview-portlet | (!) | | *Obsolete* | max |
 | org-glast-portlet | (!) | | *Obsolete* | max |
 | org-glast-portlet-base | (!) | | *Obsolete* | max |
 | org.glast.portlet | (!) | | *Obsolete* | max |
 | org-glast-portlets | (!) | | *Obsolete* | max |
 | org-glast-skeleton-portlet | (!) | | *Obsolete* | max |
 | org-glast-portal-theme | (!) | | *Obsolete* | max |
 | org-glast-grbmonitoring-web | (!) | | *Obsolete* | roberto |
 | org-glast-asdc-sourceviewer | (!) | | *Obsolete* | roberto |
 | org-glast-asp-sourceviewer | (!) | | *Obsolete* | roberto |
 | datacatalog-web | (!) | | *Obsolete* | tony |
 | org-glast-datamonitoring | (!) | | *Obsolete* | max |
 | org-glast-web-base-application | (!) | | *Obsolete* | max |
 | org-glast-datamonitoring-web | (!) | | *Obsolete* | max |
 | org-glast-trendable-db | (!) | | *Obsolete* | max |
 | org-glast-pipeline-log | (!) | | *Obsolete* | tony |
 | org-glast-pipeline-xml | (!) | | *Obsolete* | tony |
 | org-glast-pipeline-core | (!) | | *Obsolete* | tony |
 | org-glast-batch | (!) | | *Obsolete* | tony |
 | org-glast-telemetry-trends | (!) | | *Obsolete* | max |
 | org-glast-sourcemonitoring | (!) | | *Obsolete* | max |
 | org-glast-sourcemonitoring-web | (!) | | *Obsolete* | max |
 | org-glast-maven-web-project | (!) | | *Obsolete* | max |
 | org-glast-fastmonitoring | (!) | | *Obsolete* | max |
 | org-glast-fastmonitoring-web | (!) | | *Obsolete* | max |
 | org-glast-maven-plugin-parent | (!) | | *Obsolete* | matt |
 | org-glast-maven-xmlbeans-plugin | (!) | | *Obsolete* | matt |
 | org-glast | (!) | | *Obsolete* | matt |
 | org.glast.test | (!) | | *Obsolete* | matt |
 | org-glast-hello | (!) | | *Obsolete* | matt |
 | org-glast-profile | (!) | | *Obsolete* | matt |
 | org-glast-common | (!) | | *Obsolete* | matt |
 | org-glast-runquality-web | (!) | | *Obsolete* | karen |
 | org-glast-historyprocessing-web | (!) | | *Obsolete* | karen |
 | org-glast-mc-requests | (!) | | *Obsolete* | karen |