maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agfung <>
Subject "<targetPath/>" for <resource> behaves differently Windows v. Linux
Date Wed, 20 Mar 2013 18:48:42 GMT
Running "mvn compile" on the attached build (basically the POM below and a
/src/main/resources/placeholder.txt/), I get different behaviour on Windows
v Linux (tried combinations of Maven 3.0.4/3.0.5, Win7 x64/Ubuntu12.10 x64,
openjdk 1.6/1.7).

On Windows, it compiles fine.  On Linux, it tries to copy the resources to
the root directory instead of the build output directory tree.  It fails
because the account I'm running under doesn't have permissions to write

I tried attaching a debugger, and the furthest I got was stepping through
/maven-filtering-1.0-beta-2 /, and seeing that in
/DefaultMavenResourcesFiltering/, /Resource.getTargetPath()/ returns null on
Windows, and "" on Linux.  Why that is, I don't know.

Returning "" triggers the null-check logic that basically says "if
targetPath is not null, append a slash".  But if /targetPath/ is an empty
string, this creates a destination filename that resides in the root

The workaround is straightforward - remove the redundant "<targetPath/>"
element, since the default behaviour is the same - but I just wanted to
confirm if this is a bug, or something I don't understand. <>  

<project xmlns=""


View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message