Oracle Berkeley DB Java Edition Maven Support
The
Apache Maven tool is a popular method of automatic distributed software dependancy management. Berkeley DB Java Edition is avaialble from the Oracle Maven repostory. The Berkeley DB Java Edition package is
com.sleepycat and the
artifactId is
je. Every release available of JE now has a Project Object Model (POM) XML file for use in build tools such as
Ant and
Maven.
The layout for the Oracle Maven repository is shown below:
http://download.oracle.com/
maven
`-- com
`-- sleepycat
`-- je
|-- maven-metadata.xml
|-- maven-metadata.xml.md5
|-- maven-metadata.xml.sha1
|-- 3.3.75
| |-- je-3.3.75.jar
| |-- je-3.3.75.jar.md5
| |-- je-3.3.75.jar.sha1
| |-- je-3.3.75.pom
| |-- je-3.3.75.pom.md5
| |-- je-3.3.75.pom.sha1
| |-- je-3.3.75-sources.jar
| |-- je-3.3.75-sources.jar.md5
| |-- je-3.3.75-sources.jar.sha1
| |-- je-3.3.75-javadoc.jar
| |-- je-3.3.75-javadoc.jar.md5
| `-- je-3.3.75-javadoc.jar.sha1
`-- license.txt
The layout for the Berkeley DB Java Edition product packages including source, documentation, and the test suite is shown below:
http://download.oracle.com/
berkeley-db
|-- je-3.3.75.tar.gz
|-- je-3.3.75.zip
`-- ...
The layout for the Berkeley DB Java Edition online documentation is shown below:
http://download.oracle.com/
berkeley-db
`-- docs
`-- je
`-- 3.3.75
|-- index.html
`-- ...
Each release has many files. The
.JAR, sources, and cryptographic signatures for the files (as required by Maven) to ensure that the packages are downloaded intact.
The following is example code for use in
Apache Ant. Using this code Ant will work in conjunction with Apache Maven to fetch the specified version of Berkeley DB Java Edition.
<!-- Use Maven to fetch Oracle Berkeley DB Java Edition -->
<path id="maven-ant-tasks.classpath"
path="lib/maven-ant-tasks-2.0.9.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath" />
<artifact:remoteRepository id="berkeleydb-je.repository"
url="http://download.oracle.com/maven/" />
<artifact:dependencies pathId="dependency.classpath">
<remoteRepository refid="berkeleydb-je.repository" />
<dependency groupId="com.sleepycat"
artifactId="je"
version="3.3.75"/>
</artifact:dependencies>
Here is an example Maven POM file if you use Maven to build as well as manage project elements.
<?xml version="1.0" encoding="ISO-8859-1"?>>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mydomain-CHANGE_ME</groupId>
<artifactId>myProjectArtifact-CHANGE_ME</artifactId>
<version>1.0-SNAPSHOT-CHANGE_ME</version>>
<dependencies>
<dependency>
<groupId>com.sleepycat</groupId>
<artifactId>je</artifactId>
<version>3.3.75</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>oracleReleases</id>
<name>Oracle Released Java Packages</name>
<url>http://download.oracle.com/maven</url>
<layout>default</layout>
</repository>
</repositories>
</project>
We hope you find the Maven repository for Berkeley DB Java Edition useful in your projects. Please ask questions or let us know of issues on the
OTN Forum for Java Edition
|