[
http://jira.codehaus.org/browse/MOJO-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter De Maeyer updated MOJO-1535:
----------------------------------
Attachment: patch.txt
I noticed that my first patch contained a bug, anyway, here's another one with
a slightly different solution.
The unit test now fails though because of a NPE bug in AbstractArchiver: it
can't deal with a destination file that has no parent dir and it throws NPE.
The fix is good though.
> native-maven-plugin does not work with Eclipse Maven workspace resolution:
> "Unable to copy dependency to staging area"
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: MOJO-1535
> URL: http://jira.codehaus.org/browse/MOJO-1535
> Project: Mojo
> Issue Type: Bug
> Environment: linux-x86-64, sun jdk 1.6.0_20, eclipse with maven2
> plugin
> Reporter: Peter De Maeyer
> Attachments: patch.txt, patch.txt
>
>
> Affects: native-maven-plugin, version 1.0-alpha-5.
> I have a project combining some java code and native code through jni.
> When running maven "install" target from within eclipse, the linker fails
> with "Unable to copy dependency to stating area".
> The reason seems to be that the NativeLinkMojo receives a directory as
> artifact rather than a .jar, and fails on it.
> That is of course precisely what workspace resolution is all about: it uses
> directories in the workspace instead as artifacts instead of .jars. It's a
> perfectly valid use case, and plugins should be able to deal with it.
> Note that #MOJO-820 is about a similar problem, and is marked as "won't fix",
> but I suggest you reconsider in the context of this new use case.
> ---
> [ERROR] Failed to execute goal
> org.codehaus.mojo:native-maven-plugin:1.0-alpha-5:link (default-link) on
> project libboyermoore: Unable to copy dependency to staging area. Could not
> copy /home/peter/workspace/de-maeyer/search/impl/target/classes to
> /home/peter/workspace/de-maeyer/search/native/boyer-moore/linux/target/lib/search-impl.jar:
> /home/peter/workspace/de-maeyer/search/impl/target/classes (Is a directory)
> -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-5:link (default-link) on
> project libboyermoore: Unable to copy dependency to staging area. Could not
> copy /home/peter/workspace/de-maeyer/search/impl/target/classes to
> /home/peter/workspace/de-maeyer/search/native/boyer-moore/linux/target/lib/search-impl.jar
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:585)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to copy
> dependency to staging area. Could not copy
> /home/peter/workspace/de-maeyer/search/impl/target/classes to
> /home/peter/workspace/de-maeyer/search/native/boyer-moore/linux/target/lib/search-impl.jar
> at
> org.codehaus.mojo.natives.plugin.NativeLinkMojo.getDependencyFile(NativeLinkMojo.java:456)
> at
> org.codehaus.mojo.natives.plugin.NativeLinkMojo.getLibFileNames(NativeLinkMojo.java:329)
> at
> org.codehaus.mojo.natives.plugin.NativeLinkMojo.createLinkerConfiguration(NativeLinkMojo.java:220)
> at
> org.codehaus.mojo.natives.plugin.NativeLinkMojo.execute(NativeLinkMojo.java:179)
> at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
> ... 14 more
> Caused by: java.io.FileNotFoundException:
> /home/peter/workspace/de-maeyer/search/impl/target/classes (Is a directory)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:106)
> at
> org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:39)
> at
> org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1106)
> at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1013)
> at
> org.codehaus.mojo.natives.plugin.NativeLinkMojo.getDependencyFile(NativeLinkMojo.java:451)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email