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