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

dependencyBindings not working #326

Open
shiluotang opened this issue Aug 21, 2018 · 0 comments
Open

dependencyBindings not working #326

shiluotang opened this issue Aug 21, 2018 · 0 comments

Comments

@shiluotang
Copy link

Here's the problem:

  • There're some C sources compiled into both static, jni and shared lib on amd64-Linux-gpp under the help of nar-maven-plugin:3.5.0. Call it A.
  • There's another nar library, call it B, which is using the A nar library as its dependency. We need A to be statically linked into B using dependencyBindings.
  • But as a matter of fact, the generated B doesn't contain any code from A which makes the dependencyBindings useless. We checked this with nm tool.

So is this a bug?

code snippet in pom:

<?xml version="1.0"?>
<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>mygroup</groupId>
    <artifactId>mylib</artifactId>
    <version>1.0</version>
    <packaging>nar</packaging>
    <dependencies>
        <dependency>
            <groupId>org.scijava</groupId>
            <artifactId>native-lib-loader</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>mygroup</groupId>
            <artifactId>mylib0</artifactId>
            <version>1.0</version>
            <type>nar</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.github.maven-nar</groupId>
                <artifactId>nar-maven-plugin</artifactId>
                <version>3.5.0</version>
                <extensions>true</extensions>
                <configuration>
                    <libraries>
                        <library>
                            <type>shared</type>
                            <narSystemPackage>mygroup.jni</narSystemPackage>
                            <linkCPP>false</linkCPP>
                            <dependencyBindings>
                                <dependencyBinding>mylib0:static</dependencyBinding>
                            </dependencyBindings>
                        </library>
                        <library>
                            <type>static</type>
                            <narSystemPackage>mygroup.jni</narSystemPackage>
                            <linkCPP>false</linkCPP>
                        </library>
                        <library>
                            <type>jni</type>
                            <narSystemPackage>mygroup.jni</narSystemPackage>
                            <linkCPP>false</linkCPP>
                        </library>
                    </libraries>
                </configuration>
            </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