Skip to content

Instantly share code, notes, and snippets.

@gamlerhart
Created October 1, 2012 11:54
Show Gist options
  • Save gamlerhart/3811183 to your computer and use it in GitHub Desktop.
Save gamlerhart/3811183 to your computer and use it in GitHub Desktop.
VJPA and Maven
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<dependencies>
<!-- Using the Versant JPA enhancer as a dependency here -->
<dependency>
<groupId>com.versant</groupId>
<artifactId>versant-jpa-enhancer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<target>
<!-- From here it is the regular ANT build step.
See chapter: 3.3.Enhancing Y our V/JP A Entity Classes in the Versant JPA reference
-->
<taskdef name="VJPAEnhancer"
classname="com.versant.jpa.enhancer.ant.EnhancerTask" />
<VJPAEnhancer destdir="target/classes"
classpathref="maven.compile.classpath"
lenient="true">
<fileset dir="target/classes">
<include name="**/*.class"/>
</fileset>
</VJPAEnhancer>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
rem VJPA_DIR needs to point to your VJPA directory
set LIB_PATH=%VJPA_DIR%/lib
echo "Installing Versant JPA"
call mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa -Dpackaging=jar -Dversion=1.0-SNAPSHOT -Dfile=%LIB_PATH%/versantjpa-1.0.jar -DpomFile=./pom-versant-jpa.xml
echo "Installing Versant JPA Enhancer"
call mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa-enhancer -Dpackaging=jar -Dversion=1.0-SNAPSHOT -Dfile=%LIB_PATH%/versantjpa-agent-1.0.jar -DpomFile=./pom-versant-jpa-enhancer.xml
#!/bin/sh
#VJPA_DIR needs to point to your VJPA directory
LIB_PATH=$VJPA_DIR/lib
echo "Installing Versant JPA"
mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa -Dpackaging=jar -Dversion=1.0-SNAPSHOT -Dfile=$LIB_PATH/versantjpa-1.0.jar -DpomFile=./pom-versant-jpa.xml
echo "Installing Versant JPA Enhancer"
mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa-enhancer -Dpackaging=jar -Dversion=1.0-SNAPSHOT -Dfile=$LIB_PATH/versantjpa-agent-1.0.jar -DpomFile=./pom-versant-jpa-enhancer.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.versant</groupId>
<artifactId>versant-jpa-enhancer</artifactId>
<version>1.0-SNAPSHOT</version>
<description>Versant JPA Bytecode Enhancer</description>
<dependencies>
<dependency>
<groupId>com.versant</groupId>
<artifactId>versant-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.versant</groupId>
<artifactId>versant-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
<description>Versant JPA Provider</description>
<dependencies>
<!-- The JPA API. Can be from a different repository / group-id -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<version>3.3</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</project>
<dependency>
<groupId>com.versant</groupId>
<artifactId>versant-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment