Hi,

Have a look at http://jira.codehaus.org/browse/MCLEAN-48

We've added an integration test for it, since we (or I) couldn't reproduce it. The integration test will verify that it can delete both files and directories with special characters.

These tests are run on several different systems without any problem.

What happens if you check out
http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-clean-plugin/

and execute

mvn verify -Prun-its

Robert

Op Thu, 22 Aug 2013 15:11:59 +0200 schreef Jacob Zwiers <[email protected]>:

I have a resource file named "Mise à jour.pptx" under test/resources/pptx.

The file was created on Windows, checked into CVS and checked out on a Linux server.

The filename on Linux contains \o340 (which is the ISO-8859-1 / Win-1252 encoded value for the à).

When running mvn -e clean on the project, I get (under maven-clean 2.5):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project [project-name]: Failed to clean project: Failed to delete /homes/[path-to-project]/[project-name]/target/checkout/src/test/resources/pptx -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project [project-name]: Failed to clean project: Failed to delete /homes/[path-to-project]/[project-name]/target/checkout/src/test/resources/pptx at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete /homes/[path-to-project]/[project-name]/target/checkout/src/test/resources/pptx at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:215) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: java.io.IOException: Failed to delete /homes/[path-to-project]/[project-name]/target/checkout/src/test/resources/pptx
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:249)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:191)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:158)
        at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:117)
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:193)
        ... 21 more

On the previous version (2.4.1), the error message would specify the file name, but same basic message.

I've changed the filename to replace the "à" with an unaccented "a" and it works (demonstrating that nothing in the file contents, other parts of name, permissions, etc. were causing issues). This is the work around that I am have implemented.

This seems to be a known Java limitation when not using the NIO.2 (JSR-203) classes:
        http://bugs.sun.com/view_bug.do?bug_id=6522199
        http://bugs.sun.com/view_bug.do?bug_id=4899439

Am I understanding this correctly?

If so, are there other workarounds (i.e. besides renaming files)?

Thanks...
jz

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to