This is an automated email from the ASF dual-hosted git repository. pottlinger pushed a commit to branch feature/RAT-397 in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit 27bed3657eab5be930d489a81f2065442a582045 Author: P. Ottlinger <[email protected]> AuthorDate: Mon Dec 2 22:46:10 2024 +0100 Revert "RAT-379: Resources from the parent project are no longer handled by the maven-resources-plugin." This reverts commit ee349799e03b6c713820b2efc96598436a206477. --- apache-rat-core/pom.xml | 36 +++---------- .../copyResourcesFromParentProject.groovy | 59 ---------------------- apache-rat-plugin/pom.xml | 28 +++------- apache-rat-tasks/pom.xml | 24 +++------ apache-rat-tools/pom.xml | 28 +++------- apache-rat/pom.xml | 40 ++++----------- .../copyResourcesFromParentProject.groovy | 59 ---------------------- pom.xml | 6 --- src/changes/changes.xml | 3 -- 9 files changed, 39 insertions(+), 244 deletions(-) diff --git a/apache-rat-core/pom.xml b/apache-rat-core/pom.xml index 5eb639ef..8a500a5f 100644 --- a/apache-rat-core/pom.xml +++ b/apache-rat-core/pom.xml @@ -36,6 +36,13 @@ <filtering>true</filtering> <directory>src/main/filtered-resources</directory> </resource> + <resource> + <directory>..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </resource> </resources> <pluginManagement> <plugins> @@ -44,12 +51,6 @@ <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <!-- These files have bad license headers because they are used to test bad license headers --> <exclude>src/test/resources/**</exclude> <exclude>src/it/resources/ReportTest/**</exclude> @@ -135,29 +136,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>com.github.jochenw.jmp</groupId> - <artifactId>jwigrv-maven-plugin</artifactId> - <version>0.2</version> - <executions> - <execution> - <!-- Copy a set of resource files from the parent project to target/classes/META-INF, - so that they become a part of the generated jar file. See RAT-379. - --> - <phase>generate-resources</phase> - <goals><goal>run</goal></goals> - <configuration> - <scriptFile>src/main/build-grv/copyResourcesFromParentProject.groovy</scriptFile> - <scriptProperties> - <sourceDir>${basedir}/..</sourceDir> - <targetDir>${project.build.outputDirectory}/META-INF</targetDir> - <!-- Comma separated list of files, which are being copied --> - <filesToCopy>RELEASE_NOTES.txt</filesToCopy> - </scriptProperties> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build> <dependencies> diff --git a/apache-rat-core/src/main/build-grv/copyResourcesFromParentProject.groovy b/apache-rat-core/src/main/build-grv/copyResourcesFromParentProject.groovy deleted file mode 100644 index 285b8d43..00000000 --- a/apache-rat-core/src/main/build-grv/copyResourcesFromParentProject.groovy +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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. - */ - -// Copy a set of resource files from the parent project to target/classes/META-INF, -// so that they become a part of the generated jar file. See RAT-379. - -import java.io.FileNotFoundException; -import java.nio.file.attribute.FileTime; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -final Path sourceDir = Paths.get("${sourceDir}"); -final Path targetDir = Paths.get("${targetDir}"); -if (!Files.isDirectory(sourceDir)) { - final String msg = "Source directory not found: " + sourceDir.toAbsolutePath(); - log.error(msg); - throw new FileNotFoundException(msg); -} -log.debug("copyResourcesFromParent: Using source directory " + sourceDir + ", resolved to " + sourceDir.toAbsolutePath()); -log.debug("copyResourcesFromParent: Using target directory " + targetDir + ", resolved to " + targetDir.toAbsolutePath()); -Files.createDirectories(targetDir); -for (StringTokenizer st = new StringTokenizer("${filesToCopy}", ","); st.hasMoreTokens(); ) { - final String token = st.nextToken(); - final Path sourceFile = sourceDir.resolve(token); - if (!Files.isRegularFile(sourceFile)) { - final String msg = "Source file " + token + " not found in source directory " + sourceDir; - log.error("copyResourcesFromParent: " + msg); - log.error("copyResourcesFromParent: A possible reason is, that you did clone only the apache-rat-core subproject from Git."); - throw new FileNotFoundException(msg); - } - final Path targetFile = targetDir.resolve(token); - if (Files.isRegularFile(targetFile)) { - final FileTime sourceTime = Files.getLastModifiedTime(sourceFile); - final FileTime targetTime = Files.getLastModifiedTime(targetFile); - if (sourceTime != null && targetTime != null && sourceTime.compareTo(targetTime) >= 0) { - log.debug("copyResourcesFromParent: Skipping source file " - + sourceFile + ", because target file " + targetFile + " appears to be uptodate."); - continue; - } - } - log.debug("copyResourcesFromParent: Copying source file " + sourceFile - + " to target file " + targetFile); - Files.copy(sourceFile, targetFile); -} diff --git a/apache-rat-plugin/pom.xml b/apache-rat-plugin/pom.xml index 66cff432..951614fd 100644 --- a/apache-rat-plugin/pom.xml +++ b/apache-rat-plugin/pom.xml @@ -46,6 +46,13 @@ <filtering>true</filtering> <directory>src/main/filtered-resources</directory> </resource> + <resource> + <directory>..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </resource> </resources> <testResources> <testResource> @@ -85,12 +92,6 @@ <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <!-- These files do not have license headers because they are used to test license headers --> <exclude>src/it/**</exclude> <exclude>src/it/**/src.apt</exclude> @@ -253,21 +254,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <phase>generate-resources</phase> - <goals><goal>unpack-dependencies</goal></goals> - <configuration> - <includeArtifactIds>apache-rat-core</includeArtifactIds> - <includes>META-INF/RELEASE_NOTES.txt</includes> - <outputDirectory>${project.build.outputDirectory}</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build> <dependencies> diff --git a/apache-rat-tasks/pom.xml b/apache-rat-tasks/pom.xml index 8fc634bf..32f7b5d7 100644 --- a/apache-rat-tasks/pom.xml +++ b/apache-rat-tasks/pom.xml @@ -82,6 +82,13 @@ <filtering>true</filtering> <directory>src/main/filtered-resources</directory> </resource> + <resource> + <directory>..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </resource> </resources> <plugins> <plugin> @@ -89,7 +96,6 @@ <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> - <id>generate-test-resources</id> <phase>generate-test-resources</phase> <goals> <goal>copy-dependencies</goal> @@ -100,16 +106,6 @@ <outputDirectory>${project.build.directory}/dependencies</outputDirectory> </configuration> </execution> - <execution> - <id>generate-resources</id> - <phase>generate-resources</phase> - <goals><goal>unpack-dependencies</goal></goals> - <configuration> - <includeArtifactIds>apache-rat-core</includeArtifactIds> - <includes>META-INF/RELEASE_NOTES.txt</includes> - <outputDirectory>${project.build.outputDirectory}</outputDirectory> - </configuration> - </execution> </executions> </plugin> <plugin> @@ -246,12 +242,6 @@ <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <!-- These files do not have license headers --> <exclude>src/test/resources/</exclude> <exclude>src/site/apt/*.txt</exclude> diff --git a/apache-rat-tools/pom.xml b/apache-rat-tools/pom.xml index c36d51c0..a7e98914 100644 --- a/apache-rat-tools/pom.xml +++ b/apache-rat-tools/pom.xml @@ -36,6 +36,13 @@ <filtering>true</filtering> <directory>src/main/filtered-resources</directory> </resource> + <resource> + <directory>..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </resource> </resources> <pluginManagement> <plugins> @@ -44,12 +51,6 @@ <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <!-- This file is included into a generated file. --> <exclude>src/main/resources/Args.tpl</exclude> <exclude>src/main/resources/ant/report.tpl</exclude> @@ -58,21 +59,6 @@ </excludes> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <phase>generate-resources</phase> - <goals><goal>unpack-dependencies</goal></goals> - <configuration> - <includeArtifactIds>apache-rat-core</includeArtifactIds> - <includes>META-INF/RELEASE_NOTES.txt</includes> - <outputDirectory>${project.build.outputDirectory}</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> </plugins> </pluginManagement> <plugins> diff --git a/apache-rat/pom.xml b/apache-rat/pom.xml index 02ec1089..55916e53 100644 --- a/apache-rat/pom.xml +++ b/apache-rat/pom.xml @@ -42,6 +42,17 @@ </dependency> </dependencies> <build> + <resources> + <resource> + <directory>..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>RELEASE_NOTES.txt</include> + <include>LICENSE</include> + <include>NOTICE</include> + </includes> + </resource> + </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -200,29 +211,6 @@ </filesets> </configuration> </plugin> - <plugin> - <groupId>com.github.jochenw.jmp</groupId> - <artifactId>jwigrv-maven-plugin</artifactId> - <version>0.2</version> - <executions> - <execution> - <!-- Copy a set of resource files from the parent project to target/classes/META-INF, - so that they become a part of the generated jar file. See RAT-379. - --> - <phase>generate-resources</phase> - <goals><goal>run</goal></goals> - <configuration> - <scriptFile>src/main/build-grv/copyResourcesFromParentProject.groovy</scriptFile> - <scriptProperties> - <sourceDir>${basedir}/..</sourceDir> - <targetDir>${project.build.outputDirectory}/META-INF</targetDir> - <!-- Comma separated list of files, which are being copied --> - <filesToCopy>RELEASE_NOTES.txt,LICENSE,NOTICE</filesToCopy> - </scriptProperties> - </configuration> - </execution> - </executions> - </plugin> </plugins> <pluginManagement> <plugins> @@ -231,12 +219,6 @@ <artifactId>apache-rat-plugin</artifactId> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <!-- These files only describe how to use the project and they have no license headers --> <exclude>README-ANT.txt</exclude> diff --git a/apache-rat/src/main/build-grv/copyResourcesFromParentProject.groovy b/apache-rat/src/main/build-grv/copyResourcesFromParentProject.groovy deleted file mode 100644 index 285b8d43..00000000 --- a/apache-rat/src/main/build-grv/copyResourcesFromParentProject.groovy +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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. - */ - -// Copy a set of resource files from the parent project to target/classes/META-INF, -// so that they become a part of the generated jar file. See RAT-379. - -import java.io.FileNotFoundException; -import java.nio.file.attribute.FileTime; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -final Path sourceDir = Paths.get("${sourceDir}"); -final Path targetDir = Paths.get("${targetDir}"); -if (!Files.isDirectory(sourceDir)) { - final String msg = "Source directory not found: " + sourceDir.toAbsolutePath(); - log.error(msg); - throw new FileNotFoundException(msg); -} -log.debug("copyResourcesFromParent: Using source directory " + sourceDir + ", resolved to " + sourceDir.toAbsolutePath()); -log.debug("copyResourcesFromParent: Using target directory " + targetDir + ", resolved to " + targetDir.toAbsolutePath()); -Files.createDirectories(targetDir); -for (StringTokenizer st = new StringTokenizer("${filesToCopy}", ","); st.hasMoreTokens(); ) { - final String token = st.nextToken(); - final Path sourceFile = sourceDir.resolve(token); - if (!Files.isRegularFile(sourceFile)) { - final String msg = "Source file " + token + " not found in source directory " + sourceDir; - log.error("copyResourcesFromParent: " + msg); - log.error("copyResourcesFromParent: A possible reason is, that you did clone only the apache-rat-core subproject from Git."); - throw new FileNotFoundException(msg); - } - final Path targetFile = targetDir.resolve(token); - if (Files.isRegularFile(targetFile)) { - final FileTime sourceTime = Files.getLastModifiedTime(sourceFile); - final FileTime targetTime = Files.getLastModifiedTime(targetFile); - if (sourceTime != null && targetTime != null && sourceTime.compareTo(targetTime) >= 0) { - log.debug("copyResourcesFromParent: Skipping source file " - + sourceFile + ", because target file " + targetFile + " appears to be uptodate."); - continue; - } - } - log.debug("copyResourcesFromParent: Copying source file " + sourceFile - + " to target file " + targetFile); - Files.copy(sourceFile, targetFile); -} diff --git a/pom.xml b/pom.xml index 6d031055..934558eb 100644 --- a/pom.xml +++ b/pom.xml @@ -459,12 +459,6 @@ agnostic home for software distribution comprehension and audit tools. <version>0.16.1</version> <configuration> <excludes> - <!-- Automatically generated by Eclipse, thus ignorable. --> - <exclude>.classpath</exclude> - <exclude>.project</exclude> - <exclude>.settings/**/*</exclude> - <exclude>bin/**/*</exclude> - <exclude>.asf.yaml</exclude> <exclude>BUILD.txt</exclude> <!-- rat:check does not seem to use exclusions from modules --> diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 410fcf0b..986def59 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -291,9 +291,6 @@ The <action> type attribute can be one of: <action issue="RAT-345" type="update" dev="pottlinger" due-to="dependabot"> TODO: collect all dependabot updates for release 0.17. </action> - <action issue="RAT-379" type="fix" dev="jochen"> - The project sources are importable into Eclipse. - </action> </release> <release version="0.16.1" date="2024-01-24" description= "As release 0.16 introduced breaking changes concerning the configurability of the Maven plugin, these configuration options are reintroduced albeit as deprecated elements.
