Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Building OpenJPA =============================================================================== These instructions describe how to build OpenJPA from source code using the Apache Maven 2 build tool. They are written for use from the console, and are known to work on Linux and Mac OSX. They are also reported to work from Windows. The most up to date version of these instructions may be found on the OpenJPA website at http://openjpa.apache.org/building-openjpa.html 1. Ensure that you have Java 1.5 installed and in your path by running: java -version OpenJPA requires Java 1.5 but will not compile with Java 6. For more detail please see http://issues.apache.org/jira/browse/OPENJPA-5. 2. Download the Apache Maven build tool from http://maven.apache.org/. The latest maintenance release for Maven 2.x should work with this version of OpenJPA. As of this writing we've used up to version 2.2.1. 3. Extract the source archive if you have not already done so. The source will create a new directory named: openjpa-project-${version}-source. Where ${version} is the openjpa version, for example openjpa-project-1.0.4-source. 4. Change to the openjpa source directory, which has already been created in the previous step. 5. Build OpenJPA by running: mvn package or better 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 add the following to your ~/.m2/setting.xml file (see http://maven.apache.org/guides/mini/guide-mirror-settings.html) repo.mergere.com http://repo.mergere.com/maven2 central If any tests fail, and you want to ignore the failures, instead run: mvn package -Dtest=false An example session as as follows: $ cd /tmp/ $ java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112) Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing) $ mvn -v Maven version: 2.0.4 $ svn --version svn, version 1.1.4 (r13838) compiled Jul 10 2006, 22:17:43 $ svn co https://svn.apache.org/repos/asf/openjpa/trunk/ A trunk/openjpa-lib A trunk/openjpa-lib/src A trunk/openjpa-lib/src/test A trunk/openjpa-lib/src/test/java A trunk/openjpa-lib/src/test/java/org A trunk/openjpa-lib/src/test/java/org/apache A trunk/openjpa-lib/src/test/java/org/apache/openjpa A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase. java ... A trunk/openjpa-persistence/pom.xml Checked out revision 421381. $ cd trunk/ $ mvn compile [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] OpenJPA [INFO] Utilities [INFO] Kernel [INFO] JDBC [INFO] XML Store [INFO] JDBC 1.5 [INFO] Kernel 1.5 [INFO] JPA [INFO] JPA JDBC [INFO] OpenJPA Project [INFO] ------------------------------------------------------------------------- [INFO] Building OpenJPA [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------- ... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] OpenJPA ............................................... SUCCESS [0.364s] [INFO] OpenJPA Utilities ..................................... SUCCESS [3.063s] [INFO] OpenJPA Kernel ........................................ SUCCESS [3.617s] [INFO] OpenJPA JDBC .......................................... SUCCESS [0.468s] [INFO] OpenJPA XML Store ..................................... SUCCESS [0.086s] [INFO] OpenJPA Utilities 1.5 ................................. SUCCESS [0.077s] [INFO] OpenJPA Kernel 1.5 .................................... SUCCESS [0.079s] [INFO] OpenJPA JDBC 1.5 ...................................... SUCCESS [0.147s] [INFO] OpenJPA JPA ........................................... SUCCESS [0.430s] [INFO] OpenJPA JPA JDBC ...................................... SUCCESS [0.340s] [INFO] OpenJPA Aggregate Jar ................................. SUCCESS [0.261s] [INFO] OpenJPA Distribution .................................. SUCCESS [0.474s] [INFO] OpenJPA Integration Tests ............................. SUCCESS [0.000s] [INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.000s] [INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.003s] [INFO] OpenJPA Persistence Examples .......................... SUCCESS [0.099s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11 seconds [INFO] Finished at: Fri Aug 27 15:55:54 CDT 2010 [INFO] Final Memory: 15M/82M [INFO] ------------------------------------------------------------------------ $ mvn package -Dtest=false [INFO] Scanning for projects... ... [INFO] [assembly:attached {execution: bin}] [WARNING] Cannot include project artifact: org.apache.openjpa:apache-openjpa:pom:1.0.5-SNAPSHOT; it doesn't have an associated file or directory. [WARNING] Cannot include project artifact: org.apache.openjpa:apache-openjpa:pom:1.0.5-SNAPSHOT; it doesn't have an associated file or directory. [INFO] Building zip: /tmpbuild/openjpa-parent/openjpa-project/../target/site/downloads/apache-openjpa-1.0.5-SNAPSHOT-binary.zip [WARNING] DEPRECATED [descriptor]: Please use descriptors instead [INFO] [assembly:attached {execution: sources}] [INFO] Building zip: /tmpbuild/openjpa-parent/openjpa-project/../target/site/downloads/apache-openjpa-1.0.5-SNAPSHOT-source.zip ... $ ls -lh target/site/downloads/ total 23M -rw-r--r-- 1 mikedd mikedd 18M 2010-08-26 09:32 apache-openjpa-1.0.4-binary.zip -rw-r--r-- 1 mikedd mikedd 5.1M 2010-08-26 09:32 apache-openjpa-1.0.4-source.zip