maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rakesh bhakta <roc.bha...@gmail.com>
Subject Re: Native-Plugin - library name
Date Fri, 08 Oct 2004 13:56:24 GMT
> on my environment the native hello world sample is working. The "lib" prefix
> of the filename is necessary. If I remove the "lib" prefix of the "so" file I
> run into this error:
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
> native-helloworld-1.0 in java.library.path

Yes, I realize "lib" prefix is required on the Linux, and works on
Linux without problem. However, I have not been able to run it on
windows with the windows JVM from Sun, and then add cygwin in the mix.

I did review the maven-native-plugin-1.1/plugin.jelly code and opted
against creating my own version of it.  However, I have been able to
solve my issue with some pre/post goals like below for those
interested:

  <preGoal name="native:compile">
    <j:if test="${systemScope['os.name'].startsWith('Windows')}" >
       <echo>Setting Env lib for ${os.name}</echo>  
       <maven:set plugin="maven-native-plugin"
property="maven.native.include.os" value="win32"/>
       <maven:set plugin="maven-native-plugin"
property="maven.native.compiler.arg.start" value="-mno-cygwin"/>
       <maven:set plugin="maven-native-plugin"
property="maven.native.linker.arg.start" value="-mno-cygwin
-Wl,--add-stdcall-alias"/>
    </j:if>     
  </preGoal>
  
  <postGoal name="native:compile">
    <j:if test="${systemScope['os.name'].startsWith('Windows')}" >
       <echo>Renaming lib for ${os.name}</echo>  
       <ant:copy
file="${maven.build.dir}/native/lib${pom.artifactId}-${pom.currentVersion}.so"
	       tofile="${maven.build.dir}/native/${pom.artifactId}-${pom.currentVersion}.dll"
overwrite="true"/>
    </j:if>     
  </postGoal>

my environment:
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) 
  Maven 1.0
  Maven Native Plugin 1.1
  gcc version 3.3.1 (cygming special)
  Windows XP x86

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message