2.7. Packaging the Adapter
2.7. Packaging the Adapter When development is complete, the resource adapter files are packaged into a deployable artifact called a Resource Adapter Archive or RAR file. Note The file format is defined by the JCA specification and must not be confused with the RAR file compression format. The method of creating a RAR artifact will depend on your build system: JBoss Developer Studio If you create a Java Connector project in JBoss Developer Studio, it will include a build target that produces a RAR file. Apache Ant When using Apache Ant, you can use the standard rar build task. Apache Maven When using Apache Maven, set the value of the <packaging> element to rar . Since Red Hat JBoss Data Virtualization uses Maven, you can refer to any of the Connector projects; for example, pom.xml shown below. <project> <modelVersion>4.0.0</modelVersion> <artifactId>connector-{name}</artifactId> <groupId>org.company.project</groupId> <name>Name Connector</name> <packaging>rar</packaging> <description>This connector is a sample</description> <dependencies> <dependency> <groupId>org.jboss.teiid</groupId> <artifactId>teiid-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.teiid</groupId> <artifactId>teiid-common-core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.resource</groupId> <artifactId>connector-api</artifactId> <scope>provided</scope> </dependency> </dependencies> The RAR file under its associated META-INF directory must contain the ra.xml file. If you are using Apache Maven, see http://maven.apache.org/plugins/maven-rar-plugin/ . In the root of the RAR file, you can embed the JAR file containing your connector code and any dependent library JAR files.
<project> <modelVersion>4.0.0</modelVersion> <artifactId>connector-{name}</artifactId> <groupId>org.company.project</groupId> <name>Name Connector</name> <packaging>rar</packaging> <description>This connector is a sample</description> <dependencies> <dependency> <groupId>org.jboss.teiid</groupId> <artifactId>teiid-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.teiid</groupId> <artifactId>teiid-common-core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.resource</groupId> <artifactId>connector-api</artifactId> <scope>provided</scope> </dependency> </dependencies>