You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Vladimir Sosnin (JIRA)" <ji...@codehaus.org> on 2007/11/27 15:51:07 UTC

[jira] Created: (MNG-3302) Maven clean plugin doesn't filter resources from exclude list

Maven clean plugin doesn't filter resources from exclude list
-------------------------------------------------------------

                 Key: MNG-3302
                 URL: http://jira.codehaus.org/browse/MNG-3302
             Project: Maven 2
          Issue Type: Bug
          Components: Plugins and Lifecycle
    Affects Versions: 2.0.7
            Reporter: Vladimir Sosnin


For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.

<build>
...
   <plugins>
	<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
                                   <verbose>true</verbose>
						<fileset>
							<directory>logic/src/test/generated/resources
							</directory>
							<excludes>
								<exclude>.svn/**/*</exclude>
							</excludes>
							<includes>
								<include>**/*</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
       </plugins>
</build>


-- 
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

        

[jira] Updated: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MCLEAN-29:
------------------------------------

    Affects Version/s: 2.2

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch, dont-delete-excluded-file.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> {code:xml}
> <build>
>   ...
>   <plugins>
>     <plugin>
>       <artifactId>maven-clean-plugin</artifactId>
>       <configuration>
>         <verbose>true</verbose>
>         <filesets>
>           <fileset>
>             <directory>logic/src/test/generated/resources</directory>
>             <excludes>
>               <exclude>.svn/**/*</exclude>
>             </excludes>
>             <includes>
>               <include>**/*</include>
>             </includes>
>             <followSymlinks>false</followSymlinks>
>           </fileset>
>         </filesets>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
> {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

        

[jira] Moved: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Siveton moved MNG-3302 to MCLEAN-29:
--------------------------------------------

    Affects Version/s:     (was: 2.0.7)
          Component/s:     (was: Plugins and Lifecycle)
                  Key: MCLEAN-29  (was: MNG-3302)
              Project: Maven 2.x Clean Plugin  (was: Maven 2)

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> <build>
> ...
>    <plugins>
> 	<plugin>
> 				<artifactId>maven-clean-plugin</artifactId>
> 				<configuration>
>                                    <verbose>true</verbose>
> 						<fileset>
> 							<directory>logic/src/test/generated/resources
> 							</directory>
> 							<excludes>
> 								<exclude>.svn/**/*</exclude>
> 							</excludes>
> 							<includes>
> 								<include>**/*</include>
> 							</includes>
> 							<followSymlinks>false</followSymlinks>
> 						</fileset>
> 					</filesets>
> 				</configuration>
> 			</plugin>
>        </plugins>
> </build>

-- 
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

        

[jira] Updated: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MCLEAN-29:
------------------------------------

    Attachment: clean-exclude.zip

I can reproduce this issue (on WinXP), attached is a complete mini project.

A workaround is to set followSymlinks=true for the file set, that keeps the plain files alive. So it seems the issue originates somewhere from org.apache.maven.shared.model.fileset.util.FileSetManager in org.apache.maven.shared:file-management:1.2.

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> <build>
> ...
>    <plugins>
> 	<plugin>
> 				<artifactId>maven-clean-plugin</artifactId>
> 				<configuration>
>                                    <verbose>true</verbose>
> 						<fileset>
> 							<directory>logic/src/test/generated/resources
> 							</directory>
> 							<excludes>
> 								<exclude>.svn/**/*</exclude>
> 							</excludes>
> 							<includes>
> 								<include>**/*</include>
> 							</includes>
> 							<followSymlinks>false</followSymlinks>
> 						</fileset>
> 					</filesets>
> 				</configuration>
> 			</plugin>
>        </plugins>
> </build>

-- 
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

        

[jira] Updated: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MCLEAN-29:
------------------------------------

    Attachment: dont-delete-excluded-file-test.patch

Step 1: Patch providing a unit test for file-management to reveal its bug.

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> <build>
> ...
>    <plugins>
> 	<plugin>
> 				<artifactId>maven-clean-plugin</artifactId>
> 				<configuration>
>                                    <verbose>true</verbose>
> 						<fileset>
> 							<directory>logic/src/test/generated/resources
> 							</directory>
> 							<excludes>
> 								<exclude>.svn/**/*</exclude>
> 							</excludes>
> 							<includes>
> 								<include>**/*</include>
> 							</includes>
> 							<followSymlinks>false</followSymlinks>
> 						</fileset>
> 					</filesets>
> 				</configuration>
> 			</plugin>
>        </plugins>
> </build>

-- 
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

        

[jira] Updated: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MCLEAN-29:
------------------------------------

    Attachment: dont-delete-excluded-file.patch

Step 2: Patch to fix the FileSetManager.

There were actually two bugs:
- findDeletableFiles() queried scanner.getExcludedFiles() to get the mismarked symlinks but it should query scanner.getIncludedFiles()
- both findDeletableDirectories() and findDeletableFiles() forget to prevent the base directory from deletion if it contains excluded files/directories

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch, dont-delete-excluded-file.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> <build>
> ...
>    <plugins>
> 	<plugin>
> 				<artifactId>maven-clean-plugin</artifactId>
> 				<configuration>
>                                    <verbose>true</verbose>
> 						<fileset>
> 							<directory>logic/src/test/generated/resources
> 							</directory>
> 							<excludes>
> 								<exclude>.svn/**/*</exclude>
> 							</excludes>
> 							<includes>
> 								<include>**/*</include>
> 							</includes>
> 							<followSymlinks>false</followSymlinks>
> 						</fileset>
> 					</filesets>
> 				</configuration>
> 			</plugin>
>        </plugins>
> </build>

-- 
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

        

[jira] Closed: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MCLEAN-29.
-----------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.3

Fixed in [r694394|http://svn.apache.org/viewvc?view=rev&revision=694394].

> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Vladimir Sosnin
>            Assignee: Benjamin Bentmann
>             Fix For: 2.3
>
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch, dont-delete-excluded-file.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> {code:xml}
> <build>
>   ...
>   <plugins>
>     <plugin>
>       <artifactId>maven-clean-plugin</artifactId>
>       <configuration>
>         <verbose>true</verbose>
>         <filesets>
>           <fileset>
>             <directory>logic/src/test/generated/resources</directory>
>             <excludes>
>               <exclude>.svn/**/*</exclude>
>             </excludes>
>             <includes>
>               <include>**/*</include>
>             </includes>
>             <followSymlinks>false</followSymlinks>
>           </fileset>
>         </filesets>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
> {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

        

[jira] Updated: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MCLEAN-29:
------------------------------------

    Description: 
For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
{code:xml}
<build>
  ...
  <plugins>
    <plugin>
      <artifactId>maven-clean-plugin</artifactId>
      <configuration>
        <verbose>true</verbose>
        <filesets>
          <fileset>
            <directory>logic/src/test/generated/resources</directory>
            <excludes>
              <exclude>.svn/**/*</exclude>
            </excludes>
            <includes>
              <include>**/*</include>
            </includes>
            <followSymlinks>false</followSymlinks>
          </fileset>
        </filesets>
      </configuration>
    </plugin>
  </plugins>
</build>
{code}

  was:
For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.

<build>
...
   <plugins>
	<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
                                   <verbose>true</verbose>
						<fileset>
							<directory>logic/src/test/generated/resources
							</directory>
							<excludes>
								<exclude>.svn/**/*</exclude>
							</excludes>
							<includes>
								<include>**/*</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
       </plugins>
</build>



> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch, dont-delete-excluded-file.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> {code:xml}
> <build>
>   ...
>   <plugins>
>     <plugin>
>       <artifactId>maven-clean-plugin</artifactId>
>       <configuration>
>         <verbose>true</verbose>
>         <filesets>
>           <fileset>
>             <directory>logic/src/test/generated/resources</directory>
>             <excludes>
>               <exclude>.svn/**/*</exclude>
>             </excludes>
>             <includes>
>               <include>**/*</include>
>             </includes>
>             <followSymlinks>false</followSymlinks>
>           </fileset>
>         </filesets>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
> {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

        

[jira] Issue Comment Edited: (MCLEAN-29) Maven clean plugin doesn't filter resources from exclude list

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCLEAN-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_119481 ] 

bentmann edited comment on MCLEAN-29 at 1/10/08 6:48 PM:
------------------------------------------------------------------

I can reproduce this issue (on WinXP), attached is a complete mini project.

A workaround is to set followSymlinks=true for the file set, that keeps the plain files alive in your special scenario. So it seems the issue originates somewhere from org.apache.maven.shared.model.fileset.util.FileSetManager in org.apache.maven.shared:file-management:1.2.

      was (Author: bentmann):
    I can reproduce this issue (on WinXP), attached is a complete mini project.

A workaround is to set followSymlinks=true for the file set, that keeps the plain files alive. So it seems the issue originates somewhere from org.apache.maven.shared.model.fileset.util.FileSetManager in org.apache.maven.shared:file-management:1.2.
  
> Maven clean plugin doesn't filter resources from exclude list
> -------------------------------------------------------------
>
>                 Key: MCLEAN-29
>                 URL: http://jira.codehaus.org/browse/MCLEAN-29
>             Project: Maven 2.x Clean Plugin
>          Issue Type: Bug
>            Reporter: Vladimir Sosnin
>         Attachments: clean-exclude.zip, dont-delete-excluded-file-test.patch, dont-delete-excluded-file.patch
>
>
> For example you want to delete content of folder but want to keep folder itself and it's SCM (e.g. SVN) information. Following configuration for "maven-maven-clean" plugin deletes all plain files under ".svn" directory and simply keeps empty subdirs. Thus, making update command impossible.
> <build>
> ...
>    <plugins>
> 	<plugin>
> 				<artifactId>maven-clean-plugin</artifactId>
> 				<configuration>
>                                    <verbose>true</verbose>
> 						<fileset>
> 							<directory>logic/src/test/generated/resources
> 							</directory>
> 							<excludes>
> 								<exclude>.svn/**/*</exclude>
> 							</excludes>
> 							<includes>
> 								<include>**/*</include>
> 							</includes>
> 							<followSymlinks>false</followSymlinks>
> 						</fileset>
> 					</filesets>
> 				</configuration>
> 			</plugin>
>        </plugins>
> </build>

-- 
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