openjpa/openjpa-project/BUILDING.txt

146 lines
6.2 KiB
Plaintext

Building Apache OpenJPA
Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------
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 Java SE 6 is installed and on your path by running:
java -version
OpenJPA requires Java 1.6 or later to build, but still supports using
Java SE 5 for runtime even though some features are only available
with Java SE 6.
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. Extract the source archive if you have not already done so.
The source will create a new directory named:
openjpa-<version>-source. Where <version> is the openjpa
version, for example apache-openjpa-2.0.1-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)
<settings>
<mirrors>
<mirror>
<id>repo.mergere.com</id>
<url>http://repo.mergere.com/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
If any tests fail, and you want to ignore the failures, instead run:
mvn package -DskipTests
An example session as as follows:
$ cd /tmp/
$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
$ mvn -v
Maven version: 2.2.1
$ svn --version
svn, version 1.5.5 (r34862)
compiled Jan 5 2009, 12:30:39
$ svn co https://svn.apache.org/repos/asf/openjpa/tags/2.0.1
A 2.0.1/openjpa-lib
A 2.0.1/openjpa-lib/src
A 2.0.1/openjpa-lib/src/test
A 2.0.1/openjpa-lib/src/test/java
A 2.0.1/openjpa-lib/src/test/java/org
A 2.0.1/openjpa-lib/src/test/java/org/apache
A 2.0.1/openjpa-lib/src/test/java/org/apache/openjpa
A 2.0.1/openjpa-lib/src/test/java/org/apache/openjpa/lib
A 2.0.1/openjpa-lib/src/test/java/org/apache/openjpa/lib/test
A 2.0.1/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java
...
A 2.0.1/openjpa-persistence/pom.xml
Checked out revision 986101.
$ cd 2.0.1/
$ mvn clean install -DfailIfNoTests=false -Dtest=
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] OpenJPA Parent POM
[INFO] OpenJPA Utilities Library
[INFO] OpenJPA Kernel
[INFO] OpenJPA JDBC
[INFO] OpenJPA Persistence
[INFO] OpenJPA Persistence JDBC
[INFO] OpenJPA Persistence Locking Tests
[INFO] OpenJPA XML Store
[INFO] OpenJPA Slice
[INFO] OpenJPA Aggregate Jar
[INFO] OpenJPA Aggregate Jar with Dependencies
[INFO] OpenJPA Project Docs and Assemblies
[INFO] OpenJPA Examples
[INFO] OpenJPA Integration Tests
[INFO] OpenJPA Integration Tests - Examples
[INFO] OpenJPA Integration Tests - JPA TCK
[INFO] OpenJPA Integration Tests - Bean Validation
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenJPA Parent POM
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] OpenJPA Parent POM .................................... SUCCESS [8.999s]
[INFO] OpenJPA Utilities Library ............................. SUCCESS [22.600s]
[INFO] OpenJPA Kernel ........................................ SUCCESS [26.888s]
[INFO] OpenJPA JDBC .......................................... SUCCESS [13.231s]
[INFO] OpenJPA Persistence ................................... SUCCESS [8.635s]
[INFO] OpenJPA Persistence JDBC .............................. SUCCESS [1:33.5s]
[INFO] OpenJPA Persistence Locking Tests ..................... SUCCESS [3.857s]
[INFO] OpenJPA XML Store ..................................... SUCCESS [1.294s]
[INFO] OpenJPA Slice ......................................... SUCCESS [3.779s]
[INFO] OpenJPA Aggregate Jar ................................. SUCCESS [21.544s]
[INFO] OpenJPA Aggregate Jar with Dependencies ............... SUCCESS [8.322s]
[INFO] OpenJPA Project Docs and Assemblies ................... SUCCESS [1:12.6s]
[INFO] OpenJPA Examples ...................................... SUCCESS [1.049s]
[INFO] OpenJPA Integration Tests ............................. SUCCESS [0.341s]
[INFO] OpenJPA Integration Tests - Examples .................. SUCCESS [0.278s]
[INFO] OpenJPA Integration Tests - JPA TCK ................... SUCCESS [0.229s]
[INFO] OpenJPA Integration Tests - Bean Validation ........... SUCCESS [4.028s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 minutes 56 seconds
[INFO] Finished at: Wed Feb 24 09:01:40 EST 2010
[INFO] Final Memory: 110M/376M
[INFO] ------------------------------------------------------------------------
$ ls openjpa-project/target/site/downloads/
apache-openjpa-2.0.1-binary.zip
apache-openjpa-2.0.1-source.zip