You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "jira-importer (via GitHub)" <gi...@apache.org> on 2025/02/28 10:42:25 UTC

[I] [MCLEAN-47] On windows if there are junctions on the cleaned directories, clean deletes .* resources under junction's target along with junction. [maven-clean-plugin]

jira-importer opened a new issue, #221:
URL: https://github.com/apache/maven-clean-plugin/issues/221

   **[Laurent Chaply](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=lchaply)** opened **[MCLEAN-47](https://issues.apache.org/jira/browse/MCLEAN-47?redirect=false)** and commented
   
   Hi,
   
   I did a minimal test to reproduce and describe the issue:
   
   I have a directory containing .* resources (for example ".svn") let's say `C:\tmp\svn_checkout`
   I create a project with a minimal pom.xml :
   
   ```xml
   <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   	<modelVersion>4.0.0</modelVersion>
   	<groupId>test</groupId>
   	<artifactId>test</artifactId>
   	<name>test</name>
   	<version>1.0-SNAPSHOT</version>
   </project>
   ```
   
   In the project I create a `"target"` directory
   In the target directory I do `"mklink /J svn_checkout C:\tmp\svn_checkout"`
   So I have
   
   ```
   C:\testproject
   C:\testproject\pom.xml
   C:\testproject\target
   C:\testproject\target\svn_checkout -> C:\tmp\svn_checkout
   ```
   
   If I do `"mvn clean"` the target directory is deleted as expected, but also all my `.svn` directories under `C:\tmp\svn_checkout`
   If I have other .* files (.project, .classpath) they are deleted too.
   
   In the real life I have a custom maven plugin that creates an ear on my app server, and replaces the war files in it by junction to the war project I checkout from svn.
   I add the ear in the list of directories to be "cleaned" (by adding a \<fileset>), and I have all my `.svn` deleted on each clean.
   
   Regards,
   
   Laurent
   
   
   ---
   
   **Affects:** 2.4.1
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MCLEAN-47] On windows if there are junctions on the cleaned directories, clean deletes .* resources under junction's target along with junction. [maven-clean-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #221:
URL: https://github.com/apache/maven-clean-plugin/issues/221#issuecomment-2690316208

   **[Kristian Rosenvold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=krosenvold)** commented
   
   Fixed for java7+ users in r1631508. This issue will not be fixed for prior java versions
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MCLEAN-47] On windows if there are junctions on the cleaned directories, clean deletes .* resources under junction's target along with junction. [maven-clean-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #221:
URL: https://github.com/apache/maven-clean-plugin/issues/221#issuecomment-2690316203

   **[Robert Scholte](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rfscholte)** commented
   
   It looks like it is not possible to recognize a junction with Java6 or previous version (and this plugin has recently moved to java5!).
   But there is a project called [JNA](https://github.com/twall/jna) which could help us here with [getFileAttributes()](http://twall.github.com/jna/3.4.0/javadoc/com/sun/jna/platform/win32/Kernel32Util.html#getFileAttributes(java.lang.String))
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org