<!-- NOTE: The < > delimiters around urls are intentional. I don't want them to be clickable, I want them to stand out, but be included literally, in the text -->

Who is Responsible for Integrating JSR-303 into Glassfish?

Oracle employee Jane Young

Most Recently Integrated Version of JSR-303 Implementation

The binary manifestation of JSR-303 for Glassfish V3 is a single OSGi module jar, the maven repository information for which is listed below.

As of 20111117, Glassfish svn trunk has 1.0.0.GA of the JSR-303 API, which corresponds to 4_2_0_Final of the JSR-303 RI. The corresponding svn urls follow.

Maven Artifact Information

Bean Validator artifact consists of Validation API (JSR 303), Hibernate Validator and it's dependencies repackaged as OSGi bundle. The artifact is assembled in the HK2 workspace and promoted along with HK2 release. The artifact is published to the GlassFish Maven repository. The Maven GAV is as:

<dependency>
  <groupId>org.glassfish.hk2.external</groupId>
  <artifactId>bean-validator</artifactId>
  <version> ... </version>
  <scope>provided</scope>
</dependency>

The corresponding binary artifacts from JBoss, the source code for which we use to build the preceding artifact follow. First is the API, second the RI, third the TCK, which we do not use at all for GlassFish integration.

<dependency>
  <groupId>javax.validation<groupId>
  <artifactId>validation-api</artifactId>
  <version>1.0.0.GA</version>
</dependency>

<dependency>
  <groupId>org.hibernate<groupId>
  <artifactId>hibernate-validator</artifactId>
  <version>4.2.0.Final</version>
</dependency>

<dependency>
  <groupId>org.hibernate.jsr303.tck<groupId>
  <artifactId>jsr303-tck</artifactId>
  <version>1.0.6.GA</version>
</dependency>

Integration Process

There is a multi stage integration process. Stage 1 loosely consists of the following steps.

Stage 2 loosely consists of the following steps

  • checkout hk2 HEAD from <https://hk2.java.net/svn/hk2/trunk&gt;
  • edit hk2/external/bean-validator/pom.xml to make the bean-validator dependencies point to the versions just pushed to the repo in the previous stage
  • cd hk2 and do mvn clean install
  • Manually follow the integration steps, this time with the new bean-validator.jar in the glassfish modules directory, to make sure everything still works.
  • Visit the internal RE Hudson job at <http://gf-hudson.sfbay.sun.com/hudson/job/promote-hk2/&gt; and cause a promotion of hk2 to happen. This ends up running a shell script <hk2/release.sh> on the hudson build machine, that does a bunch of stuff. Executing the job automatically increments the hk2 version number from what it was the last time. Also, wait for the jars to appears in the maven repo at <http://maven.glassfish.org/content/groups/glassfish&gt; and have the expected version number.

Stage 3 loosely consists of the following steps

  • check out and build glassfish v3 HEAD from <https://svn.java.net/glassfish-svn/trunk/v3&gt;.
  • edit the top level pom.xml and increment the version number in <hk2.version> and <hk2.plugin.version> to match the published hk2 version in the previous stage.
  • mvn clean
  • move aside your local maven repository so the glassfish build must pull all of its dependencies from the network.
  • mvn install
  • If the build is successful, check it in and send mail to dev@glassfish.java.net saying the upgrade has been performed.

Integration Testing

Integration testing is currently a manual process and involves manually running the Quicklook tests, with SecurityManager enabled and without the SecurityManager enabled, as well as manually running the JSF 2.0 bean validator whose source code is at <https://mojarra.java.net/svn/mojarra/trunk/jsf-demo/bean-validator;>.

Work is progressing on a more robust integration testing solution. First step is to discover exactly how Bean Validation is used in the Glassfish codebase. This find command will show all usages:find . -name .svn -prune -o -name "*.java" -exec grep javax.validation {} \; -print

Quicklook Testing

The Quicklook coverege of Bean Validator consists of the following