├── src ├── it │ ├── default │ │ ├── target │ │ │ ├── test-1.0-SNAPSHOT.jar │ │ │ ├── site │ │ │ │ └── index.html │ │ │ ├── classes │ │ │ │ └── main.properties │ │ │ └── test-classes │ │ │ │ └── test.properties │ │ ├── verify.bsh │ │ ├── setup.bsh │ │ └── pom.xml │ ├── only-test-clean │ │ ├── target │ │ │ ├── test-1.0-SNAPSHOT.jar │ │ │ ├── site │ │ │ │ └── index.html │ │ │ ├── classes │ │ │ │ └── main.properties │ │ │ └── test-classes │ │ │ │ └── test.properties │ │ ├── invoker.properties │ │ ├── setup.bsh │ │ ├── verify.bsh │ │ └── pom.xml │ ├── exclude-default-dirs │ │ ├── target │ │ │ ├── test-1.0-SNAPSHOT.jar │ │ │ ├── site │ │ │ │ └── index.html │ │ │ ├── classes │ │ │ │ └── main.properties │ │ │ └── test-classes │ │ │ │ └── test.properties │ │ ├── pom.xml │ │ └── verify.bsh │ ├── fast-delete │ │ ├── target │ │ │ └── dummy.txt │ │ ├── invoker.properties │ │ ├── verify.groovy │ │ └── pom.xml │ ├── symlink-dont-follow │ │ ├── ext │ │ │ ├── file.txt │ │ │ └── dir │ │ │ │ └── file.txt │ │ ├── target │ │ │ └── dummy.txt │ │ ├── target2 │ │ │ └── dummy.txt │ │ ├── setup.groovy │ │ ├── verify.groovy │ │ └── pom.xml │ ├── fast-delete-default │ │ ├── target │ │ │ └── dummy.txt │ │ ├── invoker.properties │ │ ├── verify.groovy │ │ └── pom.xml │ ├── dangling-symlinks │ │ ├── target │ │ │ └── link-target.txt │ │ ├── verify.groovy │ │ ├── setup.groovy │ │ └── pom.xml │ ├── file-sets-includes-excludes │ │ ├── dirs │ │ │ ├── dir4 │ │ │ │ ├── file.txt │ │ │ │ ├── excluded │ │ │ │ │ └── file.txt │ │ │ │ └── included │ │ │ │ │ └── file.txt │ │ │ ├── dir0 │ │ │ │ ├── excluded.txt │ │ │ │ ├── included.txt │ │ │ │ ├── sub0 │ │ │ │ │ ├── excluded.txt │ │ │ │ │ └── included.txt │ │ │ │ ├── sub1 │ │ │ │ │ └── included.txt │ │ │ │ └── sub2 │ │ │ │ │ └── excluded.txt │ │ │ ├── dir1 │ │ │ │ ├── excluded.txt │ │ │ │ ├── included.txt │ │ │ │ ├── sub0 │ │ │ │ │ ├── excluded.txt │ │ │ │ │ └── included.txt │ │ │ │ ├── sub1 │ │ │ │ │ └── included.txt │ │ │ │ └── sub2 │ │ │ │ │ └── excluded.txt │ │ │ ├── dir2 │ │ │ │ ├── excluded.txt │ │ │ │ ├── included.txt │ │ │ │ ├── sub0 │ │ │ │ │ ├── excluded.txt │ │ │ │ │ └── included.txt │ │ │ │ ├── sub1 │ │ │ │ │ └── included.txt │ │ │ │ └── sub2 │ │ │ │ │ └── excluded.txt │ │ │ └── dir3 │ │ │ │ ├── excluded.txt │ │ │ │ ├── included.txt │ │ │ │ ├── sub0 │ │ │ │ ├── excluded.txt │ │ │ │ └── included.txt │ │ │ │ ├── sub1 │ │ │ │ └── included.txt │ │ │ │ └── sub2 │ │ │ │ └── excluded.txt │ │ ├── verify.bsh │ │ └── pom.xml │ ├── read-only │ │ ├── target │ │ │ ├── writable-dir │ │ │ │ └── writable.properties │ │ │ └── read-only-dir │ │ │ │ └── read-only.properties │ │ ├── verify.bsh │ │ ├── setup.bsh │ │ └── pom.xml │ ├── file-sets-absolute-paths │ │ ├── delete-me │ │ │ └── test.txt │ │ ├── verify.bsh │ │ ├── pom.xml │ │ └── child-a │ │ │ └── pom.xml │ ├── file-sets-relative-paths │ │ ├── deploy │ │ │ └── test.txt │ │ ├── target │ │ │ └── test.txt │ │ ├── child-a │ │ │ ├── target │ │ │ │ └── test.txt │ │ │ ├── temp-stuff │ │ │ │ └── test.txt │ │ │ └── pom.xml │ │ ├── child-b │ │ │ ├── deploy │ │ │ │ └── test.txt │ │ │ ├── target │ │ │ │ └── test.txt │ │ │ └── pom.xml │ │ ├── temp-stuff │ │ │ └── test.txt │ │ ├── pom.xml │ │ └── verify.bsh │ ├── sources-targetPath │ │ ├── target │ │ │ └── test-classes │ │ │ │ └── README.md │ │ ├── verify.bsh │ │ ├── setup.bsh │ │ ├── outside-target │ │ │ └── README.md │ │ └── pom.xml │ ├── special-characters │ │ ├── setup.bsh │ │ ├── verify.bsh │ │ └── pom.xml │ ├── non-existent-base-dirs │ │ └── pom.xml │ └── settings.xml ├── test │ ├── resources │ │ └── unit │ │ │ ├── fileset-clean-test │ │ │ ├── target │ │ │ │ ├── file.txt │ │ │ │ ├── classes │ │ │ │ │ └── file.txt │ │ │ │ ├── subdir │ │ │ │ │ └── file.txt │ │ │ │ └── test-classes │ │ │ │ │ └── file.txt │ │ │ ├── buildOutputDirectory │ │ │ │ └── file.txt │ │ │ └── pom.xml │ │ │ ├── nested-clean-test │ │ │ ├── target │ │ │ │ ├── file.txt │ │ │ │ ├── classes │ │ │ │ │ └── file.txt │ │ │ │ ├── subdir │ │ │ │ │ └── file.txt │ │ │ │ └── test-classes │ │ │ │ │ └── file.txt │ │ │ └── pom.xml │ │ │ ├── basic-clean-test │ │ │ ├── buildDirectory │ │ │ │ └── file.txt │ │ │ ├── buildOutputDirectory │ │ │ │ └── file.txt │ │ │ ├── buildTestDirectory │ │ │ │ └── file.txt │ │ │ └── pom.xml │ │ │ ├── invalid-directory-test │ │ │ ├── this-is-a-file │ │ │ └── pom.xml │ │ │ ├── locked-file-test │ │ │ ├── buildDirectory │ │ │ │ └── file.txt │ │ │ └── pom.xml │ │ │ ├── empty-clean-test │ │ │ ├── testDirectoryStructure │ │ │ │ ├── file.txt │ │ │ │ └── outputDirectory │ │ │ │ │ └── file.txt │ │ │ └── pom.xml │ │ │ └── missing-directory-test │ │ │ └── pom.xml │ └── java │ │ └── org │ │ └── apache │ │ └── maven │ │ └── plugins │ │ └── clean │ │ └── CleanerTest.java ├── site │ ├── resources │ │ └── download.cgi │ ├── apt │ │ ├── examples │ │ │ ├── skipping-clean.apt.vm │ │ │ ├── ignoring-errors.apt.vm │ │ │ └── delete_additional_files.apt.vm │ │ ├── usage.apt.vm │ │ └── index.apt.vm │ ├── site.xml │ ├── fml │ │ └── faq.fml │ └── xdoc │ │ └── download.xml.vm └── main │ └── java │ └── org │ └── apache │ └── maven │ └── plugins │ └── clean │ ├── FastMode.java │ └── Fileset.java ├── NOTICE ├── .gitignore ├── .github ├── release-drafter-3.x.yml ├── release-drafter.yml ├── workflows │ ├── stale.yml │ ├── pr-automation.yml │ ├── release-drafter.yml │ └── maven-verify.yml ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── FEATURE.yml │ └── BUG.yml └── pull_request_template.md ├── .git-blame-ignore-revs ├── Jenkinsfile ├── .asf.yaml └── README.md /src/it/default/target/test-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/maven-clean-plugin/HEAD/src/it/default/target/test-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/maven-clean-plugin/HEAD/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/target/test-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/maven-clean-plugin/HEAD/src/it/exclude-default-dirs/target/test-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Maven Clean Plugin 2 | Copyright 2007-2024 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .project 3 | .classpath 4 | .settings/ 5 | .svn/ 6 | bin/ 7 | # Intellij 8 | *.ipr 9 | *.iml 10 | .idea 11 | out/ 12 | .DS_Store 13 | /bootstrap 14 | /dependencies.xml 15 | .java-version 16 | -------------------------------------------------------------------------------- /src/it/default/target/site/index.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/it/fast-delete/target/dummy.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/only-test-clean/target/site/index.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/target/site/index.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/ext/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/default/target/classes/main.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/fast-delete-default/target/dummy.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/ext/dir/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/target/dummy.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/target2/dummy.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/dangling-symlinks/target/link-target.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/default/target/test-classes/test.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir4/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/read-only/target/writable-dir/writable.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/target/classes/main.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-absolute-paths/delete-me/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir4/excluded/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir4/included/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/deploy/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/target/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/only-test-clean/target/classes/main.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | -------------------------------------------------------------------------------- /src/it/only-test-clean/target/test-classes/test.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/read-only/target/read-only-dir/read-only.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/target/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/nested-clean-test/target/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/target/test-classes/test.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-a/target/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-b/deploy/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-b/target/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/temp-stuff/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/test/resources/unit/basic-clean-test/buildDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/target/classes/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/target/subdir/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/invalid-directory-test/this-is-a-file: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/locked-file-test/buildDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/nested-clean-test/target/classes/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/nested-clean-test/target/subdir/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-a/temp-stuff/test.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Test -------------------------------------------------------------------------------- /src/test/resources/unit/basic-clean-test/buildOutputDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/basic-clean-test/buildTestDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/buildOutputDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/target/test-classes/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/test/resources/unit/nested-clean-test/target/test-classes/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/test/resources/unit/empty-clean-test/testDirectoryStructure/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/sub0/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/sub0/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/sub1/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir0/sub2/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/sub0/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/sub0/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/sub1/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir1/sub2/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/sub0/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/sub0/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/sub1/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir2/sub2/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/sub0/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/sub0/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/sub1/included.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/dirs/dir3/sub2/excluded.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | Just a file. -------------------------------------------------------------------------------- /src/it/only-test-clean/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | invoker.goals = clean -Ptest-clean -------------------------------------------------------------------------------- /src/test/resources/unit/empty-clean-test/testDirectoryStructure/outputDirectory/file.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /.github/release-drafter-3.x.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | _extends: maven-gh-actions-shared:.github/release-drafter.yml 19 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | # Change maven code style 21 | 7b053970f4b9443651fa5dffe42c8b025c596dff 22 | -------------------------------------------------------------------------------- /src/it/fast-delete/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | invoker.goals = install clean -Dorg.slf4j.simpleLogger.showThreadName=true -X -e 19 | -------------------------------------------------------------------------------- /src/it/fast-delete-default/invoker.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | invoker.goals = install clean -Dorg.slf4j.simpleLogger.showThreadName=true -X -e 19 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | asfMavenTlpPlgnBuild(jdks:[ "17", "21" ], maven: [ "4.0.x" ], siteJdk:[ "17" ], siteMvn:[ "4.0.x" ]) 21 | -------------------------------------------------------------------------------- /src/it/sources-targetPath/target/test-classes/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | The purpose of this file is to verify that the directory 19 | specified by `` is still deleted. 20 | -------------------------------------------------------------------------------- /src/it/sources-targetPath/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.File; 21 | 22 | return !(new File(basedir, "target").exists() || new File(basedir, "outside-target").exists()); 23 | -------------------------------------------------------------------------------- /src/site/resources/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # Just call the standard mirrors.cgi script. It will use download.html 21 | # as the input template. 22 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | _extends: maven-gh-actions-shared 19 | 20 | include-pre-releases: true 21 | prerelease: true 22 | 23 | header: | 24 | > [!WARNING] 25 | > This plugin is a Maven 4 plugin and requires Maven 4.x to run. 26 | -------------------------------------------------------------------------------- /src/it/read-only/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.File; 21 | 22 | if (new File(basedir, "target").exists()) { 23 | System.out.println("target should have been deleted."); 24 | return false; 25 | } 26 | return true; 27 | -------------------------------------------------------------------------------- /src/it/sources-targetPath/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.File; 21 | 22 | return new File(basedir, "target").exists() && new File(basedir, "outside-target").exists(); 23 | // The opposite condition is tested in "verify.bsh". 24 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Stale 19 | 20 | on: 21 | schedule: 22 | - cron: '16 4 * * *' 23 | issue_comment: 24 | types: [ 'created' ] 25 | 26 | jobs: 27 | stale: 28 | uses: 'apache/maven-gh-actions-shared/.github/workflows/stale.yml@v4' 29 | -------------------------------------------------------------------------------- /.github/workflows/pr-automation.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: PR Automation 19 | on: 20 | pull_request_target: 21 | types: 22 | - closed 23 | 24 | jobs: 25 | pr-automation: 26 | name: PR Automation 27 | uses: apache/maven-gh-actions-shared/.github/workflows/pr-automation.yml@v4 28 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Release Drafter 19 | on: 20 | push: 21 | branches: 22 | - master 23 | workflow_dispatch: 24 | 25 | jobs: 26 | update_release_draft: 27 | uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4 28 | -------------------------------------------------------------------------------- /src/it/sources-targetPath/outside-target/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | The purpose of this file is to verify that the directory specified by `` is deleted. 19 | This verification requires a directory outside the `target` directory, otherwise its deletion could 20 | not be distinguished from the usual deletion of `${maven.build.directory}`. 21 | -------------------------------------------------------------------------------- /src/it/fast-delete-default/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | if ( new File( basedir, "target" ).exists() ) 21 | { 22 | System.out.println( "FAILURE: 'target' has not been deleted." ); 23 | return false; 24 | } 25 | 26 | File buildLog = new File(basedir, 'build.log') 27 | return buildLog.text.contains('mvn-background-cleaner') 28 | -------------------------------------------------------------------------------- /.github/workflows/maven-verify.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Verify 19 | 20 | on: 21 | push: 22 | pull_request: 23 | 24 | jobs: 25 | build: 26 | name: Verify 27 | uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4 28 | with: 29 | maven4-build: true 30 | maven4-version: '4.0.0-rc-5' # the same as used in project 31 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | version: 2 18 | updates: 19 | 20 | - package-ecosystem: "maven" 21 | directory: "/" 22 | schedule: 23 | interval: "daily" 24 | 25 | - package-ecosystem: "github-actions" 26 | directory: "/" 27 | schedule: 28 | interval: "daily" 29 | 30 | - package-ecosystem: "maven" 31 | directory: "/" 32 | schedule: 33 | interval: "daily" 34 | target-branch: "maven-clean-plugin-3.x" 35 | -------------------------------------------------------------------------------- /src/test/resources/unit/empty-clean-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | true 27 | true 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/special-characters/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | import org.apache.maven.plugin.clean.*; 25 | 26 | 27 | File parentDir = new File( basedir, "target" ); 28 | File target = new File( parentDir, "Pep\u00E9 le Pew" ); 29 | target.mkdirs(); 30 | target = new File( parentDir, "Conditions_g\u00E9n\u00E9rales_d'isalaire.txt" ); 31 | target.createNewFile(); 32 | -------------------------------------------------------------------------------- /src/it/fast-delete/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | if ( new File( basedir, "target" ).exists() ) 21 | { 22 | System.out.println( "FAILURE: 'target' has not been deleted." ); 23 | return false; 24 | } 25 | if ( new File( basedir, ".fastdir" ).exists() ) 26 | { 27 | System.out.println( "FAILURE: '.fastdir' has not been deleted." ); 28 | return false; 29 | } 30 | 31 | File buildLog = new File(basedir, 'build.log') 32 | return buildLog.text.contains('mvn-background-cleaner') 33 | -------------------------------------------------------------------------------- /src/test/resources/unit/locked-file-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | ${project.basedir}/buildDirectory 27 | true 28 | true 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/resources/unit/invalid-directory-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | ${project.basedir}/this-is-a-file 27 | true 28 | true 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/resources/unit/missing-directory-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | ${project.basedir}/does-not-exist 27 | true 28 | true 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/it/default/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | File targetDir = new File( basedir, "target" ); 28 | System.out.println( "Checking for absence of " + targetDir ); 29 | if ( targetDir.exists() ) 30 | { 31 | System.out.println( "FAILURE!" ); 32 | return false; 33 | } 34 | } 35 | catch( Throwable t ) 36 | { 37 | t.printStackTrace(); 38 | return false; 39 | } 40 | 41 | return true; 42 | -------------------------------------------------------------------------------- /src/it/default/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | File targetDir = new File( basedir, "target" ); 28 | System.out.println( "Checking for existence of " + targetDir ); 29 | if ( !targetDir.isDirectory() ) 30 | { 31 | System.out.println( "FAILURE!" ); 32 | return false; 33 | } 34 | } 35 | catch( Throwable t ) 36 | { 37 | t.printStackTrace(); 38 | return false; 39 | } 40 | 41 | return true; 42 | -------------------------------------------------------------------------------- /src/it/dangling-symlinks/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | File targetDir = new File( basedir, "target" ); 28 | System.out.println( "Checking for absence of " + targetDir ); 29 | if ( targetDir.exists() ) 30 | { 31 | System.out.println( "FAILURE!" ); 32 | return false; 33 | } 34 | } 35 | catch( Throwable t ) 36 | { 37 | t.printStackTrace(); 38 | return false; 39 | } 40 | 41 | return true; 42 | -------------------------------------------------------------------------------- /src/it/only-test-clean/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | File targetDir = new File( basedir, "target" ); 28 | System.out.println( "Checking for existence of " + targetDir ); 29 | if ( !targetDir.isDirectory() ) 30 | { 31 | System.out.println( "FAILURE!" ); 32 | return false; 33 | } 34 | } 35 | catch( Throwable t ) 36 | { 37 | t.printStackTrace(); 38 | return false; 39 | } 40 | 41 | return true; 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 19 | 20 | blank_issues_enabled: false 21 | 22 | contact_links: 23 | 24 | - name: Project Mailing Lists 25 | url: https://maven.apache.org/mailing-lists.html 26 | about: Please ask a question or discuss here 27 | 28 | - name: Old JIRA Issues 29 | url: https://issues.apache.org/jira/projects/MCLEAN 30 | about: Please search old JIRA issues 31 | -------------------------------------------------------------------------------- /src/it/special-characters/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | // this confirms that special character file and directory are deleted 28 | File targetDir = new File( basedir, "target" ); 29 | if ( targetDir.exists() ) 30 | { 31 | System.out.println( "FAILURE! target must not exist" ); 32 | return false; 33 | } 34 | 35 | } 36 | catch( Throwable t ) 37 | { 38 | t.printStackTrace(); 39 | return false; 40 | } 41 | 42 | return true; 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 19 | 20 | name: Feature request 21 | description: File a proposal for new feature, improvement 22 | labels: ["enhancement"] 23 | 24 | body: 25 | - type: markdown 26 | attributes: 27 | value: | 28 | Thanks for taking the time to fill out this new feature, improvement proposal. 29 | 30 | - type: textarea 31 | id: massage 32 | attributes: 33 | label: New feature, improvement proposal 34 | validations: 35 | required: true 36 | -------------------------------------------------------------------------------- /src/test/resources/unit/nested-clean-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | ${project.basedir}/target 27 | ${project.basedir}/target/classes 28 | ${project.basedir}/target/test-classes 29 | true 30 | true 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/test/resources/unit/basic-clean-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | ${project.basedir}/buildDirectory 27 | ${project.basedir}/buildOutputDirectory 28 | ${project.basedir}/buildTestDirectory 29 | true 30 | true 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/it/file-sets-absolute-paths/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | String[] unexpected = { 28 | "delete-me", 29 | }; 30 | for ( String path : unexpected ) 31 | { 32 | File file = new File( basedir, path ); 33 | System.out.println( "Checking for absence of " + file ); 34 | if ( file.exists() ) 35 | { 36 | System.out.println( "FAILURE!" ); 37 | return false; 38 | } 39 | } 40 | } 41 | catch( Throwable t ) 42 | { 43 | t.printStackTrace(); 44 | return false; 45 | } 46 | 47 | return true; 48 | -------------------------------------------------------------------------------- /src/it/read-only/setup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.File; 21 | 22 | if (!new File(basedir, "target/read-only-dir/read-only.properties").setWritable(false)) { 23 | System.out.println("Cannot change file permission."); 24 | return false; 25 | } 26 | if (File.separatorChar == '/') { 27 | // Directory permission can be changed only on Unix, not on Windows. 28 | if (!new File(basedir, "target/read-only-dir").setWritable(false)) { 29 | System.out.println("Cannot change directory permission."); 30 | return false; 31 | } 32 | } 33 | if (!new File(basedir, "target/writable-dir/writable.properties").canWrite()) { 34 | System.out.println("Expected a writable file."); 35 | return false; 36 | } 37 | return true; 38 | -------------------------------------------------------------------------------- /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # see https://s.apache.org/asfyaml 18 | github: 19 | description: "Apache Maven Clean Plugin" 20 | homepage: https://maven.apache.org/plugins/maven-clean-plugin/ 21 | labels: 22 | - java 23 | - build-management 24 | - maven-plugins 25 | - maven-clean-plugin 26 | - maven 27 | enabled_merge_buttons: 28 | squash: true 29 | merge: false 30 | rebase: true 31 | autolink_jira: 32 | - MCLEAN 33 | protected_branches: 34 | master: { } 35 | maven-clean-plugin-3.x: { } 36 | pull_requests: 37 | del_branch_on_merge: true 38 | features: 39 | issues: true 40 | 41 | notifications: 42 | commits: commits@maven.apache.org 43 | issues: issues@maven.apache.org 44 | pullrequests: issues@maven.apache.org 45 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Following this checklist to help us incorporate your 2 | contribution quickly and easily: 3 | 4 | - [ ] Your pull request should address just one issue, without pulling in other changes. 5 | - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. 6 | - [ ] Each commit in the pull request should have a meaningful subject line and body. 7 | Note that commits might be squashed by a maintainer on merge. 8 | - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. 9 | This may not always be possible but is a best-practice. 10 | - [ ] Run `mvn verify` to make sure basic checks pass. 11 | A more thorough check will be performed on your pull request automatically. 12 | - [ ] You have run the integration tests successfully (`mvn -Prun-its verify`). 13 | 14 | If your pull request is about ~20 lines of code you don't need to sign an 15 | [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure 16 | please ask on the developers list. 17 | 18 | To make clear that you license your contribution under 19 | the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 20 | you have to acknowledge this by using the following check-box. 21 | 22 | - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 23 | - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). 24 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/setup.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.*; 21 | import java.nio.file.attribute.*; 22 | 23 | def pairs = 24 | [ 25 | [ "ext/file.txt", "target/link.txt" ], 26 | [ "ext/dir", "target/link" ], 27 | [ "ext/file.txt", "target2/link.txt" ], 28 | [ "ext/dir", "target2/link" ], 29 | ]; 30 | 31 | for ( pair : pairs ) 32 | { 33 | Path target = basedir.toPath().resolve( pair[0] ); 34 | Path link = basedir.toPath().resolve( pair[1] ); 35 | System.out.println( "Creating symlink " + link + " -> " + target ); 36 | Files.createSymbolicLink( link, target, new FileAttribute[0] ); 37 | if ( !Files.exists( link, new LinkOption[0] ) ) 38 | { 39 | println "Platform does not support symlinks, skipping test."; 40 | return; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 19 | 20 | name: Bug Report 21 | description: File a bug report 22 | labels: ["bug"] 23 | 24 | body: 25 | - type: markdown 26 | attributes: 27 | value: | 28 | Thanks for taking the time to fill out this bug report. 29 | 30 | Simple fixes in single PRs do not require issues. 31 | 32 | **Do you use the latest project version?** 33 | 34 | - type: input 35 | id: version 36 | attributes: 37 | label: Affected version 38 | validations: 39 | required: true 40 | 41 | - type: textarea 42 | id: massage 43 | attributes: 44 | label: Bug description 45 | validations: 46 | required: true 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/it/dangling-symlinks/setup.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.nio.file.*; 21 | import java.nio.file.attribute.*; 22 | 23 | try 24 | { 25 | Path targetDir = basedir.toPath().resolve( "target" ); 26 | Path link = targetDir.resolve( "link" ); 27 | Path target = targetDir.resolve( "link-target.txt" ); 28 | 29 | System.out.println( "Creating symlink " + link + " -> " + target ); 30 | Files.createSymbolicLink( link, target, new FileAttribute[0] ); 31 | if ( !Files.exists( link, new LinkOption[0] ) ) 32 | { 33 | System.out.println( "Platform does not support symlinks, skipping test." ); 34 | } 35 | 36 | System.out.println( "Deleting symlink target " + target ); 37 | Files.delete( target ); 38 | } 39 | catch( Exception ex ) 40 | { 41 | ex.printStackTrace(); 42 | return false; 43 | } 44 | 45 | return true; 46 | -------------------------------------------------------------------------------- /src/site/apt/examples/skipping-clean.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Skipping Clean 3 | ------ 4 | Vincent Siveton 5 | ------ 6 | 2007-11-13 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Skipping Clean 30 | 31 | To skip running the cleanup for a particular project, set the <<>> property to <<>>. 32 | 33 | +-------- 34 | 35 | [...] 36 | 37 | maven-clean-plugin 38 | ${project.version} 39 | 40 | true 41 | 42 | 43 | [...] 44 | 45 | +--------- 46 | 47 | You can also skip the cleaning via command line by executing the following command: 48 | 49 | +-------- 50 | mvn clean -Dmaven.clean.skip=true 51 | +--------- 52 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | 22 | def expected = [ 23 | "ext", 24 | "ext/file.txt", 25 | "ext/dir/file.txt", 26 | ]; 27 | 28 | for ( String path : expected ) 29 | { 30 | File file = new File( basedir, path ); 31 | println "Checking for existence of " + file; 32 | if ( !file.exists() ) 33 | { 34 | println "FAILURE!"; 35 | return false; 36 | } 37 | } 38 | 39 | def unexpected = [ 40 | "target/link.txt", 41 | "target/link", 42 | "target", 43 | "target2/link.txt", 44 | "target2/link", 45 | "target2", 46 | ]; 47 | 48 | for ( String path : unexpected ) 49 | { 50 | File file = new File( basedir, path ); 51 | println "Checking for absence of " + file; 52 | if ( file.exists() ) 53 | { 54 | println "FAILURE!"; 55 | return false; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/it/dangling-symlinks/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | dangling-symlinks 25 | 1.0-SNAPSHOT 26 | 27 | Check for proper cleaning of dangling symlinks (MCLEAN-28). 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-clean-plugin 38 | @pom.version@ 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/it/default/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | default 25 | 1.0-SNAPSHOT 26 | 27 | Test for clean 28 | Check for proper cleaning of default output files. 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-clean-plugin 39 | @pom.version@ 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/site/apt/examples/ignoring-errors.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Ignoring Clean Errors 3 | ------ 4 | Vincent Siveton 5 | ------ 6 | 2007-11-13 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Ignoring Clean Errors 30 | 31 | To ignore errors when running the cleanup for a particular project, set the <<>> property to <<>>. 32 | 33 | +-------- 34 | 35 | [...] 36 | 37 | maven-clean-plugin 38 | ${project.version} 39 | 40 | false 41 | 42 | 43 | [...] 44 | 45 | +--------- 46 | 47 | You can also ignore them via command line by executing the following command: 48 | 49 | +-------- 50 | mvn clean -Dmaven.clean.failOnError=false 51 | +--------- 52 | -------------------------------------------------------------------------------- /src/it/special-characters/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.apache.maven.plugins.clean.its 24 | mrelease-48 25 | 1.0-SNAPSHOT 26 | 27 | Test for clean 28 | Check for proper cleaning of default output files. 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-clean-plugin 39 | @pom.version@ 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/it/sources-targetPath/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.1.0 22 | 23 | test 24 | sources-targetPath 25 | 1.0-SNAPSHOT 26 | 27 | Test <targetPath> cleaning 28 | Check for proper cleaning of output files in directories specified by <targetPath>. 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-clean-plugin 35 | @pom.version@ 36 | 37 | 38 | 39 | 40 | 41 | ${project.basedir}/outside-target 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/it/only-test-clean/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | File targetDir = new File( basedir, "target" ); 28 | System.out.println( "Checking for absence of " + targetDir ); 29 | if ( !targetDir.exists() ) 30 | { 31 | System.out.println( "FAILURE! target must exists" ); 32 | return false; 33 | } 34 | 35 | File targetClasses = new File( targetDir, "classes" ); 36 | if ( !targetClasses.exists() ) 37 | { 38 | System.out.println( "FAILURE! target/classes must exists" ); 39 | return false; 40 | } 41 | 42 | File targetTestsClasses = new File( targetDir, "test-classes" ); 43 | if ( targetTestsClasses.exists() ) 44 | { 45 | System.out.println( "FAILURE! target/test-classes must not exists" ); 46 | return false; 47 | } 48 | 49 | } 50 | catch( Throwable t ) 51 | { 52 | t.printStackTrace(); 53 | return false; 54 | } 55 | 56 | return true; 57 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | parent 25 | 1.0-SNAPSHOT 26 | pom 27 | 28 | Test for clean 29 | 30 | 31 | child-a 32 | child-b 33 | 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.apache.maven.plugins 44 | maven-clean-plugin 45 | @pom.version@ 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/read-only/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | read-only 25 | 1.0-SNAPSHOT 26 | 27 | Test for clean 28 | Check for proper deletion (or not) of read-only files. 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-clean-plugin 39 | @pom.version@ 40 | 41 | true 42 | false 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/it/file-sets-absolute-paths/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | parent 25 | 1.0-SNAPSHOT 26 | pom 27 | 28 | Test for clean 29 | 30 | 31 | child-a 32 | 33 | 34 | 35 | UTF-8 36 | @project.build.directory@/it/file-sets-absolute-paths/delete-me 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.apache.maven.plugins 44 | maven-clean-plugin 45 | @pom.version@ 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/fast-delete-default/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | fast-delete 25 | 1.0-SNAPSHOT 26 | 27 | Fast delete 28 | Check fast delete with default configuration. The default directory is `target/.clean`, 29 | which implies additional work as it is a directory inside the directory to delete. 30 | 31 | 32 | UTF-8 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-clean-plugin 40 | @project.version@ 41 | 42 | true 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/it/non-existent-base-dirs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | non-existent-base-dirs 25 | 1.0-SNAPSHOT 26 | 27 | Check that non-existing base directories for clean do not fail the build. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-clean-plugin 38 | @pom.version@ 39 | 40 | 41 | 42 | non-existing-dir 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/it/fast-delete/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | fast-delete 25 | 1.0-SNAPSHOT 26 | 27 | Fast delete 28 | Check that fast delete is invoked. For making this test simpler, 29 | this test uses a `.fastdir` directory outside the `target` directory. 30 | 31 | 32 | UTF-8 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-clean-plugin 40 | @project.version@ 41 | 42 | true 43 | ${project.basedir}${file.separator}.fastdir 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | exclude-default-dirs 25 | 1.0-SNAPSHOT 26 | 27 | Check for exclusion of default directories from cleaning if requested. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-clean-plugin 38 | @pom.version@ 39 | 40 | true 41 | 42 | 43 | delete-me 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/symlink-dont-follow/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | symlinks-dont-follow 25 | 1.0-SNAPSHOT 26 | 27 | Check that symlinks are not followed if requested (MCLEAN-39). 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-clean-plugin 38 | @project.version@ 39 | 40 | false 41 | 42 | 43 | target2 44 | false 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/it/file-sets-absolute-paths/child-a/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | test 25 | parent 26 | 1.0-SNAPSHOT 27 | 28 | 29 | child-a 30 | 1.0-SNAPSHOT 31 | 32 | Child A 33 | Check for proper cleaning of file sets with absolute paths during reactor build. 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-clean-plugin 44 | 45 | 46 | 47 | ${deploy.dir} 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | String[] expected = { 28 | "temp-stuff/test.txt", 29 | "deploy/test.txt", 30 | }; 31 | for ( String path : expected ) 32 | { 33 | File file = new File( basedir, path ); 34 | System.out.println( "Checking for existence of " + file ); 35 | if ( !file.exists() ) 36 | { 37 | System.out.println( "FAILURE!" ); 38 | return false; 39 | } 40 | } 41 | 42 | String[] unexpected = { 43 | "target", 44 | "child-a/target", 45 | "child-a/temp-stuff", 46 | "child-b/target", 47 | "child-b/deploy", 48 | }; 49 | for ( String path : unexpected ) 50 | { 51 | File file = new File( basedir, path ); 52 | System.out.println( "Checking for absence of " + file ); 53 | if ( file.exists() ) 54 | { 55 | System.out.println( "FAILURE!" ); 56 | return false; 57 | } 58 | } 59 | } 60 | catch( Throwable t ) 61 | { 62 | t.printStackTrace(); 63 | return false; 64 | } 65 | 66 | return true; 67 | -------------------------------------------------------------------------------- /src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | it-repo 26 | 27 | true 28 | 29 | 30 | 31 | local.central 32 | @localRepositoryUrl@ 33 | 34 | true 35 | ignore 36 | 37 | 38 | true 39 | ignore 40 | 41 | 42 | 43 | 44 | 45 | local.central 46 | @localRepositoryUrl@ 47 | 48 | true 49 | ignore 50 | 51 | 52 | true 53 | ignore 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/test/resources/unit/fileset-clean-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | maven-clean-plugin 25 | 26 | true 27 | 28 | 29 | ${project.basedir}/target 30 | 31 | **/file.txt 32 | **/test-classes/** 33 | 34 | 35 | **/subdir/** 36 | 37 | 38 | 39 | ${project.basedir}/buildOutputDirectory 40 | 41 | ** 42 | 43 | 44 | 45 | 46 | 47 | 48 | true 49 | true 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/it/exclude-default-dirs/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | String[] expected = { 28 | "target", 29 | "target/test-1.0-SNAPSHOT.jar", 30 | "target/classes", 31 | "target/classes/main.properties", 32 | "target/test-classes", 33 | "target/test-classes/test.properties", 34 | "target/site", 35 | "target/site/index.html", 36 | }; 37 | for ( String path : expected ) 38 | { 39 | File file = new File( basedir, path ); 40 | System.out.println( "Checking for existence of " + file ); 41 | if ( !file.exists() ) 42 | { 43 | System.out.println( "FAILURE!" ); 44 | return false; 45 | } 46 | } 47 | 48 | String[] unexpected = { 49 | "delete-me", 50 | }; 51 | for ( String path : unexpected ) 52 | { 53 | File file = new File( basedir, path ); 54 | System.out.println( "Checking for absence of " + file ); 55 | if ( file.exists() ) 56 | { 57 | System.out.println( "FAILURE!" ); 58 | return false; 59 | } 60 | } 61 | } 62 | catch( Throwable t ) 63 | { 64 | t.printStackTrace(); 65 | return false; 66 | } 67 | 68 | return true; 69 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-a/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | test 25 | parent 26 | 1.0-SNAPSHOT 27 | 28 | 29 | child-a 30 | 1.0-SNAPSHOT 31 | 32 | Child A 33 | Check for proper cleaning of file sets with relative paths during reactor build. 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-clean-plugin 44 | 45 | 46 | 47 | 48 | temp-stuff 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/it/file-sets-relative-paths/child-b/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | test 25 | parent 26 | 1.0-SNAPSHOT 27 | 28 | 29 | child-b 30 | 1.0-SNAPSHOT 31 | 32 | Child B 33 | Check for proper cleaning of file sets with relative paths during reactor build. 34 | 35 | 36 | UTF-8 37 | 38 | deploy 39 | 40 | 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-clean-plugin 46 | 47 | 48 | 49 | ${deploy.dir} 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/it/only-test-clean/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | default 25 | 1.0-SNAPSHOT 26 | 27 | Test for clean 28 | Check for proper cleaning of default output files. 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-clean-plugin 39 | @pom.version@ 40 | 41 | 42 | 43 | 44 | 45 | 46 | test-clean 47 | 48 | 49 | 50 | 51 | org.apache.maven.plugins 52 | maven-clean-plugin 53 | @pom.version@ 54 | 55 | true 56 | 57 | 58 | ${project.build.testOutputDirectory} 59 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/site/apt/examples/delete_additional_files.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Delete Additional Files Not Exposed to Maven 3 | ------ 4 | Mike Perham 5 | 6 | ------ 7 | 2007-11-14 8 | ------ 9 | 10 | ~~ Licensed to the Apache Software Foundation (ASF) under one 11 | ~~ or more contributor license agreements. See the NOTICE file 12 | ~~ distributed with this work for additional information 13 | ~~ regarding copyright ownership. The ASF licenses this file 14 | ~~ to you under the Apache License, Version 2.0 (the 15 | ~~ "License"); you may not use this file except in compliance 16 | ~~ with the License. You may obtain a copy of the License at 17 | ~~ 18 | ~~ http://www.apache.org/licenses/LICENSE-2.0 19 | ~~ 20 | ~~ Unless required by applicable law or agreed to in writing, 21 | ~~ software distributed under the License is distributed on an 22 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 23 | ~~ KIND, either express or implied. See the License for the 24 | ~~ specific language governing permissions and limitations 25 | ~~ under the License. 26 | 27 | ~~ NOTE: For help with the syntax of this file, see: 28 | ~~ http://maven.apache.org/doxia/references/apt-format.html 29 | 30 | Delete Additional Files Not Exposed to Maven 31 | 32 | The Maven Clean Plugin will delete the <<>> directory by default. You may configure 33 | it to delete additional directories and files. The following example shows how: 34 | 35 | +-------- 36 | 37 | [...] 38 | 39 | maven-clean-plugin 40 | ${project.version} 41 | 42 | 43 | 44 | some/relative/path 45 | 46 | **/*.tmp 47 | **/*.log 48 | 49 | 50 | **/important.log 51 | **/another-important.log 52 | 53 | false 54 | 55 | 56 | 57 | 58 | [...] 59 | 60 | +--------- 61 | 62 | <> The <<>> in the <<>> is a relative path inside a project, in other words, 63 | 64 | +-------- 65 | some/relative/path 66 | +-------- 67 | 68 | is equivalent to: 69 | 70 | +-------- 71 | ${basedir}/some/relative/path 72 | +-------- 73 | 74 | You could also define file set rules in a parent POM. In this case, the clean plugin adds the subproject 75 | basedir to the defined relative path. 76 | 77 | <> The <<>> delete method will not work for any <<>> which defines any <<>> 78 | or <<>>, or sets <<>> to <<>>, or sets <<>> to <<>>. -------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/verify.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.*; 21 | import java.util.*; 22 | import java.util.jar.*; 23 | import java.util.regex.*; 24 | 25 | try 26 | { 27 | String[] expected = { 28 | "dir0/excluded.txt", 29 | "dir0/sub0/excluded.txt", 30 | "dir0/sub1", 31 | "dir0/sub2/excluded.txt", 32 | 33 | "dir1/excluded.txt", 34 | "dir1/sub0/excluded.txt", 35 | "dir1/sub1", 36 | "dir1/sub2/excluded.txt", 37 | 38 | "dir2/excluded.txt", 39 | "dir2/sub0/excluded.txt", 40 | "dir2/sub2/excluded.txt", 41 | 42 | "dir3/excluded.txt", 43 | "dir3/sub0/excluded.txt", 44 | "dir3/sub2/excluded.txt", 45 | 46 | "dir4/excluded/file.txt", 47 | }; 48 | for ( String path : expected ) 49 | { 50 | File file = new File( new File( basedir, "dirs" ), path ); 51 | System.out.println( "Checking for existence of " + file ); 52 | if ( !file.exists() ) 53 | { 54 | System.out.println( "FAILURE!" ); 55 | return false; 56 | } 57 | } 58 | 59 | String[] unexpected = { 60 | "dir0/included.txt", 61 | "dir0/sub0/included.txt", 62 | "dir0/sub1/included.txt", 63 | 64 | "dir1/included.txt", 65 | "dir1/sub0/included.txt", 66 | "dir1/sub1/included.txt", 67 | 68 | "dir2/included.txt", 69 | "dir2/sub0/included.txt", 70 | "dir2/sub1", 71 | 72 | "dir3/included.txt", 73 | "dir3/sub0/included.txt", 74 | "dir3/sub1", 75 | 76 | "dir4/file.txt", 77 | "dir4/included/file.txt", 78 | }; 79 | for ( String path : unexpected ) 80 | { 81 | File file = new File( new File( basedir, "dirs" ), path ); 82 | System.out.println( "Checking for absence of " + file ); 83 | if ( file.exists() ) 84 | { 85 | System.out.println( "FAILURE!" ); 86 | return false; 87 | } 88 | } 89 | } 90 | catch( Throwable t ) 91 | { 92 | t.printStackTrace(); 93 | return false; 94 | } 95 | 96 | return true; 97 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/clean/FastMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.plugins.clean; 20 | 21 | import java.util.Locale; 22 | 23 | /** 24 | * Specifies when to delete files when fast clean is used. 25 | * This enumeration defines the value values for {@code maven.clean.fastMode}, 26 | * in upper case and with {@code '-'} replaced by {@code '_'}. 27 | */ 28 | enum FastMode { 29 | /** 30 | * Start deletion immediately and wait for all files to be deleted when the session ends. 31 | * This is the default mode when the deletion of files in a background thread is enabled. 32 | */ 33 | BACKGROUND, 34 | 35 | /** 36 | * Actual deletion should be performed synchronously when the session ends. 37 | * The plugin waits for all files to be deleted when the session end. 38 | */ 39 | AT_END, 40 | 41 | /** 42 | * Actual file deletion should be started in the background when the session ends. 43 | * The plugin does not wait for files to be deleted. 44 | */ 45 | DEFER; 46 | 47 | /** 48 | * {@return the enumeration value for the given configuration option} 49 | * 50 | * @param option the configuration option, case insensitive 51 | * @throws IllegalArgumentException if the given option is invalid 52 | */ 53 | public static FastMode caseInsensitiveValueOf(String option) { 54 | try { 55 | return valueOf(option.trim().toUpperCase(Locale.US).replace('-', '_')); 56 | } catch (NullPointerException | IllegalArgumentException e) { 57 | StringBuilder sb = 58 | new StringBuilder("Illegal value '").append(option).append("' for fastMode. Allowed values are '"); 59 | FastMode[] values = values(); 60 | int last = values.length; 61 | for (int i = 0; i <= last; i++) { 62 | sb.append(values[i]).append(i < last ? "', '" : "' and '"); 63 | } 64 | throw new IllegalArgumentException(sb.append("'.").toString(), e); 65 | } 66 | } 67 | 68 | /** 69 | * {@return the lower-case variant of this enumeration value} 70 | */ 71 | @Override 72 | public String toString() { 73 | return name().replace('_', '-').toLowerCase(Locale.US); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/site/apt/usage.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Usage 3 | ------ 4 | Edwin Punzalan 5 | ------ 6 | 2006-06-29 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | Usage 30 | 31 | The Maven Clean Plugin, as the name implies, attempts to clean the files and 32 | directories generated by Maven during its build. While there are plugins 33 | that generate additional files, the Clean Plugin assumes that these files are 34 | generated inside the <<>> directory. 35 | 36 | * Cleaning a Maven project using the command-line 37 | 38 | The Clean Plugin can be called to execute in the command-line without any 39 | additional configurations. Like the other plugins, to run the Clean Plugin, 40 | you use: 41 | 42 | +----- 43 | mvn clean:clean 44 | +----- 45 | 46 | where the first <<>> refers to the plugin's alias, and the second 47 | <<>> refers to the plugin goal. 48 | 49 | However, the Clean Plugin is a special plugin and is bound to its own special 50 | lifecycyle phase called <<>>. Thus, for simplicity, it can also be 51 | executed by using: 52 | 53 | +----- 54 | mvn clean 55 | +----- 56 | 57 | or with other phases/goals like: 58 | 59 | +----- 60 | mvn clean package site 61 | +----- 62 | 63 | * Running the Clean Plugin automatically during a build 64 | 65 | If for some reason, adding <<>> to the command-line is not option, 66 | the Clean Plugin can be put into a project's <<>> so that it gets executed 67 | everytime the project is built. Below is a sample <<>> for running the 68 | Clean Plugin in the <<>> phase everytime the project is built: 69 | 70 | +----- 71 | 72 | [...] 73 | 74 | 75 | 76 | maven-clean-plugin 77 | ${project.version} 78 | 79 | 80 | auto-clean 81 | initialize 82 | 83 | clean 84 | 85 | 86 | 87 | 88 | 89 | 90 | [...] 91 | 92 | +----- 93 | -------------------------------------------------------------------------------- /src/site/fml/faq.fml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 27 | 28 | 29 | I already ran mvn clean but the directory (put dir name here) is still there. What should I do? 30 | 31 |

32 | Some files-generating plugins can generate their files outside of the 33 | default directories being deleted by the clean plugin. You should add 34 | the location of such files in the clean plugin configuration or change 35 | the configuration of those plugins to put their files inside the 36 | project.build.directory which is by default, the target 37 | directory. 38 |

39 |
40 |
41 | 42 | On Windows, I got "Unable to delete directory". What's wrong? 43 | 44 |

45 | For instance, clean could fail if you already have opened a command 46 | line with target as the current dir. Windows locks some ressources and you need 47 | to close the handles on these ressources. 48 | To skip these errors, you could call clean with the command line parameter -Dmaven.clean.failOnError=false. 49 | For more information, refer to Ignoring Errors page. 50 |

51 |

52 | Sysinternals produced 53 | a number of utilities, like Process Explorer 54 | or Handle 55 | that help you to deal with Windows handles. 56 |

57 |
58 |
59 |
60 |
-------------------------------------------------------------------------------- /src/it/file-sets-includes-excludes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | test 24 | file-sets-includes-excludes 25 | 1.0-SNAPSHOT 26 | 27 | Check for proper handling of includes/excludes during cleaning, especially with varying symlink handling. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-clean-plugin 38 | @pom.version@ 39 | 40 | 41 | 42 | ${basedir}/dirs/dir0 43 | 44 | **/*included*/** 45 | 46 | true 47 | 48 | 49 | ${basedir}/dirs/dir1 50 | 51 | **/*included*/** 52 | 53 | false 54 | 55 | 56 | ${basedir}/dirs/dir2 57 | 58 | **/*excluded*/** 59 | 60 | true 61 | 62 | 63 | ${basedir}/dirs/dir3 64 | 65 | **/*excluded*/** 66 | 67 | false 68 | 69 | 70 | ${basedir}/dirs/dir4 71 | 72 | **/file.txt 73 | **/included/** 74 | 75 | 76 | **/excluded/** 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Introduction 3 | ------ 4 | Edwin Punzalan 5 | ------ 6 | 2013-07-22 7 | ------ 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | ${project.name} 30 | 31 | The Clean Plugin is used when you want to remove files generated at 32 | build-time in a project's directory. 33 | 34 | * Goals Overview 35 | 36 | The Clean Plugin only has one goal. 37 | 38 | * {{{./clean-mojo.html}clean:clean}} attempts to clean a project's working 39 | directory of the files that were generated at build-time. By default, it 40 | discovers and deletes the directories configured in 41 | <<>>, <<>>, 42 | <<>>, and 43 | <<>>. 44 | 45 | * Usage 46 | 47 | General instructions on how to use the Clean Plugin can be found on the {{{./usage.html}usage page}}. Some more 48 | specific use cases are described in the examples given below. 49 | 50 | In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel 51 | free to contact the {{{./mailing-lists.html}user mailing list}}. The posts to the mailing list are archived and could 52 | already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching 53 | the {{{./mailing-lists.html}mail archive}}. 54 | 55 | If you feel like the plugin is missing a feature or has a defect, you can submit a feature request or bug report in our 56 | {{{./issue-management.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your 57 | concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, 58 | entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. 59 | Of course, patches are welcome, too. Contributors can check out the project from our 60 | {{{./scm.html}source repository}} and will find supplementary information in the 61 | {{{https://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. 62 | 63 | * Examples 64 | 65 | To provide you with better understanding on some usages of the Clean Plugin, 66 | you can take a look into the following examples: 67 | 68 | * {{{./examples/delete_additional_files.html}How to delete additional files outside of 69 | the default directories?}} 70 | 71 | * {{{./examples/ignoring-errors.html}How to ignore clean errors?}} 72 | 73 | * {{{./examples/skipping-clean.html}How to skipping clean execution?}} 74 | 75 | [] 76 | -------------------------------------------------------------------------------- /src/site/xdoc/download.xml.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | Download ${project.name} Source 25 | 26 | 27 | 28 |
29 | 30 |

${project.name} ${project.version} is distributed in source format.

31 | 32 |

Use a source archive if you intend to build ${project.name} yourself.

33 | 34 |

Otherwise, simply use the ready-made binary artifacts from central repository.

35 | 36 |

${project.name} is distributed under the Apache License, version 2.0.

37 | 38 | 39 | 40 |

This is the current stable version of ${project.name}.

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
LinkChecksumSignature
${project.name} ${project.version} (Source zip)${project.artifactId}-${project.version}-source-release.zip${project.artifactId}-${project.version}-source-release.zip.sha512${project.artifactId}-${project.version}-source-release.zip.asc
60 | 61 |

It is essential that you verify the integrity of the downloaded file 62 | using the checksum (.sha512 file) 63 | or using the signature (.asc file) against the public KEYS used by the Apache Maven developers. 64 |

65 | 66 |
67 | 68 | 69 |

It is strongly recommended to use the latest release version of ${project.name} to take advantage of the newest features and bug fixes.

70 |

Older non-recommended releases can be found on our archive site.

71 |
72 |
73 | 74 |
75 | 76 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/plugins/clean/Fileset.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.plugins.clean; 20 | 21 | import java.nio.file.Path; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * Customizes the string representation of 27 | * {@code org.apache.maven.api.model.FileSet} to return the 28 | * included and excluded files from the file-set's directory. Specifically, 29 | * "file-set: [directory] (included: [included files], 30 | * excluded: [excluded files])" 31 | * 32 | * @since 2.1 33 | */ 34 | public class Fileset { 35 | 36 | private Path directory; 37 | 38 | private String[] includes; 39 | 40 | private String[] excludes; 41 | 42 | private boolean followSymlinks; 43 | 44 | private boolean useDefaultExcludes; 45 | 46 | /** 47 | * Creates an initially empty file set. 48 | */ 49 | public Fileset() {} 50 | 51 | /** 52 | * {@return the base directory}. 53 | */ 54 | public Path getDirectory() { 55 | return directory; 56 | } 57 | 58 | /** 59 | * {@return the patterns of the file to include, or an empty list if unspecified}. 60 | */ 61 | public List getIncludes() { 62 | return listWithoutNull(includes); 63 | } 64 | 65 | /** 66 | * {@return the patterns of the file to exclude, or an empty list if unspecified}. 67 | */ 68 | public List getExcludes() { 69 | return listWithoutNull(excludes); 70 | } 71 | 72 | /** 73 | * {@return the content of the given array without null elements}. 74 | * The existence of null elements has been observed in practice, 75 | * not sure where they come from. 76 | * 77 | * @param patterns the {@link #includes} or {@link #excludes} array, or {@code null} if none 78 | */ 79 | private static List listWithoutNull(String[] patterns) { 80 | if (patterns == null) { 81 | return List.of(); 82 | } 83 | var list = new ArrayList(patterns.length); 84 | for (String pattern : patterns) { 85 | if (pattern != null) { 86 | list.add(pattern); 87 | } 88 | } 89 | return list; 90 | } 91 | 92 | /** 93 | * {@return whether the base directory is excluded from the fileset}. 94 | * This is {@code false} by default. The base directory can be excluded 95 | * explicitly if the exclude patterns contains an empty string. 96 | */ 97 | public boolean isBaseDirectoryExcluded() { 98 | if (excludes != null) { 99 | for (String pattern : excludes) { 100 | if (pattern == null || pattern.isEmpty()) { 101 | return true; 102 | } 103 | } 104 | } 105 | return false; 106 | } 107 | 108 | /** 109 | * {@return whether to follow symbolic links}. 110 | */ 111 | public boolean followSymlinks() { 112 | return followSymlinks; 113 | } 114 | 115 | /** 116 | * {@return whether to use a default set of excludes}. 117 | */ 118 | public boolean useDefaultExcludes() { 119 | return useDefaultExcludes; 120 | } 121 | 122 | /** 123 | * Appends the elements of the given array in the given buffer. 124 | * This is a helper method for {@link #toString()} implementations. 125 | * 126 | * @param buffer the buffer to add the elements to 127 | * @param label label identifying the array of elements to add 128 | * @param patterns the elements to append, or {@code null} if none 129 | */ 130 | private static void append(StringBuilder buffer, String label, List patterns) { 131 | buffer.append(label).append(": ["); 132 | String separator = ""; 133 | for (String pattern : patterns) { 134 | buffer.append(separator).append(pattern); 135 | separator = ", "; 136 | } 137 | buffer.append(']'); 138 | } 139 | 140 | /** 141 | * {@return a string representation of the included and excluded files from this file-set's directory}. 142 | * Specifically, "file-set: [directory] (included: 143 | * [included files], excluded: [excluded files])" 144 | */ 145 | @Override 146 | public String toString() { 147 | var buffer = new StringBuilder("file set: ").append(getDirectory()); 148 | append(buffer.append(" ("), "included", getIncludes()); 149 | append(buffer.append(", "), "excluded", getExcludes()); 150 | return buffer.append(')').toString(); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 17 | Contributing to [Apache Maven Clean Plugin](https://maven.apache.org/plugins/maven-clean-plugin/) 18 | ====================== 19 | 20 | [![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license] 21 | [![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-clean-plugin.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-clean-plugin) 22 | [![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-clean-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-clean-plugin) 23 | [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/apache/maven/plugins/maven-clean-plugin/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/maven/plugins/maven-clean-plugin/README.md) 24 | [![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-clean-plugin/job/master.svg?)][build] 25 | [![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-clean-plugin/job/master.svg?)][test-results] 26 | 27 | You have found a bug or you have an idea for a cool new feature? Contributing 28 | code is a great way to give something back to the open source community. Before 29 | you dig right into the code, there are a few guidelines that we need 30 | contributors to follow so that we can have a chance of keeping on top of 31 | things. 32 | 33 | Getting Started 34 | --------------- 35 | 36 | + Make sure you have a [GitHub account](https://github.com/signup/free). 37 | + If you're planning to implement a new feature, it makes sense to discuss your changes 38 | on the [dev list][ml-list] first. 39 | This way you can make sure you're not wasting your time on something that isn't 40 | considered to be in Apache Maven's scope. 41 | + Submit a ticket for your issue, assuming one does not already exist. 42 | + Clearly describe the issue, including steps to reproduce when it is a bug. 43 | + Make sure you fill in the earliest version that you know has the issue. 44 | + Fork the repository on GitHub. 45 | 46 | Making and Submitting Changes 47 | -------------- 48 | 49 | We accept Pull Requests via GitHub. The [developer mailing list][ml-list] is the 50 | main channel of communication for contributors. 51 | There are some guidelines which will make applying PRs easier for us: 52 | + Create a topic branch from where you want to base your work (this is usually the master branch). 53 | Push your changes to a topic branch in your fork of the repository. 54 | + Make commits of logical units. 55 | + Respect the original code style: by using the same [codestyle][code-style], 56 | patches should only highlight the actual difference, not being disturbed by any formatting issues: 57 | + Only use spaces for indentation. 58 | + Create minimal diffs - disable on save actions like reformat source code or organize imports. 59 | If you feel the source code should be reformatted, create a separate PR for this change. 60 | + Check for unnecessary whitespace with `git diff --check` before committing. 61 | + Make sure you have added the necessary tests (JUnit/IT) for your changes. 62 | + Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken. 63 | + Submit a pull request to the repository in the Apache organization. 64 | 65 | If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla]. 66 | 67 | Additional Resources 68 | -------------------- 69 | 70 | + [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch) 71 | + [Contributor License Agreement][cla] 72 | + [General GitHub documentation](https://help.github.com/) 73 | + [GitHub pull request documentation](https://help.github.com/send-pull-requests/) 74 | + [Apache Maven X Account](https://x.com/ASFMavenProject) 75 | + [Apache Maven Bluesky Account](https://bsky.app/profile/maven.apache.org) 76 | + [Apache Maven Mastodon Account](https://mastodon.social/deck/@ASFMavenProject@fosstodon.org) 77 | 78 | [license]: https://www.apache.org/licenses/LICENSE-2.0 79 | [ml-list]: https://maven.apache.org/mailing-lists.html 80 | [code-style]: https://maven.apache.org/developers/conventions/code.html 81 | [cla]: https://www.apache.org/licenses/#clas 82 | [maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index 83 | [test-results]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-clean-plugin/job/master/lastCompletedBuild/testReport/ 84 | [build]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-clean-plugin/job/master/ 85 | -------------------------------------------------------------------------------- /src/test/java/org/apache/maven/plugins/clean/CleanerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.plugins.clean; 20 | 21 | import java.nio.file.AccessDeniedException; 22 | import java.nio.file.Path; 23 | import java.nio.file.attribute.PosixFilePermission; 24 | import java.nio.file.attribute.PosixFilePermissions; 25 | import java.util.Set; 26 | 27 | import org.apache.maven.api.plugin.Log; 28 | import org.apache.maven.api.services.PathMatcherFactory; 29 | import org.apache.maven.impl.DefaultPathMatcherFactory; 30 | import org.junit.jupiter.api.Test; 31 | import org.junit.jupiter.api.condition.DisabledOnOs; 32 | import org.junit.jupiter.api.condition.OS; 33 | import org.junit.jupiter.api.io.TempDir; 34 | import org.mockito.ArgumentCaptor; 35 | import org.mockito.InOrder; 36 | 37 | import static java.nio.file.Files.createDirectory; 38 | import static java.nio.file.Files.createFile; 39 | import static java.nio.file.Files.exists; 40 | import static java.nio.file.Files.setPosixFilePermissions; 41 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 42 | import static org.junit.jupiter.api.Assertions.assertEquals; 43 | import static org.junit.jupiter.api.Assertions.assertFalse; 44 | import static org.junit.jupiter.api.Assertions.assertThrows; 45 | import static org.junit.jupiter.api.Assertions.assertTrue; 46 | import static org.mockito.ArgumentMatchers.any; 47 | import static org.mockito.ArgumentMatchers.eq; 48 | import static org.mockito.Mockito.inOrder; 49 | import static org.mockito.Mockito.mock; 50 | import static org.mockito.Mockito.never; 51 | import static org.mockito.Mockito.times; 52 | import static org.mockito.Mockito.verify; 53 | import static org.mockito.Mockito.when; 54 | 55 | class CleanerTest { 56 | 57 | private final Log log = mock(Log.class); 58 | 59 | /** 60 | * The factory to use for creating patch matcher. 61 | * The actual implementation is used rather than a mock because filtering is an important part 62 | * of this plugin and is tedious to test. Therefore, it is hard to guarantee that the tests of 63 | * {@code PathMatcherFactory} in Maven core are sufficient, and we want this plugin to test it 64 | * more. 65 | */ 66 | private final PathMatcherFactory matcherFactory = new DefaultPathMatcherFactory(); 67 | 68 | @Test 69 | @DisabledOnOs(OS.WINDOWS) 70 | void deleteSucceedsDeeply(@TempDir Path tempDir) throws Exception { 71 | final Path basedir = createDirectory(tempDir.resolve("target")).toRealPath(); 72 | final Path file = createFile(basedir.resolve("file")); 73 | final var cleaner = new Cleaner(matcherFactory, log, false, false, false, true, false); 74 | cleaner.delete(basedir); 75 | assertFalse(exists(basedir)); 76 | assertFalse(exists(file)); 77 | } 78 | 79 | @Test 80 | @DisabledOnOs(OS.WINDOWS) 81 | void deleteFailsWithoutRetryWhenNoPermission(@TempDir Path tempDir) throws Exception { 82 | when(log.isWarnEnabled()).thenReturn(true); 83 | final Path basedir = createDirectory(tempDir.resolve("target")).toRealPath(); 84 | createFile(basedir.resolve("file")); 85 | // Remove the executable flag to prevent directory listing, which will result in a DirectoryNotEmptyException. 86 | final Set permissions = PosixFilePermissions.fromString("rw-rw-r--"); 87 | setPosixFilePermissions(basedir, permissions); 88 | final var cleaner = new Cleaner(matcherFactory, log, false, false, false, true, false); 89 | final var exception = assertThrows(AccessDeniedException.class, () -> cleaner.delete(basedir)); 90 | verify(log, times(1)).warn(any(CharSequence.class), any(Throwable.class)); 91 | assertTrue(exception.getMessage().contains(basedir.toString())); 92 | } 93 | 94 | @Test 95 | @DisabledOnOs(OS.WINDOWS) 96 | void deleteFailsAfterRetryWhenNoPermission(@TempDir Path tempDir) throws Exception { 97 | final Path basedir = createDirectory(tempDir.resolve("target")).toRealPath(); 98 | createFile(basedir.resolve("file")); 99 | // Remove the executable flag to prevent directory listing, which will result in a DirectoryNotEmptyException. 100 | final Set permissions = PosixFilePermissions.fromString("rw-rw-r--"); 101 | setPosixFilePermissions(basedir, permissions); 102 | final var cleaner = new Cleaner(matcherFactory, log, false, false, false, true, true); 103 | final var exception = assertThrows(AccessDeniedException.class, () -> cleaner.delete(basedir)); 104 | assertTrue(exception.getMessage().contains(basedir.toString())); 105 | } 106 | 107 | @Test 108 | @DisabledOnOs(OS.WINDOWS) 109 | void deleteLogsWarningWithoutRetryWhenNoPermission(@TempDir Path tempDir) throws Exception { 110 | when(log.isWarnEnabled()).thenReturn(true); 111 | final Path basedir = createDirectory(tempDir.resolve("target")).toRealPath(); 112 | final Path file = createFile(basedir.resolve("file")); 113 | // Remove the writable flag to prevent deletion of the file, which will result in an AccessDeniedException. 114 | final Set permissions = PosixFilePermissions.fromString("r-xr-xr-x"); 115 | setPosixFilePermissions(basedir, permissions); 116 | final var cleaner = new Cleaner(matcherFactory, log, false, false, false, false, false); 117 | assertDoesNotThrow(() -> cleaner.delete(basedir)); 118 | verify(log, times(1)).warn(any(CharSequence.class), any(Throwable.class)); 119 | InOrder inOrder = inOrder(log); 120 | ArgumentCaptor cause1 = ArgumentCaptor.forClass(AccessDeniedException.class); 121 | inOrder.verify(log).warn(eq("Failed to delete " + file), cause1.capture()); 122 | assertEquals(file.toString(), cause1.getValue().getMessage()); 123 | } 124 | 125 | @Test 126 | @DisabledOnOs(OS.WINDOWS) 127 | void deleteDoesNotLogAnythingWhenNoPermissionAndWarnDisabled(@TempDir Path tempDir) throws Exception { 128 | when(log.isWarnEnabled()).thenReturn(false); 129 | final Path basedir = createDirectory(tempDir.resolve("target")).toRealPath(); 130 | createFile(basedir.resolve("file")); 131 | // Remove the writable flag to prevent deletion of the file, which will result in an AccessDeniedException. 132 | final Set permissions = PosixFilePermissions.fromString("r-xr-xr-x"); 133 | setPosixFilePermissions(basedir, permissions); 134 | final var cleaner = new Cleaner(matcherFactory, log, false, false, false, false, false); 135 | assertDoesNotThrow(() -> cleaner.delete(basedir)); 136 | verify(log, never()).warn(any(CharSequence.class), any(Throwable.class)); 137 | } 138 | } 139 | --------------------------------------------------------------------------------