mojohaus / maven-native

https://www.mojohaus.org/maven-native/
MIT License
18 stars 12 forks source link

Duplicate target when running `package` and `install` at once #28

Open bbaldino opened 5 years ago

bbaldino commented 5 years ago

I've noticed that when I try and run mvn package install in my project, the linker command seems to list the target twice, resulting in duplicate symbol complaints. It's entirely possible I've screwed something up in the jar/definition. The pom is a submodule, but the specific file is here.

If I run mvn package and then mvn install, it works fine but running both at the same time causes the issue. Have I got something wrong in the config?

bbaldino commented 5 years ago

I end up with a linking command that looks like this:

/bin/sh -c cd '/Users/bbaldino/work/sctp4j/jniwrapper/native' && 'gcc' '-shared' '-L/Users/bbaldino/work/sctp4j/jniwrapper/native/target/usrsctp-1.0-SNAPSHOT/lib' 'target/usrsctp-1.0-SNAPSHOT/lib/libusrsctp.a' '-lpthread' '-o' '/Users/bbaldino/work/sctp4j/jniwrappe
r/native/target/libjnisctp-darwin-x86_64.jnilib' 'target/objs/org_jitsi_modified_sctp4j_SctpJni.o' 'target/objs/org_jitsi_modified_sctp4j_SctpJni.o'

(same target listed twice at the end)

bbaldino commented 5 years ago

After looking at the code a bit I can confirm it's resolved by https://github.com/mojohaus/maven-native/pull/27. Is there a plan for a new release?

dantran commented 5 years ago

please test 1.0.0-alpha-10 at staging https://oss.sonatype.org/content/repositories/orgcodehausmojo-1137

bbaldino commented 5 years ago

sorry, but for the life of me I can't figure out how to add that repo in maven. I tried:

<repository>
  <id>oss-sonatype</id>
  <name>oss-sonatype</name>
  <url>https://oss.sonatype.org/content/repositories/orgcodehausmojo-1137</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

but can't find 1.0-alpha-10