[ 
http://jira.codehaus.org/browse/MOJO-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_113240
 ] 

Kevin Conaway edited comment on MOJO-820 at 11/8/07 3:50 PM:
-------------------------------------------------------------

I'm experiencing the same issue as the original poster.  I have the following 
setup:

myproject
 -- myproject-java
 -- myproject-native

When I call 'mvn install' from myproject, everything works fine.  However, when 
I call 'mvn compile' from myproject, I get the following error:
{quote}
[INFO] [native:compile]
[INFO] cl.exe /LD -IC:\code\java\jdpapi\jdpapi-native\src\main\native 
"-IC:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include" 
-IC:\code\java\jdpapi\jdpapi-native\target\native\javah "-IC:\Program 
Files\Java\jdk1.6.0_02\jre\..\include" "-IC:\Program 
Files\Java\jdk1.6.0_02\jre\..\include\win32" 
/FoC:\code\java\jdpapi\jdpapi-native\target\DPAPI.obj -c 
C:\code\java\jdpapi\jdpapi-native\src\main\native\DPAPI.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

DPAPI.cpp
[DEBUG] net.sourceforge.jdpapi:jdpapi-native:dll:1.0-SNAPSHOT (selected for null
)
[DEBUG]   junit:junit:jar:3.8.1:test (selected for test)
[DEBUG]   active project artifact:
        artifact = net.sourceforge.jdpapi:jdpapi-java:jar:1.0-SNAPSHOT:compile;
        project: [EMAIL PROTECTED] (selected for co
mpile)
[DEBUG] Configuring mojo 'org.codehaus.mojo:native-maven-plugin:1.0-alpha-2:link
' -->
[DEBUG]   (f) compilerProvider = msvc
[DEBUG]   (f) envFactoryName = 
org.codehaus.mojo.natives.msvc.MSVC2005x86EnvFactory
[DEBUG]   (f) externalLibDirectory = 
C:\code\java\jdpapi\jdpapi-native\target\lib
[DEBUG]   (f) linkerStartOptions = [/DLL Crypt32.lib /LIBPATH:"C:\Program 
Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib"]
[DEBUG]   (f) outputDirectory = C:\code\java\jdpapi\jdpapi-native\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG]   (f) projectArtifactMap = {
    net.sourceforge.jdpapi:jdpapi-java=active project 
    artifact:artifact = 
net.sourceforge.jdpapi:jdpapi-java:jar:1.0-SNAPSHOT:compile;
    project: [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [native:link]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to copy dependency to staging area
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to copy 
dependency to staging area
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to copy 
dependency to staging area
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.getDependencyFile(NativeLinkMojo.java:349)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.getLibFileNames(NativeLinkMojo.java:262)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.createLinkerConfiguration(NativeLinkMojo.java:206)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.execute(NativeLinkMojo.java:168)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
{quote}


 was:
I'm experiencing the same issue as the original poster.  I have the following 
setup:

myproject
 -- myproject-java
 -- myproject-native

When I call 'mvn install' from myproject, everything works fine.  However, when 
I call 'mvn compile' from myproject, I get the following error:

[INFO] [native:compile]
[INFO] cl.exe /LD -IC:\code\java\jdpapi\jdpapi-native\src\main\native 
"-IC:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include" 
-IC:\code\java\jdpapi\jdpapi-native\target\native\javah "-IC:\Program 
Files\Java\jdk1.6.0_02\jre\..\include" "-IC:\Program 
Files\Java\jdk1.6.0_02\jre\..\include\win32" 
/FoC:\code\java\jdpapi\jdpapi-native\target\DPAPI.obj -c 
C:\code\java\jdpapi\jdpapi-native\src\main\native\DPAPI.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

DPAPI.cpp
[DEBUG] net.sourceforge.jdpapi:jdpapi-native:dll:1.0-SNAPSHOT (selected for null
)
[DEBUG]   junit:junit:jar:3.8.1:test (selected for test)
[DEBUG]   active project artifact:
        artifact = net.sourceforge.jdpapi:jdpapi-java:jar:1.0-SNAPSHOT:compile;
        project: [EMAIL PROTECTED] (selected for co
mpile)
[DEBUG] Configuring mojo 'org.codehaus.mojo:native-maven-plugin:1.0-alpha-2:link
' -->
[DEBUG]   (f) compilerProvider = msvc
[DEBUG]   (f) envFactoryName = 
org.codehaus.mojo.natives.msvc.MSVC2005x86EnvFactory
[DEBUG]   (f) externalLibDirectory = 
C:\code\java\jdpapi\jdpapi-native\target\lib
[DEBUG]   (f) linkerStartOptions = [/DLL Crypt32.lib /LIBPATH:"C:\Program 
Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib"]
[DEBUG]   (f) outputDirectory = C:\code\java\jdpapi\jdpapi-native\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG]   (f) projectArtifactMap = {
    net.sourceforge.jdpapi:jdpapi-java=active project 
    artifact:artifact = 
net.sourceforge.jdpapi:jdpapi-java:jar:1.0-SNAPSHOT:compile;
    project: [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [native:link]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to copy dependency to staging area
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to copy 
dependency to staging area
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to copy 
dependency to staging area
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.getDependencyFile(NativeLinkMojo.java:349)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.getLibFileNames(NativeLinkMojo.java:262)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.createLinkerConfiguration(NativeLinkMojo.java:206)
        at 
org.codehaus.mojo.natives.plugin.NativeLinkMojo.execute(NativeLinkMojo.java:168)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more


> NativeLinkMojo fails in multi project environment - Attempts to copy whole 
> directory using file copy method
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: MOJO-820
>                 URL: http://jira.codehaus.org/browse/MOJO-820
>             Project: Mojo
>          Issue Type: Bug
>          Components: native
>         Environment: Win32
>            Reporter: Richard Simmonds
>            Priority: Critical
>
> When trying to link files if plugin is part of multple projects being called 
> the artifact passed in file member var may be of type directory.  When the 
> FileUtils.copyFile method is called this causes a failure
> {code} 
>     private File getDependencyFile( Artifact artifact, boolean doCopy )
>         throws MojoExecutionException
>     {
>         File newLocation = artifact.getFile();
>         newLocation = new File( this.externalLibDirectory, 
> artifact.getArtifactId() + "."
>             + artifact.getArtifactHandler().getExtension() );
>         try
>         {
>             if ( doCopy && ( !newLocation.exists() || 
> newLocation.lastModified() <= artifact.getFile().lastModified() ) )
>             {
>                 FileUtils.copyFile( artifact.getFile(), newLocation );
>             }
>         }
>         catch ( IOException ioe )
>         {
>             throw new MojoExecutionException( "Unable to copy dependency to 
> staging area" );
>         }
>         return newLocation;
>     }
> {code} 

-- 
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

Reply via email to