Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package maven-file-management for
openSUSE:Factory checked in at 2024-06-12 15:39:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/maven-file-management (Old)
and /work/SRC/openSUSE:Factory/.maven-file-management.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "maven-file-management"
Wed Jun 12 15:39:39 2024 rev:7 rq:1180176 version:3.1.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/maven-file-management/maven-file-management.changes
2024-05-16 17:18:08.474371999 +0200
+++
/work/SRC/openSUSE:Factory/.maven-file-management.new.19518/maven-file-management.changes
2024-06-12 15:40:32.747018273 +0200
@@ -1,0 +2,14 @@
+Wed Jun 12 10:00:20 UTC 2024 - Fridrich Strba <[email protected]>
+
+- Update to upstream version 3.1.0
+ * Changes:
+ + remove vestigial file
+ + deps: update JUnit
+ + ignore .checkstyle
+ + update plexus-utils
+ + Remove dependency on maven-shared-io
+ + Use try with resources
+ + Remove deprecated methods in favor of Apache Commons IO
+ + MSHARED-1090: Update module
+
+-------------------------------------------------------------------
Old:
----
file-management-3.0.0-source-release.zip
New:
----
file-management-3.1.0-source-release.zip
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ maven-file-management.spec ++++++
--- /var/tmp/diff_new_pack.UQxC5d/_old 2024-06-12 15:40:33.239036300 +0200
+++ /var/tmp/diff_new_pack.UQxC5d/_new 2024-06-12 15:40:33.239036300 +0200
@@ -17,7 +17,7 @@
Name: maven-file-management
-Version: 3.0.0
+Version: 3.1.0
Release: 0
Summary: Maven File Management API
License: Apache-2.0
@@ -26,15 +26,14 @@
Source0:
https://repo1.maven.org/maven2/org/apache/maven/shared/file-management/%{version}/file-management-%{version}-source-release.zip
Source1: %{name}-build.xml
BuildRequires: ant
+BuildRequires: apache-commons-io
BuildRequires: fdupes
BuildRequires: javapackages-local >= 6
BuildRequires: maven-lib
-BuildRequires: maven-shared-io
-BuildRequires: maven-shared-utils
BuildRequires: modello >= 2.0.0
BuildRequires: plexus-utils
BuildRequires: plexus-xml
-BuildRequires: sisu-plexus
+BuildRequires: slf4j
BuildRequires: unzip
BuildArch: noarch
@@ -57,12 +56,11 @@
%build
mkdir -p lib
build-jar-repository -s lib \
+ commons-io \
maven/maven-plugin-api \
- maven-shared-io/maven-shared-io \
- maven-shared-utils/maven-shared-utils \
- org.eclipse.sisu.plexus \
plexus/utils \
- plexus/xml
+ plexus/xml \
+ slf4j/api
%{ant} \
jar javadoc
++++++ file-management-3.0.0-source-release.zip ->
file-management-3.1.0-source-release.zip ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/.asf.yaml
new/file-management-3.1.0/.asf.yaml
--- old/file-management-3.0.0/.asf.yaml 1970-01-01 01:00:00.000000000 +0100
+++ new/file-management-3.1.0/.asf.yaml 2022-06-29 11:19:58.000000000 +0200
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# see https://s.apache.org/asfyaml
+github:
+ description: "Apache Maven File Management API"
+ homepage: https://maven.apache.org/shared/file-management/
+ labels:
+ - java
+ - build-management
+ - maven-shared
+ - maven
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/DEPENDENCIES
new/file-management-3.1.0/DEPENDENCIES
--- old/file-management-3.0.0/DEPENDENCIES 2015-12-25 14:31:56.000000000
+0100
+++ new/file-management-3.1.0/DEPENDENCIES 2022-06-29 11:19:58.000000000
+0200
@@ -6,70 +6,18 @@
Apache Maven File Management API
-From: 'an unknown organization'
- - FindBugs-jsr305 (http://findbugs.sourceforge.net/)
com.google.code.findbugs:jsr305:jar:2.0.1
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Plexus Cipher: encryption/decryption Component
(http://spice.sonatype.org/plexus-cipher)
org.sonatype.plexus:plexus-cipher:jar:1.4
- License: Apache Public License 2.0
(http://www.apache.org/licenses/LICENSE-2.0)
- - Plexus Security Dispatcher Component
(http://spice.sonatype.org/plexus-sec-dispatcher)
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
- License: Apache Public License 2.0
(http://www.apache.org/licenses/LICENSE-2.0)
- - Sisu - Guice (http://forge.sonatype.com/sisu-guice/)
org.sonatype.sisu:sisu-guice:pom:2.1.7
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-
-From: 'Codehaus' (http://www.codehaus.org/)
- - Plexus Classworlds (http://plexus.codehaus.org/plexus-classworlds/)
org.codehaus.plexus:plexus-classworlds:jar:2.2.3
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Plexus :: Component Annotations
(http://plexus.codehaus.org/plexus-containers/plexus-component-annotations/)
org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Plexus Interpolation API
(http://plexus.codehaus.org/plexus-components/plexus-interpolation)
org.codehaus.plexus:plexus-interpolation:jar:1.14
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Plexus Common Utilities (http://plexus.codehaus.org/plexus-utils)
org.codehaus.plexus:plexus-utils:jar:3.0.22
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-
-From: 'Sonatype, Inc.' (http://www.sonatype.com)
- - Aether :: API (http://aether.sonatype.org/aether-api/)
org.sonatype.aether:aether-api:jar:1.7
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Aether :: Implementation (http://aether.sonatype.org/aether-impl/)
org.sonatype.aether:aether-impl:jar:1.7
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Aether :: SPI (http://aether.sonatype.org/aether-spi/)
org.sonatype.aether:aether-spi:jar:1.7
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Aether :: Utilities (http://aether.sonatype.org/aether-util/)
org.sonatype.aether:aether-util:jar:1.7
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Sisu - Inject (JSR330 bean support)
(http://sisu.sonatype.org/sisu-inject/guice-bean/sisu-inject-bean/)
org.sonatype.sisu:sisu-inject-bean:bundle:1.4.2
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Sisu - Inject (Plexus bean support)
(http://sisu.sonatype.org/sisu-inject/guice-bean/guice-plexus/sisu-inject-plexus/)
org.sonatype.sisu:sisu-inject-plexus:bundle:1.4.2
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-
-From: 'The Apache Software Foundation' (http://www.apache.org/)
- - Commons IO (http://commons.apache.org/io/) commons-io:commons-io:jar:2.4
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Aether Provider (http://maven.apache.org/maven-aether-provider/)
org.apache.maven:maven-aether-provider:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Artifact (http://maven.apache.org/maven-artifact/)
org.apache.maven:maven-artifact:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Compat (http://maven.apache.org/maven-compat/)
org.apache.maven:maven-compat:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Core (http://maven.apache.org/maven-core/)
org.apache.maven:maven-core:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Model (http://maven.apache.org/maven-model/)
org.apache.maven:maven-model:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Model Builder (http://maven.apache.org/maven-model-builder/)
org.apache.maven:maven-model-builder:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Plugin API (http://maven.apache.org/maven-plugin-api/)
org.apache.maven:maven-plugin-api:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Repository Metadata Model
(http://maven.apache.org/maven-repository-metadata/)
org.apache.maven:maven-repository-metadata:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Settings (http://maven.apache.org/maven-settings/)
org.apache.maven:maven-settings:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Maven Settings Builder (http://maven.apache.org/maven-settings-builder/)
org.apache.maven:maven-settings-builder:jar:3.0
- License: The Apache Software License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Apache Maven Shared I/O API
(http://maven.apache.org/shared/maven-shared-io/)
org.apache.maven.shared:maven-shared-io:jar:3.0.0
- License: Apache License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Apache Maven Shared Utils
(http://maven.apache.org/shared/maven-shared-utils/)
org.apache.maven.shared:maven-shared-utils:jar:3.0.0
- License: Apache License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
- - Apache Maven Wagon :: API
(http://maven.apache.org/wagon/wagon-provider-api)
org.apache.maven.wagon:wagon-provider-api:jar:2.10
+From: 'Codehaus Plexus' (https://codehaus-plexus.github.io/)
+ - Plexus Common Utilities (https://codehaus-plexus.github.io/plexus-utils/)
org.codehaus.plexus:plexus-utils:jar:3.4.2
License: Apache License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.txt)
+From: 'QOS.ch' (http://www.qos.ch)
+ - SLF4J API Module (http://www.slf4j.org) org.slf4j:slf4j-api:jar:1.7.36
+ License: MIT License (http://www.opensource.org/licenses/mit-license.php)
+
+From: 'The Apache Software Foundation' (https://www.apache.org/)
+ - Apache Commons IO (https://commons.apache.org/proper/commons-io/)
commons-io:commons-io:jar:2.11.0
+ License: Apache License, Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0.txt)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/Jenkinsfile
new/file-management-3.1.0/Jenkinsfile
--- old/file-management-3.0.0/Jenkinsfile 1970-01-01 01:00:00.000000000
+0100
+++ new/file-management-3.1.0/Jenkinsfile 2022-06-29 11:19:58.000000000
+0200
@@ -0,0 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+asfMavenTlpStdBuild()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/NOTICE
new/file-management-3.1.0/NOTICE
--- old/file-management-3.0.0/NOTICE 2015-12-25 14:31:56.000000000 +0100
+++ new/file-management-3.1.0/NOTICE 2022-06-29 11:19:58.000000000 +0200
@@ -1,6 +1,6 @@
Apache Maven File Management API
-Copyright 2002-2015 The Apache Software Foundation
+Copyright 2002-2022 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/README.md
new/file-management-3.1.0/README.md
--- old/file-management-3.0.0/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/file-management-3.1.0/README.md 2022-06-29 11:19:58.000000000 +0200
@@ -0,0 +1,99 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+Contributing to [Apache Maven File Management
API](https://maven.apache.org/shared/file-management/)
+======================
+
+[][jira]
+[][license]
+[](https://search.maven.org/artifact/org.apache.maven.shared/file-management)
+[][build]
+[][test-results]
+
+
+You have found a bug or you have an idea for a cool new feature? Contributing
+code is a great way to give something back to the open source community. Before
+you dig right into the code, there are a few guidelines that we need
+contributors to follow so that we can have a chance of keeping on top of
+things.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature, it makes sense to discuss
your changes
+ on the [dev list][ml-list] first.
+ This way you can make sure you're not wasting your time on something that
isn't
+ considered to be in Apache Maven's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+ + Clearly describe the issue, including steps to reproduce when it is a bug.
+ + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making and Submitting Changes
+--------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][ml-list] is
the
+main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ Create a topic branch from where you want to base your work (this is usually
the master branch).
+ Push your changes to a topic branch in your fork of the repository.
++ Make commits of logical units.
++ Respect the original code style: by using the same [codestyle][code-style],
+ patches should only highlight the actual difference, not being disturbed by
any formatting issues:
+ + Only use spaces for indentation.
+ + Create minimal diffs - disable on save actions like reformat source code
or organize imports.
+ If you feel the source code should be reformatted, create a separate PR
for this change.
+ + Check for unnecessary whitespace with `git diff --check` before committing.
++ Make sure your commit messages are in the proper format. Your commit message
should contain the key of the JIRA issue.
+```
+[MSHARED-XXX] - Subject of the JIRA Ticket
+ Optional supplemental description.
+```
++ Make sure you have added the necessary tests (JUnit/IT) for your changes.
++ Run all the tests with `mvn -Prun-its verify` to assure nothing else was
accidentally broken.
++ Submit a pull request to the repository in the Apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you plan to contribute on a regular basis, please consider filing a
[contributor license agreement][cla].
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always
+necessary to create a new ticket in JIRA. In this case, it is appropriate to
+start the first line of a commit with '(doc)' instead of a ticket number.
+
+Additional Resources
+--------------------
+
++ [Contributing
patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
++ [Apache Maven Shared Components project page][jira]
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request
documentation](https://help.github.com/send-pull-requests/)
++ [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject)
++ #Maven IRC channel on freenode.org
+
+[jira]: https://issues.apache.org/jira/projects/MSHARED/
+[license]: https://www.apache.org/licenses/LICENSE-2.0
+[ml-list]: https://maven.apache.org/mailing-lists.html
+[code-style]: https://maven.apache.org/developers/conventions/code.html
+[cla]: https://www.apache.org/licenses/#clas
+[maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index
+[test-results]:
https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-file-management/job/master/lastCompletedBuild/testReport/
+[build]:
https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-file-management/job/master/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/pom.xml
new/file-management-3.1.0/pom.xml
--- old/file-management-3.0.0/pom.xml 2015-12-25 14:31:50.000000000 +0100
+++ new/file-management-3.1.0/pom.xml 2022-06-29 11:19:58.000000000 +0200
@@ -26,12 +26,12 @@
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
- <version>22</version>
-
<relativePath>../../pom/maven/maven-shared-components/pom.xml</relativePath>
+ <version>36</version>
+ <relativePath />
</parent>
<artifactId>file-management</artifactId>
- <version>3.0.0</version>
+ <version>3.1.0</version>
<name>Apache Maven File Management API</name>
<description>API to collect files from a given directory using several
include/exclude rules.</description>
@@ -43,60 +43,57 @@
</contributor>
</contributors>
- <prerequisites>
- <maven>${mavenVersion}</maven>
- </prerequisites>
-
<scm>
-
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/shared/tags/file-management-3.0.0</connection>
-
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/file-management-3.0.0</developerConnection>
-
<url>http://svn.apache.org/viewvc/maven/shared/tags/file-management-3.0.0</url>
+
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-file-management.git</connection>
+
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-file-management.git</developerConnection>
+
<url>https://github.com/apache/maven-file-management/tree/${project.scm.tag}</url>
+ <tag>file-management-3.1.0</tag>
</scm>
<issueManagement>
<system>jira</system>
- <url>https://issues.apache.org/jira/browse/MSHARED/component/12326425</url>
+ <url>https://issues.apache.org/jira/browse/MSHARED/</url>
</issueManagement>
<distributionManagement>
<site>
<id>apache.website</id>
-
<url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
+
<url>scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}</url>
</site>
</distributionManagement>
<properties>
- <mavenVersion>3.0</mavenVersion>
- <maven.compiler.target>1.6</maven.compiler.target>
- <maven.compiler.source>1.6</maven.compiler.source>
+ <javaVersion>8</javaVersion>
+ <slf4jVersion>1.7.36</slf4jVersion>
+
<project.build.outputTimestamp>2022-06-29T11:19:57Z</project.build.outputTimestamp>
</properties>
<dependencies>
- <!-- Maven -->
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${mavenVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-io</artifactId>
- <version>3.0.0</version>
- </dependency>
-
<dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-utils</artifactId>
- <version>3.0.0</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>3.0.22</version>
+ <version>3.4.2</version>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.11.0</version>
+ </dependency>
+
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.11</version>
+ <version>4.13.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -107,7 +104,6 @@
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
- <useJava5>true</useJava5>
<version>1.1.0</version>
<models>
<model>src/main/mdo/fileset.mdo</model>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FileNameMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FileNameMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FileNameMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FileNameMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -20,30 +20,27 @@
*/
/**
- * Interface to be used by SourceFileScanner.
- *
- * <p>Used to find the name of the target file(s) corresponding to a
- * source file.</p>
+ * Interface used by SourceFileScanner
+ * to find the name of the target file(s) corresponding to a
+ * source file.
*
* <p>The rule by which the file names are transformed is specified
* via the setFrom and setTo methods. The exact meaning of these is
* implementation dependent.</p>
- *
- * @version $Id: FileNameMapper.java 1721672 2015-12-25 13:18:36Z khmarbaise $
*/
public interface FileNameMapper
{
/**
* Sets the from part of the transformation rule.
*
- * @param from The source.
+ * @param from the source
*/
void setFrom( String from );
/**
* Sets the to part of the transformation rule.
*
- * @param to The destination.
+ * @param to the destination
*/
void setTo( String to );
@@ -51,12 +48,12 @@
* Returns the target filename for the
* given source file.
*
- * <p>if the given rule doesn't apply to the source file,
- * implementation must return null. SourceFileScanner will then
+ * <p>If the given rule doesn't apply to the source file,
+ * the implementation must return null. SourceFileScanner will then
* omit the source file in question.</p>
*
- * @param sourceFileName the name of the source file relative to some
given basedirectory.
- * @return the target filename for the given source file.
+ * @param sourceFileName the name of the source file relative to some
given base directory
+ * @return the target filename for the given source file
*/
String mapFileName( String sourceFileName );
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FlatFileNameMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FlatFileNameMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FlatFileNameMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/FlatFileNameMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -19,33 +19,33 @@
* under the License.
*/
+import java.io.File;
+
/**
* Implementation of FileNameMapper that always returns the source
* file name without any leading directory information.
*
* <p>This is the default FileNameMapper for the copy and move
* tasks if the flatten attribute has been set.</p>
- *
- * @version $Id: FlatFileNameMapper.java 661727 2008-05-30 14:21:49Z bentmann $
*/
public class FlatFileNameMapper
implements FileNameMapper
{
- /** {@inheritDoc} */
+ @Override
public void setFrom( String from )
{
// nop
}
- /** {@inheritDoc} */
+ @Override
public void setTo( String to )
{
// nop
}
- /** {@inheritDoc} */
+ @Override
public String mapFileName( String sourceFileName )
{
- return new String( new java.io.File( sourceFileName ).getName() );
+ return new File( sourceFileName ).getName();
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/GlobPatternMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/GlobPatternMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/GlobPatternMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/GlobPatternMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -30,8 +30,6 @@
*
* <p>This is one of the more useful Mappers, it is used by <code>javac</code>
for
* example.</p>
- *
- * @version $Id: GlobPatternMapper.java 1721579 2015-12-23 21:08:39Z
khmarbaise $
*/
public class GlobPatternMapper
implements FileNameMapper
@@ -91,7 +89,7 @@
this.caseSensitive = caseSensitive;
}
- /** {@inheritDoc} */
+ @Override
public void setFrom( String from )
{
int index = from.lastIndexOf( "*" );
@@ -109,7 +107,7 @@
postfixLength = fromPostfix.length();
}
- /** {@inheritDoc} */
+ @Override
public void setTo( String to )
{
int index = to.lastIndexOf( "*" );
@@ -125,7 +123,7 @@
}
}
- /** {@inheritDoc} */
+ @Override
public String mapFileName( String sourceFileName )
{
if ( fromPrefix == null || !modifyName( sourceFileName ).startsWith(
modifyName( fromPrefix ) )
@@ -133,7 +131,7 @@
{
return null;
}
- return new String( toPrefix + extractVariablePart( sourceFileName ) +
toPostfix );
+ return toPrefix + extractVariablePart( sourceFileName ) + toPostfix;
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/IdentityMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/IdentityMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/IdentityMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/IdentityMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -24,25 +24,23 @@
*
* <p>This is the default FileNameMapper for the copy and move
* tasks.</p>
- *
- * @version $Id: IdentityMapper.java 661727 2008-05-30 14:21:49Z bentmann $
*/
public class IdentityMapper
implements FileNameMapper
{
- /** {@inheritDoc} */
+ @Override
public void setFrom( String from )
{
// nop
}
- /** {@inheritDoc} */
+ @Override
public void setTo( String to )
{
// nop
}
- /** {@inheritDoc} */
+ @Override
public String mapFileName( String sourceFileName )
{
return sourceFileName;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperException.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperException.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperException.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperException.java
2022-06-29 11:19:58.000000000 +0200
@@ -21,8 +21,6 @@
/**
* Mapper Exception
- *
- * @version $Id: MapperException.java 1721672 2015-12-25 13:18:36Z khmarbaise $
*/
public class MapperException
extends Exception
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MapperUtil.java
2022-06-29 11:19:58.000000000 +0200
@@ -20,7 +20,6 @@
*/
import org.apache.maven.shared.model.fileset.Mapper;
-import org.apache.maven.shared.utils.io.IOUtil;
import java.io.IOException;
import java.io.InputStream;
@@ -28,8 +27,6 @@
/**
* Element to define a FileNameMapper.
- *
- * @version $Id: MapperUtil.java 1721672 2015-12-25 13:18:36Z khmarbaise $
*/
public final class MapperUtil
{
@@ -53,30 +50,19 @@
ClassLoader cloader =
Thread.currentThread().getContextClassLoader();
- InputStream stream = null;
-
- try
+ try ( InputStream stream = cloader.getResourceAsStream(
MAPPER_PROPERTIES ) )
{
- stream = cloader.getResourceAsStream( MAPPER_PROPERTIES );
-
if ( stream == null )
{
throw new IllegalStateException( "Cannot find classpath
resource: " + MAPPER_PROPERTIES );
}
- try
- {
- props.load( stream );
- implementations = props;
- }
- catch ( IOException e )
- {
- throw new IllegalStateException( "Cannot find classpath
resource: " + MAPPER_PROPERTIES );
- }
+ props.load( stream );
+ implementations = props;
}
- finally
+ catch ( IOException e )
{
- IOUtil.close( stream );
+ throw new IllegalStateException( "Cannot find classpath
resource: " + MAPPER_PROPERTIES );
}
}
}
@@ -86,7 +72,7 @@
*
* @param mapper {@link Mapper}
* @return {@link FileNameMapper}
- * @throws MapperException in case of an error.
+ * @throws MapperException in case of an error
*/
public static FileNameMapper getFileNameMapper( Mapper mapper )
throws MapperException
@@ -129,11 +115,7 @@
{
throw new MapperException( "Cannot find mapper implementation: " +
classname, e );
}
- catch ( InstantiationException e )
- {
- throw new MapperException( "Cannot load mapper implementation: " +
classname, e );
- }
- catch ( IllegalAccessException e )
+ catch ( InstantiationException | IllegalAccessException e )
{
throw new MapperException( "Cannot load mapper implementation: " +
classname, e );
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MergingMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MergingMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MergingMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/MergingMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -25,27 +25,25 @@
*
* <p>This is the default FileNameMapper for the archiving tasks and
* up-to-date.</p>
- *
- * @version $Id: MergingMapper.java 1721672 2015-12-25 13:18:36Z khmarbaise $
*/
public class MergingMapper
implements FileNameMapper
{
private String mergedFile = null;
- /** {@inheritDoc} */
+ @Override
public void setFrom( String from )
{
// nop
}
- /** {@inheritDoc} */
+ @Override
public void setTo( String to )
{
mergedFile = to;
}
- /** {@inheritDoc} */
+ @Override
public String mapFileName( String sourceFileName )
{
return mergedFile;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/PackageNameMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/PackageNameMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/PackageNameMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/PackageNameMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -29,13 +29,11 @@
* <mapper classname="org.apache.tools.ant.util.PackageNameMapper"
* from="*Test.java" to="${test.data.dir}/TEST-*Test.xml"/>
* </pre>
- *
- * @version $Id: PackageNameMapper.java 1721579 2015-12-23 21:08:39Z
khmarbaise $
*/
public class PackageNameMapper
extends GlobPatternMapper
{
- /** {@inheritDoc} */
+ @Override
protected String extractVariablePart( String name )
{
String var = name.substring( prefixLength, name.length() -
postfixLength );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/RegexpPatternMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/RegexpPatternMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/RegexpPatternMapper.java
1970-01-01 01:00:00.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/RegexpPatternMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -0,0 +1,60 @@
+package org.apache.maven.shared.model.fileset.mappers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Implementation of RegexpPatternMapper that returns either the source file
+ * name or it processed by a matching Regular Expression and its replacement.
+ *
+ * <p>This is a RegexpPatternMapper for the copy and move tasks.</p>
+ */
+public class RegexpPatternMapper
+ implements FileNameMapper
+{
+ private Pattern fromPattern;
+ private String toReplaceExpression;
+
+ @Override
+ public void setFrom( String from )
+ {
+ this.fromPattern = Pattern.compile( from );
+ }
+
+ @Override
+ public void setTo( String to )
+ {
+ this.toReplaceExpression = to;
+ }
+
+ @Override
+ public String mapFileName( String sourceFileName )
+ {
+ Matcher matcher = this.fromPattern.matcher( sourceFileName );
+ if ( !matcher.find( ) )
+ {
+ return sourceFileName;
+ }
+
+ return matcher.replaceFirst( this.toReplaceExpression );
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/UnPackageNameMapper.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/UnPackageNameMapper.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/UnPackageNameMapper.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/mappers/UnPackageNameMapper.java
2022-06-29 11:19:58.000000000 +0200
@@ -30,13 +30,11 @@
* <mapper classname="org.apache.tools.ant.util.UnPackageNameMapper"
* from="${test.data.dir}/TEST-*Test.xml" to="*Test.java">
* </pre>
- *
- * @version $Id: UnPackageNameMapper.java 661727 2008-05-30 14:21:49Z bentmann
$
*/
public class UnPackageNameMapper
extends GlobPatternMapper
{
- /** {@inheritDoc} */
+ @Override
protected String extractVariablePart( String name )
{
String var = name.substring( prefixLength, name.length() -
postfixLength );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/util/FileSetManager.java
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/util/FileSetManager.java
---
old/file-management-3.0.0/src/main/java/org/apache/maven/shared/model/fileset/util/FileSetManager.java
2015-12-25 14:31:50.000000000 +0100
+++
new/file-management-3.1.0/src/main/java/org/apache/maven/shared/model/fileset/util/FileSetManager.java
2022-06-29 11:19:58.000000000 +0200
@@ -25,33 +25,28 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.shared.io.logging.DefaultMessageHolder;
-import org.apache.maven.shared.io.logging.MessageHolder;
-import org.apache.maven.shared.io.logging.MessageLevels;
-import org.apache.maven.shared.io.logging.MojoLogSink;
-import org.apache.maven.shared.io.logging.PlexusLoggerSink;
+import org.apache.commons.io.FileUtils;
import org.apache.maven.shared.model.fileset.FileSet;
import org.apache.maven.shared.model.fileset.mappers.FileNameMapper;
import org.apache.maven.shared.model.fileset.mappers.MapperException;
import org.apache.maven.shared.model.fileset.mappers.MapperUtil;
-import org.apache.maven.shared.utils.io.DirectoryScanner;
-import org.apache.maven.shared.utils.io.FileUtils;
-import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.util.Objects.requireNonNull;
/**
* Provides operations for use with FileSet instances, such as retrieving the
included/excluded files, deleting all
* matching entries, etc.
*
* @author jdcasey
- * @version $Id: FileSetManager.java 1721672 2015-12-25 13:18:36Z khmarbaise $
*/
public class FileSetManager
{
@@ -59,7 +54,7 @@
private final boolean verbose;
- private MessageHolder messages;
+ private final Logger logger;
// ----------------------------------------------------------------------
// Constructors
@@ -68,77 +63,31 @@
/**
* Create a new manager instance with the supplied log instance and flag
for whether to output verbose messages.
*
- * @param log The mojo log instance
- * @param verbose Whether to output verbose messages
+ * @param logger the logger instance
+ * @param verbose whether to output verbose messages
*/
- public FileSetManager( Log log, boolean verbose )
+ public FileSetManager( Logger logger, boolean verbose )
{
- if ( verbose )
- {
- this.messages =
- new DefaultMessageHolder( MessageLevels.LEVEL_DEBUG,
MessageLevels.LEVEL_INFO, new MojoLogSink( log ) );
- }
- else
- {
- this.messages =
- new DefaultMessageHolder( MessageLevels.LEVEL_INFO,
MessageLevels.LEVEL_INFO, new MojoLogSink( log ) );
- }
-
+ this.logger = requireNonNull( logger );
this.verbose = verbose;
}
/**
* Create a new manager instance with the supplied log instance. Verbose
flag is set to false.
*
- * @param log The mojo log instance
+ * @param logger The log instance
*/
- public FileSetManager( Log log )
+ public FileSetManager( Logger logger )
{
- this.messages =
- new DefaultMessageHolder( MessageLevels.LEVEL_INFO,
MessageLevels.LEVEL_INFO, new MojoLogSink( log ) );
- this.verbose = false;
+ this( logger, false );
}
/**
- * Create a new manager instance with the supplied log instance and flag
for whether to output verbose messages.
- *
- * @param log The mojo log instance
- * @param verbose Whether to output verbose messages
- */
- public FileSetManager( Logger log, boolean verbose )
- {
- if ( verbose )
- {
- this.messages = new DefaultMessageHolder(
MessageLevels.LEVEL_DEBUG, MessageLevels.LEVEL_INFO,
- new PlexusLoggerSink(
log ) );
- }
- else
- {
- this.messages = new DefaultMessageHolder(
MessageLevels.LEVEL_INFO, MessageLevels.LEVEL_INFO,
- new PlexusLoggerSink(
log ) );
- }
-
- this.verbose = verbose;
- }
-
- /**
- * Create a new manager instance with the supplied log instance. Verbose
flag is set to false.
- *
- * @param log The mojo log instance
- */
- public FileSetManager( Logger log )
- {
- this.messages =
- new DefaultMessageHolder( MessageLevels.LEVEL_INFO,
MessageLevels.LEVEL_INFO, new PlexusLoggerSink( log ) );
- this.verbose = false;
- }
-
- /**
- * Create a new manager instance with an empty messages. Verbose flag is
set to false.
+ * Create a new manager instance with an own logger. Verbose flag is set
to false.
*/
public FileSetManager()
{
- this.verbose = false;
+ this( LoggerFactory.getLogger( FileSetManager.class ), false );
}
// ----------------------------------------------------------------------
@@ -155,14 +104,12 @@
throws MapperException
{
String[] sourcePaths = getIncludedFiles( fileSet );
- Map<String, String> mappedPaths = new LinkedHashMap<String, String>();
+ Map<String, String> mappedPaths = new LinkedHashMap<>();
FileNameMapper fileMapper = MapperUtil.getFileNameMapper(
fileSet.getMapper() );
- for ( int i = 0; i < sourcePaths.length; i++ )
+ for ( String sourcePath : sourcePaths )
{
- String sourcePath = sourcePaths[i];
-
String destPath;
if ( fileMapper != null )
{
@@ -276,18 +223,16 @@
{
Set<String> deletablePaths = findDeletablePaths( fileSet );
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
String paths = String.valueOf( deletablePaths ).replace( ',', '\n'
);
- messages.addDebugMessage( "Found deletable paths: " + paths
).flush();
+ logger.debug( "Found deletable paths: " + paths );
}
- List<String> warnMessages = new LinkedList<String>();
+ List<String> warnMessages = new LinkedList<>();
- for ( Iterator<String> it = deletablePaths.iterator(); it.hasNext(); )
+ for ( String path : deletablePaths )
{
- String path = it.next();
-
File file = new File( fileSet.getDirectory(), path );
if ( file.exists() )
@@ -296,18 +241,18 @@
{
if ( fileSet.isFollowSymlinks() || !isSymlink( file ) )
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Deleting directory: " +
file ).flush();
+ logger.info( "Deleting directory: " + file );
}
removeDir( file, fileSet.isFollowSymlinks(),
throwsError, warnMessages );
}
else
{ // delete a symlink to a directory without follow
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Deleting symlink to
directory: " + file ).flush();
+ logger.info( "Deleting symlink to directory: " +
file );
}
if ( !file.delete() )
@@ -327,12 +272,12 @@
}
else
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Deleting file: " + file
).flush();
+ logger.info( "Deleting file: " + file );
}
- if ( !delete( file ) )
+ if ( !FileUtils.deleteQuietly( file ) )
{
String message = "Failed to delete file " +
file.getAbsolutePath() + ". Reason is unknown.";
if ( throwsError )
@@ -346,11 +291,11 @@
}
}
- if ( messages != null && messages.isWarningEnabled() && !throwsError
&& ( warnMessages.size() > 0 ) )
+ if ( logger.isWarnEnabled() && !throwsError && ( warnMessages.size() >
0 ) )
{
- for ( Iterator<String> it = warnMessages.iterator(); it.hasNext();
)
+ for ( String warnMessage : warnMessages )
{
- messages.addWarningMessage( it.next() ).flush();
+ logger.warn( warnMessage );
}
}
}
@@ -362,7 +307,7 @@
private boolean isSymlink( File file )
throws IOException
{
- File fileInCanonicalParent = null;
+ File fileInCanonicalParent;
File parentDir = file.getParentFile();
if ( parentDir == null )
{
@@ -372,11 +317,11 @@
{
fileInCanonicalParent = new File( parentDir.getCanonicalPath(),
file.getName() );
}
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Checking for symlink:\nFile's canonical
path: "
+ logger.debug( "Checking for symlink:\nFile's canonical path: "
+ fileInCanonicalParent.getCanonicalPath() + "\nFile's
absolute path with canonical parent: "
- + fileInCanonicalParent.getPath() ).flush();
+ + fileInCanonicalParent.getPath() );
}
return !fileInCanonicalParent.getCanonicalFile().equals(
fileInCanonicalParent.getAbsoluteFile() );
}
@@ -391,38 +336,38 @@
private Set<String> findDeletableDirectories( FileSet fileSet )
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Scanning for deletable directories."
).flush();
+ logger.info( "Scanning for deletable directories." );
}
DirectoryScanner scanner = scan( fileSet );
if ( scanner == null )
{
- return Collections.<String>emptySet();
+ return Collections.emptySet();
}
- Set<String> includes = new HashSet<String>( Arrays.asList(
scanner.getIncludedDirectories() ) );
- List<String> excludes = new ArrayList<String>( Arrays.asList(
scanner.getExcludedDirectories() ) );
- List<String> linksForDeletion = new ArrayList<String>();
+ Set<String> includes = new HashSet<>( Arrays.asList(
scanner.getIncludedDirectories() ) );
+ List<String> excludes = new ArrayList<>( Arrays.asList(
scanner.getExcludedDirectories() ) );
+ List<String> linksForDeletion = new ArrayList<>();
if ( !fileSet.isFollowSymlinks() )
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Adding symbolic link dirs which were
previously excluded"
- + " to the list being deleted." ).flush();
+ logger.info( "Adding symbolic link dirs which were previously
excluded"
+ + " to the list being deleted." );
}
// we need to see which entries were only excluded because they're
symlinks...
scanner.setFollowSymlinks( true );
scanner.scan();
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Originally marked for delete: " +
includes ).flush();
- messages.addDebugMessage( "Marked for preserve (with
followSymlinks == false): " + excludes ).flush();
+ logger.debug( "Originally marked for delete: " + includes );
+ logger.debug( "Marked for preserve (with followSymlinks ==
false): " + excludes );
}
List<String> includedDirsAndSymlinks = Arrays.asList(
scanner.getIncludedDirectories() );
@@ -430,10 +375,10 @@
linksForDeletion.addAll( excludes );
linksForDeletion.retainAll( includedDirsAndSymlinks );
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Symlinks marked for deletion
(originally mismarked): "
- + linksForDeletion ).flush();
+ logger.debug( "Symlinks marked for deletion (originally
mismarked): "
+ + linksForDeletion );
}
excludes.removeAll( includedDirsAndSymlinks );
@@ -448,9 +393,9 @@
private Set<String> findDeletableFiles( FileSet fileSet, Set<String>
deletableDirectories )
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Re-scanning for deletable files."
).flush();
+ logger.info( "Re-scanning for deletable files." );
}
DirectoryScanner scanner = scan( fileSet );
@@ -460,27 +405,26 @@
return deletableDirectories;
}
- Set<String> includes = deletableDirectories;
- includes.addAll( Arrays.asList( scanner.getIncludedFiles() ) );
- List<String> excludes = new ArrayList<String>( Arrays.asList(
scanner.getExcludedFiles() ) );
- List<String> linksForDeletion = new ArrayList<String>();
+ deletableDirectories.addAll( Arrays.asList( scanner.getIncludedFiles()
) );
+ List<String> excludes = new ArrayList<>( Arrays.asList(
scanner.getExcludedFiles() ) );
+ List<String> linksForDeletion = new ArrayList<>();
if ( !fileSet.isFollowSymlinks() )
{
- if ( verbose && messages != null )
+ if ( verbose )
{
- messages.addInfoMessage( "Adding symbolic link files which
were previously excluded "
- + "to the list being deleted." ).flush();
+ logger.info( "Adding symbolic link files which were previously
excluded "
+ + "to the list being deleted." );
}
// we need to see which entries were only excluded because they're
symlinks...
scanner.setFollowSymlinks( true );
scanner.scan();
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Originally marked for delete: " +
includes ).flush();
- messages.addDebugMessage( "Marked for preserve (with
followSymlinks == false): " + excludes ).flush();
+ logger.debug( "Originally marked for delete: " +
deletableDirectories );
+ logger.debug( "Marked for preserve (with followSymlinks ==
false): " + excludes );
}
List<String> includedFilesAndSymlinks = Arrays.asList(
scanner.getIncludedFiles() );
@@ -488,20 +432,20 @@
linksForDeletion.addAll( excludes );
linksForDeletion.retainAll( includedFilesAndSymlinks );
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Symlinks marked for deletion
(originally mismarked): "
- + linksForDeletion ).flush();
+ logger.debug( "Symlinks marked for deletion (originally
mismarked): "
+ + linksForDeletion );
}
excludes.removeAll( includedFilesAndSymlinks );
}
- excludeParentDirectoriesOfExcludedPaths( excludes, includes );
+ excludeParentDirectoriesOfExcludedPaths( excludes,
deletableDirectories );
- includes.addAll( linksForDeletion );
+ deletableDirectories.addAll( linksForDeletion );
- return includes;
+ return deletableDirectories;
}
/**
@@ -515,25 +459,23 @@
*/
private void excludeParentDirectoriesOfExcludedPaths( List<String>
excludedPaths, Set<String> deletablePaths )
{
- for ( Iterator<String> it = excludedPaths.iterator(); it.hasNext(); )
+ for ( String path : excludedPaths )
{
- String path = it.next();
-
String parentPath = new File( path ).getParent();
while ( parentPath != null )
{
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Verifying path " + parentPath
- + " is not present; contains file which is excluded."
).flush();
+ logger.debug(
+ "Verifying path " + parentPath + " is not present;
contains file which is excluded." );
}
boolean removed = deletablePaths.remove( parentPath );
- if ( removed && messages != null && messages.isDebugEnabled() )
+ if ( removed && logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Path " + parentPath + " was
removed from delete list." ).flush();
+ logger.debug( "Path " + parentPath + " was removed from
delete list." );
}
parentPath = new File( parentPath ).getParent();
@@ -542,17 +484,17 @@
if ( !excludedPaths.isEmpty() )
{
- if ( messages != null && messages.isDebugEnabled() )
+ if ( logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Verifying path " + "."
- + " is not present; contains file which is excluded."
).flush();
+ logger.debug( "Verifying path " + "."
+ + " is not present; contains file which is excluded." );
}
boolean removed = deletablePaths.remove( "" );
- if ( removed && messages != null && messages.isDebugEnabled() )
+ if ( removed && logger.isDebugEnabled() )
{
- messages.addDebugMessage( "Path " + "." + " was removed from
delete list." ).flush();
+ logger.debug( "Path " + "." + " was removed from delete list."
);
}
}
}
@@ -575,9 +517,8 @@
list = new String[0];
}
- for ( int i = 0; i < list.length; i++ )
+ for ( String s : list )
{
- String s = list[i];
File f = new File( dir, s );
if ( f.isDirectory() && ( followSymlinks || !isSymlink( f ) ) )
{
@@ -585,7 +526,7 @@
}
else
{
- if ( !delete( f ) )
+ if ( !FileUtils.deleteQuietly( f ) )
{
String message = "Unable to delete file " +
f.getAbsolutePath();
if ( throwsError )
@@ -601,7 +542,7 @@
}
}
- if ( !delete( dir ) )
+ if ( !FileUtils.deleteQuietly( dir ) )
{
String message = "Unable to delete directory " +
dir.getAbsolutePath();
if ( throwsError )
@@ -616,25 +557,6 @@
}
}
- /**
- * Delete a file
- *
- * @param f a file
- */
- private boolean delete( File f )
- {
- try
- {
- FileUtils.forceDelete( f );
- }
- catch ( IOException e )
- {
- return false;
- }
-
- return true;
- }
-
private DirectoryScanner scan( FileSet fileSet )
{
File basedir = new File( fileSet.getDirectory() );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/src/main/mdo/fileset.mdo
new/file-management-3.1.0/src/main/mdo/fileset.mdo
--- old/file-management-3.0.0/src/main/mdo/fileset.mdo 2015-12-25
14:31:50.000000000 +0100
+++ new/file-management-3.1.0/src/main/mdo/fileset.mdo 2022-06-29
11:19:58.000000000 +0200
@@ -19,8 +19,8 @@
under the License.
-->
-<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0
http://modello.codehaus.org/xsd/modello-1.4.0.xsd">
+<model xmlns="https://codehaus-plexus.github.io/MODELLO/1.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://codehaus-plexus.github.io/MODELLO/1.4.0
https://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd">
<id>fileset</id>
<name>FileSet</name>
<description>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/src/site/site.xml
new/file-management-3.1.0/src/site/site.xml
--- old/file-management-3.0.0/src/site/site.xml 2015-12-25 14:31:52.000000000
+0100
+++ new/file-management-3.1.0/src/site/site.xml 2022-06-29 11:19:58.000000000
+0200
@@ -26,7 +26,7 @@
<item name="JavaDocs" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
- <!-- According to http://jira.codehaus.org/browse/MNGSITE-152 -->
+ <!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
<item name="License" href="http://www.apache.org/licenses/"/>
<item name="Download" href="download.html"/>
</menu>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/file-management-3.0.0/src/site/xdoc/download.xml.vm
new/file-management-3.1.0/src/site/xdoc/download.xml.vm
--- old/file-management-3.0.0/src/site/xdoc/download.xml.vm 2015-12-25
14:31:52.000000000 +0100
+++ new/file-management-3.1.0/src/site/xdoc/download.xml.vm 2022-06-29
11:19:58.000000000 +0200
@@ -34,7 +34,7 @@
<p>In order to guard against corrupted downloads/installations, it is
highly recommended to
<a
href="http://www.apache.org/dev/release-signing#verifying-signature">verify the
signature</a>
- of the release bundles against the public <a
href="http://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
+ of the release bundles against the public <a
href="https://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
developers.</p>
<p>${project.name} is distributed under the <a
href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p>
@@ -108,8 +108,8 @@
<tr>
<td>${project.name} ${project.version} (Source zip)</td>
<td><a
href="[preferred]maven/shared/${project.artifactId}-${project.version}-source-release.zip">maven/shared/${project.artifactId}-${project.version}-source-release.zip</a></td>
- <td><a
href="http://www.apache.org/dist/maven/shared/${project.artifactId}-${project.version}-source-release.zip.md5">maven/shared/${project.artifactId}-${project.version}-source-release.zip.md5</a></td>
- <td><a
href="http://www.apache.org/dist/maven/shared/${project.artifactId}-${project.version}-source-release.zip.asc">maven/shared/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
+ <td><a
href="https://www.apache.org/dist/maven/shared/${project.artifactId}-${project.version}-source-release.zip.sha512">maven/shared/${project.artifactId}-${project.version}-source-release.zip.sha512</a></td>
+ <td><a
href="https://www.apache.org/dist/maven/shared/${project.artifactId}-${project.version}-source-release.zip.asc">maven/shared/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
</tr>
</tbody>
</table>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
new/file-management-3.1.0/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
---
old/file-management-3.0.0/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
2015-12-25 14:31:52.000000000 +0100
+++
new/file-management-3.1.0/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
2022-06-29 11:19:58.000000000 +0200
@@ -29,12 +29,9 @@
/**
* A test-case for the MapperUtil.
- *
- * @version $Id: MapperUtilTest.java 1716893 2015-11-27 16:09:51Z khmarbaise $
*/
public class MapperUtilTest
{
-
@Test
public void getFileNameMapperShouldReturnNull()
throws MapperException
@@ -69,16 +66,16 @@
@Test
public void testGetFileNameMapper() throws MapperException
{
- Mapper mapper = null;
try
{
- assertNull( MapperUtil.getFileNameMapper( mapper ) );
+ assertNull( MapperUtil.getFileNameMapper( null ) );
}
catch ( MapperException e )
{
fail( "Unexpected exception " + e );
}
- mapper = new Mapper();
+
+ Mapper mapper = new Mapper();
try
{
// default to identity mapper.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/file-management-3.0.0/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
new/file-management-3.1.0/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
---
old/file-management-3.0.0/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
2015-12-25 14:31:52.000000000 +0100
+++
new/file-management-3.1.0/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
2022-06-29 11:19:58.000000000 +0200
@@ -24,43 +24,39 @@
import java.net.URL;
import java.net.URLDecoder;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
+import org.apache.commons.io.FileUtils;
import org.apache.maven.shared.model.fileset.FileSet;
-import org.apache.maven.shared.utils.cli.CommandLineException;
-import org.apache.maven.shared.utils.cli.Commandline;
-import org.apache.maven.shared.utils.io.FileUtils;
-import junit.framework.TestCase;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.junit.After;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
/**
* Test the FileSet
- *
- * @version $Id: FileSetUtilsTest.java 1716893 2015-11-27 16:09:51Z khmarbaise
$
*/
public class FileSetUtilsTest
- extends TestCase
{
- private Set<File> testDirectories = new HashSet<File>();
+ private final Set<File> testDirectories = new HashSet<>();
- private Set<File> linkFiles = new HashSet<File>();
+ private final Set<File> linkFiles = new HashSet<>();
/** {@inheritDoc} */
+ @After
public void tearDown()
throws IOException
{
- for ( Iterator<File> it = linkFiles.iterator(); it.hasNext(); )
+ for ( File linkFile : linkFiles )
{
- File linkFile = it.next();
-
linkFile.delete();
}
- for ( Iterator<File> it = testDirectories.iterator(); it.hasNext(); )
+ for ( File dir : testDirectories )
{
- File dir = it.next();
-
FileUtils.deleteDirectory( dir );
}
}
@@ -68,6 +64,7 @@
/**
* @throws IOException if any
*/
+ @Test
public void testGetIncludedFiles()
throws IOException
{
@@ -87,10 +84,10 @@
/**
* @throws IOException if any
* @throws InterruptedException if any
- * @throws org.apache.maven.shared.utils.cli.CommandLineException if any
*/
+ @Test
public void testIncludesDontFollowSymlinks()
- throws IOException, InterruptedException, CommandLineException
+ throws IOException, InterruptedException, CommandLineException
{
File directory = setupTestDirectory( "testIncludesDontFollowSymlinks"
);
File subdir = new File( directory, directory.getName() );
@@ -119,6 +116,7 @@
* @throws InterruptedException if any
* @throws CommandLineException if any
*/
+ @Test
public void testDeleteDontFollowSymlinks()
throws IOException, InterruptedException, CommandLineException
{
@@ -148,6 +146,7 @@
/**
* @throws IOException if any
*/
+ @Test
public void testDelete()
throws IOException
{
@@ -169,6 +168,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteDanglingSymlink()
throws Exception
{
@@ -197,6 +197,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteExcludeParentOfExcludedFile()
throws Exception
{
@@ -217,6 +218,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteExcludeParentOfExcludedDir()
throws Exception
{
@@ -237,6 +239,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteExcludeFollowSymlinks()
throws Exception
{
@@ -259,6 +262,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteExcludeDontFollowSymlinks()
throws Exception
{
@@ -281,6 +285,7 @@
/**
* @throws Exception if any
*/
+ @Test
public void testDeleteDontFollowSymlinksButDeleteThem()
throws Exception
{
@@ -316,7 +321,8 @@
* @throws CommandLineException
*/
private boolean createSymlink( File target, File link )
- throws InterruptedException, CommandLineException
+ throws InterruptedException, CommandLineException
+
{
if ( link.exists() )
{
@@ -336,11 +342,6 @@
return result == 0;
}
- /**
- * @param directoryName
- * @return
- * @throws IOException
- */
private File setupTestDirectory( String directoryName )
throws IOException
{
@@ -357,12 +358,12 @@
String testBase = System.getProperty( "testBase",
"target/test-directories" );
File testDir = new File( basedir, testBase + "/" + directoryName );
- testDir.mkdirs();
-
- FileUtils.copyDirectoryStructure( sourceDir, testDir );
-
- testDirectories.add( testDir );
-
- return testDir;
+ if ( testDir.mkdirs() ) {
+ FileUtils.copyDirectory( sourceDir, testDir );
+ testDirectories.add( testDir );
+ return testDir;
+ } else {
+ throw new IOException( "Could not create test directory " +
testDir );
+ }
}
}
++++++ maven-file-management-build.xml ++++++
--- /var/tmp/diff_new_pack.UQxC5d/_old 2024-06-12 15:40:33.351040403 +0200
+++ /var/tmp/diff_new_pack.UQxC5d/_new 2024-06-12 15:40:33.355040550 +0200
@@ -8,16 +8,17 @@
<property file="build.properties"/>
- <property name="project.version" value="3.0.0"/>
+ <property name="project.version" value="3.1.0"/>
<property name="project.groupId" value="org.apache.maven.shared"/>
<property name="project.artifactId" value="file-management"/>
<property name="project.name" value="Apache Maven File Management API"/>
<property name="project.organization.name" value="The Apache Software
Foundation"/>
- <property name="spec.version" value="3.0"/>
+ <property name="spec.version" value="3.1"/>
- <property name="compiler.source" value="1.8"/>
+ <property name="compiler.release" value="8"/>
+ <property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName"
value="${project.artifactId}-${project.version}"/>
@@ -95,6 +96,7 @@
encoding="UTF-8"
optimize="false"
deprecation="true"
+ release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="false"