You will need a recent version of Java SE 5 or later installed to build and run the JUnit tests.

Apache BVal supports the Oracle (formerly Sun) JDK available at The IBM Java SDK at should also work and will be supported as well as possible. Other Java vendors or versions may work, so please ping the Mailing Lists if you encounter problems. We will aim for across-the-board compatibility wherever possible.


Command Line Builds

These instructions describe how to check out the current BVal trunk source code from the Apache Software Foundation's Apache Subversion source code management repository and build it using the Apache Maven build tool. These utilities support use from the console and are known to work on Windows, Linux and Mac OS X.

  1. Ensure that you have Java installed and in your path by running: java -version
  2. Install Apache Maven, version 2.2.1 or later. If it is installed correctly, typing mvn -v from the console will display the expected version number.
  3. Install Apache Subversion v1.4.x or later. If it installed correctly, typing the following command should output help information: svn help or svn --version
  4. Create a new directory you want to do your work in, then change to that directory from the console.
  5. Check out the sources by running: svn co bval-trunk. It will check out the sources to a bval-trunk directory (ASF committers use https).
  6. Change to the bval-trunk directory, which has already been created in the previous step.
  7. Build the code by running: mvn install. The first time you run the build, many dependencies are automatically resolved and downloaded. It is common for dependency downloading to fail the first time, which will fail the build. If any of these dependency downloads fail, just re-run the command. You may also want to add a maven central mirror repository to your ~/.m2/settings.xml file if download times are consistently slow or fail (see here).

Eclipse with Command-line Maven utilities

  1. Checkout the source as described above
  2. Build the source using Maven as described above

    mvn eclipse:eclipse

    If this is the first project in your workspace to use maven artifacts you need to create a classpath variable named M2_REPO which contains the full path to your local repository. The eclipse plugin can do this for you with the following command:

    mvn eclipse:configure-workspace -Declipse.workspace=${path_to_your_workspace}
  3. Start Eclipse (3.4 or later suggested) and create a new workspace

  4. Import the BVal project, by:

    • Select File --> Import... --> General - Existing Projects into Workspace --> Next
    • Select root directory = [svn checkout location above]
    • Press Finish

Eclipse with M2Eclipse plugin

  1. Checkout the source as described above
  2. Build the source using Maven as described above
  3. Start Eclipse (3.5 Galileo or later is recommended) and create a new workspace
  4. Good references for this M2Eclipse plugin (need to install the plugin into your Eclipse environment)
  5. Import the BVAL project, by:
    • Select File --> Import... --> General -> Maven Projects --> Next
    • Select root directory = [svn checkout location above]
    • All of the pom.xml files should be pre-selected for the svn checkout location
    • You can affect the naming convention used for the generated Eclipse projects (one for each Maven module). Click on Advanced and fill in the Name Template field. I prefer TRUNK-artifactId since it helps with workspace organization, but it's your choice.
    • Press Finish
    • Note: You may get a popup internal error at the end of this Import processing. Not sure what the problem is, but it doesn't seem to affect the usage. This will probably get cleared up soon since Eclipse 3.5 is still quite new.
    • The bval-jsr303 module needs the jaxb2:xjc goal to run as part of its build process: Add this to the project's Maven --> Lifecycle Mapping options under Goals to invoke after project clean:.