470,820 Members | 1,643 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,820 developers. It's quick & easy.

Maven native plugin and JNI

Hi everyone!
I'm in a bit of a problem here:
I have to make a maven project for native (jni & C) code.

I am using this plugin: http://mojo.codehaus.org/maven-nativ...gin/index.html

and trying to make this example build:
(the jni one in svn)

The profile is win32 and MSVC is the compiler provider.

I get the following error:
Expand|Select|Wrap|Line Numbers
  1. [ERROR] 
  3. Maven encountered an error while looking up the following Mojo:
  4. Group-Id: org.codehaus.mojo
  5. Artifact-Id: native-maven-plugin
  6. Version: 1.0-alpha-2
  7. Mojo: compile
  8. brought in via: Direct invocation
  10. Referenced from project:
  11. Group-Id: org.codehaus.mojo.natives.it.jni.win32
  12. Artifact-Id: hello
  13. Version: 1.0-SNAPSHOT
  14. From file: \\Sfil0\UserData$\pjovanovic05\workspace\jni\native\win32\pom.xml
  15. Reason: Unable to lookup component 'org.apache.maven.plugin.Mojo', it could not be started.
  16.       role: org.apache.maven.plugin.Mojo
  17.   roleHint: org.codehaus.mojo:native-maven-plugin:1.0-alpha-2:compile
  18. classRealm: /plugins/org.codehaus.mojo:native-maven-plugin:1.0-alpha-2@48/thread:main
  20. Root cause: Component descriptor cannot be found in the component repository: org.codehaus.mojo.natives.manager.CompilerManager [default] (lookup realm: ClassRealm[/plugins/org.codehaus.mojo:native-maven-plugin:1.0-alpha-2@48/thread:main, parent: ClassRealm[/projects/org.codehaus.mojo.natives.it.jni.win32:hello:1.0-SNAPSHOT/thread:main, parent: ClassRealm[plexus.core, parent: null]]]).
  21.       role: org.codehaus.mojo.natives.manager.CompilerManager
  22.   roleHint: default
  23. classRealm: /plugins/org.codehaus.mojo:native-maven-plugin:1.0-alpha-2@48/thread:main

Anybody seen anything like this?
Jun 4 '08 #1
3 5145
11,448 Expert 8TB
Not knowing Maven the error diagnostic indicates to me that you haven't properly
installed Maven or forgot to set some (class)path variable for it. Check its
installation instructions. The error diagnostic indicates that it can't find one of its
own components.

kind regards,

Jun 4 '08 #2
Yeah, it does look like that, but it's a plugin and maven is pretty much just a bunch of plugins doing stuff.
The installation of the plugin is automated and instructed by POM, and i've literally copied the example from the repository and it breaks there.
I'am trying stuff, but it just wont click.

Thanks anyway!
Jun 4 '08 #3
Ok, so just in case anybody comes across this looking for an answer, I did it, and this is how:

in win32 pom, i've added -LD to <compilerStartOptions> and i gave up on IDEs, just did it from console...
Also I've added user32.lib & advapi32.lib to linkerStartOption (like in the tutorial)
There may have been more changes on my part, but I can't remember all now, and I think these were the key ones.
At first it didn't go, but when I logged on a few hours later it worked without any change. Oh the joy!
Jun 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Byron Saltysiak | last post: by
2 posts views Thread by Ron | last post: by
reply views Thread by radhikams | last post: by
1 post views Thread by popprem | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.