[
http://jira.codehaus.org/browse/MOJO-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_99277
]
Richard Simmonds commented on MOJO-820:
---------------------------------------
My project structure is setup as follows. I have a multi-module project with a
pom list containing 2 projects.
e.g
{code:xml}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>my-parent</artifactId>
<version>2.0</version>
<modules>
<module>p1<module>
<module>p2-n<module>
</modules>
</project>
{code}
p3-n contains the native plugin and has dependencies of p1. If I execute mvn
compile on the multimodule p1,p2-n will compile, then when it tries to link
p2-n it attempts to copy over the classes directory of p1 rather than the jar
file.
If I drop down into the p2-n directory and run the link is successfull as it
appears to copy the p1.jar over.
> 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