Prerequisites

To build Trinidad , you'll need the software listed below installed on your machine.

Using Java6 or Java7

If your default JDK/JRE is Java6 or Java7, the build will run the Java5 javac in forked mode. You will need to tell maven where your JDK5 is installed. This can be done in your maven settings.xml. This will ensure that all Trinidad source is compilable on Java 1.5. Example of setting this (path shown is the Ubuntu Java 5 default install location):

<settings>
  <profiles>
    <profile>
      <id>java5.home</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <jdk5.home>/usr/lib/jvm/java-1.5.0-sun</jdk5.home>
      </properties>
    </profile>
  </profiles>
</settings>

On Windows, the path must not contain spaces. This is because of MCOMPILER-74 which can be fixed once the plug-in version 2.1 is released (2.0.2 is current as of this edit). Example for windows:

<settings>
  <profiles>
    <profile>
      <id>java5.home</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <jdk5.home>C:\Java\jdk1.5.0_16</jdk5.home>
      </properties>
    </profile>
  </profiles>
</settings>

Running the Trinidad build

Source repository information can be found at http://myfaces.apache.org/trinidad/source-repository.html

{{{svn co https://svn.apache.org/repos/asf/myfaces/trinidad/trunk/ trinidad cd trinidad mvn clean install }}}

Note: If your install fails due to errors in the automatic tests you can skip the tests using this command:

mvn -Dmaven.test.skip=true install

(It's fine for users to skip the tests, but if you're a committer, you need to make sure the tests are completing successfully before checking in! If the tests fail, the build fails, and snapshots will not be deployed.)

Generate Trinidad docs

cd ../trinidad
set MAVEN_OPTS=-Xmx300M
mvn site

Look for Taglib and Javadocs in trinidad/trinidad-api/target/site.

Special Build Options

Trinidad has added a number of options which can be used to do special things with the build. A number of these options apply toward the building of the Trinidad examples, in order to make the generated wars more easily deployable on other servers. Maven does this though the use of profiles. There are two ways to invoke a profile, the first is through the use of the -Pprofile command line option and the second is through special activation. Below is the documentation for the profiles that can be invoked directly as well as those whose activation is done by a property (-D).

Direct Profiles

These profiles may be invoked by adding -PprofileName to your maven command line. Multiple profiles may be invoked using the following notation: -Pprofile1,profile2.

Profile Name

Description

buildExamples

This profile will force the examples to be built. Normally the examples are always build unless you specify the -DperformRelease property (see below) on the command line. Since examples are not deployed as artifacts, they are not build as part of a release. Using this profile will force the examples to be built even if the -DperformRelease property is set.

enableAsserts

This turns on Java asserts during the running of the surefire tests. Normally asserts are not turned on and it makes compilation much faster. This option should not be used in Maven 1.0.6.

includeJSF*

This profile will copy the current JSF libraries into the WEB-INF/lib folder of the Trinidad examples. This is useful for creating a war that can be deployed to a container which does not include a JSF implementation (like Tomcat and Jetty).

includeJSTL

This profile will copy the current JSTL libraries into the WEB-INF/lib folder of the Trinidad examples. This is useful for creating a war that can be deployed to a container which does not include a JSTL implementation (like Tomcat).

includeBridge*

This profile will copy the current portlet-bridge libraries into the WEB-INF/lib folder for the Trinidad examples so that they can be more easily deployed into a portal environment.

jdk1.4-compatible**

Retrofits Trinidad to work with JDK1.4 using retrotranslator

jettyConfig

This profile enables the config necessary to run the jetty:run target. This should be used only when you are trying to run jetty from maven. In order to run jetty, you would issue the following command from the trinidad-examples/trinidad-demo project: mvn -PjettyConfig install jetty:run. There is no need to invoke the includeJSF profile, the same behavior will already be set up in this profile.

* These options are only available for Trinidad 1.2
** This option is only available for Trinidad 1.0

Build Properties

Some profiles in maven are designed to be activated by the existence of properties (or lack thereof). Each property is added to the command line individually and it proceeded by a -D. Optionally profiles may have values. Each property would be added on the maven command line by adding -Doption or -Doption=value.

The table below contains the property names and their acceptable values. If a property has nothing in the acceptable values field, then that means the property my have any value or none at all, it just has to be present. If the property has only one acceptable value, it is assumed that the property must have that value assigned even if there is only one.

Property Name

Values

Description

prepareRelease

This will enable the release preparation profile which will allow versioning of all trinidad sub-projects. This is generally only needed when preparing a release and is documented in the Trinidad Release documentation.

performRelease

true

This will be invoked automatically during a release:perform target on trinidad. It would also be used to generate release artifacts for vote. By adding this property, you turn off building of the Trinidad Examples projects and you enable the building of the JavaDocs and gpg signing. If you do not want to exclude the example projects from a build with this property on it, make sure to invoke the -PbuildExamples profile.

jsf

ri

By default the demo projects refer to myfaces. This will force the demo projects to reference the Reference Implementation. This setting is important to running the demos from jetty using maven as it will specify which JSF implementation you will use. It also determines which distribution is added to the WEB-INF/lib folder when used with the -PincludeJSF profile

Examples

Run Jetty with Myfaces: {{{cd trinidad-examples/trinidad-demo mvn install jetty:run -PjettyConfig }}}

Run Jetty with RI: {{{cd trinidad-examples/trinidad-demo mvn install jetty:run -PjettyConfig -Djsf=ri }}}

Build Demo with JSF and JSTL included: {{{mvn clean install -PincludeJSF,includeJSTL }}}

Build Demo with JSF (RI) and JSTL included: {{{mvn clean install -PincludeJSF,includeJSTL -Djsf=ri }}}

Run a build with assertions enabled: {{{mvn clean install -PenableAsserts }}}

Building_Trinidad_With_Maven (last edited 2009-09-20 23:01:55 by localhost)