Java

You will need a recent version of Java SE 5 or 6 from Sun installed to build and run the JUnit tests.
The IBM 5 or 6 SDK should also work and will be supported as best as possible.
Other Java vendors or Java SE 7 may work, so please ping the Mailing Lists if you encounter problems.

Maven

Command Line Builds

These instructions describe how to check out the current BVal trunk source code (from the Subversion source code management repository) and build it (using the Apache Maven 2 build tool). They are written for use from the console, and are known to work on Windows, Linux and MacOSX.

  1. Ensure that you have Java installed and in your path by running: java -version
  2. Install the build tool, Apache Maven 2.2.1 or later, from http://maven.apache.org/. If it is installed correctly, typing mvn -v from the console will result in the text Maven version: 2.2.1
  3. Install Subversion v1.4.x or later from http://subversion.apache.org/. 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 https://svn.apache.org/repos/asf/incubator/bval/trunk bval-trunk. It will check out the sources to a bval-trunk directory.
  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/setting.xml file if download times are consistently slow or fail (see http://maven.apache.org/guides/mini/guide-mirror-settings.html)

Eclipse with Command-line Maven utilities

  1. Checkout the source as described above
  2. Build the source using Maven as described above
  3. Create the Eclipse Metadata -
    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} 
      
  4. Start Eclipse (3.4 or 3.5 suggested) and create a new workspace
  5. 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 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:".


  • No labels