Return-Path:
- The Maven2 build support is currently under development and is co-resident with the existing Maven1 build scripts and sources.
- The general strategy is to make heavy use of Ant from within the Maven2 build or as Ant Tasks/Ant Maven2 Plugins if required.
- For this reason, the Maven2 build can be found in the pom.xml and build.xml files throughout the Jetspeed2 source tree.
- As with the Maven1 build, it is a multi-module build, primarily following the J2 component and application subprojects.
- There are also two Maven2 build specific top level subprojects: ant-tasks and maven-archetypes.
-
- The development team is actively keeping both environments up to date,
- but the Maven2 build modifications may lag behind newly committed changes.
- At the moment, Maven2 does not build all LDAP related artifacts and it does not build the uberjar/classworlds executable jar files
- for the deploy tool. Otherwise it is generally complete, (at least AFAIK).
-
- Maven 2.0.4 and the accompanying Ant artifact tasks are now being used for this effort,
- with an upgraded surefire plugin version, (2.1.3). If you wish to use the Maven2 build,
- please ensure that maven 2.0.4 is installed and in your path.
- Due to modifications in the pom.xml files, earlier versions of maven will not work correctly.
- This Maven2 build will be deprecated in 2.2, and replaced with a new Maven2 build.
- The Maven1 build will be completely dropped in 2.2
- The first step in using the Maven2 build is to either:
-
-
-
- Once in place, please customize the properties as one would have done for Maven1 using build.properties. - The properties are preconfigured for embedded Derby, so more changes are required if another database solution is to be used. - To complete this step, ensure that the proper jetspeed database active profile is uncommented for your database in - the <activeProfiles> element jetspeed-db-drivers-path should be selected for all non-embedded databases. - This setting is needed to execute Jetspeed component tests. -
--While the default location of the settings.xml file should not be changed, (e.g. ~/.m2/settings.xml), -one can relocate the repository using the <localRepository> element in the settings.xml file. -See the settings.xml.sample file for an example. -Note that the repository path must be an absolute path and not contain any property expressions. -
-- Here is a quick summary of the current Jetspeed2 Maven2 build commands, - (most of these commands can be executed at the root of the J2 source tree or at lower levels to perform partial builds/deployments): -
-
- commands - |
-
-
- explanation - |
-
- mvn - |
-
- performs base build and installs J2 artifacts in the Maven2 repository, (install is the default Maven2 goal for this build) - - |
-
- mvn -P test - |
-
- performs base build and includes execution of test cases, (includes test database setup) - |
-
- mvn -P tomcat - |
-
- performs base build and deploys to Tomcat app server, (includes prodution database setup). Other app servers will be supported in the future, (see below for details) - |
-
-
- mvn clean - |
-
- cleans all build target directories - |
-
- other commands - - |
-
- explanation - |
-
Please note that the Maven2 repositories used by default with this build are generally saturated and the Jetspeed2 Maven2 -repository does not yet contain a full mirror of the artifacts required to build Jetspeed2. If you experience download or connection failures, - simply restart the build by issuing your last command again to retry. -
-The -o offline option can be specified with the commands documented here to force Maven2 to use only the local repository. This can be invaluable in the event the main Maven2 repositories are down and the build insists upon validating a missing or troublesome POM.
--
-With Maven2 and Jetspeed Maven Plugins, you can build Jetspeed 2.2 and deploy Jetspeed Demo Portal very easily. In most cases, just following this section could be enough to build and deploy Jetspeed 2.2.
+You need the following prerequisites: +
+ All the settings needed during the build (and the jetspeed-demo Portal deployment) are isolated in one single file in the root folder
+ of the project: jetspeed-mvn-setttings.xml
.
+
+ To make it easy to create your own jetspeed-mvn-settings.xml, a sample file, jetspeed-mvn-setttings-sample.xml
+ is provided which you can simply copy to jetspeed-mvn-setttings.xml
and modify only
+ the properties you'll need.
+
+ The jetspeed-mvn-setttings-sample.xml
provides a default configuration using an Embbedded Derby database, and if that
+ suites you, probably the only changes needed will be for the location of the Derby database(s) and the deployment target directory for the
+ jetspeed-demo Portal:
+
<properties> + ... + <!-- Your Tomcat Installation Path --> + <org.apache.jetspeed.server.home>/home/demo/tomcat-5.5</org.apache.jetspeed.server.home> + + <!-- Production jdbc driver artifact properties --> + <org.apache.jetspeed.production.jdbc.driver.groupId>org.apache.derby</org.apache.jetspeed.production.jdbc.driver.groupId> + <org.apache.jetspeed.production.jdbc.driver.artifactId>derby</org.apache.jetspeed.production.jdbc.driver.artifactId> + <org.apache.jetspeed.production.jdbc.driver.version>10.3.2.1</org.apache.jetspeed.production.jdbc.driver.version> + + <!-- Production database name, JDBC url, JDBC driver name and connection information --> + <org.apache.jetspeed.production.database.default.name>derby</org.apache.jetspeed.production.database.default.name> + <org.apache.jetspeed.production.database.url>jdbc:derby:/tmp/derby/productiondb;create=true</org.apache.jetspeed.production.database.url> + <org.apache.jetspeed.production.database.driver>org.apache.derby.jdbc.EmbeddedDriver</org.apache.jetspeed.production.database.driver> + <org.apache.jetspeed.production.database.user></org.apache.jetspeed.production.database.user> + <org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password> + ... +</properties>+
+ Note: depending on your database platform, the value of 'org.apache.jetspeed.production.database.default.name' property can be one of the followings: +
+ The following jetspeed-mvn-settings.xml
provides a sample configuration using a MySQL database.
+
<properties> + ... + <!-- Your Tomcat Installation Path --> + <org.apache.jetspeed.server.home>/home/demo/tomcat-5.5</org.apache.jetspeed.server.home> + + <!-- Production jdbc driver artifact properties --> + <org.apache.jetspeed.production.jdbc.driver.groupId>mysql</org.apache.jetspeed.production.jdbc.driver.groupId> + <org.apache.jetspeed.production.jdbc.driver.artifactId>mysql-connector-java</org.apache.jetspeed.production.jdbc.driver.artifactId> + <org.apache.jetspeed.production.jdbc.driver.version>5.1.6</org.apache.jetspeed.production.jdbc.driver.version> + + <!-- Production database name, JDBC url, JDBC driver name and connection information --> + <org.apache.jetspeed.production.database.default.name>mysql5</org.apache.jetspeed.production.database.default.name> + <org.apache.jetspeed.production.database.url>jdbc:mysql://localhost:3306/j2</org.apache.jetspeed.production.database.url> + <org.apache.jetspeed.production.database.driver>com.mysql.jdbc.Driver</org.apache.jetspeed.production.database.driver> + <org.apache.jetspeed.production.database.user>j2</org.apache.jetspeed.production.database.user> + <org.apache.jetspeed.production.database.password>j2</org.apache.jetspeed.production.database.password> + ... +</properties>+
+ If, and only if, no (full) build has been done yet, a subset of the build has to be performed once first: +
$mvn install -P init+
+ This will ensure the required Jetspeed-2 Maven plugins are build and installed as well as the jetspeed-portal-resources artifact. +
++ Performing a full build of all the Jetspeed-2 components, as well as the jetspeed-demo Portal is plain Maven-2 simple: +
$mvn install+
+ This requires downloading and installing your own Tomcat
+ (for Jetspeed-2.2 at least version 5.5.26 is now required!)
+ Once you've installed Tomcat, adjust the org.apache.jetspeed.server.home
property
+ in the jetspeed-mvn-settings.xml file to point at the installation directory.
+
+ You can deploy the Jetspeed Demo Portal to your Tomcat installation by using the following command: +
$mvn org.apache.portals.jetspeed-2:jetspeed-mvn-maven-plugin:mvn -Dtarget=demo+
<settings xmlns="http://maven.apache.org/POM/4.0.0"> + <pluginGroups> + <!-- add the following line to shorten the command invoking the Jetspeed Maven Plugin. --> + <pluginGroup>org.apache.portals.jetspeed-2</pluginGroup> + </pluginGroups> +</settings>
$mvn jetspeed:mvn -Dtarget=demo+
+ Start your Tomcat: +
$ $TOMCAT_HOME/bin/catalina.sh run+
+ Use the jetspeed-demo Portal: + http://localhost:8080/jetspeed +
++ For login, use one of the following username/password combinations: admin/admin, user/user, jetspeed/jetspeed +
+the following profiles are optional and can be supplied when building/deploying to Tomcat
-
- mvn -P tomcat,min - |
-
- specified that only the administrative portlets be deployed along with a minimal set of PSML pages. - |
-
-
- mvn -P tomcat,full - |
-
- at the moment, this is the same as the default build: deploys a full J2 set of portlets and PSML pages. - |
-
- mvn -P tomcat,nodb - - |
-
- specifies that configuration of the production database should be skipped. - |
-
- mvn -P tomcat,hot - |
-
-
- indicates that a portlet app, component, or content should be directly written to the deployed Jetspeed2 webapp. - |
-
- mvn -P tomcat,dbpsml - |
-
- specifies portal build and database deployment/import to include configuration of database PSML. - - |
-
- mvn -P prod - |
-
- executes deployment to application server specified in settings.xml, (see below). - |
-
Currently, only Tomcat 5 and Tomcat 5.5 application servers are supported by this build. More platforms are to be supported in the near future. To do so, additional deployment profiles and new app-servers Ant deployment build files will need to be added. See the following files for details:
-pom.xml,
-app-servers/tomcat-build.xml,
-maven-archetypes/portal/src/archetype/archetype-resources/pom.xml, and
- -maven-archetypes/portal/src/archetype/archetype-resources/app-servers/tomcat-build.xml.
-Some of the additional profiles make sense to preconfigure in your settings.xml, (see the settings.xml.sample file for syntax)
-org.apache.jetspeed.env.deploy.target, application server to deploy to. Setting this property allows one to use the generic prod profile.
- -org.apache.jetspeed.env.deploy.type, set to full or min. Takes the place of the full and min profiles.
-org.apache.jetspeed.env.deploy.db.psml, set to true or false. Equivalent to using dbpsml if enabled.
-The following profiles can be supplied when building
+
+ mvn -P all + |
+
+ specified that all modules (the API, plugins, portal resources, commons, components and applications) be built. + |
+
+ mvn -P init + |
+
+ specified some modules to be initialized first (the API, plugins and portal resources) + |
+
+ mvn -P test + |
+
+ specified that all modules (the API, plugins, portal resources, commons, components and applications) be built, with the property setting, -Dmaven.test.skip=false + |
+
The -o offline option can be specified with the commands documented here to force Maven2 to use only the local repository. This can be invaluable in the event the main Maven2 repositories are down and the build insists upon validating a missing or troublesome POM.
+With the new jetspeed-mvn plugin, building the Jetspeed-2 Portal itself from source as well as building and deploying the default jetspeed-demo portal is now extremely easy.
+In most cases, just following the first section could be enough, but because Jetspeed Maven Plugins provide many optional tasks, you can make use of those useful options.
+By default, running test-cases is disabled for Jetspeed-2 because it is very time-consuming and also requires the setup and initialization of a dedicated test database every time!
+But if you are a Jetspeed committer or otherwise would like to run the test-cases anyway, the following command is used to setup and initialize the test database: +
$mvn jetspeed:mvn -Dtarget=testdb+
Thereafter, enabling the test-cases during a build is done by using profile test
:
+
$mvn install -P test+
But, to make it even a little more easier, another jetspeed:mvn target is provided which already combines the above two steps in one: +
$mvn jetspeed:mvn -Dtarget=test-install+
The production database configuration provided by the Jetspeed-2 Portal project itself is primarly intended to be used by the developers using the jetspeed-demo Portal.
+Manual initializing or reinitializing of the production database is done using the following command: +
$mvn jetspeed:mvn -Dtarget=proddb+
The above command however will only created the required database tables, not seed it with (demo) data, for which the following command is needed: +
$mvn jetspeed:mvn -Dtarget=demo-seed+
As the above two commands usually goes together, the following command can be used instead to automatically invoke both: +
$mvn jetspeed:mvn -Dtarget=demo-db+
The jetspeed-demo Portal is an example custom Portal project used by the Jetspeed-2 committers for development and testing, but can of course also be used as real "demo" for other purposes.
+The full setup and usage of the jetspeed-demo Portal requires the following steps:
+Task | +Command | +
---|---|
building and installing the jetspeed-demo war | +
+ $mvn jetspeed:mvn -Dtarget=demo-install |
+
database initialization and seeding | +
+ $mvn jetspeed:mvn -Dtarget=demo-db |
+
setting up a (clean) Tomcat server | +
+ This requires downloading and installing your own Tomcat (for Jetspeed-2.2 at least version 5.5.26 is now required!)
+Once you've installed Tomcat, adjust the org.apache.jetspeed.server.home property in the jetspeed-mvn-settings.xml file to point at the installation directory.
+ |
+
deploying the jetspeed-demo Portal | +
+ $mvn jetspeed:mvn -Dtarget=demo-deploy |
+
performing everything above (except Tomcat installation) with a single command instead | +
+ $mvn jetspeed:mvn -Dtarget=demo |
+
starting Tomcat | +
+ $ $TOMCAT_HOME/bin/catalina.sh run |
+
Using the jetspeed-demo Portal | +
+ http://localhost:8080/jetspeed +For login, use one of the following username/password combinations: admin/admin, user/user, jetspeed/jetspeed + |
+
There is one optional feature for building and deploying the jetspeed-demo Portal: storing and using PSML in the database. This requires using an additional profile, dbpsml, during building the jetspeed-demo war as well as slightly different jetspeed:mvn targets to execute. To execute all of that with one command, use: +
$mvn jetspeed:mvn -Dtarget=demo-dbpsml+
Further detail of the different jetspeed:mvn targets and configurations used for the dbpsml demo can be found in the jetspeed-mvn-plugin configuration within the root pom.xml.
+