maven-nar / nar-maven-plugin

Native ARchive plugin for Maven
https://maven-nar.github.io/
Apache License 2.0
232 stars 160 forks source link

Fix copy libraries bug #322

Closed AndreyBorodavkin closed 5 years ago

AndreyBorodavkin commented 6 years ago

If the libraries tag contains more than one library tag with different types, files of the same type are copied to all NAR archives. For example, we want to package a third-party library that is built both as static and as shared. So pom.xml contains the following nar-maven-plugin configuration:

<configuration>
    ...
    <libraries>
        <library>
            <type>static</type>
        </library>
        <library>
            <type>shared</type>
        </library>
    </libraries>
    ...
</configuration>

Accordingly, native libraries are located as follows:

src/main/nar/resources/aol/amd64-Linux-gpp/lib/shared/somelib.so
src/main/nar/resources/aol/amd64-Linux-gpp/lib/static/somelib.lib

Expected that two NAR archives will be generated: one with a static library, the other with a shared library.

In fact, two NAR archives with the same content are generated. The content of the archives are determined by the order of the libraries in the configuration.

GregDomjan commented 5 years ago

Not the way I'd do it, but don't have time to re arrange it, and it's not wrong as far as I can see. No rejections from others, passed travis, merging.