Running junit test
EclipsePluginUnitTest.testBuildDirectoryList_ShouldUseTestOutputDirFromProjectWhenBuildOutputDirIsStandard

returns results:

Can't canonicalize system path:
C:\TEMP\EclipsePlugin.unitTest.1165557188766\D:\ide\workspace\maven\maven-eclipse-plugin\target\main-output

org.apache.maven.plugin.MojoExecutionException: Can't canonicalize
system path: 
C:\TEMP\EclipsePlugin.unitTest.1165557188766\D:\ide\workspace\maven\maven-eclipse-plugin\target\main-output
at org.apache.maven.plugin.ide.IdeUtils.getCanonicalPath(IdeUtils.java:60)
at 
org.apache.maven.plugin.ide.IdeUtils.toRelativeAndFixSeparator(IdeUtils.java:72)
at 
org.apache.maven.plugin.eclipse.EclipsePlugin.extractResourceDirs(EclipsePlugin.java:978)
at 
org.apache.maven.plugin.eclipse.EclipsePlugin.buildDirectoryList(EclipsePlugin.java:903)
at 
org.apache.maven.plugin.eclipse.EclipsePluginUnitTest.testBuildDirectoryList_ShouldUseTestOutputDirFromProjectWhenBuildOutputDirIsStandard(EclipsePluginUnitTest.java:58)


The reason for this is that in IdeUtils.toRelativeAndFixSeparator line 72 is:
   absolutePath = getCanonicalPath( fileToAdd );

But the fileToAdd is a relative file taken from the project model see
EclipsePlugin lines 894:
       boolean useStandardOutputDir = buildOutputDirectory.equals(
new File( project.getBuild().getOutputDirectory() ) );
       if ( useStandardOutputDir )
       {
           testOutput = IdeUtils.toRelativeAndFixSeparator(
projectBaseDir, new File( project.getBuild()
               .getTestOutputDirectory() ), false );
       }

So when getCanonicalPath() is called this value is resolved relative
to whatever is on the Java command executable (in my case the checked
out eclipse plugin root directory)

This canonical version of the "relative" path is then concatenated at
EclipsePlugin line 967.
   File outputFile = new File( workspaceProjectBaseDir, output );
where
   workspaceProjectBaseDir = temp dir in this case
C:\TEMP\EclipsePlugin.unitTest.1165557188766\
   output = \D:\ide\workspace\maven\maven-eclipse-plugin\target\main-output

when output should probably be just "\target\main-output"


As its 5pm on a Friday, I'm not going to get much of a chance to look
into this further, so I thought I would post and see if someone who
knows this code better can see the problem.

Cheers
Bae

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to