2

I am deploying a Java application that depends on a library with native libraries that are attached via Java Native Interface. I would like to know how I can configure the appassembler plugin to take this into account so that the libraries are exported correctly and the script adds them to the path so that they are found.

The POM, as requested, is shown below. There is nothing special about the use of appassembler so far. It builds the program start mechanism with the default repository structure.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>au.com.oracle</groupId>
<artifactId>impact</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>${neo-version}</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-servlet</artifactId>
        <version>${jersey-version}</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-client</artifactId>
        <version>${jersey-version}</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.2.9</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-json</artifactId>
        <version>${jersey-version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${jetty-version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-start</artifactId>
        <version>${jetty-version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-util</artifactId>
        <version>${jetty-version}</version>
    </dependency>
    <dependency>
        <groupId>com.tinkerpop.blueprints</groupId>
        <artifactId>blueprints-core</artifactId>
        <version>${blueprints-version}</version>
    </dependency>
    <dependency>
        <groupId>com.tinkerpop.rexster</groupId>
        <artifactId>rexster-core</artifactId>
        <version>${blueprints-version}</version>
    </dependency>
    <dependency>
        <groupId>com.tinkerpop.blueprints</groupId>
        <artifactId>blueprints-neo4j-graph</artifactId>
        <version>${blueprints-version}</version>
        <exclusions>
            <exclusion>
                <artifactId>neo4j</artifactId>
                <groupId>org.neo4j</groupId>
            </exclusion>
            <exclusion>
                <artifactId>neo4j-ha</artifactId>
                <groupId>org.neo4j</groupId>
            </exclusion>
            <exclusion>
                <artifactId>neo4j-management</artifactId>
                <groupId>org.neo4j</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.tinkerpop.gremlin</groupId>
        <artifactId>gremlin-java</artifactId>
        <version>${blueprints-version}</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>charva</artifactId>
        <version>1.1.4</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1</version>
            <configuration>
                <mainClass>au.com.oracle.benchmarks.NeoBenchmark</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>au.com.oracle.benchmarks.NeoBenchmark</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>appassembler-maven-plugin</artifactId>
            <version>1.3.1</version>
            <executions>
                <execution>
                    <id>execution1</id>
                    <phase>package</phase>
                    <configuration>
                        <programs>
                            <program>
                                <mainClass>au.com.oracle.impact.Main</mainClass>
                                <name>impact</name>
                            </program>
                        </programs>
                        </configuration>
                    <goals>
                        <goal>assemble</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<properties>
    <jersey-version>1.17.1</jersey-version>
    <jetty-version>9.0.0.v20130308</jetty-version>
    <neo-version>1.9.RC2</neo-version>
    <blueprints-version>2.3.0</blueprints-version>

</properties>

Jörn Guy Süß
  • 1,408
  • 11
  • 18
  • Can you show your pom file? Which version of appassembler plugin do you use? Which maven version do you use? – khmarbaise May 29 '13 at 06:35
  • Had the same problem with rxtx, found a version without the native libs tough http://dev.root1.de/projects/rxtx-rebundled/wiki – Franz Ebner Jul 15 '13 at 15:27

0 Answers0