visual c++ - native-maven-plugin error with msvc compiler "The command line is too long." -


i'm trying build cpp lib via maven using native-mvn-plugin. however, during linking part, i'm encountering error saying "the command line long"

as configuration, im having this:

<envfactoryname>org.codehaus.mojo.natives.msvc.msvc2008x86envfactory</envfactoryname> <compilerprovider>msvc</compilerprovider> <compilerstartoptions>     <compilerstartoption> /gl /ehsc </compilerstartoption> </compilerstartoptions> 

and linkerstartoptions, have this:

<linkerstartoptions>     <linkerstartoption>-g -fo -lstdc</linkerstartoption> </linkerstartoptions> 

would glad if can me.

i discourage use of maven native plugin, had lot of trouble configuring it, , don't know if maintained main page says last published on 2011-03-09. did handle problem of building c++ library maven use maven-exec plugin. load msbuild tool calling:

"c:\program files (x86)\microsoft visual studio 10.0\vc\bin\vcvars32.bat" 

from command line. after that, msbuild available in scope.

these contents of pom file :

<plugin>     <artifactid>exec-maven-plugin</artifactid>     <configuration>         <executable>msbuild</executable>         <sourceroot>${basedir}/library/</sourceroot>     </configuration>     <executions>         <execution>             <id>clean</id>             <phase>clean</phase>             <configuration>                 <arguments>                     <argument>${basedir}/library/library.vcxproj</argument>                     <argument>/p:configuration=release</argument>                     <argument>/p:platform=x64</argument>                     <argument>/t:clean</argument>                 </arguments>             </configuration>             <goals>                 <goal>exec</goal>                 </goals>             </execution>         <execution>             <id>build</id>             <phase>compile</phase>             <configuration>                 <arguments>                     <argument>${basedir}/library/library.vcxproj</argument>                     <argument>/p:configuration=release</argument>                     <argument>/p:platform=x64</argument>                     <argument>/t:build</argument>                 </arguments>             </configuration>             <goals>                 <goal>exec</goal>             </goals>         </execution>     </executions> </plugin> 

that way configuration make project responds both clean , compile goals. can go further , use assembly plugin pack library , make install library in local repository can added dependency in other projects.


Comments