This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git
commit 24c2df4335944be50f119804803d13d9e7613855 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Nov 4 21:46:36 2026 +0000 Combine and tighten the enforcer ITs always-pass hosts one passing configuration per rule so the POM XML binding stays covered; require-snapshot-version_success stays separate because the project version cannot be both a release and a snapshot. --- .../src/it/projects/MENFORCER-395/pom.xml | 60 ------ .../{require-file-checksum => always-pass}/LICENSE | 0 .../src/it/projects/always-pass/pom.xml | 221 +++++++++++++++++++++ .../setup.groovy | 17 +- .../src/it/projects/always-pass/verify.groovy | 50 ++++- .../verify.groovy | 7 +- .../projects/ban-distribution-management/pom.xml | 55 ----- .../ban-distribution-management/verify.groovy | 20 -- .../it/projects/ban-property-prefix-pass/pom.xml | 63 ------ .../ban-property-prefix-pass/verify.groovy | 20 -- .../src/it/projects/banned-dependencies/pom.xml | 58 ------ .../banned-plugins-fails/invoker.properties | 18 -- .../src/it/projects/banned-plugins-fails/pom.xml | 63 ------ .../it/projects/banned-plugins-fails/verify.groovy | 21 -- .../src/it/projects/banned-plugins/pom.xml | 55 ----- .../it/projects/builds_a_pom_noop/module/pom.xml | 30 --- .../src/it/projects/builds_a_pom_noop/pom.xml | 49 ----- .../verify.groovy | 6 +- .../invoker.properties | 18 -- .../pom.xml | 79 -------- .../pom.xml | 6 + .../verify.groovy | 6 +- .../invoker.properties | 18 -- .../pom.xml | 75 ------- .../pom.xml | 75 ------- .../invoker.properties | 18 -- .../pom.xml | 79 -------- .../dependency-convergence_include_failure/pom.xml | 26 +++ .../verify.groovy | 14 +- .../verify.groovy | 7 +- .../pom.xml | 3 + .../verify.groovy | 14 +- .../pom.xml | 64 ------ .../verify.groovy | 27 --- .../src/it/projects/evaluate-beanshell/pom.xml | 59 ------ .../it/projects/evaluate-beanshell/verify.groovy | 22 -- .../projects/require-environment-variable/pom.xml | 56 ------ .../require-environment-variable/verify.groovy | 21 -- .../src/it/projects/require-file-checksum/pom.xml | 78 -------- .../it/projects/require-file-checksum/setup.groovy | 22 -- .../it/projects/require-files-dont-exist/pom.xml | 58 ------ .../src/it/projects/require-files-exist/pom.xml | 60 ------ .../projects/require-files-size/invoker.properties | 18 -- .../src/it/projects/require-files-size/pom.xml | 67 ------- .../src/it/projects/require-java-version/pom.xml | 61 ------ .../it/projects/require-java-version/verify.groovy | 23 --- .../src/it/projects/require-maven-version/pom.xml | 61 ------ .../projects/require-maven-version/verify.groovy | 23 --- .../it/projects/require-no-repositories/pom.xml | 56 ------ .../projects/require-no-repositories/verify.groovy | 20 -- .../src/it/projects/require-os/pom.xml | 54 ----- .../src/it/projects/require-os/verify.groovy | 21 -- .../src/it/projects/require-property/pom.xml | 56 ------ .../src/it/projects/require-property/verify.groovy | 20 -- .../require-release-dependencies-excludes/pom.xml | 63 ------ .../invoker.properties | 18 -- .../pom.xml | 63 ------ .../invoker.properties | 18 -- .../pom.xml | 60 ------ .../projects/require-release-dependencies/pom.xml | 54 ----- .../it/projects/require-release-version/pom.xml | 54 ----- .../projects/require-same-versions_success/pom.xml | 88 -------- .../pom.xml | 90 --------- .../it/projects/require-textfile-checksum/LICENSE | 16 -- .../it/projects/require-textfile-checksum/pom.xml | 80 -------- .../require-textfile-checksum/verify.groovy | 26 --- 66 files changed, 344 insertions(+), 2484 deletions(-) diff --git a/maven-enforcer-plugin/src/it/projects/MENFORCER-395/pom.xml b/maven-enforcer-plugin/src/it/projects/MENFORCER-395/pom.xml deleted file mode 100644 index 54edc983..00000000 --- a/maven-enforcer-plugin/src/it/projects/MENFORCER-395/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>minimal-test</artifactId> - <version>0.0.1</version> - <packaging>jar</packaging> - <description>Minimal test for NPE in maven-enforcer-plugin:3.0.0</description> - <properties> - <java.source>1.8</java.source> - <java.target>1.8</java.target> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce-no-snapshots</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseDeps> - <includes> - <include>testgroup:testartifact</include> - </includes> - </requireReleaseDeps> - </rules> - <fail>true</fail> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-file-checksum/LICENSE b/maven-enforcer-plugin/src/it/projects/always-pass/LICENSE similarity index 100% rename from maven-enforcer-plugin/src/it/projects/require-file-checksum/LICENSE rename to maven-enforcer-plugin/src/it/projects/always-pass/LICENSE diff --git a/maven-enforcer-plugin/src/it/projects/always-pass/pom.xml b/maven-enforcer-plugin/src/it/projects/always-pass/pom.xml index 2375f8c6..16c0e33c 100644 --- a/maven-enforcer-plugin/src/it/projects/always-pass/pom.xml +++ b/maven-enforcer-plugin/src/it/projects/always-pass/pom.xml @@ -25,12 +25,62 @@ under the License. <groupId>org.apache.maven.its.enforcer</groupId> <artifactId>test</artifactId> <version>1.0</version> + <!-- no module resolution, no dependency jars: the rules below only read the project model --> + <packaging>pom</packaging> <description> + One passing configuration for every rule that needs no special project: the XML + configuration of each rule must bind and the mojo must log the rule as passed. </description> + <properties> + <other.prefix.value>ok</other.prefix.value> + </properties> + + <repositories> + <repository> + <id>com.asual.maven.public</id> + <name>Asual Public Repository</name> + <url>http://localhost</url> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>plugin-repo</id> + <url>http://example.com/repo</url> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.apache.maven.plugins.enforcer.its</groupId> + <artifactId>menforcer85_api</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugins.enforcer.its</groupId> + <artifactId>menforcer192-b</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugins.enforcer.its</groupId> + <artifactId>menforcer192-c</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.14</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.14</version> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> @@ -44,6 +94,167 @@ under the License. <configuration> <rules> <AlwaysPass/> + <banDistributionManagement/> + <banPropertyPrefix> + <prefixes> + <prefix>secured.system</prefix> + </prefixes> + </banPropertyPrefix> + <BannedDependencies> + <excludes> + <exclude>org.apache.maven.plugins.enforcer.its:menforcer72_logging</exclude> + </excludes> + </BannedDependencies> + <bannedPlugins> + <excludes> + <exclude>org.codehaus.mojo:build-helper-maven-plugin</exclude> + </excludes> + </bannedPlugins> + <DependencyConvergence/> + <evaluateBeanshell> + <condition>${project.artifactId} == test</condition> + </evaluateBeanshell> + <evaluateBeanshell> + <condition>${project.version} == 1.0</condition> + </evaluateBeanshell> + <requireEnvironmentVariable> + <variableName>PATH</variableName> + </requireEnvironmentVariable> + <requireFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>md5</type> + <checksum>7c5b65d44e8123e70d24d9eef17e9fa2</checksum> + </requireFileChecksum> + <requireFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha1</type> + <checksum>278661cbaf6a1bcbd34e3877b6de0e8bd7097846</checksum> + </requireFileChecksum> + <requireFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha256</type> + <checksum>61b825d68516541151e5ce0145e54765c48cd5802b886aee8fb8cf1953f02d10</checksum> + </requireFileChecksum> + <requireFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha384</type> + <checksum>6f9e6b81487911c5a339c541016a459acaf8312e430ccabe5c10cb2ddf9a307f4595c78555f911377f4fb853ffe87046</checksum> + </requireFileChecksum> + <requireFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha512</type> + <checksum>c51c3cf07c87af78dd7af4407ae3993ea1051d8a7c260cf34bbaa41c468dcd3b62d2be3d9a09807a8595d0065e2d75d1bf9ffc8276d567a983ff057f6b51b0cc</checksum> + </requireFileChecksum> + <requireFilesDontExist> + <files> + <file>target/unwanted.txt</file> + </files> + </requireFilesDontExist> + <requireFilesExist> + <files> + <file>pom.xml</file> + <file>../always-pass/pom.xml</file> + <file>${project.basedir}/../always-pass/pom.xml</file> + </files> + </requireFilesExist> + <requireFilesSize> + <maxsize>102400</maxsize> + <minsize>512</minsize> + <files> + <file>pom.xml</file> + </files> + </requireFilesSize> + <!-- passes only if the sizes below the directory are summed up: 3 files of 4 KB --> + <requireFilesSize> + <maxsize>1000000</maxsize> + <minsize>12000</minsize> + <recursive>true</recursive> + <files> + <file>test</file> + </files> + </requireFilesSize> + <requireJavaVersion> + <!-- implicit range --> + <version>1.4</version> + </requireJavaVersion> + <requireJavaVersion> + <!-- explicit range --> + <version>[1.4,)</version> + </requireJavaVersion> + <requireMavenVersion> + <!-- implicit range --> + <version>2.0</version> + </requireMavenVersion> + <requireMavenVersion> + <!-- explicit range --> + <version>[2.0,)</version> + </requireMavenVersion> + <requireNoRepositories> + <allowedRepositories> + <allowedRepository>com.asual.maven.public</allowedRepository> + </allowedRepositories> + <allowedPluginRepositories> + <allowedPluginRepository>plugin-repo</allowedPluginRepository> + </allowedPluginRepositories> + </requireNoRepositories> + <requireOS> + <display>true</display> + <name>!XXX-Test-Name</name> + </requireOS> + <requireProperty> + <property>basedir</property> + </requireProperty> + <requireReleaseDeps> + <message>No Snapshots Allowed!</message> + <!-- the snapshot dependency is excluded; the include only narrows the exclude to what it does not select --> + <excludes> + <exclude>org.apache.maven.plugins.enforcer.its:menforcer85_api</exclude> + </excludes> + <includes> + <include>testgroup:testartifact</include> + </includes> + </requireReleaseDeps> + <requireReleaseVersion/> + <requireSameVersions> + <buildPlugins> + <buildPlugin>org.apache.maven.plugins:maven-surefire-plugin</buildPlugin> + <buildPlugin>org.apache.maven.plugins:maven-failsafe-plugin</buildPlugin> + </buildPlugins> + <reportPlugins> + <reportPlugin>org.apache.maven.plugins:maven-surefire-report-plugin</reportPlugin> + </reportPlugins> + </requireSameVersions> + <requireSameVersions> + <dependencies> + <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-a</dependency> + <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-b</dependency> + </dependencies> + </requireSameVersions> + <requireTextFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>md5</type> + <checksum>7c5b65d44e8123e70d24d9eef17e9fa2</checksum> + </requireTextFileChecksum> + <requireTextFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha1</type> + <checksum>278661cbaf6a1bcbd34e3877b6de0e8bd7097846</checksum> + </requireTextFileChecksum> + <requireTextFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha256</type> + <checksum>61b825d68516541151e5ce0145e54765c48cd5802b886aee8fb8cf1953f02d10</checksum> + </requireTextFileChecksum> + <requireTextFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha384</type> + <checksum>6f9e6b81487911c5a339c541016a459acaf8312e430ccabe5c10cb2ddf9a307f4595c78555f911377f4fb853ffe87046</checksum> + </requireTextFileChecksum> + <requireTextFileChecksum> + <file>${project.basedir}/LICENSE</file> + <type>sha512</type> + <checksum>c51c3cf07c87af78dd7af4407ae3993ea1051d8a7c260cf34bbaa41c468dcd3b62d2be3d9a09807a8595d0065e2d75d1bf9ffc8276d567a983ff057f6b51b0cc</checksum> + </requireTextFileChecksum> </rules> </configuration> </execution> @@ -51,4 +262,14 @@ under the License. </plugin> </plugins> </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.14</version> + </plugin> + </plugins> + </reporting> </project> diff --git a/maven-enforcer-plugin/src/it/projects/require-files-size/setup.groovy b/maven-enforcer-plugin/src/it/projects/always-pass/setup.groovy similarity index 70% rename from maven-enforcer-plugin/src/it/projects/require-files-size/setup.groovy rename to maven-enforcer-plugin/src/it/projects/always-pass/setup.groovy index 4e46fe71..d34a2333 100644 --- a/maven-enforcer-plugin/src/it/projects/require-files-size/setup.groovy +++ b/maven-enforcer-plugin/src/it/projects/always-pass/setup.groovy @@ -16,14 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -def dir = new File(basedir, "test") -dir.mkdir() -def content = "A" * 4096 // 4KB of 'A' +// require-file-checksum compares the checksum of LICENSE with line separators as checked out +def license = new File(basedir, "LICENSE") +license.write(license.text.normalize()) -(1..3).each { i -> - def file = new File(dir, "file${i}.txt") - file.text = content +// require-files-size sums the sizes below this directory: 3 files of 4 KB +def dir = new File(basedir, "test") +dir.mkdir() +def content = "A" * 4096 +for (int i = 1; i <= 3; i++) { + new File(dir, "file${i}.txt").text = content } - -println "Successfully created bogus files with 4KB of data." \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/always-pass/verify.groovy b/maven-enforcer-plugin/src/it/projects/always-pass/verify.groovy index 5ae92d6e..7f771716 100644 --- a/maven-enforcer-plugin/src/it/projects/always-pass/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/always-pass/verify.groovy @@ -16,8 +16,52 @@ * specific language governing permissions and limitations * under the License. */ -File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( '[INFO] Rule 0: org.apache.maven.enforcer.rules.AlwaysPass passed' ) +def buildLog = new File(basedir, 'build.log').text +// the rules of the project pom, in the order of the configuration +def expectedRules = [ + 'org.apache.maven.enforcer.rules.AlwaysPass', + 'org.apache.maven.enforcer.rules.BanDistributionManagement', + 'org.apache.maven.enforcer.rules.property.BanPropertyPrefix', + 'org.apache.maven.enforcer.rules.dependency.BannedDependencies', + 'org.apache.maven.enforcer.rules.BannedPlugins', + 'org.apache.maven.enforcer.rules.dependency.DependencyConvergence', + 'org.apache.maven.enforcer.rules.EvaluateBeanshell', + 'org.apache.maven.enforcer.rules.EvaluateBeanshell', + 'org.apache.maven.enforcer.rules.property.RequireEnvironmentVariable', + 'org.apache.maven.enforcer.rules.checksum.RequireFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireFileChecksum', + 'org.apache.maven.enforcer.rules.files.RequireFilesDontExist', + 'org.apache.maven.enforcer.rules.files.RequireFilesExist', + 'org.apache.maven.enforcer.rules.files.RequireFilesSize', + 'org.apache.maven.enforcer.rules.files.RequireFilesSize', + 'org.apache.maven.enforcer.rules.version.RequireJavaVersion', + 'org.apache.maven.enforcer.rules.version.RequireJavaVersion', + 'org.apache.maven.enforcer.rules.version.RequireMavenVersion', + 'org.apache.maven.enforcer.rules.version.RequireMavenVersion', + 'org.apache.maven.enforcer.rules.RequireNoRepositories', + 'org.apache.maven.enforcer.rules.RequireOS', + 'org.apache.maven.enforcer.rules.property.RequireProperty', + 'org.apache.maven.enforcer.rules.dependency.RequireReleaseDeps', + 'org.apache.maven.enforcer.rules.RequireReleaseVersion', + 'org.apache.maven.enforcer.rules.RequireSameVersions', + 'org.apache.maven.enforcer.rules.RequireSameVersions', + 'org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum', + 'org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum' +] - \ No newline at end of file +for (int i = 0; i < expectedRules.size(); i++) { + assert buildLog.contains("[INFO] Rule ${i}: ${expectedRules[i]} passed".toString()) : "rule ${i} ${expectedRules[i]} did not pass" +} + +// no further rule is configured +assert !buildLog.contains("[INFO] Rule ${expectedRules.size()}: ".toString()) + +// requireOS display +assert buildLog.contains('OS Info - Arch') diff --git a/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/verify.groovy b/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/verify.groovy index 6db67a72..5eb01ed9 100644 --- a/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/verify.groovy @@ -16,5 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( '[INFO] BUILD SUCCESS' ) +def buildLog = new File(basedir, 'build.log').text + +assert buildLog.contains('[INFO] BUILD SUCCESS') +// the site distribution management of the parent and both modules is allowed by allowSite +assert buildLog.count('[INFO] Rule 0: org.apache.maven.enforcer.rules.BanDistributionManagement passed') == 3 diff --git a/maven-enforcer-plugin/src/it/projects/ban-distribution-management/pom.xml b/maven-enforcer-plugin/src/it/projects/ban-distribution-management/pom.xml deleted file mode 100644 index 304aa5e2..00000000 --- a/maven-enforcer-plugin/src/it/projects/ban-distribution-management/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>ban-distribution-management</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <banDistributionManagement/> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven-enforcer-plugin/src/it/projects/ban-distribution-management/verify.groovy b/maven-enforcer-plugin/src/it/projects/ban-distribution-management/verify.groovy deleted file mode 100644 index 9e3d918e..00000000 --- a/maven-enforcer-plugin/src/it/projects/ban-distribution-management/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( '[INFO] Rule 0: org.apache.maven.enforcer.rules.BanDistributionManagement passed' ) diff --git a/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/pom.xml b/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/pom.xml deleted file mode 100644 index 80157717..00000000 --- a/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - Bans a property by its prefix, must pass because no property matches - </description> - - <properties> - <other.prefix.value>ok</other.prefix.value> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <banPropertyPrefix> - <prefixes> - <prefix>secured.system</prefix> - </prefixes> - </banPropertyPrefix> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/verify.groovy b/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/verify.groovy deleted file mode 100644 index bcbd6ab7..00000000 --- a/maven-enforcer-plugin/src/it/projects/ban-property-prefix-pass/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( '[INFO] Rule 0: org.apache.maven.enforcer.rules.property.BanPropertyPrefix passed' ) diff --git a/maven-enforcer-plugin/src/it/projects/banned-dependencies/pom.xml b/maven-enforcer-plugin/src/it/projects/banned-dependencies/pom.xml deleted file mode 100644 index 8fd7fc5d..00000000 --- a/maven-enforcer-plugin/src/it/projects/banned-dependencies/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <BannedDependencies> - <excludes> - <exclude>org.apache.maven.plugins.enforcer.its:menforcer72_logging</exclude> - </excludes> - </BannedDependencies> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/invoker.properties b/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/invoker.properties deleted file mode 100644 index 58b6526e..00000000 --- a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult = failure diff --git a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/pom.xml b/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/pom.xml deleted file mode 100644 index 09c2af39..00000000 --- a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.3.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <bannedPlugins> - <excludes> - <exclude>org.codehaus.mojo:build-helper-maven-plugin</exclude> - </excludes> - </bannedPlugins> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/verify.groovy b/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/verify.groovy deleted file mode 100644 index 857383cf..00000000 --- a/maven-enforcer-plugin/src/it/projects/banned-plugins-fails/verify.groovy +++ /dev/null @@ -1,21 +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. - */ -def buildLog = new File( basedir, 'build.log' ).text -assert buildLog.contains( '[ERROR] Rule 0: org.apache.maven.enforcer.rules.BannedPlugins failed with message:' ) -assert buildLog =~ /org.codehaus.mojo:build-helper-maven-plugin:maven-plugin:.* <--- banned plugin/ diff --git a/maven-enforcer-plugin/src/it/projects/banned-plugins/pom.xml b/maven-enforcer-plugin/src/it/projects/banned-plugins/pom.xml deleted file mode 100644 index 7a59cd89..00000000 --- a/maven-enforcer-plugin/src/it/projects/banned-plugins/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <bannedPlugins> - </bannedPlugins> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/module/pom.xml b/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/module/pom.xml deleted file mode 100644 index f0dfcfdd..00000000 --- a/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/module/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>test</groupId> - <artifactId>TestParent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - <artifactId>TestModule</artifactId> - <version>1.0-SNAPSHOT</version> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/pom.xml b/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/pom.xml deleted file mode 100644 index 0ffa71b6..00000000 --- a/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>test</groupId> - <artifactId>TestParent</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <configuration> - <rules> - <DependencyConvergence/> - </rules> - </configuration> - <goals> - <goal>enforce</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-files-exist/verify.groovy b/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/verify.groovy similarity index 69% rename from maven-enforcer-plugin/src/it/projects/require-files-exist/verify.groovy rename to maven-enforcer-plugin/src/it/projects/dependencies_not_converging/verify.groovy index cf9a9b55..cc86109a 100644 --- a/maven-enforcer-plugin/src/it/projects/require-files-exist/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/verify.groovy @@ -18,5 +18,7 @@ */ def buildLog = new File(basedir, 'build.log').text -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.files.RequireFilesExist passed') +assert buildLog.contains('[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:') +assert buildLog =~ /Dependency convergence error for org\.slf4j:slf4j-api:jar:1\.6\.[01]\. Paths to dependency are:/ +assert buildLog.contains('org.slf4j:slf4j-jdk14:jar:1.6.1:compile') +assert buildLog.contains('org.slf4j:slf4j-nop:jar:1.6.0:compile') diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/invoker.properties deleted file mode 100644 index 66b78c06..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/pom.xml deleted file mode 100644 index 35864402..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_failure/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>dependency-convergence</artifactId> - <version>1.0.0</version> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.6.2</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-nop</artifactId> - <version>1.6.0</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <configuration> - <rules> - <!-- if everything is included, return any errors that are not excluded --> - <dependencyConvergence> - <includes> - <include>*</include> - </includes> - <excludes> - <exclude>org.apache.commons</exclude> - <exclude>org.slf4j:slf4j-api:[1.6.2]</exclude> - </excludes> - </dependencyConvergence> - </rules> - </configuration> - <goals> - <goal>enforce</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/pom.xml index 80300d67..6f72659e 100644 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/pom.xml +++ b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/pom.xml @@ -64,6 +64,12 @@ <excludes>org.slf4j:slf4j-api:[1.6.1,1.6.2]</excludes> </excludes> </dependencyConvergence> + <!-- if there are no includes, assume everything is included and apply excludes --> + <dependencyConvergence> + <excludes> + <excludes>org.slf4j:*:[1.6.1,1.6.2]</excludes> + </excludes> + </dependencyConvergence> </rules> </configuration> <goals> diff --git a/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/verify.groovy b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/verify.groovy similarity index 77% rename from maven-enforcer-plugin/src/it/projects/require-files-dont-exist/verify.groovy rename to maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/verify.groovy index 4dd75163..ff8c857d 100644 --- a/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-all-exclude_success/verify.groovy @@ -18,5 +18,7 @@ */ def buildLog = new File(basedir, 'build.log').text -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.files.RequireFilesDontExist passed') +for (int i = 0; i < 2; i++) { + assert buildLog.contains("[INFO] Rule ${i}: org.apache.maven.enforcer.rules.dependency.DependencyConvergence passed".toString()) : "rule ${i} did not pass" +} +assert !buildLog.contains('Dependency convergence error') diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/invoker.properties deleted file mode 100644 index 66b78c06..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/pom.xml deleted file mode 100644 index 2fec85fc..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_failure/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>dependency-convergence</artifactId> - <version>1.0.0</version> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.6.2</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-nop</artifactId> - <version>1.6.0</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <configuration> - <rules> - <!-- if there are no includes, assume everything is included and apply excludes --> - <dependencyConvergence> - <excludes> - <exclude>org.slf4j:*:[1.6.2]</exclude> - </excludes> - </dependencyConvergence> - </rules> - </configuration> - <goals> - <goal>enforce</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_success/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_success/pom.xml deleted file mode 100644 index 49fdb9ce..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-empty_success/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>dependency-convergence</artifactId> - <version>1.0.0</version> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.6.2</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-nop</artifactId> - <version>1.6.0</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <configuration> - <rules> - <!-- if there are no includes, assume everything is included and apply excludes --> - <dependencyConvergence> - <excludes> - <excludes>org.slf4j:*:[1.6.1,1.6.2]</excludes> - </excludes> - </dependencyConvergence> - </rules> - </configuration> - <goals> - <goal>enforce</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/invoker.properties deleted file mode 100644 index 66b78c06..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/pom.xml deleted file mode 100644 index aacfdb5c..00000000 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include-exclude_failure/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>dependency-convergence</artifactId> - <version>1.0.0</version> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.6.2</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-nop</artifactId> - <version>1.6.0</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <configuration> - <rules> - <!-- if some are included, return errors for those included and not excluded --> - <dependencyConvergence> - <includes> - <include>org.slf4j</include> - <include>org.apache.commons</include> - </includes> - <excludes> - <exclude>org.slf4j:*:[1.6.2]</exclude> - </excludes> - </dependencyConvergence> - </rules> - </configuration> - <goals> - <goal>enforce</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/pom.xml index 9606e6d1..461dd34f 100644 --- a/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/pom.xml +++ b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/pom.xml @@ -62,6 +62,32 @@ <include>org.slf4j:slf4j-api:[1.6.2]</include> </includes> </dependencyConvergence> + <!-- if everything is included, return any errors that are not excluded --> + <dependencyConvergence> + <includes> + <include>*</include> + </includes> + <excludes> + <exclude>org.apache.commons</exclude> + <exclude>org.slf4j:slf4j-api:[1.6.2]</exclude> + </excludes> + </dependencyConvergence> + <!-- if there are no includes, assume everything is included and apply excludes --> + <dependencyConvergence> + <excludes> + <exclude>org.slf4j:*:[1.6.2]</exclude> + </excludes> + </dependencyConvergence> + <!-- if some are included, return errors for those included and not excluded --> + <dependencyConvergence> + <includes> + <include>org.slf4j</include> + <include>org.apache.commons</include> + </includes> + <excludes> + <exclude>org.slf4j:*:[1.6.2]</exclude> + </excludes> + </dependencyConvergence> </rules> </configuration> <goals> diff --git a/maven-enforcer-plugin/src/it/projects/require-file-checksum/verify.groovy b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/verify.groovy similarity index 57% rename from maven-enforcer-plugin/src/it/projects/require-file-checksum/verify.groovy rename to maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/verify.groovy index 034a54b4..380b5924 100644 --- a/maven-enforcer-plugin/src/it/projects/require-file-checksum/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/dependency-convergence_include_failure/verify.groovy @@ -18,9 +18,11 @@ */ def buildLog = new File(basedir, 'build.log').text -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.checksum.RequireFileChecksum passed') -assert buildLog.contains('[INFO] Rule 1: org.apache.maven.enforcer.rules.checksum.RequireFileChecksum passed') -assert buildLog.contains('[INFO] Rule 2: org.apache.maven.enforcer.rules.checksum.RequireFileChecksum passed') -assert buildLog.contains('[INFO] Rule 3: org.apache.maven.enforcer.rules.checksum.RequireFileChecksum passed') -assert buildLog.contains('[INFO] Rule 4: org.apache.maven.enforcer.rules.checksum.RequireFileChecksum passed') +// all four rules fail: include only, include everything but excluded, exclude only, include and exclude; +// each reports the slf4j-api conflict that its includes and excludes leave +def expectedConflicts = [0: '1.6.2', 1: '1.6.1', 2: '1.6.1', 3: '1.6.1'] +for (entry in expectedConflicts) { + def rule = entry.key + def version = entry.value + assert buildLog =~ /(?s)\[ERROR\] Rule ${rule}: \S+DependencyConvergence failed with message:(?:(?!\[ERROR\] Rule \d).)*?Dependency convergence error for org\.slf4j:slf4j-api:jar:\Q${version}\E\. Paths to dependency are:/ : "rule ${rule} did not report the conflict of slf4j-api ${version}" +} diff --git a/maven-enforcer-plugin/src/it/projects/require-files-size/verify.groovy b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-excluding-tests-nonmatch/verify.groovy similarity index 68% rename from maven-enforcer-plugin/src/it/projects/require-files-size/verify.groovy rename to maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-excluding-tests-nonmatch/verify.groovy index 9c6650b9..d1f52b14 100644 --- a/maven-enforcer-plugin/src/it/projects/require-files-size/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-excluding-tests-nonmatch/verify.groovy @@ -18,6 +18,7 @@ */ def buildLog = new File(basedir, 'build.log').text -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.files.RequireFilesSize passed') -assert buildLog.contains('[ERROR] Rule 1: org.apache.maven.enforcer.rules.files.RequireFilesSize failed with message') +// junit is a compile dependency, so ignoring the test scope does not hide it +assert buildLog.contains('[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.EnforceBytecodeVersion failed with message:') +assert buildLog.contains('[ERROR] Found Banned Dependency: junit:junit:jar:4.13.2') +assert buildLog.contains('[ERROR] Found Banned Dependency: org.hamcrest:hamcrest-core:jar:1.3') diff --git a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/pom.xml b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/pom.xml index 64d40a57..287fb8c0 100644 --- a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/pom.xml +++ b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/pom.xml @@ -49,6 +49,9 @@ under the License. <maxJdkVersion>1.9</maxJdkVersion> <strict>true</strict> </enforceBytecodeVersion> + <enforceBytecodeVersion> + <maxJdkVersion>1.9</maxJdkVersion> + </enforceBytecodeVersion> </rules> </configuration> <executions> diff --git a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/verify.groovy b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/verify.groovy index 52c4b32f..07f5548b 100644 --- a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/verify.groovy +++ b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9-strict/verify.groovy @@ -17,12 +17,12 @@ * under the License. */ -File file = new File( basedir, "build.log" ); -assert file.exists(); +def text = new File(basedir, "build.log").getText("utf-8") -String text = file.getText("utf-8"); +assert !text.contains('[INFO] Adding ignore: module-info') +assert !text.contains('Found Banned Dependency: org.ow2.asm:asm:jar:6.0') -assert ! text.contains( '[INFO] Adding ignore: module-info' ) -assert ! text.contains( 'Found Banned Dependency: org.ow2.asm:asm:jar:6.0' ) - -return true; +// strict and non-strict rule +for (int i = 0; i < 2; i++) { + assert text.contains("[INFO] Rule ${i}: org.apache.maven.enforcer.rules.dependency.EnforceBytecodeVersion passed".toString()) : "rule ${i} did not pass" +} diff --git a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/pom.xml b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/pom.xml deleted file mode 100644 index 704adbbb..00000000 --- a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>pim.pam.poum</groupId> - <artifactId>smoking</artifactId> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <configuration> - <rules> - <enforceBytecodeVersion> - <maxJdkVersion>1.9</maxJdkVersion> - </enforceBytecodeVersion> - </rules> - </configuration> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <phase>validate</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - - <dependencies> - <dependency> - <groupId>org.ow2.asm</groupId> - <artifactId>asm</artifactId> - <version>6.0</version> - <scope>runtime</scope> - </dependency> - </dependencies> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/verify.groovy b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/verify.groovy deleted file mode 100644 index 2b42706b..00000000 --- a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-module-info-jdk9/verify.groovy +++ /dev/null @@ -1,27 +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. - */ - -File file = new File( basedir, "build.log" ); -assert file.exists(); - -String text = file.getText("utf-8"); - -assert ! text.contains( '[INFO] Adding ignore: module-info' ) - -return true; diff --git a/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/pom.xml b/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/pom.xml deleted file mode 100644 index c99f6e60..00000000 --- a/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <evaluateBeanshell> - <condition>${project.artifactId} == test</condition> - </evaluateBeanshell> - <evaluateBeanshell> - <condition>${project.version} == 1.0</condition> - </evaluateBeanshell> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/verify.groovy b/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/verify.groovy deleted file mode 100644 index 491bf209..00000000 --- a/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/verify.groovy +++ /dev/null @@ -1,22 +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. - */ - -File buildLog = new File(basedir, 'build.log') -assert buildLog.text.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.EvaluateBeanshell passed') -assert buildLog.text.contains('[INFO] Rule 1: org.apache.maven.enforcer.rules.EvaluateBeanshell passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-environment-variable/pom.xml b/maven-enforcer-plugin/src/it/projects/require-environment-variable/pom.xml deleted file mode 100644 index fdc6d354..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-environment-variable/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireEnvironmentVariable> - <variableName>PATH</variableName> - </requireEnvironmentVariable> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-environment-variable/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-environment-variable/verify.groovy deleted file mode 100644 index ac388a3f..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-environment-variable/verify.groovy +++ /dev/null @@ -1,21 +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. - */ -File buildLog = new File(basedir, 'build.log') - -assert buildLog.text.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.property.RequireEnvironmentVariable passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-file-checksum/pom.xml b/maven-enforcer-plugin/src/it/projects/require-file-checksum/pom.xml deleted file mode 100644 index 46e5a44e..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-file-checksum/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - <url>https://issues.apache.org/jira/browse/MENFORCER-247</url> - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>md5</type> - <checksum>7c5b65d44e8123e70d24d9eef17e9fa2</checksum> - </requireFileChecksum> - <requireFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha1</type> - <checksum>278661cbaf6a1bcbd34e3877b6de0e8bd7097846</checksum> - </requireFileChecksum> - <requireFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha256</type> - <checksum>61b825d68516541151e5ce0145e54765c48cd5802b886aee8fb8cf1953f02d10</checksum> - </requireFileChecksum> - <requireFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha384</type> - <checksum>6f9e6b81487911c5a339c541016a459acaf8312e430ccabe5c10cb2ddf9a307f4595c78555f911377f4fb853ffe87046</checksum> - </requireFileChecksum> - <requireFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha512</type> - <checksum>c51c3cf07c87af78dd7af4407ae3993ea1051d8a7c260cf34bbaa41c468dcd3b62d2be3d9a09807a8595d0065e2d75d1bf9ffc8276d567a983ff057f6b51b0cc</checksum> - </requireFileChecksum> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-file-checksum/setup.groovy b/maven-enforcer-plugin/src/it/projects/require-file-checksum/setup.groovy deleted file mode 100644 index 059795a4..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-file-checksum/setup.groovy +++ /dev/null @@ -1,22 +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. - */ - - def file = new File (basedir,"LICENSE") - - file.write(file.text.normalize()) \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/pom.xml b/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/pom.xml deleted file mode 100644 index 544c1a2c..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireFilesDontExist> - <files> - <file>target/unwanted.txt</file> - </files> - </requireFilesDontExist> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-files-exist/pom.xml b/maven-enforcer-plugin/src/it/projects/require-files-exist/pom.xml deleted file mode 100644 index 9c81f169..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-files-exist/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireFilesExist> - <files> - <file>pom.xml</file> - <file>../require-files-exist/pom.xml</file> - <file>${project.basedir}/../require-files-exist/pom.xml</file> - </files> - </requireFilesExist> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-files-size/invoker.properties b/maven-enforcer-plugin/src/it/projects/require-files-size/invoker.properties deleted file mode 100644 index 66b78c06..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-files-size/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure diff --git a/maven-enforcer-plugin/src/it/projects/require-files-size/pom.xml b/maven-enforcer-plugin/src/it/projects/require-files-size/pom.xml deleted file mode 100644 index a7e5e5ec..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-files-size/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireFilesSize> - <maxsize>10240</maxsize> - <minsize>512</minsize> - <files> - <file>pom.xml</file> - </files> - </requireFilesSize> - <requireFilesSize> - <maxsize>12000</maxsize> - <recursive>true</recursive> - <files> - <file>test</file> - </files> - </requireFilesSize> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-java-version/pom.xml b/maven-enforcer-plugin/src/it/projects/require-java-version/pom.xml deleted file mode 100644 index 8e85cffd..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-java-version/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireJavaVersion> - <!-- implicit range --> - <version>1.4</version> - </requireJavaVersion> - <requireJavaVersion> - <!-- explicit range --> - <version>[1.4,)</version> - </requireJavaVersion> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-java-version/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-java-version/verify.groovy deleted file mode 100644 index 2a35d5c8..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-java-version/verify.groovy +++ /dev/null @@ -1,23 +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. - */ -def buildLog = new File(basedir, 'build.log').text - -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed') -assert buildLog.contains('[INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-maven-version/pom.xml b/maven-enforcer-plugin/src/it/projects/require-maven-version/pom.xml deleted file mode 100644 index e2c26df4..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-maven-version/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireMavenVersion> - <!-- implicit range --> - <version>2.0</version> - </requireMavenVersion> - <requireMavenVersion> - <!-- explicit range --> - <version>[2.0,)</version> - </requireMavenVersion> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-maven-version/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-maven-version/verify.groovy deleted file mode 100644 index f1a981a0..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-maven-version/verify.groovy +++ /dev/null @@ -1,23 +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. - */ -def buildLog = new File(basedir, 'build.log').text - -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed') -assert buildLog.contains('[INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-no-repositories/pom.xml b/maven-enforcer-plugin/src/it/projects/require-no-repositories/pom.xml deleted file mode 100644 index bf5d7f90..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-no-repositories/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - This IT demonstrates having no repositories defined at all. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireNoRepositories> - </requireNoRepositories> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-no-repositories/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-no-repositories/verify.groovy deleted file mode 100644 index 60e7176f..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-no-repositories/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( '[INFO] Rule 0: org.apache.maven.enforcer.rules.RequireNoRepositories passed' ) diff --git a/maven-enforcer-plugin/src/it/projects/require-os/pom.xml b/maven-enforcer-plugin/src/it/projects/require-os/pom.xml deleted file mode 100644 index a0b3f221..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-os/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>require-os-test</artifactId> - <version>1.0</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>require-os</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireOS> - <display>true</display> - <name>!XXX-Test-Name</name> - </requireOS> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-os/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-os/verify.groovy deleted file mode 100644 index b53f516c..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-os/verify.groovy +++ /dev/null @@ -1,21 +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. - */ -File buildLog = new File(basedir, 'build.log') -assert buildLog.text.contains('OS Info - Arch') -assert buildLog.text.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.RequireOS passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-property/pom.xml b/maven-enforcer-plugin/src/it/projects/require-property/pom.xml deleted file mode 100644 index da9f9979..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-property/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireProperty> - <property>basedir</property> - </requireProperty> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-property/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-property/verify.groovy deleted file mode 100644 index da1e2d61..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-property/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File buildLog = new File(basedir, 'build.log') -assert buildLog.text.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.property.RequireProperty passed') diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/pom.xml b/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/pom.xml deleted file mode 100644 index a20df3b5..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>requireReleaseDeps</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseDeps> - <message>No Snapshots Allowed!</message> - <excludes> - <exclude>org.apache.maven.plugins.enforcer.its:menforcer85_api</exclude> - </excludes> - </requireReleaseDeps> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.maven.plugins.enforcer.its</groupId> - <artifactId>menforcer85_api</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - </dependencies> - </project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/invoker.properties deleted file mode 100644 index c98ac4c5..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/pom.xml deleted file mode 100644 index cc0de84b..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>requireReleaseDeps</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseDeps> - <message>No Snapshots Allowed!</message> - <excludes> - <exclude>org.apache.maven.plugins.enforcer.its:menforcer85_api:[2.0,)</exclude> - </excludes> - </requireReleaseDeps> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.maven.plugins.enforcer.its</groupId> - <artifactId>menforcer85_api</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - </dependencies> - </project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/invoker.properties deleted file mode 100644 index 66b78c06..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.buildResult=failure diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/pom.xml b/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/pom.xml deleted file mode 100644 index 2788f8dd..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies-optional_failure/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ 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. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>requireReleaseDepsOptional</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseDeps> - <message>No snapshot dependencies are allowed, including optional ones.</message> - </requireReleaseDeps> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.maven.plugins.enforcer.its</groupId> - <artifactId>menforcer85_api</artifactId> - <version>1.0-SNAPSHOT</version> - <optional>true</optional> - </dependency> - </dependencies> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-release-dependencies/pom.xml b/maven-enforcer-plugin/src/it/projects/require-release-dependencies/pom.xml deleted file mode 100644 index 6693dc62..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-dependencies/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseDeps/> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-release-version/pom.xml b/maven-enforcer-plugin/src/it/projects/require-release-version/pom.xml deleted file mode 100644 index 2b5d5826..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-release-version/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - - <description> - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireReleaseVersion/> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_success/pom.xml b/maven-enforcer-plugin/src/it/projects/require-same-versions_success/pom.xml deleted file mode 100644 index 7e613965..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-same-versions_success/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>requireSameVersion</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireSameVersions> - <buildPlugins> - <buildPlugin>org.apache.maven.plugins:maven-surefire-plugin</buildPlugin> - <buildPlugin>org.apache.maven.plugins:maven-failsafe-plugin</buildPlugin> - </buildPlugins> - <reportPlugins> - <reportPlugin>org.apache.maven.plugins:maven-surefire-report-plugin</reportPlugin> - </reportPlugins> - </requireSameVersions> - <!-- almost the rule configuration --> - <requireSameVersions> - <plugins> - <plugin>org.apache.maven.plugins:maven-surefire-plugin</plugin> - <plugin>org.apache.maven.plugins:maven-failsafe-plugin</plugin> - <plugin>org.apache.maven.plugins:maven-surefire-report-plugin</plugin> - </plugins> - </requireSameVersions> - </rules> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.14</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <version>2.14</version> - </plugin> - </plugins> - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.14</version> - </plugin> - </plugins> - </reporting> - - - </project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml deleted file mode 100644 index 67e18a42..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.enforcer.its</groupId> - <artifactId>requireSameVersion</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>enforce</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <!-- almost the rule configuration --> - <requireSameVersions> - <dependencies> - <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-a</dependency> - <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-b</dependency> - </dependencies> - </requireSameVersions> - </rules> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.14</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <version>2.14</version> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.maven.plugins.enforcer.its</groupId> - <artifactId>menforcer192-b</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>org.apache.maven.plugins.enforcer.its</groupId> - <artifactId>menforcer192-c</artifactId> - <version>1.0</version> - </dependency> - </dependencies> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.14</version> - </plugin> - </plugins> - </reporting> - - </project> \ No newline at end of file diff --git a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/LICENSE b/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/LICENSE deleted file mode 100644 index a6301e0d..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/LICENSE +++ /dev/null @@ -1,16 +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. diff --git a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/pom.xml b/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/pom.xml deleted file mode 100644 index 1fe5c61b..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.enforcer</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - <url>https://issues.apache.org/jira/browse/MENFORCER-361</url> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>test</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireTextFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>md5</type> - <checksum>7c5b65d44e8123e70d24d9eef17e9fa2</checksum> - </requireTextFileChecksum> - <requireTextFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha1</type> - <checksum>278661cbaf6a1bcbd34e3877b6de0e8bd7097846</checksum> - </requireTextFileChecksum> - <requireTextFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha256</type> - <checksum>61b825d68516541151e5ce0145e54765c48cd5802b886aee8fb8cf1953f02d10</checksum> - </requireTextFileChecksum> - <requireTextFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha384</type> - <checksum>6f9e6b81487911c5a339c541016a459acaf8312e430ccabe5c10cb2ddf9a307f4595c78555f911377f4fb853ffe87046</checksum> - </requireTextFileChecksum> - <requireTextFileChecksum> - <file>${project.basedir}/LICENSE</file> - <type>sha512</type> - <checksum>c51c3cf07c87af78dd7af4407ae3993ea1051d8a7c260cf34bbaa41c468dcd3b62d2be3d9a09807a8595d0065e2d75d1bf9ffc8276d567a983ff057f6b51b0cc</checksum> - </requireTextFileChecksum> - </rules> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/verify.groovy deleted file mode 100644 index 340b48e6..00000000 --- a/maven-enforcer-plugin/src/it/projects/require-textfile-checksum/verify.groovy +++ /dev/null @@ -1,26 +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. - */ -def buildLog = new File(basedir, 'build.log').text - -// rule executed -assert buildLog.contains('[INFO] Rule 0: org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum passed') -assert buildLog.contains('[INFO] Rule 1: org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum passed') -assert buildLog.contains('[INFO] Rule 2: org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum passed') -assert buildLog.contains('[INFO] Rule 3: org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum passed') -assert buildLog.contains('[INFO] Rule 4: org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum passed')
