Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with appassembler plugin #337

Open
Dragas opened this issue Apr 30, 2019 · 0 comments
Open

Usage with appassembler plugin #337

Dragas opened this issue Apr 30, 2019 · 0 comments

Comments

@Dragas
Copy link

Dragas commented Apr 30, 2019

The plugin on its own seems to work alright, it compiles and extracts dependencies during build phase, but question stands: how do you use it with other plugins that provide executables? ex. codehaus appassembler plugin. So far I've came up with the following pom.xml, but when trying to run the app executable, I get that liblibnativeclock-1.0-SNAPSHOT is not available on classpath. Upon further inspection I see that in generated repo folder, there's the libnativeclock.nar file, but it doesn't seem to be extracted. At runtime java.class.path property seems to include the libnativeclock.nar file.

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>hcsr04</artifactId>
        <groupId>lt.saltyjuice.dragas.chip</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>tester</artifactId>

    <dependencies>
        <dependency>
            <groupId>lt.saltyjuice.dragas.chip</groupId>
            <artifactId>libnativeclock</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>nar</type>
        </dependency>
        <dependency>
            <groupId>lt.saltyjuice.dragas.chip</groupId>
            <artifactId>libhcsr04</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <version>1.10</version>
                <configuration>
                    <programs>
                        <program>
                            <mainClass>lt.saltyjuice.dragas.chip.tester.Main</mainClass>
                            <id>app</id>
                            <jvmSettings>
                                <extraArguments>
                                    <extraArgument>
                                        -Dpi4j.linking=dynamic
                                    </extraArgument>
                                </extraArguments>
                            </jvmSettings>
                        </program>
                        <program>
                            <mainClass>lt.saltyjuice.dragas.chip.tester.Main</mainClass>
                            <id>debug-app</id>
                            <jvmSettings>
                                <extraArguments>
                                    <extraArgument>
                                        -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8001
                                    </extraArgument>
                                    <extraArgument>
                                        -Dpi4j.linking=dynamic
                                    </extraArgument>
                                </extraArguments>
                            </jvmSettings>
                        </program>
                    </programs>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>assemble</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.maven-nar</groupId>
                <artifactId>nar-maven-plugin</artifactId>
                <version>3.5.1</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>nar-download</id>
                        <goals>
                            <goal>nar-download</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>nar-extract</id>
                        <goals>
                            <goal>nar-unpack</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant