This document will provide detail into the steps necessary to convert the existing OpenPTK ant based project to a maven based project. Jira issue OPENPTK-107 will be used to track the progress of a potential migration to maven. As quoted from the Apache Maven site: "Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model
(POM), Maven can manage a project's build, reporting and documentation from a central piece of information." Deployment Plan
File StructureThe high level structure of a maven project is based on similar principals already used in the OpenPTK ant bases structure. Below is a table that attempts to show a couple of similarities in convention in the way that maven recommends a project layout and how OpenPTK does it today. The only real difference is the injection of a couple directories (main, test) which hold the projects "main" code and "test" code.
The way we organize each of the OpenPTK projects today still applies in a maven project structure. Maven InfoA maven pom.xml file includes several top level items that define each maven project. The required items are organized into a project definition like: <groupId>org.openptk</groupId> <artifactId>framework</artifactId> <version>2.1-SNAPSHOT</version> <packaging>jar</packaging> <name>OpenPTK-Framework</name> <url>http://www.openptk.org</url> This information is used to uniquely identify:
Maven DependenciesIn the same way that ant defines dependencies in a build.xml file, maven includes the ability to include dependency information in the pom.xml file. An example might look like:<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>base</artifactId> <version>${project.version}</version> </dependency> </dependencies> In this example, there are a couple of dependencies:
Proposed OpenPTK Maven ProjectsBelow is a proposed table including a cross reference of the OpenPTK Project names today to that of the mavon pom.xml components.For all cases, the following groupId and version are proposed:
IssuesService specific buildsThe "packaged" war files, for the server, should only contain the necessary Services. There are two reasons for this:
The following table identifies the "packages" and jars that are not automatically available in the maven repository.
Configuration file specific buildsThis "issue" is related to the above (Service specific builds) issue. A deployment may need to specify a configuration file other than the default (openptk.xml). A configuration file may only contain a specific Service. There needs to be a process for copying a customized configuration file to the standard file name, during deployment. Local JARsAdding jars to the maven local repository. service-oimclientmvn install:install-file \ -DgroupId=com.oracle.iam \ -DartifactId=oracle-iam-oimclient \ -Dpackaging=jar \ -Dversion=11.1.1.3.0 \ -DgeneratePom=true \ -Dfile=oimclient.jar service-oracleidmgrmvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xlapi \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlAPI.jar mvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xlauthentication \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlAuthentication.jar mvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xlcache \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlCache.jar mvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xlcrypto \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlCrypto.jar mvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xllogger \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlLogger.jar mvn install:install-file \ -DgroupId=com.thortech \ -DartifactId=thortech-xlutils \ -Dpackaging=jar \ -Dversion=9.1.0 \ -DgeneratePom=true \ -Dfile=xlUtils.jar service-oraclejdbcmvn install:install-file \ -DgroupId=com.oracle.jdbc \ -DartifactId=oracle-jdbc \ -Dpackaging=jar \ -Dversion=6 \ -DgeneratePom=true \ -Dfile=ojdbc5.jar service-spmlmvn install:install-file \ -DgroupId=org.openspml \ -DartifactId=openspml \ -Dpackaging=jar \ -Dversion=1.2.2 \ -DgeneratePom=true \ -Dfile=openspml.jar mvn install:install-file \ -DgroupId=org.openspml \ -DartifactId=openspml-idm80 \ -Dpackaging=jar \ -Dversion=1.2.2 \ -DgeneratePom=true \ -Dfile=idm_80_openspml.jar service-spml2mvn install:install-file \ -DgroupId=org.openspml.v2 \ -DartifactId=openspmlv2-toolkit \ -Dpackaging=jar \ -Dversion=2 \ -DgeneratePom=true \ -Dfile=openspml2-toolkit.jar mvn install:install-file \ -DgroupId=com.sun.idm \ -DartifactId=idmclient \ -Dpackaging=jar \ -Dversion=1 \ -DgeneratePom=true \ -Dfile=idmclient.jar Set upExtra setup steps options The generated deployable war file (for the server) may need to be specific to a combination of the web container and identity repository
.m2Create a settings.xml file in your ${HOME}/.m2 directory. This file contains maven related settings that are unique to users system. The following example has local tomcat settings: <settings> <servers> <server> <id>tomcat</id> <username>admin</username> <password>admin</password> </server> </servers> </settings> Tomcathttps://wiki.base22.com/display/btg/How+to+create+a+Maven+web+app+and+deploy+to+Tomcat+-+fast Commands
|
Projects >