mojohaus / mojohaus.github.io

Organization website
https://www.mojohaus.org
44 stars 27 forks source link

native-maven-plugin : linkerSecondaryOutputExtensions behaviour - Has it changed recently? #24

Closed minajagi closed 6 years ago

minajagi commented 6 years ago

Hi,

Can you please let me know if the behaviour of this option linkerSecondaryOutputExtensions has been recently changed in the native-maven-plugin?

Our build script used to look like this earlier(see below) with two profiles and used to populate linkerSecondaryOutput with a particular value based on either Profile A or B.In one case it was empty/blank.

The way this used to work a few months ago was it used to always produce the dll and because of lib would install corresponding artifact.lib into my local repo in the install phase. In Profile A linkerSecondaryOutput used to be set to pdb so ${linkerSecondaryOutput} used to do the samething for corresponding artifact.pdb file. For Profile B this was empty so there would be no pdb file.

Now it looks like when the >${linkerSecondaryOutput} has value it seems to overwrite the earlier lib config and thus I end up only getting the pdb in the local repo in this case and not the lib (which earlier used to be installed to my local repo no matter what).

I think I know the workaround now i.e.

  1. knockoff the static lib
  2. in the profile B have ${linkerSecondaryOutput} set to just lib and in profile A have ${linkerSecondaryOutput} set to lib,pdb

I would appreciate if anyone here can let me know if this behavior got changed recently as I can then justify these pom changes to my team. Please let me know if you have any questions so I can try explaining the issue better. Btw, we use Maven 3 and

org.codehaus.mojo native-maven-plugin 1.0-alpha-7

I don’t quite remember if we have maven 2 earlier. Do you think it changed from maven 2 – maven 3.I doubt as we have not changed the version of the native plugin being used.

Regards, Chetan

  <profiles>
        <profile>
              <id>B</id>
                    <properties>
                          <compilerOptions> /O2 /MT /GS </compilerOptions>
                          <linkerOptions> </linkerOptions>
                          <linkerSecondaryOutput> </linkerSecondaryOutput> <!—Empty because we don’t generate the pdb in this case-- >
                    </properties>                 
        </profile>

        <profile>
              <id>A</id>
                    <properties>
                          <compilerOptions> /Od /MTd /GS- </compilerOptions>
                          <linkerOptions> /DEBUG</linkerOptions>
                          <linkerSecondaryOutput>pdb</linkerSecondaryOutput>
                    </properties>                 
        </profile>  
  </profiles>       
org.codehaus.mojo native-maven-plugin 1.0-alpha-7 true win32 org.codehaus.mojo.natives.msvc.MSVC2008x86EnvFactory msvc ${basedir} **\*.c ${project.build.directory}/objs/${project.name} /D JVMINFO_EXPORTS ${compilerOptions} lib ${linkerSecondaryOutput} /INCREMENTAL:NO /DLL ${linkerOptions}
andham commented 6 years ago

Questions should be asked on the users list, see https://www.mojohaus.org/maven-native/native-maven-plugin/mail-lists.html.