maven-enforcer-1.4.2/0000775000175000017500000000000013133666303013763 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/0000775000175000017500000000000013133666303020166 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/pom.xml0000664000175000017500000001567013122035147021506 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer enforcer 1.4.2 org.apache.maven.plugins maven-enforcer-plugin maven-plugin 2.2.1 Apache Maven Enforcer Plugin The Loving Iron Fist of Maven org.apache.maven maven-artifact org.apache.maven maven-plugin-api org.apache.maven maven-core org.codehaus.plexus plexus-utils commons-lang commons-lang org.apache.maven.enforcer enforcer-api org.apache.maven.enforcer enforcer-rules org.apache.maven.enforcer enforcer-rules test-jar org.apache.maven.plugin-testing maven-plugin-testing-harness test org.apache.maven.plugin-tools maven-plugin-annotations provided org.mockito mockito-core test junit junit test org.apache.rat apache-rat-plugin src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/META-INF/MANIFEST.MF org.apache.maven.plugins maven-plugin-plugin true generate-helpmojo helpmojo mojo-descriptor descriptor ${basedir}/src/main/resources org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} run-its maven-invoker-plugin 2.0.0 true src/it/projects ${project.build.directory}/it setup verify ${project.build.directory}/local-repo src/it/mrm/settings.xml validate integration-test install run org.codehaus.mojo mrm-maven-plugin 1.0.0 start stop repository.proxy.url src/it/mrm/repository maven-enforcer-1.4.2/maven-enforcer-plugin/src/0000775000175000017500000000000013133666303020755 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/0000775000175000017500000000000013133666303021371 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/0000775000175000017500000000000013133666303022164 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/0000775000175000017500000000000013133666303024403 5ustar ebourgebourg././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_classworlds-1.1-alpha-2.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_classworlds-1.1-alpha-0000664000175000017500000000241112166625524032622 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer138_classworlds 1.1-alpha-2 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_archiver-2.1.1.pom0000664000175000017500000000354512166625524031670 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer138_archiver 2.1.1 org.apache.maven.plugins.enforcer.its menforcer138_container-default 1.0-alpha-9-stable-1 org.apache.maven.plugins.enforcer.its menforcer138_utils 3.0 org.apache.maven.plugins.enforcer.its menforcer138_io 2.0.3 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer72_junit-3.8.1.pom0000664000175000017500000000237412166625524031142 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer72_junit 3.8.1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_utils-3.0.pom0000664000175000017500000000237312166625524031064 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer138_utils 3.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer72_logging-1.1.1.pom0000664000175000017500000000243412166625524031423 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer72_logging 1.1.1 pom maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer146_x-3.1.pom0000664000175000017500000000236712166625524030176 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer146-x 3.1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer85_api-1.0-SNAPSHOT.pom0000664000175000017500000000240112166625524031641 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer85_api 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_project-1.0-SNAPSHOT.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_project-1.0-SNAPSHOT.p0000664000175000017500000000330412166625524032260 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer134_project 1.0-SNAPSHOT org.apache.maven.plugins.enforcer.its menforcer134_modelbuilder 1.0-SNAPSHOT org.apache.maven.plugins.enforcer.its menforcer134_model 1.0-20130423.042904-7222 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_utils-1.0.4.pom0000664000175000017500000000237612166625524031227 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer1308_utils 1.0.4 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer128_api-1.5.0.pom0000664000175000017500000000237312166625524030635 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128_api 1.5.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer146_x-1.1.pom0000664000175000017500000000236712166625524030174 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer146-x 1.1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer128_classic-0.9.9.pom0000664000175000017500000000273612166625524031524 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128_classic 0.9.9 org.apache.maven.plugins.enforcer.its menforcer128_api 1.5.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer126_maven-plugin-1.0.pom0000664000175000017500000000245112166625524032316 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer126_maven-plugin 1.0 maven-plugin maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer146_b-1.0.pom0000664000175000017500000000272212166625524030140 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer146-b 1.0 org.apache.maven.plugins.enforcer.its menforcer146-x 2.1 ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_container-default-1.0-alpha-9-stable-1.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_container-default-1.0-0000664000175000017500000000327412166625524032612 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer138_container-default 1.0-alpha-9-stable-1 org.apache.maven.plugins.enforcer.its menforcer1308_utils 1.0.4 org.apache.maven.plugins.enforcer.its menforcer138_classworlds 1.1-alpha-2 ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_model-1.0-20130423.042904-7222.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_model-1.0-20130423.0420000664000175000017500000000240412166625524031417 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer134_model 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer152-1.0.pom0000664000175000017500000000242312166625524027632 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer152 1.0 jar maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer146_x-2.1.pom0000664000175000017500000000236712166625524030175 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer146-x 2.1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer158_utils-1.0.pom0000664000175000017500000000237312166625524031064 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer158_utils 1.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer138_io-2.0.3.pom0000664000175000017500000000272712166625524030476 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer138_io 2.0.3 org.apache.maven.plugins.enforcer.its menforcer138_utils 3.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer128_api-1.4.0.pom0000664000175000017500000000237312166625524030634 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128_api 1.4.0 ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_modelbuilder-1.0-SNAPSHOT.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_modelbuilder-1.0-SNAPS0000664000175000017500000000300112166625524032442 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer134_modelbuilder 1.0-SNAPSHOT org.apache.maven.plugins.enforcer.its menforcer134_model 1.0-20130423.044324-5638 ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_model-1.0-20130423.044324-5638.pommaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer134_model-1.0-20130423.0440000664000175000017500000000240412166625524031421 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer134_model 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/repository/menforcer128_api-1.6.0.pom0000664000175000017500000000237312166625524030636 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128_api 1.6.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/mrm/settings.xml0000664000175000017500000000506512166625524024561 0ustar ebourgebourg mrm-maven-plugin Mock Repository Manager @repository.proxy.url@ * it-repo snapshots @repository.proxy.url@ true ignore never true ignore always snapshots @repository.proxy.url@ true ignore never true ignore always it-repo maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/0000775000175000017500000000000013133666303023222 5ustar ebourgebourg././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-projectGAVexpressions/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-projectGAVexpress0000775000175000017500000000000013133666303033375 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-projectGAVexpressions/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-projectGAVexpress0000664000175000017500000000723412166625524033412 0ustar ebourgebourg 4.0.0 ${projectGAV.groupId} ${projectGAV.artifactId} ${projectGAV.version} org.apache.maven.enforcer.its menforcer92 1.0 org.apache.maven.plugins maven-clean-plugin 2.5 org.apache.maven.plugins maven-resources-plugin 2.6 org.apache.maven.plugins maven-compiler-plugin 2.5.1 org.apache.maven.plugins maven-surefire-plugin 2.12.4 org.apache.maven.plugins maven-jar-plugin 2.4 org.apache.maven.plugins maven-install-plugin 2.4 org.apache.maven.plugins maven-deploy-plugin 2.7 org.apache.maven.plugins maven-site-plugin 3.2 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/0000775000175000017500000000000013133666303031574 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/module/0000775000175000017500000000000013133666303033061 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/module/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/module/p0000664000175000017500000000245013120504433033233 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.1-SNAPSHOT ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/verify.g0000664000175000017500000000203413120504433033236 0ustar ebourgebourg/* * 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 LS = System.getProperty( "line.separator" ) File buildLog = new File( basedir, 'build.log' ) assert buildLog.text.contains( 'Ignoring requireUpperBoundDeps in org.apache.maven.plugins.enforcer.its:menforcer128_api' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_ignored/pom.xml0000664000175000017500000000473513120504433033111 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128 1.0-SNAPSHOT jar org.apache.maven.plugins.enforcer.its menforcer128_api 1.4.0 org.apache.maven.plugins.enforcer.its menforcer128_classic 0.9.9 org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce org.apache.maven.plugins.enforcer.its:menforcer128_api enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/0000775000175000017500000000000013133666303031574 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/module/0000775000175000017500000000000013133666303033061 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/module/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/module/p0000664000175000017500000000245012166625524033251 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.1-SNAPSHOT ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/invoker.0000664000175000017500000000145412320351742033251 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/verify.g0000664000175000017500000000312612157072432033251 0ustar ebourgebourg/* * 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 LS = System.getProperty( "line.separator" ) File buildLog = new File( basedir, 'build.log' ) assert buildLog.text.contains( 'Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:' ) def message = 'Require upper bound dependencies error for org.apache.maven.plugins.enforcer.its:menforcer128_api:1.4.0 paths to dependency are:'+LS+ '+-org.apache.maven.plugins.enforcer.its:menforcer128:1.0-SNAPSHOT'+LS+ ' +-org.apache.maven.plugins.enforcer.its:menforcer128_api:1.4.0'+LS+ 'and'+LS+ '+-org.apache.maven.plugins.enforcer.its:menforcer128:1.0-SNAPSHOT'+LS+ ' +-org.apache.maven.plugins.enforcer.its:menforcer128_classic:0.9.9'+LS+ ' +-org.apache.maven.plugins.enforcer.its:menforcer128_api:1.5.0'+LS assert buildLog.text.contains( message ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_failure/pom.xml0000664000175000017500000000443412166625524033123 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128 1.0-SNAPSHOT jar org.apache.maven.plugins.enforcer.its menforcer128_api 1.4.0 org.apache.maven.plugins.enforcer.its menforcer128_classic 0.9.9 org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000162112353624735033232 0ustar ebourgebourg/* * 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] BUILD SUCCESS' ) ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000366112353624735033240 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm-except-site 1.0-SNAPSHOT pom site-location This is the site file:///Test org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce true module1 module2 ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/module2/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/module2/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000267412353624735033243 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm-except-site 1.0-SNAPSHOT module2 site-location This is the site file:///Test/module2 org.apache.maven.its.enforcer module1 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/module1/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-except-site/module1/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000236212353624735033235 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm-except-site 1.0-SNAPSHOT module1 site-location This is the site file:///Test/module1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/0000775000175000017500000000000013133666303026763 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/evaluate-beanshell/pom.xml0000664000175000017500000000321411241364640030275 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce ${project.artifactId} == test maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/0000775000175000017500000000000013133666302030071 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-dont-exist/pom.xml0000664000175000017500000000326711241364640031414 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce target/unwanted.txt maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile/0000775000175000017500000000000013133666303027605 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile/pom.xml0000664000175000017500000000342711241364640031125 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce it it true maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/0000775000175000017500000000000013133666303033201 5ustar ebourgebourg././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/module/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/mo0000775000175000017500000000000013133666303033535 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/module/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/mo0000664000175000017500000000245012166625524033545 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.1-SNAPSHOT ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/in0000664000175000017500000000145412320351742033531 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging_test_scope/po0000664000175000017500000000417212166625524033553 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT jar org.slf4j slf4j-jdk14 1.6.1 org.slf4j slf4j-nop 1.6.0 test org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies/0000775000175000017500000000000013133666303027075 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies/pom.xml0000664000175000017500000000334312153440331030405 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its:menforcer72_logging maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile-all/0000775000175000017500000000000013133666303030353 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile-all/pom.xml0000664000175000017500000000412112264572300031663 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce it1,it2,it3 true it1 true it2 true it3 true maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-pass/0000775000175000017500000000000013133666303025466 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-pass/pom.xml0000664000175000017500000000303211241364640026776 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_success/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000775000175000017500000000000013133666303033232 5ustar ebourgebourg././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_success/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000664000175000017500000000447612166625524033254 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its menforcer146-a 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce org.apache.maven.plugins.enforcer.its menforcer146-x 3.1 org.apache.maven.plugins.enforcer.its menforcer146-b 1.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/0000775000175000017500000000000013133666303025562 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/invoker.properties0000664000175000017500000000147412320351742031356 0ustar ebourgebourg# 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.goals = validate maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/pom.xml0000664000175000017500000000326412154636774027117 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer multimodule 1.0-SNAPSHOT pom org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce module1 module2 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/module2/0000775000175000017500000000000013133666303027131 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/module2/pom.xml0000664000175000017500000000241612154636774030464 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer multimodule 1.0-SNAPSHOT module2 org.apache.maven.its.enforcer module1 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/module1/0000775000175000017500000000000013133666303027130 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/multimodule/module1/pom.xml0000664000175000017500000000207512154636774030464 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer multimodule 1.0-SNAPSHOT module1 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-property/0000775000175000017500000000000013133666303026560 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-property/pom.xml0000664000175000017500000000316011241364640030072 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce basedir ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_failure/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_f0000775000175000017500000000000013133666303033312 5ustar ebourgebourg././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_f0000664000175000017500000000145412320351742033313 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_failure/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_f0000664000175000017500000000223712155055771033324 0ustar ebourgebourg/* * 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( 'Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:' ) assert buildLog.text.contains( 'Require upper bound dependencies error for org.apache.maven.plugins.enforcer.its:menforcer134_model:1.0-20130423.042904-7222 paths to dependency are:' ) ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_failure/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_f0000664000175000017500000000430712166625524033325 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireUpperBoundDependenciesUnique jar 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce true org.apache.maven.plugins.enforcer.its menforcer134_project 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integ0000775000175000017500000000000013133666303033332 5ustar ebourgebourg././@LongLink0000644000000000000000000000021500000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integ0000664000175000017500000000145312320351742033332 0ustar ebourgebourg# 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.maven.version=3.0+././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integ0000664000175000017500000000745413121176075033345 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer pluginWithIntegrationTestLifecycle 1.0.0-SNAPSHOT eclipse-plugin 0.19.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false org.apache.maven.plugins:maven-clean-plugin,org.apache.maven.plugins:maven-install-plugin,org.apache.maven.plugins:maven-deploy-plugin,org.apache.maven.plugins:maven-site-plugin org.eclipse.tycho tycho-maven-plugin ${tycho-version} true org.eclipse.tycho target-platform-configuration ${tycho-version} p2 org.eclipse.tycho tycho-compiler-plugin ${tycho-version} org.eclipse.tycho tycho-packaging-plugin ${tycho-version} org.eclipse.tycho tycho-p2-plugin ${tycho-version} maven-resources-plugin 2.4.3 ././@LongLink0000644000000000000000000000020400000000000011577 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/META-INF/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integ0000775000175000017500000000000013133666303033332 5ustar ebourgebourg././@LongLink0000644000000000000000000000021700000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integration-test-lifecycle/META-INF/MANIFEST.MFmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-integ0000664000175000017500000000013011774774053033341 0ustar ebourgebourgBundle-SymbolicName: pluginWithIntegrationTestLifecycle Bundle-Version: 1.0.0.qualifiermaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_success/0000775000175000017500000000000013133666303031746 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_success/pom.xml0000664000175000017500000000315012770317331033262 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer menforcer-204 1.0-SNAPSHOT https://issues.apache.org/jira/browse/MENFORCER-204 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-pom-dependency-version/0000775000175000017500000000000013133666303030352 5ustar ebourgebourg././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-pom-dependency-version/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-pom-dependency-version/invoker.proper0000664000175000017500000000145412320351742033257 0ustar ebourgebourg# 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=failuremaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-pom-dependency-version/verify.groovy0000664000175000017500000000234212153202033033111 0ustar ebourgebourg/* * 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( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions failed with message:' ) assert buildLog.text.contains( 'Found 1 duplicate dependency declaration in this project:' ) assert buildLog.text.contains( '- dependencies.dependency[org.apache.maven.plugins.enforcer.its:menforcer152:jar] ( 2 times )' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-pom-dependency-version/pom.xml0000664000175000017500000000365512153202033031663 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-pom-dependency-version 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its menforcer152 1.0 org.apache.maven.plugins.enforcer.its menforcer152 1.0 ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-extensions/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-exten0000775000175000017500000000000013133666303033347 5ustar ebourgebourg././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-extensions/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-plugin-with-exten0000664000175000017500000000712213121176075033352 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer pluginWithExtensions 1.0-SNAPSHOT zip org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false org.apache.maven.plugins:maven-clean-plugin,org.apache.maven.plugins:maven-install-plugin,org.apache.maven.plugins:maven-deploy-plugin,org.apache.maven.plugins:maven-site-plugin org.codehaus.mojo pde-maven-plugin 1.0-alpha-1 true example.product clean-pde clean clean org.apache.maven.plugins maven-resources-plugin 2.5 org.apache.maven.plugins maven-compiler-plugin 2.5.1 org.apache.maven.plugins maven-surefire-plugin 2.12 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies/0000775000175000017500000000000013133666303030740 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies/pom.xml0000664000175000017500000000304211241364640032251 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/0000775000175000017500000000000013133666303032552 5ustar ebourgebourg././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes/pom0000664000175000017500000000441312166625524033277 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireReleaseDeps jar 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce No Snapshots Allowed! org.apache.maven.plugins.enforcer.its:menforcer85_api org.apache.maven.plugins.enforcer.its menforcer85_api 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_success/0000775000175000017500000000000013133666303031615 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_success/module/0000775000175000017500000000000013133666302033101 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_success/module/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_success/module/p0000664000175000017500000000245012166625524033272 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.1-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-deps_success/pom.xml0000664000175000017500000000443412166625524033144 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.its menforcer128 1.0-SNAPSHOT jar org.apache.maven.plugins.enforcer.its menforcer128_api 1.6.0 org.apache.maven.plugins.enforcer.its menforcer128_classic 0.9.9 org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000145712353624735033241 0ustar ebourgebourg# 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 ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000216312353624735033234 0ustar ebourgebourg/* * 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] BUILD FAILURE' ) assert buildLog.text.contains( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanDistributionManagement failed with message:' ) assert buildLog.text.contains( 'You have defined a repository in distributionManagement.' ) ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000357012561645371033237 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm 1.0-SNAPSHOT pom first This is the name file:///Test org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce module1 module2 ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/module2/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/module2/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000237212353624735033236 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm 1.0-SNAPSHOT module2 org.apache.maven.its.enforcer module1 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/module1/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000775000175000017500000000000013133666303033222 5ustar ebourgebourg././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/module1/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-0000664000175000017500000000242412561645371033234 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management-mm 1.0-SNAPSHOT module1 first This is the name file:///Test maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_success/0000775000175000017500000000000013133666302031216 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_success/pom.xml0000664000175000017500000000654712166625524032555 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireSameVersion jar 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce org.apache.maven.plugins:maven-surefire-plugin org.apache.maven.plugins:maven-failsafe-plugin org.apache.maven.plugins:maven-surefire-report-plugin org.apache.maven.plugins:maven-surefire-plugin org.apache.maven.plugins:maven-failsafe-plugin org.apache.maven.plugins:maven-surefire-report-plugin org.apache.maven.plugins maven-surefire-plugin 2.14 org.apache.maven.plugins maven-failsafe-plugin 2.14 org.apache.maven.plugins maven-surefire-report-plugin 2.14 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions/0000775000175000017500000000000013133666303032420 5ustar ebourgebourg././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions/invok0000664000175000017500000000265112320351742033470 0ustar ebourgebourg# 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. # When running with M2.2.1 Maven already fails to download the pom, so it doesn't even reach the rule. Not sure why MRM can't serve this file, but does with M3 # #Caused by: java.io.FileNotFoundException: http://localhost:50910/org/apache/maven/enforcer/its/menforcer126_maven-plugin/1.0/menforcer126_maven-plugin-1.0.pom # at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1434) # at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) # at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115) # ... 33 more invoker.maven.version=3.0+././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions/pom.x0000664000175000017500000001264712166625524033423 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requirePluginVersions_Expressions 1.0-SNAPSHOT org.apache.maven.enforcer.its menforcer126_maven-plugin 1.0 org.apache.maven.plugins maven-clean-plugin 2.5 org.apache.maven.plugins maven-resources-plugin 2.6 org.apache.maven.plugins maven-compiler-plugin 2.5.1 org.apache.maven.plugins maven-surefire-plugin 2.12.4 org.apache.maven.plugins maven-jar-plugin 2.4 org.apache.maven.plugins maven-install-plugin 2.4 org.apache.maven.plugins maven-deploy-plugin 2.7 org.apache.maven.plugins maven-site-plugin 3.2 ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} menforcer126 ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} ${expressionplugin.groupId} ${expressionplugin.artifactId} ${expressionplugin.version} maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/0000775000175000017500000000000013133666303026712 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/module/0000775000175000017500000000000013133666303030177 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/module/pom.xml0000664000175000017500000000245012166625524031522 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/builds_a_pom_noop/pom.xml0000664000175000017500000000343012166625524030234 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT pom org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange/0000775000175000017500000000000013133666303031575 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange/pom.xml0000664000175000017500000000453612473146352033125 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer menforcer72 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its:menforcer72_junit:[3.8,4.0):jar org.apache.maven.plugins.enforcer.its:menforcer72_junit:[3.8,4.0):*:test org.apache.maven.plugins.enforcer.its menforcer72_logging 1.1.1 pom org.apache.maven.plugins.enforcer.its menforcer72_junit 3.8.1 test maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-exist/0000775000175000017500000000000013133666303027130 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-exist/pom.xml0000664000175000017500000000324311241364640030444 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce pom.xml maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail/0000775000175000017500000000000013133666303025433 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail/invoker.properties0000664000175000017500000000145712320351742031230 0ustar ebourgebourg# 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 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail/pom.xml0000664000175000017500000000303211241364640026743 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-version/0000775000175000017500000000000013133666302027776 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-version/pom.xml0000664000175000017500000000304511241364640031313 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_fai0000775000175000017500000000000013133666303033312 5ustar ebourgebourg././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_fai0000664000175000017500000000145412320351742033313 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_failure/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-release-dependencies-excludes_fai0000664000175000017500000000452012166625524033322 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireReleaseDeps jar 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce No Snapshots Allowed! org.apache.maven.plugins.enforcer.its:menforcer85_api:[2.0,) org.apache.maven.plugins.enforcer.its menforcer85_api 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/0000775000175000017500000000000013133666303031505 5ustar ebourgebourg././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/invoker.0000664000175000017500000000145712320351742033165 0ustar ebourgebourg# 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 ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/verify.g0000664000175000017500000000176412153432357033172 0ustar ebourgebourg/* * 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( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanTransitiveDependencies failed with message:' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies-fail/pom.xml0000664000175000017500000000432512153432357033027 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-transitive-fail-test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its:menforcer138_classworlds org.apache.maven.plugins.enforcer.its:menforcer138_io org.apache.maven.plugins.enforcer.its menforcer138_archiver 2.1.1 org.apache.maven.plugins.enforcer.its menforcer138_utils 3.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management/0000775000175000017500000000000013133666303030611 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management/verify.groovy0000664000175000017500000000162112353624735033372 0ustar ebourgebourg/* * 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] BUILD SUCCESS' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-distribution-management/pom.xml0000664000175000017500000000310112353624735032127 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-distribution-management 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies/0000775000175000017500000000000013133666303030574 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/ban-transitive-dependencies/pom.xml0000664000175000017500000000432612153432357032117 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer ban-transitive-test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its:menforcer138_container-default org.apache.maven.plugins.enforcer.its:menforcer138_io org.apache.maven.plugins.enforcer.its menforcer138_archiver 2.1.1 org.apache.maven.plugins.enforcer.its menforcer138_utils 3.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-java-version/0000775000175000017500000000000013133666303027300 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-java-version/pom.xml0000664000175000017500000000347311360342031030611 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce 1.4 [1.4,) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/0000775000175000017500000000000013133666302031175 5ustar ebourgebourg././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/invoker.pro0000664000175000017500000000145412320351742033374 0ustar ebourgebourg# 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=failuremaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/pom.xml0000664000175000017500000000651112166625524032523 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireSameVersion 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce org.apache.maven.plugins:maven-surefire-plugin org.apache.maven.plugins:maven-failsafe-plugin org.apache.maven.plugins:maven-surefire-report-plugin org.apache.maven.plugins:maven-surefire-plugin org.apache.maven.plugins:maven-failsafe-plugin org.apache.maven.plugins:maven-surefire-report-plugin org.apache.maven.plugins maven-surefire-plugin 2.14 org.apache.maven.plugins maven-failsafe-plugin 2.15 org.apache.maven.plugins maven-surefire-report-plugin 2.13 ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_failure/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000775000175000017500000000000013133666303033232 5ustar ebourgebourg././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000664000175000017500000000145412320351742033233 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_failure/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000664000175000017500000000310212157376075033241 0ustar ebourgebourg/* * 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 LS = System.getProperty( "line.separator" ) File buildLog = new File( basedir, 'build.log' ) assert buildLog.text.contains( 'Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:' ) def message = 'Failed while enforcing RequireUpperBoundDeps. The error(s) are [' + LS+ 'Require upper bound dependencies error for org.apache.maven.plugins.enforcer.its:menforcer146-x:1.1 paths to dependency are:' + LS+ '+-org.apache.maven.enforcer.its:menforcer146-a:1.0-SNAPSHOT' + LS+ ' +-org.apache.maven.plugins.enforcer.its:menforcer146-b:1.0' + LS+ ' +-org.apache.maven.plugins.enforcer.its:menforcer146-x:1.1 (managed) <-- org.apache.maven.plugins.enforcer.its:menforcer146-x:2.1' + LS+ ']' + LS assert buildLog.text.contains( message )././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_failure/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-managed_0000664000175000017500000000447612166625524033254 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its menforcer146-a 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce org.apache.maven.plugins.enforcer.its menforcer146-x 1.1 org.apache.maven.plugins.enforcer.its menforcer146-b 1.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-size/0000775000175000017500000000000013133666303026746 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-files-size/pom.xml0000664000175000017500000000336511241364640030267 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce 10240 512 pom.xml maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-plugins/0000775000175000017500000000000013133666302026127 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-plugins/pom.xml0000664000175000017500000000307511241364640027447 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/0000775000175000017500000000000013133666303031114 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/invoker.prop0000664000175000017500000000145612320351742033474 0ustar ebourgebourg# 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.goals = clean package././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/verify.groov0000664000175000017500000000163012165352056033477 0ustar ebourgebourg/* * 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. */ assert new File( basedir, 'target/resolve_collect_dependencies-1.0-extjars.zip' ).isFile() maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/pom.xml0000664000175000017500000000471512565164141032441 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer resolve_collect_dependencies 1.0 pom org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false org.apache.maven.plugins maven-assembly-plugin 2.5.5 assemble package single src/assembly/extjars.xml org.apache.maven.plugins.enforcer.its menforcer158_utils 1.0 maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/src/0000775000175000017500000000000013133666302031702 5ustar ebourgebourg././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/src/assembly/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/src/assembly0000775000175000017500000000000013133666303033443 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/src/assembly/extjars.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/resolve_collect_dependencies/src/assembly0000664000175000017500000000317512165352056033454 0ustar ebourgebourg extjars zip false 0644 0755 false false maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/0000775000175000017500000000000013133666303031544 5ustar ebourgebourg././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/invoker.p0000664000175000017500000000145412320351742033401 0ustar ebourgebourg# 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././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/verify.gr0000664000175000017500000000226512153723667033417 0ustar ebourgebourg/* * 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( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireNoRepositories failed with message:' ) assert buildLog.text.contains( 'Some poms have repositories defined:' ) assert buildLog.text.contains( 'org.apache.maven.its.enforcer:test version:1.0 has repositories [com.asual.maven.public]' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories_failure/pom.xml0000664000175000017500000000344212153723667033074 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 com.asual.maven.public Asual Public Repository http://localhost org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/0000775000175000017500000000000013133666303030751 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/module/0000775000175000017500000000000013133666303032236 5ustar ebourgebourg././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/module/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/module/pom.xm0000664000175000017500000000245012166625524033405 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.1-SNAPSHOT ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/invoker.prope0000664000175000017500000000145412320351742033474 0ustar ebourgebourg# 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=failuremaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_not_converging/pom.xml0000664000175000017500000000413112166625524032272 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT jar org.slf4j slf4j-jdk14 1.6.1 org.slf4j slf4j-nop 1.6.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions/0000775000175000017500000000000013133666302030037 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions/pom.xml0000664000175000017500000000366611241364640031365 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 pom org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false org.apache.maven.plugins:maven-clean-plugin,org.apache.maven.plugins:maven-install-plugin,org.apache.maven.plugins:maven-deploy-plugin,org.apache.maven.plugins:maven-site-plugin maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/0000775000175000017500000000000013133666303032506 5ustar ebourgebourg././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/inv0000664000175000017500000000145712473146352033237 0ustar ebourgebourg# 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 ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/verify.groovymaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/ver0000664000175000017500000000173112473146352033232 0ustar ebourgebourg/* * 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( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:' ) ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-versionrange-fail/pom0000664000175000017500000000443612473146352033236 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer menforcer72 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce org.apache.maven.plugins.enforcer.its:menforcer72_junit:[3.8,4.0):jar org.apache.maven.plugins.enforcer.its:menforcer72_logging:[1.0,2.0) org.apache.maven.plugins.enforcer.its menforcer72_logging 1.1.1 pom org.apache.maven.plugins.enforcer.its menforcer72_junit 3.8.1 test maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail-warn/0000775000175000017500000000000013133666303026400 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail-warn/invoker.properties0000664000175000017500000000145712320351742032175 0ustar ebourgebourg# 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 = success maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail-warn/verify.groovy0000664000175000017500000000172312322316427031154 0ustar ebourgebourg/* * 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( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.AlwaysFail warned with message:' ) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/always-fail-warn/pom.xml0000664000175000017500000000313512174204674027722 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce WARN maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-file-checksum/0000775000175000017500000000000013133666303027413 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-file-checksum/LICENSE0000664000175000017500000000136113016402410030404 0ustar ebourgebourgLicensed 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. maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-file-checksum/pom.xml0000664000175000017500000000571013016402410030716 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 https://issues.apache.org/jira/browse/MENFORCER-247 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce ${project.basedir}/LICENSE md5 7c5b65d44e8123e70d24d9eef17e9fa2 ${project.basedir}/LICENSE sha1 278661cbaf6a1bcbd34e3877b6de0e8bd7097846 ${project.basedir}/LICENSE sha256 61b825d68516541151e5ce0145e54765c48cd5802b886aee8fb8cf1953f02d10 ${project.basedir}/LICENSE sha384 6f9e6b81487911c5a339c541016a459acaf8312e430ccabe5c10cb2ddf9a307f4595c78555f911377f4fb853ffe87046 ${project.basedir}/LICENSE sha512 c51c3cf07c87af78dd7af4407ae3993ea1051d8a7c260cf34bbaa41c468dcd3b62d2be3d9a09807a8595d0065e2d75d1bf9ffc8276d567a983ff057f6b51b0cc maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-wildcards/0000775000175000017500000000000013133666303031047 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/banned-dependencies-wildcards/pom.xml0000664000175000017500000000436612153440331032365 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer menforcer72 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce *:*:*:jar *:menforcer72_junit:*:*:test org.apache.maven.plugins.enforcer.its menforcer72_logging 1.1.1 pom org.apache.maven.plugins.enforcer.its menforcer72_junit 3.8.1 test maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile-from-settings/0000775000175000017500000000000013133666303032404 5ustar ebourgebourg././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile-from-settings/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-active-profile-from-settings/pom.0000664000175000017500000000423512264572300033201 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce it1,it2,it3,it-repo true it1 true it2 true it3 true maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-maven-version/0000775000175000017500000000000013133666303027465 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-maven-version/pom.xml0000664000175000017500000000347711360342031031002 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce 2.0 [2.0,) maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_failure/0000775000175000017500000000000013133666302031724 5ustar ebourgebourg././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_failure/invoker.propertiesmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_failure/invoker.0000664000175000017500000000145412770317331033407 0ustar ebourgebourg# 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=failuremaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-snapshot-version_failure/pom.xml0000664000175000017500000000313712770317331033246 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer menforcer-204 1.0 https://issues.apache.org/jira/browse/MENFORCER-204 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories/0000775000175000017500000000000013133666303030035 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-no-repositories/pom.xml0000664000175000017500000000311511241364640031347 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-custom-packaging/0000775000175000017500000000000013133666303033272 5ustar ebourgebourg././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-custom-packaging/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-plugin-versions-custom-packaging/0000664000175000017500000000463111253503340033270 0ustar ebourgebourg 4.0.0 org.apache.maven.its.enforcer test 1.0 maven-one-plugin org.apache.maven.plugins maven-one-plugin 1.2 true org.apache.maven.plugins maven-enforcer-plugin @project.version@ test enforce false org.apache.maven.plugins:maven-clean-plugin, org.apache.maven.plugins:maven-install-plugin, org.apache.maven.plugins:maven-deploy-plugin, org.apache.maven.plugins:maven-site-plugin, org.apache.maven.plugins:maven-resources-plugin, org.apache.maven.plugins:maven-compiler-plugin, org.apache.maven.plugins:maven-surefire-plugin maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_converge/0000775000175000017500000000000013133666302027537 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_converge/module/0000775000175000017500000000000013133666302031024 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_converge/module/pom.xml0000664000175000017500000000245012166625524032350 0ustar ebourgebourg 4.0.0 test TestParent 1.0-SNAPSHOT TestModule 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/dependencies_converge/pom.xml0000664000175000017500000000436412166625524031071 0ustar ebourgebourg 4.0.0 test TestParent 1.0 jar org.slf4j slf4j-jdk14 1.6.1 org.slf4j slf4j-nop 1.6.0 org.slf4j slf4j-api org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_success/maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_s0000775000175000017500000000000013133666303033327 5ustar ebourgebourg././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_success/pom.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/it/projects/require-upper-bound-dependencies-unique_s0000664000175000017500000000421312166625524033336 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer.its requireUpperBoundDependenciesUnique jar 1.0-SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin @project.version@ enforce enforce org.apache.maven.plugins.enforcer.its menforcer134_project 1.0-SNAPSHOT maven-enforcer-1.4.2/maven-enforcer-plugin/src/it/pom.xml0000664000175000017500000000702312166625524022715 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins maven-enforcer-plugin-it1 1 jar org.apache.maven.shared maven-invoker 2.0.7-SNAPSHOT org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-dependency-plugin 2.0-alpha-4 copy copy-dependencies org.apache.maven.plugins maven-enforcer-plugin 1.0-SNAPSHOT custom-rule custom-rule-sample 1.0 enforce [1.3,1.6] 2.0.8 You need 2.0.8! true !tandem rti.getApplicationVersion().getMajorVersion() == 2; org.apache.maven com.acme enforce validate maven-enforcer-1.4.2/maven-enforcer-plugin/src/site/0000775000175000017500000000000013133666303021721 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/site/site.xml0000664000175000017500000000372413121174604023410 0ustar ebourgebourg maven-enforcer-1.4.2/maven-enforcer-plugin/src/site/apt/0000775000175000017500000000000013133666303022505 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/site/apt/index.apt0000664000175000017500000000514513121176075024326 0ustar ebourgebourg~~ 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. ------ Introduction ------ Brian Fox ------ Mar 2007 ------ Maven Enforcer Plugin - The Loving Iron Fist of Maven\x99 The Enforcer plugin provides goals to control certain environmental constraints such as Maven version, JDK version and OS family along with many more built-in rules and user created rules. * Goals Overview The Enforcer plugin has two goals: *{{{./enforce-mojo.html}enforcer:enforce}} executes rules for each project in a multi-project build. *{{{./display-info-mojo.html}enforcer:display-info}} display the current information as detected by the built-in rules. * Usage General instructions on how to use the Enforcer Plugin can be found on the {{{./usage.html}usage page}}. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{/guides/development/guide-helping.html}guide to helping with Maven}}. maven-enforcer-1.4.2/maven-enforcer-plugin/src/site/apt/usage.apt.vm0000664000175000017500000001044013121174604024732 0ustar ebourgebourg~~ 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. ------ Usage ------ Brian Fox ------ Mar 2007 ------ Usage Brief examples on how to use the enforcer goals. * Generic Plugin configuration information See the following links for information about including and configuring plugins in your project: *{{{http://maven.apache.org/guides/mini/guide-configuring-plugins.html}Configuring Plugins}} *{{{http://maven.apache.org/guides/plugin/guide-java-plugin-development.html}Plugin Development}} *{{{http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html}Plugin Prefix}} [] * The <<>> mojo This goal is meant to be bound to a lifecycle phase and configured in your <<>>. The enforcers execute the configured rules to check for certain constraints. The available built-in rules are described {{{../enforcer-rules/index.html}here}}. Besides the rules to execute, these goals support three options: * {{{./enforce-mojo.html#skip}skip}} - a quick way to skip checks via a profile or using <<<-Denforcer.skip=true>>> from the command line. * {{{./enforce-mojo.html#fail}fail}} - if the goal should fail the build when a rule fails. The default is <<>>. If false, the errors will be logged as warnings. * {{{./enforce-mojo.html#failFast}failFast}} - if the goal should stop checking after the first failure. The default is <<>>. [] Each rule to be executed should be added to the rules element along with the specific configuration for that rule. As of version 1.4, you may add a <<>> element to the rules. Valid values are <<>> and <<>>. When <<>> <<>> is specified, the rule will only spit out a warning but will not fail the build. Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-versions enforce WARN org.apache.maven.plugins:maven-verifier-plugin Please consider using the maven-invoker-plugin (http://maven.apache.org/plugins/maven-invoker-plugin/)! 2.0.6 1.5 unix [...] +---+ * The <<>> mojo This goal is used to determine the current information as detected by the standard rules: +---+ mvn enforcer:display-info ... [enforcer:display-info] Maven Version: 2.0.6 JDK Version: 1.5.0_11 normalized as: 1.5.0-11 OS Info: Arch: x86 Family: windows Name: windows xp Version: 5.1 +---+ maven-enforcer-1.4.2/maven-enforcer-plugin/src/site/fml/0000775000175000017500000000000013133666303022477 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/site/fml/faq.fml0000664000175000017500000000336711237301344023751 0ustar ebourgebourg Why can't I just use the prerequisites tag in the pom?

The prerequisites tag was designed to be used by tools like plugins. It will work for regular projects, but it isn't inherited to their children. If it is set in a parent reactor, then Maven will do the check. However if one of the children are built, the check is not performed. The enforcer plugin is designed to allow centralized control over the build environment from a single "super-pom", and to allow greater flexibility in version specification by supporting ranges.

maven-enforcer-1.4.2/maven-enforcer-plugin/src/main/0000775000175000017500000000000013133666303021701 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/0000775000175000017500000000000013133666303022622 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/0000775000175000017500000000000013133666303023411 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/0000775000175000017500000000000013133666303024632 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/0000775000175000017500000000000013133666303025740 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/0000775000175000017500000000000013133666303027421 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/0000775000175000017500000000000013133666303031224 5ustar ebourgebourg././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayInfoMojo.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayIn0000664000175000017500000000620713075342666033060 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.commons.lang.SystemUtils; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.context.Context; import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; /** * This goal displays the current platform information. * * @author Brian Fox * @version $Id: DisplayInfoMojo.java 1791757 2017-04-18 07:52:22Z khmarbaise $ */ @Mojo( name = "display-info", threadSafe = true ) public class DisplayInfoMojo extends AbstractMojo implements Contextualizable { /** * MojoExecution needed by the ExpressionEvaluator */ @Parameter( defaultValue = "${mojoExecution}", readonly = true, required = true ) protected MojoExecution mojoExecution; /** * The MavenSession */ @Parameter( defaultValue = "${session}", readonly = true, required = true ) protected MavenSession session; /** * POM */ @Parameter( defaultValue = "${project}", readonly = true, required = true ) protected MavenProject project; // set by the contextualize method. Only way to get the // plugin's container in 2.0.x protected PlexusContainer container; public void contextualize( Context context ) throws ContextException { container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); } /** * Entry point to the mojo */ public void execute() throws MojoExecutionException { String mavenVersion = session.getSystemProperties().getProperty( "maven.version" ); getLog().info( "Maven Version: " + mavenVersion ); getLog().info( "JDK Version: " + SystemUtils.JAVA_VERSION + " normalized as: " + RequireJavaVersion.normalizeJDKVersion( SystemUtils.JAVA_VERSION_TRIMMED ) ); RequireOS os = new RequireOS(); os.displayOSInfo( getLog(), true ); } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMo0000664000175000017500000003002512621630212033013 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import org.apache.maven.enforcer.rule.api.EnforcerLevel; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRule2; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.maven.project.path.PathTranslator; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.context.Context; import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; /** * This goal executes the defined enforcer-rules once per module. * * @author Brian Fox * @version $Id: EnforceMojo.java 1714313 2015-11-14 13:00:58Z khmarbaise $ */ // CHECKSTYLE_OFF: LineLength @Mojo( name = "enforce", defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyCollection = ResolutionScope.TEST, threadSafe = true ) //CHECKSTYLE_ON: LineLength public class EnforceMojo extends AbstractMojo implements Contextualizable { /** * This is a static variable used to persist the cached results across plugin invocations. */ protected static Hashtable cache = new Hashtable(); /** * Path Translator needed by the ExpressionEvaluator */ @Component( role = PathTranslator.class ) protected PathTranslator translator; /** * MojoExecution needed by the ExpressionEvaluator */ @Parameter( defaultValue = "${mojoExecution}", readonly = true, required = true ) protected MojoExecution mojoExecution; /** * The MavenSession */ @Parameter( defaultValue = "${session}", readonly = true, required = true ) protected MavenSession session; /** * POM */ @Parameter( defaultValue = "${project}", readonly = true, required = true ) protected MavenProject project; /** * Flag to easily skip all checks */ @Parameter( property = "enforcer.skip", defaultValue = "false" ) protected boolean skip = false; /** * Flag to fail the build if a version check fails. */ @Parameter( property = "enforcer.fail", defaultValue = "true" ) private boolean fail = true; /** * Fail on the first rule that doesn't pass */ @Parameter( property = "enforcer.failFast", defaultValue = "false" ) private boolean failFast = false; /** * Array of objects that implement the EnforcerRule interface to execute. */ @Parameter( required = true ) private EnforcerRule[] rules; /** * Use this flag to disable rule result caching. This will cause all rules to execute on each project even if the * rule indicates it can safely be cached. */ @Parameter( property = "enforcer.ignoreCache", defaultValue = "false" ) protected boolean ignoreCache = false; // set by the contextualize method. Only way to get the // plugin's container in 2.0.x protected PlexusContainer container; public void contextualize( Context context ) throws ContextException { container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); } private boolean havingRules() { return rules != null && rules.length > 0; } /** * Entry point to the mojo * * @throws MojoExecutionException */ public void execute() throws MojoExecutionException { Log log = this.getLog(); EnforcerExpressionEvaluator evaluator = new EnforcerExpressionEvaluator( session, translator, project, mojoExecution ); if ( isSkip() ) { log.info( "Skipping Rule Enforcement." ); return; } if ( !havingRules() ) { // CHECKSTYLE_OFF: LineLength throw new MojoExecutionException( "No rules are configured. Use the skip flag if you want to disable execution." ); // CHECKSTYLE_ON: LineLength } // list to store exceptions List list = new ArrayList(); String currentRule = "Unknown"; // create my helper EnforcerRuleHelper helper = new DefaultEnforcementRuleHelper( session, evaluator, log, container ); // if we are only warning, then disable // failFast if ( !fail ) { failFast = false; } boolean hasErrors = false; // go through each rule for ( int i = 0; i < rules.length; i++ ) { // prevent against empty rules EnforcerRule rule = rules[i]; final EnforcerLevel level = getLevel( rule ); if ( rule != null ) { // store the current rule for // logging purposes currentRule = rule.getClass().getName(); log.debug( "Executing rule: " + currentRule ); try { if ( ignoreCache || shouldExecute( rule ) ) { // execute the rule // noinspection // SynchronizationOnLocalVariableOrMethodParameter synchronized ( rule ) { rule.execute( helper ); } } } catch ( EnforcerRuleException e ) { // i can throw an exception // because failfast will be // false if fail is false. if ( failFast && level == EnforcerLevel.ERROR ) { throw new MojoExecutionException( currentRule + " failed with message:\n" + e.getMessage(), e ); } else { if ( level == EnforcerLevel.ERROR ) { hasErrors = true; list.add( "Rule " + i + ": " + currentRule + " failed with message:\n" + e.getMessage() ); log.debug( "Adding failure due to exception", e ); } else { list.add( "Rule " + i + ": " + currentRule + " warned with message:\n" + e.getMessage() ); log.debug( "Adding warning due to exception", e ); } } } } } // if we found anything // CHECKSTYLE_OFF: LineLength if ( !list.isEmpty() ) { for ( String failure : list ) { log.warn( failure ); } if ( fail && hasErrors ) { throw new MojoExecutionException( "Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed." ); } } // CHECKSTYLE_ON: LineLength } /** * This method determines if a rule should execute based on the cache * * @param rule the rule to verify * @return {@code true} if rule should be executed, otherwise {@code false} */ protected boolean shouldExecute( EnforcerRule rule ) { if ( rule.isCacheable() ) { Log log = this.getLog(); log.debug( "Rule " + rule.getClass().getName() + " is cacheable." ); String key = rule.getClass().getName() + " " + rule.getCacheId(); if ( EnforceMojo.cache.containsKey( key ) ) { log.debug( "Key " + key + " was found in the cache" ); if ( rule.isResultValid( (EnforcerRule) cache.get( key ) ) ) { log.debug( "The cached results are still valid. Skipping the rule: " + rule.getClass().getName() ); return false; } } // add it to the cache of executed rules EnforceMojo.cache.put( key, rule ); } return true; } /** * @return the fail */ public boolean isFail() { return this.fail; } /** * @param theFail the fail to set */ public void setFail( boolean theFail ) { this.fail = theFail; } /** * @return the rules */ public EnforcerRule[] getRules() { return this.rules; } /** * @param theRules the rules to set */ public void setRules( EnforcerRule[] theRules ) { this.rules = theRules; } /** * @param theFailFast the failFast to set */ public void setFailFast( boolean theFailFast ) { this.failFast = theFailFast; } public boolean isFailFast() { return failFast; } protected String createRuleMessage( int i, String currentRule, EnforcerRuleException e ) { return "Rule " + i + ": " + currentRule + " failed with message:\n" + e.getMessage(); } /** * @param theTranslator the translator to set */ public void setTranslator( PathTranslator theTranslator ) { this.translator = theTranslator; } /** * Returns the level of the rule, defaults to {@link EnforcerLevel#ERROR} for backwards compatibility. * * @param rule might be of type {@link EnforcerRule2}. * @return level of the rule. */ private EnforcerLevel getLevel( EnforcerRule rule ) { if ( rule instanceof EnforcerRule2 ) { return ( (EnforcerRule2) rule ).getLevel(); } else { return EnforcerLevel.ERROR; } } /** * @return the skip */ public boolean isSkip() { return this.skip; } /** * @param theSkip the skip to set */ public void setSkip( boolean theSkip ) { this.skip = theSkip; } /** * @return the project */ public MavenProject getProject() { return this.project; } /** * @param theProject the project to set */ public void setProject( MavenProject theProject ) { this.project = theProject; } /** * @return the session */ public MavenSession getSession() { return this.session; } /** * @param theSession the session to set */ public void setSession( MavenSession theSession ) { this.session = theSession; } /** * @return the translator */ public PathTranslator getTranslator() { return this.translator; } } maven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/util/0000775000175000017500000000000013133666303032201 5ustar ebourgebourg././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/util/EnforcerUtils.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/util/Enfo0000664000175000017500000000170012157401054033004 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.util; /* * 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. */ /** * @author Brian Fox * */ public class EnforcerUtils { } maven-enforcer-1.4.2/maven-enforcer-plugin/src/main/resources/0000775000175000017500000000000013133666303023713 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/resources/META-INF/0000775000175000017500000000000013133666303025053 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/resources/META-INF/m2e/0000775000175000017500000000000013133666303025536 5ustar ebourgebourg././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xmlmaven-enforcer-1.4.2/maven-enforcer-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadat0000664000175000017500000000216612521227440032466 0ustar ebourgebourg enforce maven-enforcer-1.4.2/maven-enforcer-plugin/src/test/0000775000175000017500000000000013133666303021734 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/0000775000175000017500000000000013133666303022655 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/0000775000175000017500000000000013133666303023444 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/0000775000175000017500000000000013133666303024665 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/0000775000175000017500000000000013133666303025773 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/0000775000175000017500000000000013133666303027454 5ustar ebourgebourgmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/0000775000175000017500000000000013133666303031257 5ustar ebourgebourg././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefaultEnforcementRuleHelper.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefau0000664000175000017500000000306213075342666033077 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; /** * @author Brian Fox * */ public class TestDefaultEnforcementRuleHelper extends TestCase { public void testHelper() throws ComponentLookupException, ExpressionEvaluationException { DefaultEnforcementRuleHelper helper = (DefaultEnforcementRuleHelper) EnforcerTestUtils.getHelper(); assertNotNull( helper.getLog() ); assertNotNull( helper.evaluate( "${session}" ) ); assertNotNull( helper.evaluate( "${project}" ) ); } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/MockEnforcerRule.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/MockEnfor0000664000175000017500000000674210767711000033071 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * @author Brian Fox * */ public class MockEnforcerRule implements EnforcerRule { public boolean failRule = false; public String cacheId=""; public boolean isCacheable = false; public boolean isResultValid = false; public boolean executed = false; public MockEnforcerRule( boolean fail ) { this.failRule = fail; } public MockEnforcerRule( boolean fail, String cacheId, boolean isCacheable, boolean isResultValid ) { this.failRule = fail; this.isCacheable = isCacheable; this.isResultValid= isResultValid; this.cacheId = cacheId; } public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { executed = true; if ( isFailRule() ) { throw new EnforcerRuleException( " this condition is not allowed." ); } } /** * @return the failRule */ public boolean isFailRule() { return this.failRule; } /** * @param theFailRule * the failRule to set */ public void setFailRule( boolean theFailRule ) { this.failRule = theFailRule; } /** * @return the isResultValid */ public boolean isResultValid () { return this.isResultValid; } /** * @param theIsResultValid the isResultValid to set */ public void setResultValid ( boolean theIsResultValid ) { this.isResultValid = theIsResultValid; } /** * @param theCacheId the cacheId to set */ public void setCacheId ( String theCacheId ) { this.cacheId = theCacheId; } /** * @param theIsCacheable the isCacheable to set */ public void setCacheable ( boolean theIsCacheable ) { this.isCacheable = theIsCacheable; } /* (non-Javadoc) * @see org.apache.maven.enforcer.rule.api.EnforcerRule#getCacheId() */ public String getCacheId () { return cacheId; } /* (non-Javadoc) * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable() */ public boolean isCacheable () { return isCacheable; } /* (non-Javadoc) * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule) */ public boolean isResultValid ( EnforcerRule theCachedRule ) { return isResultValid; } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnforceMojo.javamaven-enforcer-1.4.2/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnfor0000664000175000017500000001755012451602040033111 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.plugin.MojoExecutionException; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.runners.MockitoJUnitRunner; /** * Exhaustively check the enforcer mojo. * * @author Brian Fox */ @RunWith( MockitoJUnitRunner.class ) public class TestEnforceMojo { @InjectMocks EnforceMojo mojo; @Test public void testEnforceMojo() throws MojoExecutionException { mojo.setFail( false ); mojo.setSession( EnforcerTestUtils.getMavenSession() ); mojo.setProject( new MockProject() ); try { mojo.execute(); fail( "Expected a Mojo Execution Exception." ); } catch ( MojoExecutionException e ) { System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() ); } EnforcerRule[] rules = new EnforcerRule[10]; rules[0] = new MockEnforcerRule( true ); rules[1] = new MockEnforcerRule( true ); mojo.setRules( rules ); mojo.execute(); try { mojo.setFailFast( false ); mojo.setFail( true ); mojo.execute(); fail( "Expected a Mojo Execution Exception." ); } catch ( MojoExecutionException e ) { System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() ); } try { mojo.setFailFast( true ); mojo.setFail( true ); mojo.execute(); fail( "Expected a Mojo Execution Exception." ); } catch ( MojoExecutionException e ) { System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() ); } ( (MockEnforcerRule) rules[0] ).setFailRule( false ); ( (MockEnforcerRule) rules[1] ).setFailRule( false ); mojo.execute(); } @Test public void testCaching() throws MojoExecutionException { mojo.setFail( true ); mojo.setSession( EnforcerTestUtils.getMavenSession() ); mojo.setProject( new MockProject() ); MockEnforcerRule[] rules = new MockEnforcerRule[10]; // check that basic caching works. rules[0] = new MockEnforcerRule( false, "", true, true ); rules[1] = new MockEnforcerRule( false, "", true, true ); mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertFalse( "Expected this rule not to be executed.", rules[1].executed ); // check that skip caching works. rules[0] = new MockEnforcerRule( false, "", true, true ); rules[1] = new MockEnforcerRule( false, "", true, true ); mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.ignoreCache = true; mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertTrue( "Expected this rule to be executed.", rules[1].executed ); mojo.ignoreCache = false; // check that different ids are compared. rules[0] = new MockEnforcerRule( false, "1", true, true ); rules[1] = new MockEnforcerRule( false, "2", true, true ); rules[2] = new MockEnforcerRule( false, "2", true, true ); mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertTrue( "Expected this rule to be executed.", rules[1].executed ); assertFalse( "Expected this rule not to be executed.", rules[2].executed ); // check that future overrides are working rules[0] = new MockEnforcerRule( false, "1", true, true ); rules[1] = new MockEnforcerRule( false, "1", false, true ); rules[2] = null; mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertTrue( "Expected this rule to be executed.", rules[1].executed ); // check that future isResultValid is used rules[0] = new MockEnforcerRule( false, "1", true, true ); rules[1] = new MockEnforcerRule( false, "1", true, false ); rules[2] = null; mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertTrue( "Expected this rule to be executed.", rules[1].executed ); } @Test public void testCachePersistence1() throws MojoExecutionException { mojo.setFail( true ); mojo.setSession( EnforcerTestUtils.getMavenSession() ); mojo.setProject( new MockProject() ); MockEnforcerRule[] rules = new MockEnforcerRule[10]; // check that basic caching works. rules[0] = new MockEnforcerRule( false, "", true, true ); rules[1] = new MockEnforcerRule( false, "", true, true ); mojo.setRules( rules ); EnforceMojo.cache.clear(); mojo.execute(); assertTrue( "Expected this rule to be executed.", rules[0].executed ); assertFalse( "Expected this rule not to be executed.", rules[1].executed ); } @Test public void testCachePersistence2() throws MojoExecutionException { mojo.setFail( true ); mojo.setSession( EnforcerTestUtils.getMavenSession() ); mojo.setProject( new MockProject() ); MockEnforcerRule[] rules = new MockEnforcerRule[10]; // check that basic caching works. rules[0] = new MockEnforcerRule( false, "", true, true ); rules[1] = new MockEnforcerRule( false, "", true, true ); mojo.setRules( rules ); mojo.execute(); assertFalse( "Expected this rule not to be executed.", rules[0].executed ); assertFalse( "Expected this rule not to be executed.", rules[1].executed ); } @Test public void testCachePersistence3() throws MojoExecutionException { System.gc(); try { Thread.sleep( 1000 ); } catch ( InterruptedException e ) { } mojo.setFail( true ); mojo.setSession( EnforcerTestUtils.getMavenSession() ); mojo.setProject( new MockProject() ); MockEnforcerRule[] rules = new MockEnforcerRule[10]; // check that basic caching works. rules[0] = new MockEnforcerRule( false, "", true, true ); rules[1] = new MockEnforcerRule( false, "", true, true ); mojo.setRules( rules ); mojo.execute(); assertFalse( "Expected this rule not to be executed.", rules[0].executed ); assertFalse( "Expected this rule not to be executed.", rules[1].executed ); } } maven-enforcer-1.4.2/NOTICE0000664000175000017500000000025712166243100014662 0ustar ebourgebourgApache Maven Enforcer Copyright 2007-2013 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). maven-enforcer-1.4.2/enforcer-rules/0000775000175000017500000000000013133666304016717 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/pom.xml0000664000175000017500000000764513122035147020241 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer enforcer 1.4.2 enforcer-rules Apache Maven Enforcer Built-In Rules This component contains the built-in Enforcer Rules org.apache.maven maven-artifact org.apache.maven maven-plugin-api org.apache.maven maven-core org.apache.maven.shared maven-common-artifact-filters org.codehaus.plexus plexus-utils org.apache.maven.plugin-testing maven-plugin-testing-harness test org.apache.commons commons-lang3 3.5 commons-codec commons-codec org.apache.maven.enforcer enforcer-api org.beanshell bsh 2.0b4 junit junit test org.mockito mockito-core test org.apache.maven.shared maven-dependency-tree org.codehaus.plexus plexus-i18n 1.0-beta-6 org.apache.maven maven-compat org.assertj assertj-core test org.apache.maven.plugins maven-jar-plugin test-jar maven-enforcer-1.4.2/enforcer-rules/src/0000775000175000017500000000000013133666303017505 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/site/0000775000175000017500000000000013133666304020452 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/site/site.xml0000664000175000017500000000226512573360174022150 0ustar ebourgebourg maven-enforcer-1.4.2/enforcer-rules/src/site/resources/0000775000175000017500000000000013133666303022463 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/0000775000175000017500000000000013133666304023731 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/root-with-parent-and-modules.png0000664000175000017500000004102712561645371032101 0ustar ebourgebourg‰PNG  IHDRºá@ŸS pHYsìëM‘ØÄAÉIDATxÚí] \MÏ?ïµ'­Z‰l!QTÖd •¤HÊVÙÚìd)Ee);‘Šð/d—­,¥ìkD%!-´oï?óê嵿W/^šïç3õî½sçÎ=÷Ì™sfΜá¥ÑhÀ >|ø0ÔÈÈ( ý=zôýsçÎi³ro}=<=%99Y‘­àpá#GŽ„ÈÈH˜a;¤ÅÛ–-^0ËÞ¤DáË\øœø_ïpñâEš¾¾>…­7ÀÀ…Ç_8û`Ô¨Qàj1¦Ú®‚7ÂÉ+ÀlÑ z>!!!öH”ŸŸo€nŠÀ¿ûŸ]ù0Ðw¨87†þĈ¶€^÷"úG9}úôd))©ÐÚò|ùò僥¥e×FdŒÉ“'ŸÆb0à!Â`¼À&bbb´ØÉÏöP»¡4ëØ[`4.ÔŠÁÇLJÂÑ0·Ü &ÐëbM– °ŽB+\÷›æéiÉÐNN.Ž~ÒM'sá¸ðfý àÚ£V}‘ˆsÀôÖÖÖ¾;wîÜnƒêîîþžãop÷î]í?B"V8ñÖ{€²²2mß¾}•ǘӮ\YQÐäP(ZuQÎÀرcšü†l233 ?þdúÉ’/àµÔ vµmû‹c$:yò¤iXXMLL }Yy¸uëVŽŽŽ(G?òĉ)ÍÊE999ÝbccßÑ æåÕAíæGÀ(œþJJn§§§Ks„‹ð‡Æm '7JËh Ö¶ ýÚóçÏ¿7ù¹¹¹ôÒž={}úôá|KÎÃÿ(ÍÚ’Z[[—ÈÊÊflÙ²E†þ¬*¿«W¯öÙ¾}û"¤Œ{{{/·±±ÙÞhAWZZ*rçÎ_ÌZ\…&‡ïÙ†H±¹Ö,~ýúužo3ŠAY’fN5ÀcgÁÜdth/>þûaÛæµ°x™;¼Ë,Áâ³Ö~¹ÖÂ;¶Ñ¿Hû5³ÀÁe|+¦@ÈÙsøÁp52†^0Fw ^öÈrèÐ!:ˆŠˆ0IEZ%·Zƒº][wÉ[ß×ÇùÑÿâuëÖÕšÏÜÜüÛׯ_eëê‡dGô|u]Cs®[d4ýfés¹J±e¹pÔÕ=G]]ïúM£ ·²²zÊ(˜¡r4I™ÅŠì°®£n]›~}„]lžˆ!¾ÿýúœ9sŠ8ÀߨÂûvЊÇ3އOr„[g~˪¤6ºæ1sögnPƒâ¿ÓÖ9W^G…Ç>èæ%S(+V¬Èºÿ~Æ7ºpœ=<<Äÿ Ÿ?þƒ‹‹KgƱ©©if“ G û<¥ø7sÁM*)D% ±PΪPe¢I…×%kðƒdúèsŽæ E©YÕ‹f“Š{÷î¥õèÑŠŠŠ°À¹šc’à‚1øùùéÇM*œaÚÔÆ-WŸ¦ÇLfL0ŸçBpޝ^½Šù¾yš¿®®.É÷9’’’>—/_FמeE´.(((#•WZZší{}||`Á‚Fzzzçš}à ¹;wîf?~¼Ñ/îä䄇IÃç2d!Ö›G5rss£¡ŠW›.ô„Pÿåtqu5" x…DË•=¤[ŒAçúàíËÀÂq3ýüº€P¸@?Ÿôðt0 *e)â,ëlW~Æ ÑÑÑ…Œã/® ¿Ë˯-²÷ýçaz‘Ç.WÞ3ÅÖn½L…aÝÅ@YYnUœª½ë|ùòå=V†±Ø®<NE ªtìØ±t©ÏIjõ!”s¿+©)܆«Thqcz¢T~^ºÏ˜Ê|T*5399ÙaêÔ©ÇX­x“¤ARRO}×oß¾­óöí[e$êù¥¤¤~ 2$ZQQ1ù¯(ÕìBGGçö„ ÎýüùS”]3‚+Ì \qü¿ÿþqý[T囋â¤òÍ ŽW~À€4ooï:¯÷ìÙS^NN.ë*;˜Ú*Ž;17ß“ôéˆ×¯_A]Б#GlþJå±‘ÌøÝ¯ãÀØû³îW™ÎÛwþ%تTÎíâ„Çç+íà¾}Gÿ5ÊWŸIbi{0nÜ8è('@¯ø‰°«ôaù‘c¬èבŲÃf̘¡ÆulãééIyóæM=Mx­WÙëÊWö¶÷îÝÃCrù¶Á";ç J”:¬·Ö!*Ç^´È~dAE^;À#Wå AXmov‹‰W¬}Ü}í†MpyØo3ÔÀpR¹ +ßî§â´jUùø–n½åeddüâ8«`w[ìË@²^VÙYÇÞcø{?_Íâr¾¼¥ûÀà/QÆV^•I$#‰Ô‡ãÇ>Â4$“Ëåz`y¥qGqºJ‡akÔjÓ¹«Ÿg®tRR’ ê`²šEªìܹ“‚úÆ)©‚Dá{d²ukv9Ž[=CßÀ«W¯–VVV`§ ??¿D ‹•–––'P¥ÿüpFmk7RSS°1þ2Ç¿…^ê-þÏÉq™fQ´R‘pÒÜÜ<ä¿ÿþ›ÖÏhv ñãÇHCPúØb*6ÿGÚ`bsÌt4[Åÿל_²Ù*Næ“HÅÿåŠ[YYÑìì쪜C–ÒýèèèÁ\YñÂÂB…{÷î}®^i A³fÍ¢aOj®«8®t}×±_9îþ±ãïxZÞW99aÙµûöíÛ€*U#¿‹íTˆMH­TcQ¾î…â¼å¾0~§¸}—‘jGŸÝ¶mÛª]»vÑ †Ùnpt§\ƦÚþcÀì“Ç<ÞÁKúÛÛ¥IJD?©ªªVžŸ6Iž2Ê( I¥qTyµ$±k1¥Õ̺Òùóçÿvì)Í qh.°]ñºf¤óóóy3k Ö`XýŒsø8''ç-×I•U–<óœNõ%uÈ`V纊#«‡‚̺:™:==}ŠP>WöœÈ\£dgg‹ikk§:99 Ó® (((ïÝ»wݹFªÔ11±ìgÏžUNb"cš(Y\_qqqqÚÿþWÕˆZ°`¼xñ‚µÇCÙÕ+PéãËuGâ’ÖP›ð÷÷/床×Uife ©T®˜óDúû>ìõãÆ?^\‡YŽƒ,&¼GJòp)Xp°†²ÆGª®´´ôw99¹<Ëuîd ÒuÒj úsTY¶lÙfOOÏåÌçNí\éÉõâ°z¥ËÇcŠ?ªœ¯®¬q]ãLÈ_)° G`³²†g縮â+V¬ð8pàD//¯Z#ÕggeeõàÊèÁƒñQQÑ_®®®…‚‚‚ùk×®•ÄËúQ¥¹_Wùùóg[ÆïjÓìDÉâ8Ú¶mKÃӓ̰±±OŸ>q¯’R£ÒGŽá^%«W¯^´Ý»w×›]/㺊×Uéj¾Z®P²°ìÞ´iÓÊ÷ïßë|vµV%«úhWPÜÃÃcEBBB7##£(þz”¬ÙVÆœY„ÝTàØn¡¡¡¦Õ”¬Z¤˜ '/GrÅ«Wº>%ë{QÕ2®kœò$—#%˳>% }© ®«8ÖÑûõëgîççWëPÝ´iÓ¾üøñC+; øøø~ø¿°°pO.êE V®\IA½¦BJJJ9sÚa²±(**j·sçN§íÛ·/A‡ººº ¥¥…;¤&•ûöí[‘‡¾l¾¸¸8kñâÅÞŽŽŽ[ùøøŠ[ž…ˆ+=lذWòòòRˆU®ihh@PPGŸ‡§¦p²²¢/Ó QQQÌyöìÙƒã¶ÆEGGdÄñhñDG¦ñ™7oޘ̘1ƒ~ìUá&É-˜;w.þ×ÿîÝ»tî?{ö,HII­]³fÍúGôþýûgûúúŠ<pâF0ÔOf˜˜˜àîÈpŸ?þ«—/_ª´¢‹‰‰ÑÂÂÂê|QºæçàzCzÃTKk(bDŽ*Í‘ºÀØf!Ø[Œ‡Í+­ø÷•„Á÷¶µaº ®5 ‡÷GçÆ@Ï!ÁÃ"ܼŽ]}WoÞÄVå³f8,#u˜1Å~òÉBä•`xùì.ý¢*tì®mj‰z¶k×®^ŠŠŠEÉÉÉü\Ot¨¹>X:À4Ãrº\aèÐ'¦yDàðN/ر Â#ô<8.ž _y§?ÖÖl Ë=_],Qù%AŠ’H 3| ‰È3ÆÔ"O•¯ç²Zâ6ž²èÁ£ËEºŠJ¹¯i/•úuð?[§#¢§#û½]]×Sñ”sÅË––WIPi°dòHHë¨'vTäÌEİêÍe¿vìÑ bïýjð#7ÖÖÖüŒÏÕDÿúõ«4^N˜‘‘qº[·šÞ˃÷©2퀗¨ãá¿“ç‘x1D×.–kÿ…AWy10;|O\*·˜Ê~SÝÁ}?èÜü_•²†Ž™ WÌùmj1å¯4»0* ]|¯¥Ã°›Ô§ú¸à+$VÐÿ€Ó‘âext¢  @PNN.ûôéÓx¡SÅ ‹Ö xÚÔ8àøÿj5íPa ‘#Œk­Cõü2}qè!ƒ:¯£úý255-x÷î]7QQÑŸÍA—?¢2 deeUúÌ?~üX qWdµµ°±±±üEܸq#dRC‡ªh¥ÿ–qDçL5µ'HìÔº;w=zt:&2j ‘Á$¢¢¢’ݵkW1qqq–ꛟŸŸ‰85©zqqqéOŸ>•7nÜe$›ƒ*¶¨^W°~ýú?úþ\7~1qâÄ0œXÉÛ¦M›ÜW¯^õêØ±cRõkúúúÀ­h±óDxG¼&ºS§NŸšÛŸ½¨³«ÜESS3A“½!!!‘É|üèÑ#ÄÄÄÎx‘!z3àæÍ›#pTIIÉ æó˜Ûüø!EˆÞ @ÚÆÍ–BÜN¦¢üÛDß½{·ç²eË\©x*+$$$`÷è’uëÖ¹»¹¹m$Do" Ú#ã'åäÉ“ôcLè:Æéñ»l@í|°dÉ÷QVFFæ!:––¦:u g~~~8õWZTT•˜™™Ñ Î*><‰„Ù‹×ÃRŸ˜Ð_¦òü¦M›([¶l)qrrâǪf«!:#fíÐ.£î››ÊKkÀø)ψ àØA¶HTŸÞ±®ÜŠ•~Cé1„°˜9‚÷ _ëRsD@KK‹G^^þ×ׯ_Û´:Núpc˜¢·LqSnº‘Ç'›K IÑÇŽ9²Š8Àq×l…Poz,|ÿˆyB¹œàõcéÒ¥9­Z¼¨wbzr²’h§µ]OJJª)nÌ-~WZ¬<*Žß$ËÇš³Tjjª@«"z]kx낱±1ÞmmUqÍ,0½y“zi…ýTú¹r‚ãÀ•ùò‹òñx:PyxA€ÿ÷ô~llì Ò‘ÖƒU«V­SWW7Ù¶m[_Æ9TëŠ3«”Ê-¡kþƒÊ&C ÑžÒÃ#‡{öì¡/Í/n„Ëezzús^^ÞÕˆàÿã¦wãj=ÕzyyQ6oÞLÁFNß­[¥:uêT¯¨*))ù4eÊ1Ô/tlÛ¶í/n|¯1 €;|ÿþå=Ÿp$R2 @@ˆÎ ¤¤¤h#1ŠúYì+++KwŒ‰‰²²²ÔãÇO8p`4!z1cÆŒ8 ~Œ]¨==k®à®Š¥€ÔÖ(¼D^^,^¼øsL)Bt€¸ÖO@@`1ÿž ÓãaUì1tûó¢7{{û[–––:ìÞWÛœ«««¾””TF«%:cù§­­íþÝ»wÏcì‹[=›ªªªNö‡ûà±ç,,™c 3ìW öƒÀc!Ц0¦Îš9yؼï ì.K¿©¾¸Ó§OK´zNß¿¿-Nµpø^Dðd,¿ñZ܇1AÎÛ .a«·è3Œ§Ñïs.Ó‡"FŽÅò/X¾|¹'^;Ì|îÊ•+æµf®ð<dŠ *# `ÅoìØ±!Hí vž¦ËNÉõÀ=}úô-áôðàÁ ÒZhUÓxäj ®ý>®{.''ç úÆ„è,àðáÃ$ÛŸíܹSµ±e C*ýû÷ï=‰LgÏž=£[D/^Ô_¹råy__ß'»ƒƒƒŸ‹ˆˆ\Þºu«3"8‘é…¾¾þE”xXÉ[×F„è„èDaa¡ ÒåO#¢­¦¦òòòô/$† {÷îqG5ëÚµë{Bô&Éæ3_¿~5?~<ýÅÔ1Ó?999%ú‡@}ÀsFŸ@ˆÎ">|8#>>>PS“ýÅ¢¢¢xŵ*ðb[¶l9 ¥¥5»G,ßóäÖyX¼Î§òØx–8N7¤xIHHdµú¯ÚÌf ñ0›¯ó'v®ÃWªFØ1ªDÁiºk"Öê9‡i­-T+’ÛAô ï×ÆÎ€—¡¥=1àdW¾3<&8‘éÕ€WëY3‡Êüø±6#¸i°0à5qwž4DFœ$Ú ¬ x©««ßÅC»kìŒX.÷Å声pó!@&ývaPyø@€Ÿûâ¼!œÞ°ùO™6mË^½ÇM‡H”êÀg‘Å„è,à¿ÿþ£ôîÝûE@@@£ÃJ-\¸ðýóçÏ»™Î^¼xAtòäI3Düãîîî Ž¿Ü½{÷Åýû÷?ž?Þü·Lç–¸Œµ¡´´T5[ Táö¨™k½zõªß—/_$³³³ùÎSVVFááá¡ ”â “Èÿ†8ò>J/‘,N5jÔinY}Á•)²ØfíØ±cÑ… ԰󎶶6=Â]›6mè[FãT0×áÀf¢(U†Qº|ù2 Nƒ¨¨(Ìu```p~Ñ¢Eþ#FŒ¸Ü*‰^\\,áààp288XÇEÔÓÓDzâð 6L˜BMá``†x{¨}ûöá ·ûüýýç×á ðïuJ8Öád‚……=ýià²8!ØÚ¹¸¸àñ¤¥ýSDG†ÇVdù9á˜èáááÜ"Õu«XTvDCCãj}³f̘Ø¢‰Ž:C1<Èsúôih(rþ߆vþ<$&&¶733S°¹:áf%ú§OŸFX[[GrgW±JKK )o|¼¿É€Wdó—nß¾½KsÄi6¢çäätsttŒDú,×rvˆÿ:H®¶ãj\[ºt)^øûÁ××WŒÓ¡›è:txWÛmi/ï€ßáóà8Ûì]!§P\Ü·‚Îoï†#>p8ô<ý·‰õBX4s2ý7cˆu‚n_Xíy ÒôŽ ‚Pˆ®f:ÀëIUò¯p²ëYóág^ÌpX 6“táÒ©]pâbðJ|×w7ÀÛ»f¤kÔ±BÏž=³RSS©\OôØØX˺Öóó”ЇI§¾I‚ÇÎÀ½ˆ زÖ”N^iXliOÒJàhÈ üJ…isBf!?¬;ŠrÑï}ólìÊÝ=¬áJ\2? â¼¹`bf Ñ_Ã1ÿ•ù­àôÉPˆ¹y6oÛã FCÿ!z»N²šL5Ô®ó]Ž;F¹~ýúh„ë\Mô•+W®]¾|y½y®… [4&ÓáСÿ·Ï8¼ÙlWnšˆt‘@ÉÒ@N„œ «‘*+Ž îw,”ä±W•$\<¹ôͰ®ÿ{^"òry(Æq­ÑáÖƒO`>¼ Ý’’ꪪu©P(<ããã„q5Ñß¿/ÓPæ‹á p!îYù(ªìÞé›nEAÚ9äë¨týoèn­Î`x&Qê¹ý™ËÖû|üøQ‰ëÅËøñãñêÚ…,߀éSœGÿ‰­G%ؿ紓h ‡|áDDýaXuFŒ¨òGŒIÎ) 6ì×}ëÖ­K8°ÕMDÞ¾HI•1èW9áÏ…ü¶MÞļò­,jCyyÕ!£@A¨yâaþúõëõ¡C‡fq=ÑñÎ*/ýýýë–ë÷„Áš¹V˜ ïòœíqèíò˜ ?gƒz{1ˆ» qßñÌKÝ6 åS'[BdDpù0ƒ¯<Wç’ufàR_'¾ÄÒ¾Î<óæÍk›’’’Ñ"TÆçÏŸ÷F–h 2±kwæÿŽDÉ6úoEå0¾oy70uD?X2­<,·œR?¸Žˆ9ÚÀ‚.vB¶»Ô(çxD$XšT‰Ÿ~öR¹¢Q%V:³QTO}ÞÒi°Ú÷?tox­ v©ˆàZ”EŠLi^IIÉ_gΜ©~m™÷AXVË=sÖú¢Tõ\ÕÍâ jÜsâlD­Ï¯+½zYÚfC$JÕ¬Ò"d‘æfdd´o‘c/¨âm]\\¶äåå9O™2¸QQQ1‰‰‰OQ½ç´èQÆ-[¶`¹à¢®®þx r;ìÓGå6b?xðàêüùÞ¾};áˆÔ¢‰ÎÀãÇéÓ?| úÏŸ?ß~Æ Œ=‚ëÊÖïÍ›7† çÎÓèß¿!z#c–#öC„l0¯€€ö'Ç^Ã-Zu÷î]mBt6¡§§÷qÉ’%01Ù´´4lܸqh—.]> t!DgH”ìž;w.ÛgÆÁƒ;ãèÐ oBôúA9yòä\WWצB¡€‚‚œ¢¢"~~þ"Bôz0mÚ´GìÜÆÜ’¾ýªá};|øp¼Cï+$ç»¶¢Ïÿ!ÍØ}‘U<þ¼«y³Ó^ƒ±å<èÞ«'À·×µæ3fŒb«/±iqšÆGÆFðPùJ| ýÍëoWï²é²²2GGÇÊ㆖@ÆœƒGBA6;ÌyÔZ¦……_ll¬&Bl«/¥eż‹Ãíwá„?€Ÿá.ûþsjìcpöìYûÎ;W7´RwN¹Óç÷gõ?ÇiuD¯þ…ÛîÆ‰‡Ê_ì7!ÀÁ¾ßœ½ø’½âRR5ç%êZÉ*>|8€t¤tí‚§lÓX¯å ‚Wˆ—ZóÖµ’U”””ð¶Z¢S(Ô²M㶺: ZR«ƒP‡~4\T.d8ðY«":&ôƱÞËœ;mi(¯™™Ùþ‹/ú‹‰‰Õ™ç÷HÖaddÞjˆ®ßyÌÅ‚µ¬;zb#fÿþýàìì\å|íK  óóéK ŠËmFðIÆf ÷ïßOX¶lÙ"ÓëAFFÆôo`•QÇÈÆ”ÏÀ |5³‘äáá!‹ˆN†êCTTÔ`D¤2}}ýÊsu-<ÑÀ"ݬ¬¬WOž<OÆ^3¡!ba'Q»¦–µjÕª2dá&¢³<2ؾ}{#?·©r-£bo!Un{7®Oÿüù³¼’’ÒÇË—/wbç>*•Z8qâÄüÌÌLin|/®Ÿ9±Vð.Š¡¡¡{–/_Þ £(Ê÷Œ‡‡'Ü‘[ß©EÌ‘â=CqÚ·oŸÝâÅ‹wLš4‰wÀ€Yx†(;;;ÿéÓ§Â'NœàA×üüýýݹý}Z”7^Á¼ w¸Œàó»víj1ïAü^Ñ Ñ ѹ >>>;V¯^í€7*éÝ»7 >|øÑÑÑ8Õv__ßń肉‰ÉkQQÑ3gάÜá¥8nÚ´É100ðCBBBWBôF¢°°PAQQñs]‘U«»÷¡ÔEWW—†4«ÊÊÊo ÑÙ@QQ‘œ¶¶6ËgÞ•àèÑ£o,--{ã„è,B^^þ ŽÿÞXà­Ø5ý",,ŒBˆÎfÏžý°)g`É’%ôx68!z@DÒjÌ}µyœyyyIæä䈴J¢cj„» å;qâ„^Ïêó8ëÒ¥ ÕØØø­’èVVVÇ“““¥¤¤~ Nn:Þ!½¶|...ëÿûï?ôß lWl„`oˆ¼ÿ†3†uËÁÏs5„_¹ }4†ÁŽ­ëé÷4äq†ž;¸U‹¼ÚÇÿñ8vìØÔqãÆUn ‘‘ùvïÞ=*²(ß-X° ‹ººz½Þf¸ÓÄ2‹‡¢7ïÞ½ëŽ×/YXX?|øPq?EYY9‡G†ßÍ›7sòòòr""" P§™R[„è//oIhh¨i£ï'$ü € nœ9sÆÉÑÑ󇇇ïF‰:Rö w´%«V­Z¿bÅŠ „èÂòåË#Ö¢¿zõjìÏRM×/[¶lý¥K—ž>~üX½‘ÀÑ9ÄÅÅ ÂÃÃaܸq æ×ÓÓ鯶¶6-((¨+³'Dg4¿S§Nt‚³‹7ÂþýûßÛØØôêÙ³çkBt!&&VØ‚3€[K¯Îž=K<¼XÁæÍ›‡……5¹8¨]»v?ÒÓÓ¥ÑÀ©S§, ÄÖ=Öæ&ü-«â¨-\½yŽ¾Ñ¸ŸŸŸdff¦D«$zbbbg%%¥Î{êóðzŽë÷€«Ç>Ðܽʵäää\ÞÖLh¼µ2žª'ŽœÊV$¬¤Gt‚ï?qºÉ‰Ô¸~ëÖ-j«$ú£G4XɇČ úw˜²MlœÁ`ÖZh/ÆSéÝ…ÁððºsçŽ/õÀÊÊꈵµ5è¬zxaDrG©jYØÃ‹J¥¦‡‡‡O$Do999ÿC3f>WŸ‡Wd=^Ó¦M+JJJŠ&DogΜ1éÙ³'mÏž=M*çãÇq·oßžÌÐ~@TTT;''§ô3f4êþ’’’„‹èþ„è,¯Gòððh?uêÔ”µkײe|úô)þíÛ·Q§¼ŠYÏ'` ©H^SÛ·oÿÙÝÝ]Y­õuš¨οqㆩÍæk„èlâóçÏísssÛàUy™™™LLL ̧ ” Ã'ÉmêÍ›7…Ïž=k‚äøíÚÊàE¦4¡d@ÄUމ‰ŽÄ„JªOž<˜˜(ûíÛ7!|ˆM5J<: ¨aâ˜ÑÅšššqH*^=zô5--­{„ÑÿA ž‹'>>Þ4((hzpp°Ò-xFŒA?¤¢¢x”Ý™P®ý¨¨ÇÀ§ &0NóAypôH X#Ô#ëP—×ûe"eø?dEF=CaôÔýw8xðàò-[¶Ø"¦æ355]]]066¦§ÖÜSáTabK ä€Ô"ì+ŠU¦TWWW/;;»½H.$ŒÎE@]´ù‚ ü‘þÜnÞ¼y ­­ GŽ! *=Ž5†6ÀQÚ°Ç0FvHÌž={ì™'í £ÿA ݳïôéÓÃ^¼x¡„¥öÕ$àú÷ïÀ?µ¾gmmÞÀ®Bx 0z3#99yبQ£®!£‘ßÅÅ…pd#ðúò^˜·9ô¬\ÁÍV¿Áüòòò°sçNüsÔòåËÓ/_¾œ|ëÖ-¼yatΕÔ9sæ<|úô©ÆÞ½{ñ€uãË*+ƒ’²RTð°QNIQ”R(À‹ïãaóùè™…Å¥À'ÀT¨}h·ŒV ¥%e@åa¯^¿i„Þ«¤(¨~¼uÖ§Ï•ïn†L¶Ÿaee…“¢½½ýQQÑÓØŽ0:瘜wÈ!_´´´Ú±ãºüýÙÕÊØˆöKà„ïN¨kÙÂq=Ø«r.õÅMpXêõl .­Ô üüAF˜ZësÝ7-ƒµ+7W^S×·?×ò=³Š~}¥KáEBjå·ëÔ||·AGIÁZË_æå G=]ásVí÷ëLu÷9åšíß²ŽG<®¼ñß&zÂð=q úɱ¾s=’ì”Û·o›àÝ/zFçþ½é…íš2޽1¹³ß1¯®Påü¥£àuè*o_¹¹ëaéÔrfÏ~ S–»œkØ·‹e5ñžvffðîã+°ž½Îo¾Z&á0“Û¯Ú£{Um„/#ÀlAy£UÕ™ÛÜgAõ,Ox¹Á¾KÁf²>, 8ãT$j”¿Ùm¬ØyƨVÝ÷ìÌŽÕ°óì]¸}l+\ÒzjÒ`ëâ¶KÓ`º®%`'M}«eàj;®Ñ4ÕÑÑáùðáC÷Å‹oCXL½‰8~ü¸¥]ÓvÔ³Z]ƒÉéç§»ÂÝÈhˆJÌ…sáçÀašaź„ÈÈzâ‰òŠƒÆ`Ux…iŸ I}™Z4±Ëk09RR`O@Å®LrƒÀoýlà©¥‘Xºm‚§/ à~r18ã|kä1·®“c ©Cgôr»æ€Zóì'§§§W€Ý‚0: ..ž–››+Ñ”2Ô4ûÔI aþ µ#ë;ü*¤‹Ö"8á·ö…?hRÝÛÉ·¯Eû )‰¹å¿ÓîØ#,'õãW(Dö@µÁ/(Ì‚}Ð|ߦ  à‡ˆˆH)Q]8÷eË–ãññFÖ|þ Яv©Æ+Œ£ºþhÓ„yéÖ*lZ`×^f£IØyü¨Ê×tîß¿e)Òy1¼LÉvHü#I-¢¤a‡×•ß#.ôOB½m““ÓÂèÒÍC;,]ºt«¯¯o£ÊøßÑ@˜:Þ„)U™åÇ›ëp1>­¢»‚˜™(ð=-›~N¡ÿàZ™<*|“SñjQ¶È?i’)Üß~r>Þ†}gc`®±fÍlÅÙ°y­'ˆõTƒ1ºã ›‚$‡)ËÓè;)J RW^©ªª^›7oÞnÂè’>ººº×tßÓÓSû©°y‘o0~ÔPè¦C5U€§¬¢nGBrZ&ýºbCXåPzŽ& F–àIÀ9H»#Ç?ñÃAˆ§ Þ>¾OÞ§¨¼2x8O‡[ñ2ÝÏà´ÀFP}‹™,WËØ`Þ­ËÏꬢ ³U4ë&¤ ×Õ«vR z÷cùT>APí?„žXúxB —ßPžŽ=ûà ”Bqqñ‡Ý»wçÆÇÇ·E|NJJÊÖÄ+ÿ„SŽ?öôéÓ¾ø÷“'OÔ-Z´ãýû÷Úx_ÖQ£FQ€}͆‡'Ñ2aïÞ½ÂèwŽ¿¿ÿÂ3gÎÜm©ïóϹébµæÖ­[ÃË'h”sçÎM8µT\\|ÈÈ‘#©=$ó1ãS+WÇÉÉÉyA o+''÷ÛBóçÏY¸paÙ¿ð‚ÿô …B322 ljq®°°P ,,l"ö¾»råÊ8EEEìVÀ3`ÀJ÷îÝÿizP©Ô¢/_¾$=xð@ðÞ½{yÏž=kŒúÛ8ÖÊäÉ“Oæb—Ü­n)^D€õyœª_{óæM7nŒŠŠŠzçÎaÈÐ’íÒ¥K‘²²r›®]»æuîÜ:uêÔFXX˜ëz„²²²Ì¤¤¤ì„„AôŸ‚Þ%÷Õ«WÒmÛ¶ý…r4fèŠôÄÜܼÕuYdE:zôèñ§úƃKKKyð¾#oß¾UþôéS'¼BµÃ[ß}ýúUoaZPP ˆ ãÄdEBBB¥‹£iüüüTœøøø( áÅéˆIËÐÿ2¼Ø}eùùùeyyy”ÜÜ\¤Rþúõ« n ’’’²²²_Q/”ŒÃGvèÐ!¥cÇŽI¨!¾ÅõÆûž¯HSFZ)6~¸ Ü£à†‚Ôˆ„ª„ÑÿI`û€á¿íçç·ÁP…0ú?¬ÖÌž=û ãØÙÙyë¤I“Î Ýÿ¡aô˜É‘Þ-ÂdDRqØö˜˜-BÂèÿpÈ´ãÇ[U?«¹uëVg,Ý •£·hóÍœ93°®ënnn^X²·„…Æ„Ñ ê„½½ýÞììì:N° ƒ'mXßN@ëpþüyÃÀÀÀ™ åÃÛ+†0z‹ÞÐÞÆÆ†åpaX…1119‹·³"Ô#ŒÞrÌË[‚gKk»V13JÌ£F' ŒN@@€0:atÂèõ¡´´TøÕ«W#_¾|©œ––&”——G§½§§çAAÁbiiéŸ=zôxª®®~Ÿ,  ŒÎõÀñÛ=zd±eË–eçÏŸïÓ³gOÀ›‚á¸3ŠŠŠx·z¨ØhÚqonn.žE…øøxúÎrwïÞ-0`ÀWWWo==½B]Âèeee‡Úéââ2G[[›bkk x%œØ…„„ÑAOP¾½âpÔ wpp€   RTæÖM›6­Ä+å £ÿüüùSyÊ”)W>þÜ 1vÃm–çàÍw'OžŒjTnfffnÏŸ?{éÒ%½Î;'’/A½¹ÔþY³fÝ‹‰‰ÁNXô¡ÿðV6Xº#(/[¶ìÃû÷ï!GÕ¡€|ÂèCRRÒp55µÈµk×Rlllþj]°j”­tÿ¼£G =þùB„Ñ›ŒÇ›6,1Þ” ÙžS”›? Ð@V±+ˆ ÕÖYLL N:Eqtt¼ðñãÇsçÎÝC¾aôF###CšÁÈèl&/͇3‡·ÂÎÿnT9íæ{’ý·!lß¾:sæÌí8΋¡ùýbâUýÉGLJTzϬ·å “^Ægå„eÒ8ùŒiÓ¦ž3gNåÐ Kº<‹Û;^>°6»ŒÇ\ÀÎyŒí˜¦»Í±ƒ7ò zþ—žžÞéòe„½ÿA‰^ZVÌýáæ0œŸ³¯ ÈCå+¬4,ÊTÕÏÈ×!ŒÎQ å?}ú´ÞÛt̘17¦˜N–ºpáý¿ P³??99ùñÒ¥K½¼¼veff"_„0z³¢oß¾O¿~ýÚû–àÐ/_¾z÷îÍñ0syyyïvíÚUôæÍààà9ß¿D¾aô? ¤·§ã{ñogGÄÝ»wï\eeå¶cÇŽ-2d?;‹3¨Tj.j4)7oÞ„K—.Éa?ó•+Wn:þ£éb¦'"ŒN@@€€0:×£  @æÑ£Gc^¿~ÝÙ1ØnÉÏÏæããËAvË/qqñ|%%¥¤Aƒ]Cê_:at®Fã¹wïžµ··÷²+W®(ã¨eLJþýûcÿyèÚµ+=Õ…¸¸8xþü9ÄÄÄàE0Øæyëêêê5}úô ¼£at‚¿½ìàÁƒ»œgá¨c³f͂ŋÓ»ÀNtýúõ£';;;|J¥ƒpT³à}ûöÙµmÛöat‚?‚_¿~u733»šœœL^ÖlÏÒÑÑ¡'‹+VXœîÖ­[RWBrrräêÒË-¯ªÂä j¡úŸ‚’º¾e&Ç  w„! páQ*ærôP=K £ÿeÐh4ÊŸzÖÑ“““YÉ‹ 8 ‹`,Íûõë_ýúáÇß¿¿Ö{©”úÙJ^âÏz&ÿüù³ˆ0z+Þ 3ôäÉ“Okhh°¼<²¡ .ôk ïøìÙ3!Âè­K–,ñÓÖÖ¾‹tÖ˜¦–¥  ¢««{!,,lüĉ¹Y5Ì !ŒÞÚ“åNïС÷#F451’Ù¶mÛÒV¯^}˜0:A£!!!‘©­¯¯ÿè¡=àï€$hÈ´ïR33O;X»+Šé-ÚN¾Öò,ºƒA^QÕhdMˆdü\TT4ÎÍÍÍ‹0:A“0`À€÷îÝë¡©©ùl÷îÝüíÛךºõR©·¬öJÝ ÆÝˆdF¥R <==?¨¨¨\Ù³gSùÓ šeeå·YYYB8,ß—¿V—”””ÇJ7nܘÆÝ+6þýc Žl8zÙþšý ¡¨¨˜üöí[å‚‚Alüž>}Ú~Á‚xéÇç rssß”&$$ð…„„Ìúþý{<Ô©84ð–íHgŸ‡Saa¡^ê†#˜¡órãÆ£èèèð¶k׎æÏzòäÉwdü–!µD»$,_¾Ü3""â5+7F'hv"5f'NŒsEEEüÑÑÑC?~¬þúõëžïß¿ïŠÝ p£À žñúOdØ~îի׫ž={¾ÆÑËFŒ‘êèèØ¨:F'ø+àçç/BŒ{§?ñ<Âè­„Ñ £43(ß¾}냌Ì)))’?þäCº;U"£µDFF&SYYù±ªªê£¦¬„"ŒNðÇðùóç¡Û¶ms ߦMêèÑ£ñF €˜˜ ¨sçεޗ™™ áááôh]=‚»wïÒúôéóÀÕÕÕ{âĉg £üuܺukÁÌ™3}%$$øñäÑøñãé‰] û7 œƒã!ÉA4팛›ìß¿¿ÌÔÔôàöíÛñ–;„Ñ þJKKÛ:;;Ÿ?vì˜ÞmûСæÙb‰B¡€¾¾>Nx!©-jH¶i(é«««?&ŒNÐlرclj 6Xìܹþ´ú´iÓp’CªQüÿþ÷¿¤ØØXM©‹€£(,,”GR4©§Nú«u111CCÃŽC† ùêää4îܹ{£4YYY=»víúbýúõT 9A+)„c æé(¥aG2謬ýÔÕ@¼ÍïðظEº;ÅËË+ !!¡v= ŒNÐhàÐÐñ...ÍÊä÷. ï ÊcIé. Ò£=¤'¿‚£AG*Ïk[9Á[ÃÊc rÕªUKüýý?FoEÀ‹Ÿ333%p¸ ¼ºŸÅеaÍš5{UUU TOchZ¤®‡gvŠgè¿'Í] æ#jä‰<µ Öï ƒ»Ç}àhç0]·;s©ÆÆÆ>„Ñ[;oÞ¼yNÌçá-p¤.V’æ‚Û¶m³>|ø0ý¸¹"u ˜ä‘(†‡Zj­‹ºš:ú[‡ýç÷ŸU®á€£¨aS £Ð÷<õððXóyFÀ"Ü0Û]¿~ݻ٢T£,NGꢣ&ÏO œÜé¿ÅÃ,Kyø“0ú_·GêÂÆÜ¦M›Vâ„Û´i“;~üø JJJ¿þf¤®‚¬TpvuïRéǦóÖ³µæ•‘‘á!Œþñ'£t1tô¸¸¸þ¬äÅ m``%ù„ ÎUŸu<¸®k¼á]ë€.ÁÆ`h½÷äæææFoåÎc0´‘‘Qx}ÓèÌ3f̉?,..¦àá¼æÆ»¨ppXåXÖ‹Èt†í[| oG –î}òä‰aôVCCÃóÎÎÎ['Nœ†¼)eá¥r–––GCCC­Ñÿæ«tY>¬œc щéÈP•¿}{@½ƒ8;ªaIHHH aôVww÷µœ,/ `ž¬¬¬ù¨Q£¨ÍTgßåsÊ™œny~…%ÓMêÍ/­f'·ý·qâĉO¨_%ŒNÐ$µ'::z€¶¶öãÿ÷Rš#R—ùÜu gSÌrø„Ä*ß¾}ûųgϲ£¢¢æF'húôéó4>>¾[¿~ý^úûû (*Ö•ºq‘ºÚwîíaç#uåQ*bò‰åO' h"ðdS¤®±ÈøkuÉËË{ckk+¶mÛ6ï)S¦œúÝÌ8<pùòåqIII‡~kРAJöööìù¹¹¹¯ÝÜÜø‡ ùùóçy5ûïªÝ rrrDæÍ›·;22rÚâÅ‹iššš”fh\©HEÁ©Ëž={Ö<þ¼NaÂèÍ‘œ£GNG?§ÿúõ«­¯¯ïR¤Ã/TRR’7n\)2`ùÙaêÒ?~¼¿víïùóç’׬Y³~×®](5xÿÿB¯cÒ)L^IEND®B`‚maven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/root-with-parent.png0000664000175000017500000002365212561645371027677 0ustar ebourgebourg‰PNG  IHDR“yJ=#g pHYsëìÕ~»'\IDATxÚí] \ÌÛ?3M«H«dhS$²ä©$’$•’B$ï‘%’GY"»PÙõÊ’)¤ž=žåÿHŠð¬E²T*íÍÿžß4i›šiS™ïçsç·Ý¹¿û;¿sÏ=çþÎ=—Ád2¼xñb„‰‰É²•=zôíÈÈÈ_«æaÔVÀ† ˜ÚÚÚåǾ¾¾ìÝW¯^-¯…ÝÛ7oÞtçXfÆ‚F1110ÃáíØ¶nÝ öŽ Aºƒ¼ÿœ ©/ñz·èèh&£®ÇÂîGùÿÝ ¯¯ˬFƒ¬_¿B½W€å‚D*Ÿ˜˜çÇÌÎÎ6iß¾ýÜ8~VyÁlº•Cmõôôh ›0aB$ÙÐBCC-åääBjÊ“žžþÒÒÒò®^‚d%›PöñðáÃÿ%^S^ðˆÛ·oãtçÂ_Ò­°ÚÀSalF=yò$øøøÐê]XEŽŸÉ ;ÔÉ—.]☇R?ƤÑhLNb†Ñâd×M›6íþìÙ³5Ø/¢^‘^¸¼¶¼âZ>¡lúMyBt¤Õ™ñöööØSH¾:E]Ÿ9sf‘¿¿¿`)Ê«=ÁBØÇºf áZxyó‚{÷î¥rU£„¹ *™sØýÌ5N¦ß¯'$ô¬±7-¶ á éD³¢¢¢zÕ[q‚‚‚B‘S YYYžÿ»mÛ6˜?þ„qãÆmOª««ç’îN¬‚Ô©÷-]ºòòò" GQÇÅÅÅ('h%¢³ç©Rì QæGl,ÕªŠ³’Y-+þ)uÌ–M®Ë7AÄwr<ž:6"ç£Év«×V>¢7Å\ " —|¥{$%%k°H`H(Qêïêužp~¤nùy#c3j+Þ¹+%¿–¸¹QÇC´ j-4€ž*EH ãÇ—ÛnPJ£Ûœ©°a Ò„«—óþ)%P‘‚ÕF˜¬2èÄ’«««O•Úºu+mÑ¢ELSS–ñ‡…±*„jíÉJj°ƒI¿JÇœÎW¬3‰pÍâùõíܹ“FßÍÉÆj}äAÿ{ðàAŸÉ)33³p¶×¹sç÷ÄÚ•îÝ»· /eö)g•­­íQR¡ÆíûÞ¿ß¹£¢ç­[·´###'èêê^ëÛ·ï3ÂO—« R5¯æI$þ+L666AAAÖ-NNIIéJÒ"*uæÌÜvëÖím‹1±&NœxºÅ 5¯~‹_)^`aaÁœ7o^U£â ÑF7{¥ ;IžVµBwwwýiÓ¦1‰!JkÖJa…j»>{öl4Û‰‘üH­Q+•Q)))Ü1£êyb†{ôéÓ§Z~¸÷ü]¹ªâëëÛ¯Ñ)%¿Qò {?}EVG ¡Y¸OL-÷={öPÊÜ,'W8ê³Σú{0XŸš‰Ñå6HdÆ/HVQ–R|¢®®^~~šÙ8*})¥Ù<­/Îé±Z?iåÄ*}])1.éå'J2AR cóˆNƒyyyìÏÔì×ŶnØçð877÷Y³¶¾µk×VÒ¿«î—UN£Y+E*@›2e ³ÝÊ–hœßš]¢‡„„ÐÒÓÓåŒß8;;¤¦¦f‘–)@¶]¸æ©Æ j@o ãã㳄XK‹i4š°hiiŠŠJƒÊ}úô)~L„‹/BQQQÆâÅ‹·.\¸p+ƒÁ(nÑJ!ˆìÈ‘#ËLš˜{•® 4Ž=Ú¨÷STT¤ÒÔ©Ô§$Inܸ±¡bž}ûöÁË—/ï‘^rŽñý0Bmܸ1<99yÒŒ3¨ãÍe?-sçÎÅÍàëׯS\†^Eòòòn+W®ôlBijj¢,è0|øptk‰ny7Sè1E°žtO뜜%$$¨7¡$$$˜§OŸæX9ª7ã´ûµ²=Jr`”Á0>­ÆÃ¦óáÚýÿÊÿ+Ó¡ iZCÁXW“œÊÚÁwÝðßô'^Œ…‹W¯¢.¿× §?ÁDGfXL¯‚ æB0$%Ü ®=NJ‚î}U¡] Ã3DnªuéÒ¥°ÉåééYëuë%»aš1ë»òù2E‚R½Ä!€è†ÞÔˆ#ø “¥KÑ@NÕñüæ°ŒYº«‹!„HÓ>ÁêU«ÈAc¾bNl¥òL]ì ÓËÆéQþ›,¥ªÊR’UTUk­«··wV“ÊÃÃãshh¨4§ëï^âwÕrU’´D?]pïßlʉµ©0sæLá&#Ñ[dÂÂÂ̳²²NôîÝ»ÚõaÃÕ+Yøý uÙ¡gIÓ3&×þfõHÇNCïÎ0å7=ð :Ç5)ýN)§µAçê©JecëW|ÿ¸Y1?“Yô½eƒ÷ø_k'o˜c¦^©Ž„›“Þ¾}»‡lw7©0777#ÑÛE‰:.H§—Ùª QÖùvÕÎ:~Š£Z g 1z¦œ´àÊ–Wô©1âx¨Ùù¤—îKälV³ª¢¢¢y™™™Bìc¢ÂAââÙ³Eˆ¶,ü#{=Ò³½$=³ ~Ÿ"úÝu<—––Ö2F¥ˆbù?B¸íS¢ÃL&J§í¹sç ÕÔÔòH^QUUÕÒ|;Š‹‹Ó¹²H ¾>þ<+11QòþýûŸI’ǃ¾FÄÆªä £økÖ¬i}ÃwD‡9‰‰›¼íÚµËE(Ò}§V½6vìØ¶?ÎÉ ó¾}û&†_02$Þæ UÖQ°zÐaÃn×6oã§%”””Ô—ŠÇèL‡Ó’Þð õ½;U\\Ìhß¾}vÅó8öÍöD䊥Æ4%AÚœŒâŠO¨ÆŸŸŸ‡««ë ¹$&ü÷ß8BY¸nݺ•‹-ÚöS ¿¬*((¤›:F›½_h"m%& 5¶‚_boܸ!%))™Ñæ E¸†‰Dá@˜Z±{÷nˆÿ²lÙ2fll,½ÍŠ(”L^ô">f-òçí!0AS®üü–-[h7n,^¾|¹ NÎkÑ„b;ªQî˜Y uGa‰Ì:Ê’ðððòcôhup]'½WÂ…kwAuàʳ• «™s!ØÙóBjå >\@VV6÷Ó§Ob­‚£.&Gë´±ºïÂ8å ÑG ;µÿZfÑWj*èeûrÕ6óÝBM¦BoÛŠXDªÎÎÎÙ­®é)É«?± 5W‘RNªézJJuO=Ë)Vß+-¡DmÑ ¸“ w­éÇB-žPœ<8ÁÈÈÛ•[Ås{WÙƒùÕ«”óî Gê‹HLÈË+ŸÃy…yè t }ÿ¬r÷îÝÇmN˜¯Y³Æ]UUÕ|Ïž=Êìs8ã‡íáÌö”f†#¨l;°ÆòLMM³233µÛd¯—””¤’œœ¬tüøñ'x\Tþ*###‰èa„H!mZRRRJ^»v-mõêÕtiié ­½{;ÈËË×ú&“™jaa!‚#ŸU‡cD¨–âÍRJJJDIs²zôèQ—„„-ÂeqÎQVV–`AA@ii)˜0Laaá’öíÛçwîÜ9]MMí6i¶IêêêÏõõõOÒéôÒ6ÃMÄì°÷öö^5}~ýõWÊW¡]»v ¡¡A¥Z Pf¾àÐK¹äùóç1Z š1Tš0aÂ'''_]]Ý‹­‚HEEE’¤Â!ÁÁÁcЋdܸq°`Á*5P¸£žUᣨ i9&nnn”‹¥¥å~__ß?êâ¶f'Ò±cÇÖþñÇ«6lØVVVTjn c&G???G ½ªÝÔ©SþP"9rd±±–ìÝ»ÝN[ŒÜëÛ·/œ:E}y>¢©©ydÑ¢E3ììì7+‘ˆð•””ÌDG,$PK†——Ö7@BBâQDØs“éõë×zä­Ä´$Ω¤2”C1!ƒ ã;pÀïôéÓB&&&¥D^õìÑ£Çë&#RNNNŸ… ư}”["B|×À±‘°Ì¡ú—ã%K–ÑÑ^ùøøth2"uíÚõYY[¯„´¤ë°#à,,œeŽ —AN0¸¬ÝF:ßgQÞ½ÂXál&Ù͇3)W@Èzq6ì‹€ ýÁ}ã¡r“$:ìxïö‡§šéóìÌ*å_±dØÙÿ_¿ §•0ÝÌÎØA߆ä+Xöì lÙRÝo}J‰ÌúÚ$DºwïžuhhhÍ MI>ÄÞ›ä7ÿF­« gè9P•†EÖÆŸV GC–ý¦ÍžB°zî(Ìͦþ{÷LŸã@•·q‰\ˆ{ þÇOBGF.L²´ƒ[±O ÐwEy~S»çp24 î^€M;=a¬ÑhÐÔ°ç(Ðã_9>KPPPÓȤ+V¬©kâü¥ÓA”8Év!üõ×)ز}lZ+=)®]å$H²6Ò€  ŠHåãU1QåG팆žÑà•‚¿C½ÁÐu­ï÷9Ïòå;ÑŽÉ®Ýy St¡4OIé ¦ÆÙåï¦!Ò‹/êŒU1üŽî ˆŠc…Õë§6öúìÏk7!íóç²9è-…ÔoØÞ Vf^±- iœGk¾fåþx³ÄÐÐ0ˆlþàúøy‰£ÊœÇˆ Õ¾ÉT<“’’*¯1ú—Ћ3¤ií¤ö»)…ñýYŸ‰lôÂâi,çSùžá2yøÑFVT3 ÙåR­œãÑ1`=ɨ’goĹËeãKE5+‘ež¾¿;Ow¯cä¿gj$*Q„ßá”ù&Õ¸¿|ù &INDDD»ª×–oñƒå5ügöj/’*Ÿ«}:‹ÒhM×"IÙ.\ø  ££³wïÞßoܸ‘ùCô$n!..žãçç7 ¿{÷N÷ñ­æææÊ 4¨Ý€rˆ¾ÅèÞ½»8—„(yÿþ}:é]i?¦Ý¾}›) P@^Âa{{û¿<==_×5K«E©*Þ¹»»¯ÃTõú~“WÅ.™UI<>wîܸ±cÇžGúŽ;f¢o8~)ÁãÆ¬W«ñŠû6xðà{˜ð' aSÅ@IM}ïVëc9sæLÿ’’æ¸W«%RHHÈÜóg!rŸHUPPPP>¥lÉ’%ÛùDªsæÌ9ÀÞoŽ&×*‰täÈ»ŠÇ;wî\D°“O¤ïZrµ ðK—.ÝÆ'Råñ=UÏ5u“kuDÂ^=»‰håíØŠ#š{ùD‚ïAçËLfsÌtâOØá‰O$>‘øDâ‰O¤ŠÌÌL[[Û“111*s£s=š‰‘¾û÷ïóøñã9ü§$RJJÊee凢œ«0Õ€qqqïfΜ‰ßÖÔúõë—øÓÉÁÁ!–HëìÙ³uæEŸoô‹zøðᣠp‘¸UÉØØø¿yóæýžlÃ-H“£"$«¨¨<&Pi³D:v옷½½=ϪtØÀ9½l“D:zô¨ÓŸþÙ 2𞸸øü’’gN=[-‘ìììîòJ éSLàMzv5ï1cÆÐQˆã’7-–H_ò3¤¤D$yšVEºôÁÜæÍJ{¦Ö¿C_Bƒô'5æ1bDïÝÜn¿¿;lÒá±Q‚"…¾÷;ÎèoP[þÒÒRáŠqxëri¾{ö4øƒNYqå1*«‚èVŒøøøñ-º¹•ä 9†O÷Ç$Ä-ð1=0w†Ú´j‹ˆˆpüå—òUËëti6˜íJåû˜Pûýƒƒƒ­Z<‘*¢°8OØ1ÌÖl·é¡9vjSàµçÏŸw”–®#”“K3·ˆÒj÷Ÿznžl•5·ÝJ8¹4sÍÉ5|@hÑDr7X¿Úíו5]ëÒ¥KÝB¾‚K3·@GŠO$7}µî:îkêÊgiiyðÒ¥KÞD¿á˜ç»K3÷˜0aBd‹%’Q¯ß¢y ¦ ""’ðàAX¼xq¥ó5»4äåQ®ÆùE¬ÙHQQS¿sçή®®QmJ™LMM½O6+žãäÒ<ÃÈ*vÅu¨•JOOO9B¤¶e–žhðêÕ«K*.ôÇÉ¥9¨§vôè¿ÿ¾q›³Ýpvõ›7o°Ç³khY...ôäääÿÚ¤‹~“:uï³rºt}˘2eÊÇ>(5´.-z<‰< L×®]ߑޮ3Ö‘©©inFF†\cÔ£ÅL¦¤¤(ìØ±cñµk×¶›®NLj¨¨¨‡™™™±„@U‡V1ÆMÔ˜pf謬¬èZZZ9²²²ôììì"˜E‚‚‚˜vvvþ[·n]ÖØ÷oÑ]Z W*ݽ{WçéÓ§ò$©=xð`è«W¯:¥§§‹0 @[SNN#R[T„q¼·bbbTB½ ׫üN­ÇAAb†Q©¤¤Ý©„ºÞ·oߨ”““ƒÞ3@˜>}úD%r_øüù3æ-%÷ËîÝ»÷ ëd›ª¬¬ülèС—;tèðµ¹éôÓŸ$/RäÞ½{fW®\m×™0­ÿþÔ:[©'"¨©©QÉÌ̬Å(L$I”éÞ+¨šTÐW¢ýÀ“'Oðά+"Rꆆ†Ñ|›ÏLõ‘Àñññæ¶ÁÁÁãˆÚ*€K3Œ1Ç 0Î<•ÚPòaÀdbbÂ>Fø€Ãˆ´ó8pàܼy£WA~~þ›£3fÌ èŸ™ª€t]ýüüþ$ºaAsss*x.ÒÎ^¨ýg{Ñ=ô ?°hñ 1†*"]kª««ë&‡D*þtÌD$Ï”yóæù¾|ùRÆÑÑtttÐä+}\BPP°bÄ2œ°íãíííƒ1°ˆnvgÿþýsˆäzØf™‰èýmmmO'&&ötwwoÒÓ~FÝ ñãîÐGÅ[[[ãg‰K!!!–UãÈ·ZfzûöíH}}ý‹êêêÂïÞñäü~ø}S0Œ›º \ ë̯  @ÅÙ'0Xºté—Ë—/¿þçŸtØËô´:f"Š4}öìÙ±ÄBDÄ.”¯àWŸ²ˆI^\ZBÊÊ).,„ŒH…ÿàñþäžE% (,DL±š‡eJ™%PR\ tÞêõF乊K€FêÇàX?&œŒd}U"*%Ï÷ ½¦ööö¯deeC‚‚‚¬­Œ‘ÚÚÚiÄÄ•&Š5×ÿû˜p±ÜÅÑÙ ‚¼|€Ó ŒÕBp4Yéܻīàä¼¾Ô¢†ÊöTßݾ 'F¯ñ¾k=—ÃꕛʯiZÃŽes¨ýÂì÷à켟¿ãX¾L%ØîµºK‰ÔXþòÍ[àèÆeÊ!D„ŽÍRX;{<µpëb8ýÝh‹>æI%®%:Pžû…"‰ÂN»råŠ%Ñ¥úµ*f"ú·4ACÆyöFZº#Æk(T:îèØü×EÞµŠX2àlÃb¨¬g1`3ŸåÑ e4¶¸XWS™0ÇÒž½z v³VBdð&¬a ÉÑmX®ìû1),籆šŽ-ì\kUÇøƒ6»Âs±0}²!,ßcU«‡~ÙäºVøÁµÊáÌýÝÁ'âü¸ Îi qdÁÁe88§­5àâ †S—׆“[uƒNŒ•VÅLÖh¥5㦺Wc$ê¼í2¸s n¾Ì…È3‘à4M‡b ‰¾¸`ȨZìáŽ0h¸<‹¾i¯!ƒH/¹z߬þ¬ÆHNmßî²¹´òÃ`‡Ç,¨­]=áa¢Ü~[GùÁX¯¥Õò˜ÿ¾¦#!FŽÒ¡˜‰¥g¦ m’wchh˜Ûª˜©cÇŽi¹¹¹RÆ€Áê [1¡².*ó#dHQ"¢‚v¬‚gî4¨î2»ÔÐo…”—eÁiÒnÃ=½:Ëy÷ê}M¸ Ó ‰p±2PiÓ½›‚‚‚ŒVÅLÄ‚ðX¹råq\c ÞV`ê€5·N†ÆðËh'b JCÏy–p))‹×ó9~Ô:Ww@;¸Õ™è ÷y¯ M¤dˆ#G¼§œð(_Ë¥å±%öù­Š™ÌÍ̓HßÜ0ÕæmÛê·Æà©£þ`3Þ Äª,†ö9ù2ü}?­¬k "øÂhùð1µ„º‚æðéæ™‰Îrûä 033‡Û»‚ çÕ?p â.Ì5­a:@QlZ½$”Àƒ±ÐGAª‘)[ÿ4­xÇŽO p¡Õ ¸¸¸lÁ•zzz·6oÞ,¢¬ÌÛä’Îâé0^_ú €ƒUA ´nþoÓXãoÝÔÁÍɼLˆ‰õˆß ïâ¢`Ôø;`ü›.ˆ ”ÂÓÿBüiС³"lXj +¶á’©°dÞ25D ­fr5î¢e:6Š‹ÁŸž~TìÖ]ƒ´õ¡O÷NP”—7®ÿé_r¨¼=³äÀÞ®‘I ÈH BÊç"øû¸'$><òÂy0ØhXè÷媈/_¾$Í™3G>$$d.Mß*-x?++K]çLMMý<<<ð+?WÒm¾Œ#ÝÜ»ç pýN,|ý&ºc&ƒÚ ¡0x@ŸjmTßÜ™J/“îÁ•[qÀ$9èt°Y´¶«õ.ÏQ2ܼù/äÓABZ$„é Ôgøúî&­·d~áX§aÓ †¤Ò¢|HJˆƒøOà[I 0Ä¥ÀÚa)h×9‰ê:‘$åWÎÓ«Â1ØvÞ<‰ƒ+·ñ ‰0tíÕjv­“†ééé ‹/–%ÉÿÓ§OÛ¾ËÙV Œ5‰)11±ß”)SBˆ‚®JVÓ\–j£¹}ÔaJu®ïÕKu0ÌRå<#!*º㪜”€~ý$¸¾]PÔ4µ©ÄU')Zwùuå鮬 3Hªs ¶¸øåž={²ãââ$ˆ$rHMM½S½ÓnÀÉ”=¢æÌ‘‡Õœ?¾oJJÊÐY³f®®.øàt:=?!!áÙþýûň^”ëãããþOí`ƒ¦¦fÜ­[·´YF“vêÔ)Ó]!×–HJJÕ×ׇ~rEØ3ÑøìRÙ>üöíÛ‹èèèÒÓ§O‹ËÈÈ|À€–sçÎ š7o×ÓÂÛ´sÆA›4iR&ö9 ¶1 ƒÊaèŠ_~ù…1bÄš––÷Û8=Š>~üøæöíÛB$å=xð ‹¶¶ö-kkë b)‡eûúúÖ»üŸÎmWTT4oêÔ©Ç1U½†]åµk×t1¡tËÌÌ”îÓ§O±’’’a´\’èÝ»wo',,ÜòD “™EºöÌçÏŸ ½~ýš‘œœœýøñcR×|dÊR.<ßuàǨª55µG˜ˆhßÍ)ΗÆ`Ïž=ëK^ZŒÁþâÅ‹_Þ¼yÓX9rŸ?–.))aˆ‹‹ç‘TØ®];fÙ„šN& ³€LÀ,% ÿ)),,ÄTŠrssi¤ë¡ýúU˜ìS³Hqi`99¹ônݺ½%Œý·˜ŸbìÂ8?’~|f⸈.N‚©!åXZZ†"#²õ»¶>3ý„††Zž8qÂ÷q)jo>3ñÁ3òóóEfÍšåÇ>ÆõªÌÌÌÂqY>3ñÁfÏž}WZbcìv ‹ÿþûïp>3ñÁ5pÌ+00Цêyb¦kê¥%øÌÔ†€V Nrät—à˜3ññÀ Fñ§OŸdjº†ßñct›yVþëæƒÏL|ð™‰>3ñÁŸ™øà3|f⃘L¦Ð‹/F$$$ôKKKÏÉÉ¡"lݺÕMLL¬HNNªê=•x Ïg&>(<|øÐœ0‰kDDÄà^½zÁ¨Q£p!NèÓ§ÆK ¢l…‰uìÿ}üøáþýûøñGÄKtuu/¹ººn&Û>3ýRG000ÐkÁ‚ó† BÃH-8Í ¯À8âcÇŽ¥°æm-,,;gÎ\¬«ÈÙÙyêU«7†lß¾²¾+Ï/ŒÁ@wÜUsrrz›žž~ëêÕ«zè›Îg¦V†”””_‰þóÏŠ+h(-~$.\ˆÁ#´åååóàˆnÃg¦Ö£X[hkk‡9r§5Ù} s3áUêG :uë D9‡¼ÁzF¢ÏŸ?ÿÒ’%Kìííÿâ3S GFF†*2Ò¡C‡š†‘Jò <`ø»Ré´«W(µ¥6à‚>¾¾¾ôéÓ§ïE׃K|fª'¢_^0²<61B··~Œ¹Ú”ÐIJÃ; Kd6æ=¦M›ÖéR¸×­¸ }þÐ&ØxžìIœ¥ëà·îy`ÎaêÚjݺu8Õ'ƒ¢{ Ÿ™ê \cûÒÓ豘æ”O%dˆŒê3:fr?«IJ&B²x-;99yÌõë×9¯ohhh•_'Â)»e QSË«zôè! ªª*îçç7 gÁ𙩱™¬8_øÂ“¨q˜üÙçqrý>—'«Y†NT49U“]ºtI —}༆†FtWVi´ç>|xþÅ‹ÇüfÚrs›«ûE—M?›TXœ'|îI¤&öz™* g ˜ñ×|­ùÞ :£˜7++KˆÛî×ÐÐ YYÙ|"E»þš2–XºSk×™&ËõŠàJû'Mégl¦j¦"¥ô¸®ü¢¢¢…„¡¸*›÷ÐЋììlfÕrøÝ\#@Q^íñÔ•úMë'¥œØ€®ã6·ËkðºñŸ9))‰¦§§w•ÏLõ„œ˜lúJ}µ“U ÓȨ>jìò‡ v…tsOH÷¡2ê.‡ž©©©)FºÂ’¡C‡ ÖfÖ ¼" eÒÏž=+C,È›èªv·%Óáÿ†¹ Z›BkIEND®B`‚maven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/module.png0000664000175000017500000004110712561645371025734 0ustar ebourgebourg‰PNG  IHDR­áÍ2 pHYsëëP”è|AùIDATxÚí]\ߺmQi’ÝBCR6ÙE‘–¿E!*"dfE‘M!#2óÏÊŽl"I()£Ò¼ÿó¼us«[ÝÛréý~>§wŸ÷ôÜï{Îóœñõ'ŸÀÛ7àmBø;Ž©Z9K*®Øëfa!HIHCaá{°pYIêñ!µ#c¿V Ož>>µSbV¦ˆ¡C‡RÇÕÎY¡¬¬ü&>>^UƒÖÍ@Óx¸OP3Q4jÔ( 3Åýq³7Cúç$xpï.¼ÒT›5®~Æ™™™¬}û‘šä/&#ê8!!á~­ÈU©‹‹‹¶œœÜèI“&E U¥^¼xq²½½ý¦ÔÔT1++«CDŸ_íJˆýW‚ÀÀ@Ö¡ ¹fÃ:xóæÝÿý·‡«Œ1ÓOO¯‚õôäÓŒÿÀ£ðáÙmX½f5ì;‰oF!pòH Ù¿»E‹»>|øÀàªÄ‚¿¨L‘FÖÆáöXjáÂ…x›߆aãæQ÷8p€;5–4Cß·-™&ÉÒ0©ªÐ­bÅký8--M ·ŽŽŽ[---§qzèܹsŸV­ZÕ¼Z-ÈÖ­[1ÿ èU{M~¼èoÿ¨RÈú`lll€p¶v”Bö¯p–.]Z°hÑ"ÁeL´L§œw·àZìS=a&uÎÀÀ€Q㛘˜l?¶åV+ÓZ“±  `AÙsäÃyþìÙ³šËØÜy…i-~}8uÚ´i­¸É”kVdee‰Õ Ýxa«bªÍL¿}zRÍ:ÀàÁƒ/ U¦V¦¿±šÿÝ»wÿî9 ™"H­ØQ¨: !{ÝaggÇœ0auΚ4ŸÈ611±GEAJ\Ò[B†7nD·jÕê}­5ÿeëêZÉxþüù§ŒŒLØ_RãŒ×®]»Ÿ•)»åZ#¥À®]»ÚÄ?ŒIÙ ßRÎû`æ_«1{‹¢¢S¤af$Þà ó°%S¨6~8+¤[ëQçŽ?ÞªÖX±xñâôÇÿ$&r+êÇ㦧ùùùRD£Ì¯V!,,,àãÇBœªäZ«ÜúôéÃ\¾|yÉqu ‹8|ø0\ŽŠÊ*z5±ý1¿ÚSWð÷f65îÈhl 'Íó·ñýASKv¬MÔÆ ¥zAqû+5ÄäµËßx ÜíX} \wqUàÙ³g?ܰaƒëxŶà5¹?˜³†ΖTBÎÄ–Òs›w.†Áx×õåò|þöi‰D™\ãÆ}LNN® ?xð ¤;Á!`Yþ¢é^”dÒ‰¤b¥<ªÌöà™¢-«°e¯ïY9nݺõÌÝÝ]ën Ës¹ãÈ¥ ïÏËË>þ¼aRRRK¬›ˆ½óÁÐÐ𼨨hNuõö:ÕŒ………óˆ–c0…‚P¨UUM,Ü2 ŽP«FÓ­Ø|ƒ¿¢ÀõZ)pdd$SLLŒ+Åë+ý²…E­Ûm©vÅ–Òµþx‰¸èkT ˆ# ˆ†S êü.XQÜÅËBÏž=oôü£vss[N¤· ÷}ÜíàÜ7TãÀ²V–4µQØZ¡þÔ*vvñÄúPžW|.¤¸ˆ1cƤýúU†¯>:V7,'Âþ»Õù5ž»¸¸´g?GìD‘à«ÛÛÛÇØØØt'…-w­W¯^%vµ­:V?À`õaç#Æ1âÕÄ­¬¬lÚ—/_äŠ;Ùº£®¼kã"Xê³ Ö­]Q¨aöhΜ9ß«UàŽJãbtªÎ³mÛ¶Mxûöm»²çqBEG4æRæìƒ{'ŠÇ9Øèñ¥Z®naœ [ܨP’gY"!‹,–t¯_¿MªÆ~|óѱZBb¤VTT4ÑÔÔÌ Ê 3hÙ²eR­ö¥Ô&ˆ‘jÁÚŸ6mÿVkDŠÌýû÷Wx½Y³f;tèðœ/ |ùòeŽ…µ0!ç¢À’lÃÎE=³µµ½]ïfUk ‰ÌŸ?6&&àØ8Ž+zn •³¬ÁzÖZ8L ûåÝh¿ˆºŸ­*õ^`NÃ1ØoË”íFíã¸{‘™Å¤ú1Xp;š7o>’/(,ðñãÇæ/^¼Hö°F õwG™RûïÞ½{@j‰.Õê[+ b‹oÚ´iùºž?®˜-Ô¨Q£|uuõ÷¤ŠÚ3sæL´¢ÿˆâãääÙ¤I£aÆ•œëܹ3•Ø Bjo+¢££W°Nâ<»ÔÔÔÛ¶ms¨Ó¶oßž¹}ûvª×±º(¢µ'JŒýܹsáîÝ»µ;¬øþýû>DǽŠ­•­ …¨é7¨yµnÝZIj¥°XPÖ¾‡»<}t=7±ì XAa§)³çÛ›ˆ{} màLØ>XXr$äÁÔj ulj2ÚwêkÖ¬¦òLLLŒ'…­yOå¨Q£bgÏž]rŒÃ÷øÂ¤j1&[=“‰`;}5ô°ÿdèaX4'A©—9DHUA‡ý=A^¹õ\èÿ@2J Ê‚®®îÝ–|ÑÉF§ìù~úJÔv¾‡;?¸«Lf¹òì\zÔ€ßÁ÷o™߃#L5–,1Õç^Í){>ân2Ì…Xæ»Eá¬Ú¯¥*‚UëwBÔ™C%’e§:ìäÉ“#k…³ì£*,°LóÎ-¤ZŒ…¨ÁcK=ƒe¿¯ÄÔ!M«ýÈ(öf8·_¿~¢µZuaõôôî‘Ý.µÕrM™2%þõëתuRÏÞ»w¬"-”¸’’Ò×£GŠ¡2ƒ2“meeõƒ´rêRRRßHAë¾ÏNOO/{þáÇ:=êtèÐ!+KKËPmmí8üÊÙï!:ô3èèè<Ä„s¶#""Lø¶ë”³¨K ­V +""’KuðùøÌ#ðáë²0þüU|_X´xùõ×väÑ…ý« Kô~111Wäåå)}u‰œœìQ쪯¯—o ;|øðxb¢(cAÙ!** ?þ¼Ó®];Ž=‹¤°XÐÊ®¶ÍÍÍaÕÁ¬°ZZZÌÍ›7—;Ïê¤`©ˆÄÚø úG Ë*(.$ìXC5;„sss¾ª šÉ6=%þ­ p¨IFæ÷ÐØË§Éü[XÿkK–,éâB+õî¥8Ëš(4räÈß¿ÿ³…%õißß+'£ÊÙh%Ví÷ï’|ÁY´ÏÎ;DZw˜=9b|A vìØá@¤¼eĈW¯^Å•CÞÞÞ‹ùR7ppp؉Vù±°ÄØdþ÷ßeûÞ³]…o KtÅ7n|*[PÄ®]»”½¼¼˜Ë–-à‹ÂbA+»ŽÐ¸Ôç¦ýú*++&“VB]¿~½7Áuös¡¡¡îŠŠŠïgWˆŽ9"Çsa•|d¿°ö?ÏÏh*-*•Áí³ãÇߟÐ÷Ïœ9csÕªUü¡È #—Ôµ^72299¹´z-,ê8«®L-0±¢‚€&GÉÖŒlÉÔkaqòÙ;w((wïÞÕÇÀÁƒïÍÌ̬@‘9VüdzÝ|`ÜÚ_ØJÔCKuuu\rS¡"Ãê{ø#ØÁƒÇY[[‡°ŽÉÇã \Eú,{“[¯…E«ì¹øøøf)2ìÊ ©-¾ðEm ¦¦V¥"Óºuë®|QØ—/_¢ÓŒÂ%K–päû… V®X±"oZ0R×2ÐѾ¾xzzæ=7ÃÛÛ» Îà/™ªZÓIh¼‚po²¿¿¿sDD„.)®ÅܰÚyfggc}MM~Ç®+b2vqqÙLþÉsò¨3&„„„,vppX²råJÐÖÖ.uÍÙÙ™Jµqqqªâ`3†‡c"ìb¯xp¼»•'M˜0aï_%Ü‚‚‚&M›6ý†ú8™N:Å7J¨ŠŠ .òÆÝ "ô ÂÂBt˜—žž.V[Ó;k]¸YYYmÍÍÍß ØÝÎñù-„ÄF}KÖ pVÒ‰'„£££ Ð#ʺuë¤qÆß—X¡cˆEz[Î”Ž»@¹%Éf²g Ü<³ü÷„CÀáHÐ…YÖÃáá§| É0~Ê èoé ‹§øý,4[˜d=VÍ™çᅦÀƒGAZ(F[L%Í!p`³çïûEdàèá ¸så8øl „³—‘öB¯ƒ†Qkxüø)hii”++ú±¹ÿ~F^^ž®Iæ áÍok@@@¥÷ KBz¡‰x¦ÛL§V!n 9 [7m7'{ø”VÔ¡z……[òlTDñ^.%ØÞ¤ñÛàKéÓ§7\»vrü¾ÿÜÑ"«hÔDJ¸§Î?¥fâ0WSÙ6Ë/見oÖëæ*áæwêÄÝJ"@•QÃ¥@Y¤ñ1¡”BG碻s,Œá~jEO\;y.%q²ÆJ­âÇ/^½zÕ›oªô—ATiié¼ððpŽy±–¡"pÀ—åÿÒ¦¿nIëÞ¬­.؃Œ­¨s¡~å«jëhcø”‘]rîxä%eùæq6 ‹Ú©©®ãÁË×Îô)7~‹˜8qbrbbb¾Ô222¨¹‰D™^I>«ùäó*¹6oÍn˜Çá™)‹}I*/ÀßûÆåÕ»ãg8¾_¡“q¹ûÙóê3¢HbÇõë×ï¾yóæÑîÝ»íˆ`ù_Ï%:-Ò²ˆšÄJq~õÃßÑÑqÚÒ¥K…äååëd¨—†*‰˜~™Äf šTT¼þ¯ ;.É-·,7--Mv×®]S'“}%}}}RoçtìØÚ´i#YYò‰¦’òìÙ3!’ oÞ¼É ÆÄO[[Û½vvvè}ñûÍC† ùw,´Ê€+=<9w­†f†S`ÝBçâ! ò jÓƒ ¦A —Ô•óôôô~[_¿(ß!ŠkVéÈ"V¢‘ÃÝM!Èg& žRø.5®ò|ÝÜÜÖ^½zµoƒn«V­R8g·mÑçIÄ­[<å«®®þ²ÁW ÛŒŒ¶ÍŸ?¿Ôù¥ÛNÀ¢i£€™ó­ÈG‹_Ñ$¬œìlÊïʯ¼¢õµ8ËBX¸}ûökY 4 â鸺º2GŽüí—K5R¢R¥-Ñb!¶ê‚›åÝr|ÿþý¹™™ÙpZ[(]÷ *"i½›u‹êæannþ…i=—Þ¿ß·™M:N^±bÅ® Té¤çرcqDãø?$‚¥-4.ôÞ@LeÏsZËZŒtÇ -Ü¿¤MØHª©™8«HSSGC0h 5ØÑÑÑ\ŸE —Käää4' l2µAtéÒΞ=[Ñí3¯\¹B…bÃø4[¶liÏ®gÓÂeƒŒŒ “4”À,/@çÉÉÉ/ÜÝÝK" ÑÂ-ÆðáÃ)ÁòвIiÏž=ÄH’ªá²\ÖTzá YˆeSQéôúxo»víÞb/tb4x\Ïé¾Ö­[ÿÚ·o¸¹y€½çr8´Æ ¢bB?#SX2o&lXå'Ï_m½¾à¿ni•IÊÊÊ ==½ÏõÊÜË/#‡4[Õ´\ ˆ!íM"÷9`Í‹^€snqÝ~Ùó8óçÀ6***”¨»woCîÖýà·j#àâM brïDY³‰•¾ÒÅŒrОñ«êHš={væ©4•tãB-Ž˜©I«¼ªÏ÷"“9b^ì µ¤Õ/Ù×ÒêVªµïgø;ž®ˆˆØïerUF…õ"Üšø6¨ ¸uûæéééD6[xúŸªèH:uêT Ý å#gëÈ‘#M¢Êô—™(=wÝ®:’LMM¿eddt¢…[Œ“'OOOOo:cÆŒ¯öööÕÊ#--í 1Ó—Á†ÑªX4mÚ4ü\MMí•“““²®®.£ £ã­¥¥¥ F)DG ´…Æ^½z¥Æí½„©´ùKwÜðˆÕ6gæÌ™+ †ˆ††ÆþÄð(Èì|bò.%šÆ2Z¸\¢°°PDZZ:‡µÔ‘W$»¥W®\¡L6///Ø»wo©ø´pÙ ))ÉD¡Vg ó²e˨x%sæÌÁÜtÇ ;ºtéÂäU¨-GÃûVcÖ.\9¤ Á)ZL™Z¸Ýºu»~ÐìE7:ìîöØÑ½{÷Ͼ¾¾wîܩڡC‡çøF°ÑÑÑsçΕætÍÍÃì=–ÃQÿpþw@C·7ø./¹ž™–3\fBBr´Qíþ›6ƒ¤£¸Çˆ<;9xÙ½F‚¯›=0ó2aîìYpÿÉkh§Þ |ý|AZLð÷ýžËáÌöåpâ\4´h§ û€AtôyóŠ"ÓÏ#å±›·Ôš–ÿ— 1Ú‡‡‡›„ó…`MLL¶Wä¢õîíÛp×Ììœ=àÈ4g°±Æ`ݦ„9¤ì?aøX[0µ[­LÀÇsŒ6¨„UØ­—0y,èô5„Î]ÑÅ> 4z‚‹—¶C Ï|=l0\¸r-êþ»c a’ó|86e:L2·„AC,!êü!˜h3nݺ¶¶¶ Ô˜ó¿+&&†¡¬ÁŠð…`Ia*½.«iãÇ ¥ö#·ÁÓiE¶un!x{-ƒE&àß]TïÑç<P.j¨óõaáÜ"ÇćüÐW^#غ¢hröÏÕpìÂX¾ù,™^j[µ)Øá"6­v[¢YGEAª;jhTZV¢fñMUТEå+– ‡Žúý"©¢ð._ @F\Ú(H—éðú]°‚ñ±æÆ#w:Ý»y‹rÉZñ½â„[ÿ»BÎ ¶[×ßvº¸¸4Ïÿ 1“ øF°±±±Ô4õ •t)ñòÆ)þƒ³»ÁuÝ~pv[«†ta!¡ò¦,›oexcY¹R1¡p¿!Yk‚ &qæ¨Q£øC°—/_þHÌÕæ]û oñ¤Á‚¢A9ò©ûìÙÍ:ƒ1Æ}XMY¥ïiÕ^îÜüF…0«+øùùIãh,_6!!¡5©›òÌÌÌ8^ÿß1?(tMµÎžNÓKØ')#AØÎZøÌ„ŠV‡~LÍ¥ò퇓Ç8f2þ÷4úi(A!Ñ‘ÆÌÞs+ŒR…–Tl[ Påà„gϞż{÷Θoª´¹ŒŒF¼xñâ+D;<Öî‚Al êBN\ ¶ÞÛBaÀàá%Ÿö¶ý'`­ÛD˜ec¾!‘Eò(ü]6jÏ„YÓmJÎõbSJ¨ì÷—ò‰+ÔŒÚ`9¬ýÁaLiïý¸î7??ÿ N¤ã+aøðá§/\¸`zÞÒÒ²Œ.Éy8CP¢Üù]«œžÑéOT5’8¡ìýeýáV4¤rïÞ½«²²²{œƒøÒ¤2dÈ…~ýú‰*((`QÂd¾î/ ×ssólò¥¨mïøµÞ ƒÂ322Ä0êã¤I“Ðj`ä1ùK  #ƒ°3X‹ÞŸ>} þkº ‹íò3III‚qqqÚýû÷¿’?~|ãÑ£G‹üIí%˜­²gÏžþðáÃëõñÎ:ûfµµµãXþ?>Q¶mÛ¶¹MièDëòŸ"l|"#áëëëºtéÒ$ÕëY/•!aìqL¬ãS§Nž€["ä_zzz544¾©¨¨HIKKsU¦ìììôW¯^ý|úôiÓû÷ïyôèQs v1qâÄ}VVVaìäÿþH+3bĈS˜8]KNNVzýúµ*a]3 çm€.§p`PRRò{³fÍ>áPs«V­Þ6ŒoH¾k¾•””’1±Ž]]]}±—Ÿ}âïß¾Ÿ´ñãÇ&IJ;úàÁ]Z°µ„'NŒ*îìé øZ°D.±ˆ°Þ%xM ¶€þÃYûcÇŽ û›˜Ë·‚E Žý˜(ö:tUP @}´ì9¦Æ%œ´`kN^îQ;`%O –G\»v­+N;>|øÐ‚® j€>}ú\ûã2üU-X´`iÁÒ‚¥A ¶! vûöí+ÝÝÝ=ZµjÅÀÀš85>>ž|8¦nèÜáìÙ³Í?Ó‚-/TÅ^½zq-Tv c//¯OK–,iÁ>œC ¨1®OÕ* ¸hÎÒÒ2éêÕ« Z°Å°µµ½_¡²°lÙ2]ÀQZ°@ ò4@øæaØÍZ ®ëCaD…RלœœÚbX Û ´ØÅÅ…ëûÝìmàîë¢jT˜CLsÒ bç8:ímЂussó:räÈïã*–/½ÏoBMÇdŸ._—/_6mðUAÓ¦MKEn®tùÁ¡ÀmUæ9räHÁ/XN3À+Z¾Ä-Hö­Á –Óää —/1˜Üæ™×àûöíÛrç*Z¾\j¨‰‰‰¼`‰Î™_öý-_â¤ñ¢«bŠ.!›åìç*Z¾„kв³•Ü—›M-•g ¨ˆpÉy11±”/XDåZnbòÛ£{EË— ÿ+9ï?Ïü‘ÍÚà Կhuwffæ+œÈL[^W®\¹GËõ‚åKBÍ+õÒ†°±±QÈÈÈ ‹¸sçŽ~=˜>>>5ÊçêÕ«ÑÉÉÉ|5½û÷n…††¶õ÷÷O 4€j,_¸þè}“,Ú´ióÎÑÑQíÅ‹¯Ft‘çéÙ[·n]mÛ¶m€¥¥åQà3ðÅvù>}Z@AA!uõêÕ²íÚµ«Ô§`~~þ; É„„„á¸àø|5æ•’’"+ep}nzzºÞˆ#òÔÕÕóq14bÑSsÞ½{Çpà€1p®Ó‚åoß¾Ô¹sç‹{÷îN^E‹ý)egg_ÃèÍk×®nllA ¶Lš4é~—.]t+˜âT YYY§‰ZøêåË—ê´`9€èÏñ3fÌPF—|¼€˜Ó°cÇ599¹¯_¾|‘¡ˆC‡­ŸÃª@e3s¦NڨΓ|§Ç˜}CO ŠæúØ6Ý®ó¤]õ%XV;;»ÝÛ·oŸZѼ.gggøö&Vn;³§˜Â¤©ž¤E’‚À¡ ‘“6ÿ9ÁÏ,ðÙ±º«)RÏT63ÇÐÐP´Þª‚ü‚§ðÉ;1 £Gmwü¯“m½xJß½{·&Ü···ß¹uëVG–¯\¹2¢§Æ]€Ûwnƒ}B „Ž€YSÇÁ¸Ñ8yD ÂOƒ ó\`žƒUÉQU3sþH›G„ìxlÒnLÂBb¹›Gî˜:©Ó„ úx÷Î;í1²Û;uêô^ƒÍiï©ÃÔvמ`4ÎF…ê KÐyðÀ¿Ã¤æ¢KÕ—PÙáéé¹rÅŠ ¶lÙ2ã ‚EÓÀÄØJË×}(LoCO^î>õýîùóç¯"&ª'û9b1ÕI‡y} –¹dðÊ…óû̯÷póæÍóYµjÕüŠ®<8 ƒb4ùÛk¢l‘³„ùGÖp‘4fà>Ñ—œ+™óèÑ£—´TÐ#Lfžy™_¥§ò™9^^^ÍhÁõXØÚÚ2KͶá0û¦ä¸’™9?þ|qëÖ-SZ°ÅèØ±ã|b©­ª©SaWWWÆË—/ŸÓ‚ekäˆN;Îßß_»ºyXXX|IIIQÿãz,¿=$¡çO¢–u—’’âú9ƒñkÔ¨Q¿ÒÓÓåùÂ@àGÄÄÄôˆŒŒJ>é__ß*µ™Ç7>O„:‡o,/~ÅСC#IDO͸vÌÀÀ@œ0ù›‚‚BÞ?òž>}**±xñbïíÛ·¯á;“–ß^šÑÍ*§kUEÚ£[G K –ì?ƒÜÜ\y‡£Ä2ë‹áÍ›7§fÂÄÅÅššÚƒàà`sbÇÓ‚åÄ,U!B|½víZœÀA%ÐqÈöïßoзoß«´`+Áúõë&''©($;DDD§!6Z[[û1F+¡ËîîîQzzzý1>9/””„M›6iÉË˧¥¦¦ÊÒ‚eÃ;w&¶k×®?Î(¬.Ž9"CÏ„)ƒñãÇï%VTó9räÐ/_¾ÈÑ‚-ªWwò*Ô‡ÿ; ³–¬/96ýoÌœ0:t耎âiÁ,_¾|Êñãǹ¾?'ý%TÇyëÀÂHžDŸ‚‹×ƒ±‰¨ÉcŒ[±Z°ÔøJUŠNNN<Í„¹ â")¡"4 pm´/œŒ¸ s&@¿~ýDc}||æaÂ}Ö|Öµ·oßö2dO3a†[;S©,:éh4\=ç°æ,X°`±¨>5©äzufÂÌq(XÒIŽ6ÌÍÍ `ÃÃçp¼Ë™0vãLáÍÇoå”`1^;}û&Š‹‹g³ÎijjÞýúõkµò30²Äå9ŽØþó‚3fÌ1 #XѲûN:Ýôóó%§”X †‚ D…rž•úO –Û™0;wî„ÅS¹¨þä\0¤æœ ÚDÍ€a!( ¢D  Z%èÞ½{ “™7¹Ì¯RáýgΦ¶Ä|-u^V{„ù»ÃÌ™3¥hÁ51ù¿qãÆMæv&Œ›o(¸UœÝ’ßZ°Å j×¼üü|ŸšÎ„133OKK‹¤[ ÕÚÚÚã±û¯ºy̘1#žUµA뱜€Õ]ºt¹¿lÙ2] žÚÉñãÇJJJRmðBE¸ÿ~—#GŽ˜¯Y³æ··w•JصkמÄÄÄ$¡o°/V¦]»vMqqqÙL ¡ž={~STTÊÊÊúùðáCáÇçÞ±c‡G=–Éd6(¡edd¨Þ¹s§ÿ‹/š½~ýZ366¶Ç›7oSRRıᒕ•ì;À$''Mš4ÆS #c"–úQ¤Æ¼ðŒ,‚+Á ©TPP999TúõëºÄâ8HImüø©©©¨ï¢ƒ!@ËÜWHÞùSEEå-iH¯ª©©½oß¾}=àÕ«WŠS§NÅQP Ä¥:nX¢k£_…bß ÍIÚ°uëVL --}wÛ¶mSÑ”§I[s#Ic„ 'ˆ©êååÄt§ÙW‹ÐÕÕEC¸«ÿòåË{X3+((DkÝœ i4iy@rrrObP\&†’˜««+e‰Óà ÏÏmGŸC0tœ;xØWí¾Y³f8wxzz~9{ölÒÿþ÷?ƒvíÚ½¥I[9¦M›výÖ­[=Ñq ƒQ}_ÌÂBÈ/, y‚ ùäçæBùH„ð9AßOÞ™“W¢"ÄôçÜuXÈ,€‚üB`òV®ßF'ù¿ò @€”O¨Âò1áè©"G– †0Ïï°¶¶ÆÔÒÉÉ)^BBâXXXØXš´ô 80©}ûöÍ7lØÀõs8©ÍÂ¥È3ÊTWgñݹ›·š¹¦šö-]«?¹ήÞð5·âwÈ·í›6ƒB#Ç÷z¯˜‹üvuÓy˜5lp/êÏýñ\]ç“×Gy•kÓÖûn„Ö2bóŸ·z ¯r‡œŸ7°™ ÞSŠBÌì\;ž‰-¹vfÿ *!|C"A·™(ײ%Æš@tt´iÇŽŸt¤I[kÖ¬Y+,,ÜÜÊʪÚyl'„»á˜tV*u>2x%¬Þsù-‚ÌÌ¥àjSDÜo¯¢ÀfÆRj¿«±¬q³.Síf€ƒ…¼JxíÀ©C> Ìað ;uá°TúwM}z,¦¯¥öµ &ÀFïÿ lÂÕ°#ò6Øš ƒyÇÀH£i¹ü}<–€ç¦¢Õ¬Ôùcþ^°éø5ˆ>°"»vƒ¡:ò`ï¶ì]?Á„ÁÖDî6n¸ÛU[¦‚ *...þ.4iÙpðàÁ #¹&:Ϋa©óÜáZÔ ¸þ6N<Îã (òI© €¨¨•HCôzjÁ«3 çÓ;HÏÅ0nåo3´š_ްD€m[ŠÆ°a©r ¼µÇ xôÄbÞçÁ¾]»ÁÈwn¹{Æ:.)GXDßiïß§èÈ×Éocdd”ãììlE“¶ ddd³²²j$u}í ÿ­F"ÅM{F*üÈ'¼\Ù°vœ¼U£²Ë5oÁAßùIä#¡ð)†°E„«ÐMø 9DŸ-Cn1.bCÖÝo““““Ö¸qãBàSü1ÒÎ;w9ùšW=¹*¼ÿð@—3ï…á4¢r@yÒ%ÍŠépñ)ãËÀ¦ƒ{A«yãrÏí\ëJtÄÕ0)ƒŒ©–I Ú¸­œZJŇäB¹ç;R8p ›ü>›hÒ–‰‰I8Ño7w½ðŒðà@°1ñ…F¥ø´—àìƒOÅMjwCbü‚ÔOEóN”ºôäHØë'w°–Á£T!3f,Äø…ÀÏ„hØqüL3Õ/[Þ7ðY¼ ¤:èÀÁF ª$SË’­~0o|¢<#†Øe''§-4i9`úôé›û÷ïÕ§OŸ[ÞÞÞ:uâéùæSÀd`PRÕÞú X˜×££àý§têz+íá°Ð¹¸÷†ÙFZ€‡§ ù~ 0¹à û¸`!¼Œ½ ã?dsuX9wx® &|€9ÓÝa@7uf5™+Au5u€UÁü»!ÔÏ$½^Aµµ"äeƒkW£!åëOêÞ¶ß࿉µDXAI“†¤´<8{plajjºßËËK˜[¯ cgøÂP¢$¿Žƒ«·nÃ÷,1è7Ä ´ôºƒ¾Žj¹:gàXW*½}z.߸Lrƒ!6³–Ãz-•’û/ 4ƒë×oBv>¤d@J”"ªÝ`óæR‚¼’r…eê1x|øzûöíÈþOìÊ:vìXôßúÿðõÔD--­Ç—.]Ä:Žˆˆ0Ùzüæ))©>Df¨IgËÓÊôGdff¾9{ölaxxxEEÅdWWW_bX…̘1£ð_øÿªIà&&&˜Xǹ¹¹"'Ož‰úpddä°–-[ õêÕK°k×®¤Æú—'Þÿ-÷óçω111b7oÞÌŠ‹‹kA ÚkVVV‡Ð¡‘ÓÏÍ›7ÿ“ÿû_½Ü†è½¹øa*{ u㨨¨×®]ësõêÕ¾Äàh®¬¬œCÈ,¡¢¢’Mö™­[·–Àå8üöf¼ÿ>ãÕ«Wb‰‰‰/^¼È$*’|£F2ÉGyƒ´2WÐÁe¿~ýb‰Ðàš’vÅ(êÆ˜0äWE÷¾~ýZ žÐöãÇÍãããUÞ½{׿ӧOÍÒÒÒdýú%FÈò«I“&¹d[@6’†IXXX L\$JWH¶…¤ RvvvaVV–I‚?~ü%©1~l8•™)äÃI$ÐÒJ$ᾚšÚ«:=<((hRÙ󱱱ѥ0úl¦¥D“–oŸŸ/dkk»·¢ëèAk\UUÕ×´´hÒòÐÃׯ_+œ¢…jê¶>Ô¡¥E“öãܹsFyócFxÅhœÑR£IûÇ€5è„ ‚¹½Õ¬qqƒ–MÚ?ƒQ˜’’Âq®dñˆ=y‡&- 4iiФ¥Aƒ&- 4iiФ¥Aƒ&í߈‚‚‚FÏž=ëÿôéSõ”””F?þ¤ä¸jÕªEbbbyrrr?:tèð¨sçÎ7éÉÜ4ië÷îݳZ·nÇÉ“'uÚ·oDGGÚ´iƒ^´µÄ½8ˆc‰ër ÃtæÌxðàܺu ®^½Z¨§§wÃ럦EK“¶ÖÀd2…÷íÛç?kÖ¬©½zõ°··Ç)ˆTâRRRÉ1²âò÷>………}fΜ AAA$ï8#LHH(Ÿ–wU-ZôšèÉ®_¿Þ›”!›¦&MZŽøðáC¯N:]?>£¦žk TC¾ÿ®Ktå,¢:˜½÷ MOš´¥ðøñã1=zô8JôWtð\gïÉÍÌ€„© LPl¥’â»â”””„ÇÃìÙ³O½}ûÖçíÒ¥IKáÛ·oí{öìytçÎuCØ‚l8´6í¿\ê´‡ïaÊËcUذaÃÎÎnúA1bÄ)š¦4i1g~kÞ¼9÷º/—!ŸÎíòŸçÈ^Sp˜» [gÃØâ¨5¼€ƒ‚8w† šª ˜´ }/\¸ uú4ç®Òš†|êØg„Ot©â˜˜_u@>(F×®]á* GGÇ­4U0iÏ;×§K—.\E…ä5ä¢u‡Ú ¿Õ½{÷çÏŸ7¤IÛÀI›‘‘!¬¨¨ÈÕ½¼†|ªmÈËËç&%%µ¤iÚÀI+!!‘KˆËÕ½¼‡|ª]üøñ£Š_iš6pÒ\â6º9o!Ÿj¿¬OŸ>ÅP¬—iš6pÒvêÔ鎺ºúÝK—.é4¨Ò{y ùTË(((H — ØAÓ´“qàÀsmmí7}ûö©Ø‚ç%äÅ´O`=Ø>UßjW XÍ®³jÃa7Ž÷®[·.mõêÕËš6mšNÓ”&-´mÛ6áСC£ìììNâˆXE= ¼†|†,, Ø y\FÍ“äxž”éq«V­nb`@š¢4iK`bbrêðáýŒ¯2¤¥¥+¼—ëO ¦¡Yí2ašeË–½ÕÓÓ;ÞihzÒ¤-‡ž={ÞüôéS£=zÄ]·óäÉ“ÿXYÌœ9³Ý•+WÆéèè<¤©I“¶BˆŠŠæ ?YŒY6dÈK¦£F*DDЫûiŠ>|x8{öl¥åË—oKOO§.š´Üc–}üøQ½!’70..n„««+ž¯uWGÙÙÙ¯·nÝúëéÓ§âD·ž’’’r—þhÒVØ™âĉQ¸öõõu%sRUU•444,èÝ»·ˆ˜˜×ù1Œ¬çÏŸ'FEE DFF*’<Î{zz®.*…;wîÀÅ‹ø¥»»ûê &ìãÖi MZU¢°°PtÏž=›çÎ; :eÊ@/9˜x©yAWW—JÅ=*ê$í^¹rå8pà!\bÔ¤I“4iið ôºcnn~!11±-!„‡‡×Ù» ¨D`åééiuøðá/ÃôõõïÒ¤¥Á äèèx5::ºG}{ÝA˜™™a’;xðà1cƼ¿wïžQ=RiÒÒàˆÏŸ?wÕÒÒŠ!ªÃÊÊê–eäÈ‘0tèÐV={öüìáá1ÕÞÞ~'MZ¥ðòåKc¢kFQFU} *<8I×®]+V¬Ø†£Ë–-ó¢IKƒBVVVËnݺBc¨Î [ < ,`Ú¾²²ò›‚´oΙXu¼¯rÿÿ™kZ…Žî8ꘌhÓzk»víÞ~ÿþ]rôèÑÇ1«‰ŸÛiÓ¦…=’ѶmÛJz    …““Ê OANf§ô›Ëî;777W䯽bcc;?þ¼C||¼ #Áqæ®÷jѢŇ:<ïØ±ã3Bòèþýû'WgMZµ‘\BÂ+˜êã}4iiüu IKƒ&- ””mb`é'%%É}ÿþ]˜èº œ³K ¶|…tuuõX--­{5õK“–ÏøðáC/Ý»w—ÀXg€žf!)gíÚµãø\zz:œ{öìÐÎ;ÇÒ¤¥Á6oÞ|`É’%ã6mÚ#FŒ¨×w?“b``àƒðððD¢JèÓfhTˆœœœf]ºtyݯ_?‰°°°?Z–Ñ£GÃðáÃ[÷êÕ볫«ëtGGÇ­4ii”·oßÚ+++?õööf QU—`æçÀ“Ø;pçÑ (`âDAh§®ºu@Zâ÷’s4숮+°fÍšM8Ò†ÃÇ4ii‘ˆÉÑ××3gNöæÙ@ð\³¯äXF^4Ú·€/ïŸAð¾½%çûŒ›Ë쇗ÝZpáÂ…³‰Ú’@“ö/E·nÝn§¦¦ÊãpôcPÓµb‹-ÚÖ±cG1ÒWxOM=ÌÜ>¶ <7£öÇL[ ΖýËÝud#,Ýr®\ÁíÚÄÁjìed˜šš®§Iû—ûøøÌÃÄ~Wå"™+Z2^žŒ…¢7n´Ý½»È—I]y˜é6Æ¢H"Õ:vp,KgÎäï jÿ{ê÷R×Ð¥¥%ƒ&í?ˆ·o߶ÀÐeƒB£s\bŽá¤tuuKæ«FEEYÉÈÈ0ÊåUÛf(T@Øì/¯`úoj_ºUOøÏZ¯Ü=Ý»wÿN“¶ÁïfÐY¹r¥'&<–È411‰ 5óŠ<%Ö‡‡™_É0×Ý ž¼J¦ŽÇ:.†éý9ÞK>,Aš´µgÈÔçûP§½sçNWnîmÔ¨Q–±±ñ¬aGŽy²ìhSDDÄÄcÇŽÙqz¶.=̼¹uÜ­4J³…InËÁÖ¸w¥Ïdffþ¤IûÉ9lذ³,râ17Ï <8ôÝ»wA¹¹¹¨7Ö5^]? Î 7ÖÁÚßÚõЩuS®ž}øð¡(MÚ¿ج£Ã$'6ó5É W#L˜0!(,,lò¸qãê®Ð…Ù°`ÊD¸ñö 1ÒaÃŽmй¥4/êW~hhh>MÚ¿‹/ö®Íü6mÚ4]QQÑzàÀb‚uTfßùSŠKY]Ÿaö„Ñ•Þ/¯c ‡7þö0ònøðáhÒÒ €zî7ºöîÝûQ]y˜±œ¶†Úæq]&aq©’ýèèè'qqqß®_¿îH“–F ´´´ÇÆÆªèèè<Û¼y³hëÖ­+¸³zfZ´S+ïu† —¨÷’ aG½ 6àÀÄ·oßÄÑ c0Fîîî¬,YYYÏííí¥7nܸÆÜÜüÈïO†ò322r(†@¶]»vmçèèXoïÏÌÌ|éáá!اOŸÿ}øðaZùzž @ÔƒÄ7oÞ(I899m¹xñâÄÙ³g3õõõêàCI&j@ò¡C‡T¶oß¾ðñãÇG Bå„*€]j{÷îµ%»¶?þl¼~ýú93©›ôíÛWDLLŒ‚¤¥¥Å“@ðôéÓâJJJï½¼¼–mÙ²%‚¤*Ÿÿ?ŒKvð ìßIEND®B`‚maven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/root.png0000664000175000017500000000700412561645371025430 0ustar ebourgebourg‰PNG  IHDRu+1‡÷­ pHYsìï)ýÀ ¶IDATxÚí[ OÏ{ ‡·þÄuww÷×TVÞ´‡‡Gî"ßYÌ6lb‰æ{÷î©N˜0¡Êøüùñø\TTTžxayÛ¬"22’1mÚ´OÚ¿ÿþû¦·oßò ˆS¬@JJŠE¾§I½|)))ܘq , jb¼\˜uÛwÒ)¸Ž'Åгp†Œ¤pÐÓÓë`liE=È‹òõ¸¸¸šAMÜÛRë@ÍãîêI\[ÇùúõëÉl}Õx¡øøø0üB‰s&µ$ LfO"ê ¡ˆÏ®Ã"\Ç÷C±Iñ›¼¼ý~RRÒîÁÏÏEEEGÂ=Æ‘„ÆÆÆîA"7°µœ•Åù3&,,,H 9’P—m/^d¹ÿ{ xRVí¹<çO®I;¡w*ræê„©ÝÖ”Ò½õ³Õ1þ)eýAkª£Þ\W ¥å¯‘(ɉ砩66V@þ`ÿ‹ š¤>œó–·½=Þ)%Úgãhvé -™ƒb8,ÙSçÝ9co+% QÚ½ßüñí¢E‹>F2Oï‚ó–,µ„»7Ó üø1¸˜žI„núk¼Aç–òísþ/"º÷žÿ>W.hêS\WW»ˆ¶‘”!RÈOUFô'c¯e€0Îÿnr%¢š¿DA°¯#Ës~ñ5:†6æ=•·yÞØØH0×Çúâ9S 5+Õ8œP]YÃŒX‹¸å“ø&¾ê~MRRòÏþÆÓ[êÿМŸPƒéß]ûÉ<Ön<¯pu_ýLLLââããc'MšÔkŸ²go€_F…³;yÎf"""`Û¶m]ÚŽžý Ü–!µÓÖùµn¾«‰öHÚºœ3?–`Ô××—p¤miiÁ´t:·½¹{ôÂwu±ij`>Wœ¨ÛéëCE§~úúúısbóæÍ4Ž$433S·{iç¡èûžé#¥B¤cÈäêÝ»woåX_ExëˆóPïcffF©©©9˱„†……­3 Ùá4yêTñAÝÃÓÓó1"RŽããѲ²2Q))©ÒˆˆS’»zõê%%%ò#&ÃPZZ*uâÄ —”””oooJ¿®fvv! Ø_>yòÄhÄåŒP4s—cÇŽ¹"bÚØØP444Þ"[KE¦£.//+!!¡ÙÐÐðÊÉ“'×úøø|jGGZp¤I¢^ttôʸ¸8ÛŠŠ ž3fÀ¬Y³@\\&Ož BBBÀÍÍ mmmPWWG|ð.//´Üð.:¨¬¬lFV炃ƒCœ©©éŽô¿v455Mñ÷÷ ^b``Ë—/Ç;ÓˆÒ`Ê”) ¢ÒųÅß­Ñ¢³Þ³gÞÁˆ·HþŽUê—7ÊÔaDVV–óÒ¥K#”ìääÔሲ ØsŸ?>Qæåäää"W'‰"ÂÃÙ»9F™Ê —ûz±?mܸ‘tþüùÏ6¯ŒŒ ±i†UUUTSS;…VñšQ¦øÏ ÖÖÖùUUUrCM¶ØãíHOŸ>]=nÜ8»ëׯÏC6;w”©Ïà}Ìeˆ©<ø‹%''P“““y¬¬¬rüüüV­X±âô(SY_¡dMMÍKKKžÎ)wv‚ÞøĆ€è ·:ÚzÚ;×C^PxCFÁj¤  `íWÁÔ{•¹³·¤¹[ϰ7—7O3é%»ç@èq¼‹„íÏŸû¯³àîÞî O”‚ukÌ ,r@Q áPÜʾ µ $PÑ]s4`¶²,Pº# _è1hÖvùPxzlÏÉÉ)¼víV¿ö£LLMMS„„„tÐñZ¹$üɬW/tšX£ÒÖ€ ¾Qœ1¤çº|ùòìì즂‚]Âv²j`ÐÖÖþwyyùMMÍÛHÕ)ÙÛÛ±ginn.vqqáöõõ=yàÀˆ‡l”M//oC^^žòƒ” 3–-[&œÑϾ763³ÿ=J^^þnqq±=2]¼®Q¦ÊÊÊ*++Ç£2ÑÑÑ1º¨¨ÈØÃÃCEb÷\d2¹2))é²ç²AAA{‘ î5”eÍÐ1qâÄJd×ﻪªJ$ ÀûäÉ“N3gÎä722¢kiiq!°|?´òèÕÕÕ%éééÔK—.ñˆˆˆTøùùí ¾€J¿ãÿ ÅaÂI6kNIEND®B`‚maven-enforcer-1.4.2/enforcer-rules/src/site/resources/images/root-with-modules.png0000664000175000017500000002406612561645371030056 0ustar ebourgebourg‰PNG  IHDRº“Nª3™ pHYsìëM‘ØÄ'èIDATxÚí] <•Í÷Ÿ{¯%BŠT–¨”"­Z•$eéU)[õ -–ò¯¤Ò¢MEiA‹^´½B›Ò"í¥D«¢E²d»ÿ9·®.YîåÊíg¾ŸÏð<ólsÏó3çÌ3s†N§#vQUUÕNTTô[QQ»×°}âÕ«W%‰‰‰alO:µ"??ŸŸk t>1>}š¯Ù¿@p#…þ}#Â܇›sŠÀzsVèþ455)Ì÷ÀÜçê8¹i“ÐŒé‹-bl?xð9::R¸ö€;waÞÐ^ºRVV~ÚìP(Æ{¹råJü·Š··w¿f?kÆ{ÑÕÕ¥¯ZµêW­§W¡ÌÌÌç\Ñùóçk°LH E?®¾äºXÆÕ$$$*°2¤”––Ò¸þQxxxõ6ü¢f?`Ïž=K0ö¬^½š^˜›‹øiˆžóM³]ÏxH³°téROx€ŽŽNüŠŸâáMkë*¸qAAÁT®¾ƒìììÙÒÒÒ'`{ÇŽçΞ={†“&sðàÁ9¦¦¦{q…ÚÌõær÷îݰ邷]ØÑªõÞ¼ËÎ.Ÿ?®ø(ɼqQµ  Ïßʤˆ.-..nפ›-ú$áxqùnIî°ùñ{´{åìjE¶xñâ‚&—œµyÄC‰ÝF_!V éêê*Å™cSDXQQ±R××— û………S¸úBSSSi­Ú,ÖnøùZâÆÌýfݜٞ|8´TèÖ­[¥ ÷f³…ùRÅÅ;Ö8v òIóÅ¢­­} C󮮼:O¡K{äw2š{T¬möqµú×e÷sÔ̱‹ãÇÓeeeËÇ-çÇRÜzW©®¢¢B÷òòBuüùûbPC™Z«Q涸pç¼+?IÀ60~º ºq?¾šKà:ôí&ÌØvqqÉY¿~}çV)|}Nn5¾¼¬]1n ‡úŽ Ï[´:`jÐ×{…רÁЈ€Ëðññ y÷î)Ïqþg¥¬~+ØËiUýpLŸ+,?ñd…­öíÛ±¼)——/Áo®¶ûJrss…ÿXᛊ]»vч RÝíõBL=_VV†&MšDiÕÂCÛljbbÂÌÛºu+½sg)ˆŒfÍB§ÃƒÑÔ?ª8$÷_å3z¿¸â®6Ø· öððp¼sçÎØWWW¯V±µÿƒ'Å3´aµ-˜7n´ŠU[±ÚÌ>ÇÊÊJmžã

ú€ÐD0 h]k÷ÇTkUUUïx®à[·n¥ÔzQZZZr<ÙCmffVakk[ÃÍ{ðàAŠ££cžnòOž<ÉWÇú;l•¿ÖÈruuݳwïÞÅBBB0$÷œ xºàaaa;$%%WŒ9Abz}¸ÒÎwss;îÜ9=ž+øË—/õ¡ÐõwrrÒµ°°โc·/¦¾cÐù¿Ç븈sZµà||||ìY?ìMÆÿV-xee%idA7t``à2ÊÇÇõY<§U° Þóú3n`4ßà‚×gd±ŽŸá)#kèСWßܬۀBÇÅÅñ®‘uöa6²¨ÃÈb¥ .ø{ž+¸ŸŸ_£FÖ¸qã¤yÖÈÂԨذaC #ëæÍ›)kÖ¬ùadµÔÇ+n#))iÆèÑ£Ã6mÚu¡>O fû àà`í &\&vV!&&F?sæ c;::ºÁsåååÁÔÍK¸ªÀ°2ôáà :›8~ü¸{çΙo¢KÂøPâãíí½½ܸqc®´´´#•JeëüÌ”ëhŽý†öï®ßæfš˜˜ØíØ±ãíÊ•+w´¡³Hˆ·ïœ÷ߌcsà[i]çÏœ9óȱcÇjØ,Ê}åч¯|hܰ>(2êêÜc ùïǘ9F¿­Þ¿;þÇBß‘àî´.v…ëŸ|è×¢œNÓêV+hûÑË<Ý'¹/c~™3fÌoרN\†¼¦`l/^¶’!àoU$BeÏ5jÔžQ/+Õ—»AúL·í¸Û}ÒNÇú>û2qêÔ©êžq&ò¿¾ÃüÜûÆø+DeßòÂmÃw‡¶£Ó2P ………üØX/ïÝ»÷/¦«ö®¡>ŽG^@ C¸â=?qVu¾Û2 ’RÕCÁ{W2òpÛçêê:“4¤tgXXXbgâû?ÿüðþ©|âuNfB|ÝêÎÿ‰ÏŸ??URR2SUU}B„ÞÊÜÝÝ)nnnN^^^®ÊÊœMì)--}‰¯{e@ìtáääÚÂígÿ€ÕÒ¥K`}_¡««+Ì4))Jv³ß8p€feeux#äãsˆGÚ\ÀHHõtÆ Õ«Wÿ¿ã¯ýNô7ƒCTUU c«*oúôé‚“'O®÷¼¤¤$äìì\úîÝ».bbbDèMÀ®]»ÂEEE§ƒ{äÈ‘FÏ0`øí>|˜_^^Ó|oÄÇÇ%BgŠŠŠt__ß&_ÏÏÏ6oÞ<ÆÑѱ[d|Dè sçÎôÐÐPŽ®©¯ÎÀÀ€jmm]Öf…^{ÒŒÃjcL[eæÝ¹sÇžó$™,ÞÆÈ33›‰Nž Â[è3221C1!'Q úõM®¡¸Ù³g¦3!’ ¤aÃ†Ý 3º{÷®"öd«Ïa Õfþ4^{fõþ";Žf´i¡>ü.f²1 –¬ë¸½½½kxxø6b2r uMë¬KíÞ½ûÎSõµ.®ÿ¢F:à°úÊ!ê¥$$$Œ„‘XX•ÌùEÕß;Ùª÷è€322Êýüù³:€ °ݺuûxâÄ )v?#21gΜ쌌 ,p¢Ó9Åû÷ï»0·¡Smÿþý+ÍÍÍé#FŒ cÓR7Æ_Ëp;Q†£[ =ƒNt:7°ñ'jçO™2mذ4¤¼"tQYY)"//ÿÅÒÒ’O[[»!U„lmm«?~ÜKAAá-z°gÏžaaacèð:~üx£çãFf,Rß¾}›†š7oޛׯ_÷"BgØy¢=z´Y÷8räHOww÷JÌþDè C‡t–9¶ì( 4~¼6‘AË[£ÿ|{óæMB||ü"ôf¦2ZZZ†íÚµ«Ñs­¬¬àŸº‘‘}þüùzºººç‰Ð9Ä©S§¶>zôh ;g…½½=èÑsØêØð³$BgYYYê·nÝZ£§§×¤ëåääÀËÜtãÆ¸1cÆÜ BgÆ »ج{(((Àp¶k.\ ¡7//¯}œ üeÂet%9õ· b«W¯¦bwþÆl"ô†{沉ì`Þ¿ÓÑ›¬/ŒíÚBäääÀÚmGèçÒbõ¦L:k©fíë=ÙÛ–Fi<ªøòåË«·Ë¾}Eo³sPŸ>½Qdxú^EC&&FˆúÓ¿ˆ;â†äµPˆ“Ru÷k÷£ADŒœ6Åtÿû‡æC‚mKµG¼'ûØÔõââ⬰‡W½ŸŸvÙü¦Á´è^üytÐ{?Šº|•1qWkžÒ6?‰­÷ÙÔ××w>V5ÛÛ¬zñ¿x$ضŠ_À?>¶|,_а‰(Ë\R‡á¯ N°Põ{Fï³›ò\mÉö3¯]»6Žg„^{ÞþŸÆù×ônfÝ­!«Îüýû÷:‡OubY|òPi“ð±oùùùxF§s:›¹©:5¯«x÷ìãFfceÕãkŸ/!!QÔØ=++J*ÊçÔ||Ûæ¬ô 㓦cdF5è¨L›6íXrrò렮 f¥ç!‘ž9z¾ŽŽÎ…6#t­îãâ8©MRRR!8άY³jäï=‡›á&³ª=ùŠÐâÕsù¿âÕVÕØg]h 33ó…¥¥¥›º Mà;§×DFFæa¡×X¥6ïÞQ4þà…²ez©!Ãá?VÜœ¥¥…XcŠhii1þ³~Ùqrr777'iCxöì™RLLLÄäbb£GÝD ºÒð‚‰°Ðƒ···-éhðu~ûöí/8 ÔÜ{á6‚///ï:xþüy_ìAVÜjOéÞ]¶I÷Ø´iÓ3,pe^ûm<ÝŸŽ]w*6!«ÂÃÃ96k±#ô{·Cyñwñü—£ÜÜ\*¬qcdd4rðàÁÎ;)((xfgg×!++K‰WÓ_ñ4!!A½¼¼œ>Fˆ‰‰©ýûï¿å¸‘­Ž\XX˜\1ì5°À?óòïùk>Lóóó—3ߤ¤¤¨ôïß?ùáÇC455 þ–Ÿò÷Ž{Õ¨à?V9‰[ÙÉ`#"t"t‚žž®åààà=;sÖ"XC¤ÓûÛ¶m[Ž-®kDè\B``àŽ5kÖ¬ðòòB‹/f¤ZP+++»:iÒ$ˆn´ËÝÝÝ‘½é `FWœ8q‚êïïßð‰ Â/6—a¯Ú!;;[¬/"tþÓ3æøÂÐÐPŠŽŽNYLLŒ°P :›¯‚ ËMÅúõëaI‰¢§OŸR‰ÐÙÀž={ü#""š}oooŠššÚ} 5"ôFpôèQ ޝ«kÄ™¡¡á ˜ëÔ&…ÓaÞhcç]½zu¶>8¾}#ΰI›;wîmRè=zôHËÌÌ”311 Á–ˆ%³«… z`µ€^¾|…dQ~Æ3tþúm4iŠ1’•EùŸ3PDÔe¤6Z©*É1®ilÄÙ… LÚ´z 1ÛÆÆÆ¡ÁˆõäææŠþ`«5ꯢ„ i¨§p27>†Z¢ÐKÏÐèÝÐbÛ9hÑF?d4N¡Ñg3fÌ þË´ƒŒÆ¬/ oß¾ÕÇßWÉ¢°ýÎŒí{ãÇ#ï7Ñ•‹'ûžÜB!‘¡Xè+}¾ç7"ôZ R©UØ•¿ŒüµÔŸŽ¾á/§ÞÚª÷%¥:¡ô öîß®]» "tô#ÃÎ;W888ìfͯ1±ªæ5];voÒ³Þ½{Gç#‚®)èZBן›ÏMHHh›±v322Ø¢)ö$ajúNîÝØˆ3ì•òõÒV®\¹uÕªU ¡Ó«~éPßt}C¯ª@UU?„ÛȈ³gΜ™B„ÞbbbR°ÀTXój*ƒ õcÅìÙ³éYYY‰ÐÁ“'Oúc¶Ò¡Óª9HKK{xëÖ-† D„μ¼¼”±õV˜ib·ÃëÔÔÔóVVVDèl¢_¿~Ï †îÞ½ûKL¶€ÕÉ㤤¤ nnnk™yDèlbÈ!ýüüø%$$¾úûû·ïرccNV!~A_¢££M±.ÁzŒÀšzùùù"ÐY¦©©yUcÊ”)…JJJÂüüü•8?7º§Nj±Á^½zu¶ÎûQr99¹Lf4ÑÚø‰£á—GDØ 5†ˆ€ ~¤¤¤L³··÷Ä<„8U»²³³aìûÍ›7¯055=A„Î%`³qï¶mÛþFxÕ³"@7œŽc3ñxYYYDhhè "ôf S§NUÁÁÁ”Ç7zî‚ àßô>}úÐoß¾-¯Í#Bç Œ^MÿrèÐ!´téÒÜ;vtëÚµë"tö^ÙœGsçÎ…E¥²¯]»FFx±¬J¼BBBš´bÓ¦MYYÙw²Dè`×®] }||8º&ýù=äéå*i‚h‚žšª3š‘ÞnÅÅÅÂmRè………¢…—˜˜h²oß>Žî}pí|tòækdliº´ûŽ<]×¢“§µP÷:Ô»woêäÉ“cڤС³ fåÁP ë"##“U×y‹-òÄæ!G#¼@à+ö†"}UIÆþ0yad±jÊ:ÆþçÏŸG¶iõ‚›Q ga{äÈ‘·a RÖðøñc°¹9áU;®zYyÍ1†††¥D§ÿ¶¥G²¾¨½zýêHlê¯ë#m«_k4ôíÛ÷ïVÇî œ¦©@@xåŽ NGxÑË ‘–ÎÔCY­£SOFx±zÿþýöÖÖÖ‡Xó±y÷k‡ƒ^¹é‘¥ÒùwZ5¯æLîÌÌÌ"¾¶,h//¯EØ]¯×§ÇLÏÅÿ$8¹oiÞ[†À=£ e~;~ýúuj›úƒØ I²eË'üÏ—“{ëͰB-V!­Òˆuæ/Üж'ê¥Ì™3çváBgw„ 6À•‘XV •Jý1½äääœÅÓgÍkh„וFxYXX¥¥¥]%BoQQQ“UTTèÐÞàôQll,cÒ:¸zõªÔªU«>55Ì ŒðJNN¾ˆ¯O%Bg|Ó¦MrX=d®[·Žc†ƒÀÝÜÜœ˜yDèlœ¥Ë—/S¤¥¥áhì­6è˜A£ :T “áDèMDvvv·oß¾‰èëëŸÍÏÏ6mÚ´RìÚS+0«¿fadd¤!n4ë ?ò×­èõ·àÙ³gæAAASñËPUU…P$Ö7íÚµ+Ä`Ó¯¨¨€®fôéÓ'Æh‚/^@—2*)))455 ĵäØèÑ£ˆD›¢]¸¬qzá6öàáÇ'üóÏ?ÈÄÄéêê2RcÒòLC‡E,A÷`Þ°MQQ‘ ,!f´´´B===—âf%›HœýââÅ‹«ÌÌÌ¶áæ”VüÔ©S¹z7†ññãÇ]]]+7nܸlñâÅ{É DoQÄÇÇ/ÄäóZ½z5âFv1|øpx ›:{ºté≠¿ÈÎη¼Bt®¢ªªJXOOï9ŸÜéÓ§[­RRRÆT^»vÍ ›=k’’’tìØñ yC„èͶ—»+))½Æ”O]]'Ê4nÜ8 vte{ôèñáúõëðÛDÞ!zs4y»¾°µµm1’W–æ£ãv ÿÓ7«óœv… ÝÁ¼®S§N( @`̘1wRRRúÀ¼?òÆþ‰ž}[ýèC?ËiÊ3"&õ˜p‘ÅN9…££cРAƒÚa2q½ü.D[2¶Å¤í¼©èÀÎÌ¢: µk×R ¢=z4ˆPûèß ÅX—eB¼}ç¼iý¦ENU6ŠÐé1áBS+Àׯ_}||¦EFFÖy<û~8š½b?cÛåPz°…&$ÿvžLO5´ÍÍu—ªyÿÏ…ÈzÅd¦¯Žà3„<€8·ÿGŒ!¨Ã;0"½Ûˆéòµ(§ëâ¾Õ@¸sÞT¨*3"uzh_`.ö[€8ØlABBBuç«Þ^o=˜f‡.\Þ‡¨L“ä Z¿ÄÝ|yYë#» G‰fÏêk4Ípí7C èèèÑ‰Ž¾çt xpx¤ÚÀvÔÿy­S_íÂGå«&ÿÇ…a.4;P7´C[›ÔÈ£µëˆ¶ðAöÓ¦¢”„üÐôñ.ðYšë¿MVV¶èîÝ»J„Ú„è tïžm¬l2UyzäXÙÑñTÿªæüüüß¿³·€í€õ8ª1$«Ð ¥$å¡âôtôW£Î4îÿ®òòòJAAÁï„ÚmŒè°ˆ¸‘²qð4eÃÈ1²£o4DèúпÿWd¯µÈ®l™º…ÍßîÇFGq$Bk™ß›ššÚV²$Ôþ%:ÚXÅzz„ºÌÈ„¦º>èêê—””x§¤¤tRQQiðܘð`di Šj™%…é·P̃CT†Ž„÷Í …ò¾šÞ¼yó¡öÿ ÑõzL<—¾4]¦%Ÿáãã3éÒ¥GŽið¼N©HGS) ƒ†©ôÄÕ­=ŠCOÒ?2ŽwSÔ@.޳~]Pù ™k›¢wõÜÏm™ rc­ÐƒôQÐîº× 8zôè; ‹¨¾}û>'Ô&6z“```yïÞ½­[¶lYëìì\ïy¦Ëö2>ðd½~‚nÞ¾‡¾–PÐ@ d>t2@Ñjc§vDë½ö£rÄÞÄcZ;±:óž&''»sçŽy[„èÍ‚‹‹‹óÖ­[K77¶ª—L/UdŒSãö?ê­¬Ò¬rÅÄÄà:x¯“\“¼%Bt®`íÚµ[ôõõc455oa² ***¶ZYètzº½½}Õ‚ wîÜéIÞ!:W1xðàÄüüüvØŒqÞ¸qãæ;v48/ºœÎìíÛ·­¬¬ÌNLLœ, PFÞ !z‹Ûê[ ›6229s&Lm rW<þ<W¬î¦¦¦¡Ø\qdg-OBt®/„²‚•×­[·¹C‡ÒÆÆÆ•£Gæ‡YBœW–ÒÔÔÔ´¨¨¨ª¸¸89ˆ°´aÆM666ßˆÄ Ñ[XëÒ!¾$f,“«¤]¾|y„}ÌÍÍ•”(+Ã&GeEEýÛ·o´¼¼>¾òþýû'CˆH sç·¼„è<^½z½†…6ëZl*FK4$ D' D' D' h1”——‹¿}ûv@NNŽTII‰vÞ¿wìØñƒ‚‚ÂQQÑBt‚¿‰Ì!!!K|||$&&v…Èejjj°Œ.ø1ÈœqFƒù¹;í°vzÿþ=D=CÉÉɰ”œ—}_{{û}’’’Ÿ Ñ Z©©©­­­ý1Q¥mmm‘††„ãfûz·---ÍH&L@K–,liœÖÇÆÆ®÷õõ…JðÑËËËÎÐÐ0’àN§óíÛ·/pݺuÆÜiýúõ-òœnݺ¡Ÿav»|ýú5Âùa 1<<|†ˆˆÈ7Bt‚C``à^;;»ÿÛµkú“Á v% ²Ã&Ï$}}ýB¼…Ÿ?ºo Ñ ¸iKŽ9òuÿþýÅZ3z ½pqq¨Ä˜ìß/^¼8vĈwÑ šüüü¾={öLÙ°aÂbóÀ¦?u꿹¹ùMggg«9sæ%D'h2 åÀ;99ý’sÉ ÙƒR-,,|»téò‘½ AYYù©ªªê“3f„CD/!!¡’æÜoùòådž.~[Mddwuu¥Á€;Bô6X%$$Äk~ûöí‹`Ù##£0v+@qqqWooïéáááŒýOIg‘é’Œm÷ Htßk=:yãÉo×Ͳ߀Ì‹Nûº!ϱ¿ï7Ñ y®µ¨1¹¼9‘̰CÅþƒ!:D nËCª«@ 0eÊ”3¬ **ʬOŸ>pÎOíùk(òò™†hÚ‚5(nóÞê™°çŽî@;üΡÀý›pB¨ïè™(&ö b®ÿîQ42wð@ÏbýÐJZ òt²©¾_s#™3æ+!z+ƒµ ìo¨T*µjìØ±ñØ&}ÙuaêümhɬQ5òôfÏA˜èí@IsòÙ`]ã¸ì Ðä¡AŒ ßpõwàrV¢·2þä0ÝîÝ»gdffʱs.ZMMí¾™™ÙIÐèp-ëq___LJÖym{Q±ïÝSº÷•qIII!zLÇ:tèƒú]°V¿°bÅ ÷¿á7>}ú”¬ØÝ–O`'„®JJJɪªªwccc‡Oœ8‘g3n™¾“Fm µÍæÂßß¶Õ_Áò2-VèfF2óóó{giiyš ÉèÙ³çëcÇŽ[[[‡ùúìAû÷{açº IÉô¬ÃF’D¼½Pv½Å$ëvbgÚoBúÅe5£‘5#’Y\\\rFFÆ'LvGBt‚fÁÐÐ0\\\|‚±±ñ¥€€ ³»ñwð!Å~Ê ÞKFAñ÷8ÄM‹dF?qâÄÃÜÜ܌˗/Oÿñt‚fbüøñqoß¾§VWW·&«•¥¸¸øÅ‚ :ìÛ·o몄è\Œñâ…ÒíÛ·GêééÅ.\¸PäO:©%%%/œœh#G޼ž••eý{{B@ÀE`¢Ýþòå‹hzzºü¬Y³±†¹lÙ2ªœœןE¥R?EFF¦a§XiïÞ½[’’’Ž¡z '‚€¼¼|zBBclÖ(lÚ´iCXX˜Ù¸qã´µµ« Ä)÷è¸Ò¤a“Cp…„„ rÙîÝ»ÃpjôbBt‚‡‚‚Â[???+HÌ}ú¤œššªœ››Û±´´”F£UˆŠŠæËÉɽÀ6ú~~þrBt‚¿˜ÀÝŽ;æèíí=“ºL¿2d‚ˆ]ÐõÓÞÄÄĉ‰?¢ôôôêH]·oßF™™™%&&&'_·™„è-†ÐÐÐóçÏ_ýÜ2,ƒ5:lö_¾|y6^¿~]æ¼¢p •••boäåå%Z3RÀÎ΢ éÝ»÷7OOOSlχ¢4ÅÅÅrŠŠŠo–.]Ê×Òñ]Ø…ˆˆÄ„§AÏŸ?ï‹ÿ»¢4ËÇä~jmmÝ¢$¯*ÍCÞ®[PøµÄzÏéÚc Ú†Ïé!%RçââBŦÌz™,Bô6/ÂÇÇWÁœ hÎý°£¹;~"ššš-VæIÑÈlÉåè»öŠöíqE’,S«J¿ 5övèÎëÇh®©Z玴úub-# ÿV/Bô¶eKÓ`Õ­[·F-Y²d3" 6ìTˆÖÅNÀÚœßÃÃcÁû-©«¬½Zçì„>|ÌG&¦H´c©í:"çuÈÀrcÿAÂcLôñÕÇ…„„&:€Q`Â$lk{ÖU ••­ž£7K\\œÊ bÔR‘ºäzõg¤úQŠ<¶2ë¬26ÓøíŒQ£F¢·2x9RW]>Ç7îÚ!CÒ¥¤¤ê¼îÏDêªÂ•g®<1Œ=…~:hÿ¾U¨=­û½kW¢Ñ[Ù™û£‹éœNX½šsÐz"ÑÂÜËÚ c9sf.Nó꺶%#uNGΫנÄÔlÆ~ßáfÈ}« j(BQqqq!zZCCã:¼bw¥7mmí“oÞ¼ñ­¨¨ `·ÅË™—žˆ/^†²ʾZ¼n2Ôb/&{RR?!z‚¦¦æU[[Ûœº>À “ ˆˆˆYø –ºm]2]JÊd|Ín/4q '¦aehhh!z‚‡‡‡#7ïçããcƒí_#---–*ó®Õs1É™>p>Úæð/ÚÖÀùÒƒ&£»—WïgL˜0!ޠɀ׮]SÇfÌÝã~)-©ËÔz=Ò5g8:¿P‡êí›7o¦Ü¿¿øîÝ»ó Ñ šëàÞ¿sçN_55µäðÃBYu£i‘ºdzôF2œ‹v?555“\÷ÇÓ š‰>}ú¼üúõk;¬Ù/uèÐaüÏž[%%%/lllD]]]=÷ïßø«šp¢"..N+--­ô³ã$7oÞ¼?Jp'''ss###cþïí Ñ£G4L´îbX³¼qã†Ù²eË胦´@åzúîĉŠ^^^›’’’‚P½†A @LL¬ ((h&ø˜@zèñÁd\Ô³gOqJuuu˜&Ç. ›077÷õ¥K—ø¢££ÛuíÚ5kݺu›÷íÛ…S£×ÿ?æáK èÛØ IEND®B`‚maven-enforcer-1.4.2/enforcer-rules/src/site/apt/0000775000175000017500000000000013133666304021236 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/site/apt/versionRanges.apt0000664000175000017500000000426413121176075024575 0ustar ebourgebourg~~ 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. ------ Version Range Specification ------ Brian Fox ------ May 2007 ------ Version Range Specification The {{{./requireMavenVersion.html}RequireMavenVersion}} and {{{./requireJavaVersion.html}RequireJavaVersion}} rules use the {{{https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges}standard Maven version range syntax}} with one minor change for ease of use (denoted with *): *----------*--------------+ | Range | Meaning | *----------*--------------+ | 1.0 | x \>\= 1.0 \* The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions here, so it has been redefined as a minimum version. | *----------*--------------+ | (,1.0] | x \<\= 1.0 | *----------*--------------+ | (,1.0) | x \< 1.0 | *----------*--------------+ | [1.0] | x \=\= 1.0 | *----------*--------------+ | [1.0,) | x \>\= 1.0 | *----------*--------------+ | (1.0,) | x \> 1.0 | *----------*--------------+ | (1.0,2.0)| 1.0 \< x \< 2.0 | *----------*--------------+ | [1.0,2.0]| 1.0 \<\= x \<\= 2.0 | *----------*--------------+ | (,1.0],[1.2,) |x \<\= 1.0 or x \>\= 1.2. Multiple sets are comma-separated | *----------*--------------+ | (,1.1),(1.1,) |x !\= 1.1 | *----------*--------------+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requirePrerequisite.apt.vm0000664000175000017500000000442412264020440026434 0ustar ebourgebourg ~~ 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. ----- Require Same Version ----- Robert Scholte ----- 2013-06-16 ----- Require Prerequisites This rule enforces that the prerequisite is specified since it is not inherited from its parent. Defining the prerequisites is especially useful for plugins to enforce at least a certain version of Maven. The following parameters are supported by this rule: * mavenVersion - an optional value contain a versionrange or the version at least required. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-prerequisites enforce 2.2.1 [2.2.1,) [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireReleaseDeps.apt.vm0000664000175000017500000000653011435515736026167 0ustar ebourgebourg~~ 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. ------ Require Release Dependencies ------ Brian Fox ------ Auguest 2008 ------ Require Release Dependencies This rule checks the dependencies and fails if any snapshots are found. The following parameters are supported by this rule: * searchTransitive - if transitive dependencies should be checked. Default: true * message - an optional message to the user if the rule fails. * onlyWhenRelease - if this rule should only be executed when the version is a non-SNAPSHOT version. Default: false * failWhenParentIsSnapshot - if the parent should be checked. Default: true * includes - List of dependency patterns to include when checking for snapshot versions * excludes - List of dependency patterns to exclude when checking for snapshot versions [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce No Snapshots Allowed! true [...] +---+ Includes/Excludes Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce No Snapshots Allowed! org.apache.maven:maven-core org.apache.maven.plugins:* true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/index.apt0000664000175000017500000001046513121174604023053 0ustar ebourgebourg~~ 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. ------ Built-In Rules ------ Brian Fox ------ 2015-01-27 ------ Built-In Rules The following built-in rules ship along with the enforcer plugin: * {{{./alwaysFail.html}alwaysFail}} - Always fail... used to test plugin configuration. * {{{./alwaysPass.html}alwaysPass}} - Always passes... used to test plugin configuration. * {{{./banDistributionManagement.html}banDistributionManagement}} - enforces that project doesn't have distributionManagement. * {{{./banDuplicatePomDependencyVersions.html}banDuplicatePomDependencyVersions}} - enforces that the project doesn't have duplicate declared dependencies. * {{{./bannedDependencies.html}bannedDependencies}} - enforces that excluded dependencies aren't included. * {{{./bannedPlugins.html}bannedPlugins}} - enforces that specific plugins aren't included in the build. * {{{./bannedRepositories.html}bannedRepositories}} - enforces to not include banned repositories. * {{{./banTransitiveDependencies.html}banTransitiveDependencies}} - enforces that project doesn't have transitive dependencies. * {{{./dependencyConvergence.html}dependencyConvergence}} - ensure all dependencies converge to the same version. * {{{./evaluateBeanshell.html}evaluateBeanshell}} - evaluates a beanshell script. * {{{./reactorModuleConvergence.html}reactorModuleConvergence}} - enforces that a multi module build follows best practice. * {{{./requireActiveProfile.html}requireActiveProfile}} - enforces one or more active profiles. * {{{./requireEnvironmentVariable.html}requireEnvironmentVariable}} - enforces the existence of an environment variable * {{{./requireFileChecksum.html}requireFileChecksum}} - enforces that the specified file has a certain checksum. * {{{./requireFilesDontExist.html}requireFilesDontExist}} - enforces that the list of files does not exist. * {{{./requireFilesExist.html}requireFilesExist}} - enforces that the list of files does exist. * {{{./requireFilesSize.html}requireFilesSize}} - enforces that the list of files exists and is within a certain size range. * {{{./requireJavaVersion.html}requireJavaVersion}} - enforces the JDK version. * {{{./requireMavenVersion.html}requireMavenVersion}} - enforces the Maven version. * {{{./requireNoRepositories.html}requireNoRepositories}} - enforces to not include repositories. * {{{./requireOS.html}requireOS}} - enforces the OS / CPU Architecture. * {{{./requirePluginVersions.html}requirePluginVersions}} - enforces that all plugins have a specified version. * {{{./requirePrerequisite.html}requirePrerequisite}} - enforces that prerequisites have been specified. * {{{./requireProperty.html}requireProperty}} - enforces the existence and values of properties. * {{{./requireReleaseDeps.html}requireReleaseDeps}} - enforces that no snapshots are included as dependencies. * {{{./requireReleaseVersion.html}requireReleaseVersion}} - enforces that the artifact is not a snapshot. * {{{./requireSnapshotVersion.html}requireSnapshotVersion}} - enforces that the artifact is not a release. * {{{./requireSameVersions.html}requireSameVersions}} - enforces that specific dependencies and/or plugins have the same version. * {{{./requireUpperBoundDeps.html}requireUpperBoundDeps}} - ensures that every (transitive) dependency is resolved to its specified version or higher. [] You may also create and inject your own custom rules by following the {{{http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html}maven-enforcer-rule-api}} instructions. maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireFilesDontExist.apt.vm0000664000175000017500000000430311433600167026662 0ustar ebourgebourg~~ 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. ------ Require Files Dont Exist ------ Brian Fox ------ August 2008 ------ Require Files Don't Exist This rule checks that the specified list of files do not exist. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * files - A list of files to check. * allowNulls - If null files should be allowed. If allowed, they will be treated as if they do not exist. Default is false. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-dont-exist enforce \${project.build.outputDirectory}/foo.txt \${project.build.outputDirectory}/foo2.txt true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireSameVersions.apt.vm0000664000175000017500000000536412156436543026414 0ustar ebourgebourg ~~ 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. ----- Require Same Version ----- Robert Scholte ----- 2013-06-13 ----- Require Same Versions This rule enforces that specific dependencies and/or plugins have the same version. The following parameters are supported by this rule: * dependencies - an optional list of dependency patterns * buildPlugins - an optional list of build plugin patterns * reportPlugins - an optional list of report plugin patterns * plugins - an optional list of both build and report plugin patterns * uniqueVersions - if SNAPSHOTs should be compared by their timestamped version or not. Default: false [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce org.apache.maven.plugins:maven-surefire-plugin org.apache.maven.plugins:maven-failsafe-plugin org.apache.maven.plugins:maven-surefire-report-plugin org.apache.maven [...] +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireOS.apt.vm0000664000175000017500000001041412130270746024300 0ustar ebourgebourg~~ 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. ------ Require OS Version ------ Brian Fox ------ June 2007 ------ Require OS Version This rule can enforce certain values about the Operating System and processor architecture. The values and code used to determine if an OS is allowed are exactly the same as the OS Profile activation in Maven. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * {{{../apidocs/org/apache/maven/plugins/enforcer/RequireOS.html#arch}arch}} - the cpu architecture. * {{{../apidocs/org/apache/maven/plugins/enforcer/RequireOS.html#family}family}} - the family of OS. Possible families are: * dos * mac * netware * os/2 * tandem * unix * windows * win9x * z/os * os/400 [] * {{{../apidocs/org/apache/maven/plugins/enforcer/RequireOS.html#name}name}} - the name of the OS. * {{{../apidocs/org/apache/maven/plugins/enforcer/RequireOS.html#version}version}} - the version of the OS. * {{{../apidocs/org/apache/maven/plugins/enforcer/RequireOS.html#display}display}} - flag to display the detected OS informatin. [] Family is calculated based on testing against the name string retreived from the JDK. The name, arch and version values are retreived from the JDK using the following code: +---+ public static final String OS_NAME = System.getProperty( "os.name" ).toLowerCase( Locale.US ); public static final String OS_ARCH = System.getProperty( "os.arch" ).toLowerCase( Locale.US ); public static final String OS_VERSION = System.getProperty( "os.version" ).toLowerCase( Locale.US ); +---+ Possible arch, name, and version values can be found here: * {{{http://lopica.sourceforge.net/os.html}lopica.sourceforge.net}} * {{{http://tolstoy.com/samizdat/sysprops.html}Sysprops}} [] The various options are considered to be "and'd" together but any number can be specified. (ie family = windows means windows, but family = windows and arch = x86 means only windows on x86 processors) Any parameter may also be used in the negative by prepending a "!" in front of it. For example !dos means everything but dos. (who uses dos anyway?) Since the various names, versions and architecture values cannot be listed exhaustively, there is an easy way to display the information for the current system: +---+ mvn enforcer:display-info ... [enforcer:display-info] Maven Version: 2.0.6 JDK Version: 1.5.0_11 normalized as: 1.5.0 OS Info: Arch: x86 Family: windows Name: windows xp Version: 5.1 +---+ Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-os enforce Windows XP windows x86 5.1.2600 true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/bannedPlugins.apt.vm0000664000175000017500000000535012053711016025150 0ustar ebourgebourg~~ 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. ------ Banned Plugins ------ Paul Gier ------ November 2012 ------ Banned Plugins This rule checks the set of plugins used during the build and enforces that specific excluded plugins are not used. The following parameters are supported by this rule: * excludes - a list of plugin artifacts to ban. The format is groupId[:artifactId][:version] where artifactId and version are optional. Wildcards may be used to replace an entire section. Examples: * org.apache.maven * org.apache.maven:bad-plugin * org.apache.maven:my-plugin:badVersion * org.apache.maven:*:1.2 [] * includes - a list of plugin artifacts to include. These are exceptions to the excludes. It is meant to allow wide exclusion rules with wildcards and fine tune using includes. If nothing has been excluded, then the includes have no effect. In otherwords, includes only subtract from artifacts that matched an exclude rule. * message - an optional message to the user if the rule fails. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-dependencies enforce org.codehaus.mojo:build-helper-maven-plugin true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireFilesExist.apt.vm0000664000175000017500000000424611433600167026043 0ustar ebourgebourg~~ 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. ------ Require Files Exist ------ Brian Fox ------ August 2008 ------ Require Files Exist This rule checks that the specified list of files exist. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * files - A list of files to check. * allowNulls - If null files should be allowed. If allowed, they will be treated as if they do exist. Default is false. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-files-exist enforce \${project.build.outputDirectory}/foo.txt \${project.build.outputDirectory}/foo2.txt true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireNoRepositories.apt.vm0000664000175000017500000000507611776417041026761 0ustar ebourgebourg~~ 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. ------ Require No Repositories ------ Brian Fox ------ Novemer 2007 ------ Require No Repositories This rule checks that this pom or its parents don't define a repository. The following parameters are supported by this rule: * banRepositories - Whether to ban non-plugin repositories. By default they are banned (true). * banPluginRepositories - Whether to ban plugin repositories. By default they are banned (true). * allowedRepositories - Specify explicitly allowed non-plugin repositories. This is a list of ids. * allowedPluginRepositories - Specify explicitly allowed plugin repositories. This is a list of ids. * allowSnapshotRepositories - Whether to allow repositories which only resolve snapshots. By default they are banned (false). * allowSnapshotPluginRepositories - Whether to allow plugin repositories which only resolve snapshots. By default they are banned (false). [] Sample Plugin Configuration (showing some defaults, defaults can be skipped): +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-repositories enforce Best Practice is to never define repositories in pom.xml (use a repository manager instead) [...] +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requirePluginVersions.apt.vm0000664000175000017500000000712211715233755026757 0ustar ebourgebourg~~ 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. ------ Require Plugin Versions ------ Brian Fox ------ November 2009 ------ Require Plugin Versions This rule enforces that all plugins have a version defined, either in the plugin or pluginManagement section of the pom or a parent pom. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * banLatest - disallow any use of "LATEST" as a version for any plugin. Default = true. * banRelease - disallow any use of "RELEASE" as a version for any plugin. Default = true. * banSnapshots - disallow any use of SNAPSHOT plugins. Default = true. * banTimestamps - disallow any use of snapshot plugins with timestamp version (only enabled when banSnapshots is true). Default = true. * phases - The comma separated list of phases that should be used to find lifecycle plugin bindings. The default value is "clean,deploy,site". * additionalPlugins - A list of additional plugins to enforce have versions. These are plugins that may not be in the poms but are used anyway, like help, eclipse etc. The plugins should be specified in the form: group:artifactId. * unCheckedPluginList - A comma separated list of plugins to skip version checking. Ie allow no version, or snapshots, etc. The plugins should be specified in the form: group:artifactId. [] Sample Plugin Configuration (showing some defaults, defaults can be skipped): +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-plugin-versions enforce Best Practice is to always define plugin versions! true true true clean,deploy,site org.apache.maven.plugins:maven-eclipse-plugin org.apache.maven.plugins:maven-reactor-plugin org.apache.maven.plugins:maven-enforcer-plugin,org.apache.maven.plugins:maven-idea-plugin [...] +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireEnvironmentVariable.apt.vm0000664000175000017500000000403013013430006027712 0ustar ebourgebourg~~ 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. ------ Require Environment Variable ------ Karl-Heinz Marbaise ------ December 2013 ------ Require Environment Variable This rule checks that a specified environment variable is set. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * variableNames - The name of the environment variable to be checked for. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-environment-variable-is-set enforce the_name_you_wish_to_be_checked true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireReleaseVersion.apt.vm0000664000175000017500000000372411304267065026715 0ustar ebourgebourg~~ 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. ------ Require Release Version ------ Brian Fox ------ August 2008 ------ Require Release Version This rule checks that the current project is not a snapshot. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * failWhenParentIsSnapshot - if the parent should be checked. Default: true [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce No Snapshots Allowed! true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/banDistributionManagement.apt.vm0000664000175000017500000001243512566375222027534 0ustar ebourgebourg~~ 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. ------ Ban DistributionManagement ------ Karl-Heinz Marbaise ------ June 2014 ------ Ban Distribution Management This rule can be used to force the absence of distributionManagement in your pom files. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * allowRepository - You can allow repository entry (default: false). * allowSnapshotRepository - you can allow snapshotRepository entry (default: false). * allowSite - You can allow site entry (default: false). * ignoreParent - You can control if the parent will be checked or not (default: true) (deprecated don't use it anymore). [] Sample Plugin Configuration: +------+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} no-distribution-management-at-all enforce [...] +-------+ * Best Practice Usually you should define the <> only in a limited number of cases. If you are in a corporate environment it makes usually only sense to define the <> in the corporate pom and forbid the usage in any other pom's. Sometimes it makes sense to allow for example the site repository definition in your other pom's which can be defined by using the <> rule. For this use case the following has to be defined in your corporate pom file: +------+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} no-distribution-management-at-all enforce true [...] +------+ * The Project Types If we take a closer look to the possible project structures you will find the following cases where the green arrow will show our current position. * The Project without Parent. We have no parent and no modules at all. This could be the situation where we are creating a corporate pom file or another simple Maven project. So the definition of maven-enforcer-plugin is within this pom file. [images/root.png] Root Project. In consequence it does not really make sense to check if the pom contains distributionManagement entries or not. * Project with Parent. We have a project with a parent. The parent is likely a kind of a corporate pom file which contains the definition of maven-enforcer-plugin. So in this case it makes sense to check if distributionManagement entries are made or not. <>: At the moment it is not possible to check if the parent does not contain the definition of maven-enforcer-plugin which would change the situation. [images/root-with-parent.png] Root project. * Project with Parent and Modules. This situation is more or less the same as the one before. So banDistributionManagement rule will check the distributionManagement entries. [images/root-with-parent-and-modules.png] Root project with parent and modules. * Root Project With Modules. If we don't have a parent this means the definition of maven-enforcer-plugin is likely done in the current pom file which means it does not make really sense to check the distributionManagement. [images/root-with-modules.png] Root with Modules. * Module of a Multi Module Build In this case we have the scenario that the module m1 has a parent <> which could contain the definition of the maven-enforcer-plugin or the <> of which in consequence means to check the distributionManagement entries. [images/module.png] Root with Modules. [] maven-enforcer-1.4.2/enforcer-rules/src/site/apt/Images.odp0000664000175000017500000003243612561645371023164 0ustar ebourgebourgPKõP G3&¬¨//mimetypeapplication/vnd.oasis.opendocument.presentationPKõP G·©0¥÷ ÷ Thumbnails/thumbnail.png‰PNG  IHDRÀd*1 ¾IDATxœíÝLÓwÇñ/´ý¶€`¡ü+¿…S~tõÇÔ1ü±Ã¡îÆMçŃ͋^²dΘ¹Ì»Ü¶—%wÉ-¹˜x·ÌärÞnTæ\@7§0й Qç@”ò£@ -í½ég6=¶y»Ðo!{¿KHi+ëŸç·ŸO¿Ÿ¶j·Û-p¥Øÿ‰J r{Ð…i7ÑÏ ïÞ  eðô‚J¥ öåâ2™œœ¤Ët«ä‰%@(€÷ îòP«Õb@Ó(§_N§ÃáðŽr­VK?é>bÄ‹B©xÿˆB@‘¼~ètD§‘=<<|õêÕæææÞÞ^Y–ív;ÝAì© €.h4šÌÌÌììl£ÑH£ŸR¡;à©¥àˆ. ýÁÁÁòòòîîîðððÄÄÄef³F–½{)Hr»Üô¬@w·X,]]]tõÖ­[M&5@%(÷” €æ0tü®­­=qâÄÒ¥ÙÛ·o—eÕ:25±q¹m6›¬ÕºÝ.ú:Ž~U©Ô)))i©©4é¹w÷²K—.íÚµKü5< €B”šÑèomm­¬¬Ü±c‡Ó1ÑØPoŸp™òr:®¶9ÝAÙK—t¶·J*­!2¼±ñÚCfóЀ¥¡«Ë¸(ùâçç I»vï.++«¨¬ÜúÔSb= ÄãP$qø§ÉŒÙlŽ˜¯?þÞ?›¯ôá½wú&'F[®´ X>;sf]áÆOTiµº¶ö§m$4Bßt¹ixТ´Z­ùùù.\ ° å(€¬z½žæô:vÂáXµ¦ Óù·Ãï,[ùpl´JÈZš—•‘zªºº°èñ±ÑѯoMlyâÉO?>NkãÌÅ‹e ­›­!!!æ? $E/ï¬[·î£“'ÛÛ;âbc*?:Ù™˜˜œšzóÆMµ*xhp0Roˆ˜¹xqÚÍ·–d/³ŽŒŽXU]X¨³µ­mIVzmmÍsÏ='þ …(¸¦g€?¼òÊuŸœMNÍøÕÓ¿Œ1nÜè–u¡AÒÔ1F.)}¦§÷NBÂSn®,Ë‹ŒÛÆÆF¿üêòÑ£å;wî\¶l™˜MáI¢TbÔÆý/¾˜—›{î|]}ÝyÏK=©“®©%2àšœt8œ‘‘‘K¿Û-ݹÓ{ïÞ=—ËœœôÛÝ»£¢¢ÄË ý Ï‹ÓÀ4ˆ7xX,–ÖÖÖööö‘«Íf£[ÛÚÚRSSÕjuXXÝ-..®°°0%%…®ÿPL¥”£à"Xìüçƒé:¢?â!î0>>NUìß¿?==Ýwžã=,þ-ÿ (Ï{®ØD£\ hº@Óýúúúººº†† ÀápˆWúÅÞqC@ñíÐb‹ýž’ϰ~ûí·égyyyii)"†¾Ò`šÀ½ÀKÌm¶oßNÓýÌÌLï5$ À;˧nqqqll¬À{=ž ÀfáabÉë{]#vG£° f8bôÓ„§¥¥¥»»ûÊ•+YYYË—/—ð<³!ÐkÜo½õVWWWjjjBB‚Óé¼2qA\gGGɯÓã×®]+..–𠸦ÎvïØ±ãå—^\S°~å ³Õ:’ÿhÁÐÐPuuõÆãããñ<¸E0Mñ©E‹ŒýµìÝwßÿq˜”””˜Ífß·¿Lû`9ßtø´,ð£€ND1ÑÑûöퟔ••µpáB±;hÚ–81ú¥û»©½Dì¤@àÞ ''ÅÂ<¤ûçÈ|G¹ýtçþþþªª*š&‰ëW¬X‘ŸŸï}³€R<€oG³ÛEÇîà •hÀwktÿ Äâ£sůbô·¶¶:t('''##ƒ®Ÿ˜˜8yòdssóóÏ?Óà3 À{ ~ÀÛïoöTS“®IUÐô÷¾øòé‚x ¥Ýn?|øðæ-[bcbìãv§Ã©ÓéÒÓÓÞ{ïß´hÞ²e VÌ0s3 À;”½ïùš†= ëÎþÎ!ûÀòÄ•4ø¥ÿþF Ég…ÐÐÐ`0ÒÓÓéÊÓ§O'&&ªUªžÞÞq›-6>¡áÜ™c'?yù÷¿k8vóæÍøÀ˜9?<HžlvL:¾;.gthôÇï­Ø»*Í\”±eë’§sâré&:„[,Zã:ºýæ›o=ztÆ ¥¥¥ô§ëÏžùò«ËÃCƒóÂçb®]5/´ÞáthµòÈÈHxxø <€ßÖ·†n ØTÁÓç$@_H_ïH¯ä–zFz[úšV׈hNßÞÞ>00 èëë³Z­t}wwwSSSJr’}ÜQüxѹ3µë×ÕÔœÍÈZbˆŠÒéB¼¯ Ìߦ@Kb—~簾@AÁÏ>¤ùyÆc,ÊW{>!ÂseHHˆÉdŠŠŠëš½úꫯ¿þznn.]>][Sùþ49štS*µFóyݹ–+M'ÇÇÅwjÌ?¦@ASÿy^çùþ9-|Ó ‹£3§>ógÒ陸»¯‰U2= ¬^½ÚûZPvvNrZZB|ü/ŠŸÔh4EE XöìÝwáâ&S€O΂™óÛ3Ñ¥ï[Ž~ûÚ¿ÛEs¡`)˜æHÞ3\ÞoIòþC_4÷ìÎÇŽÛ´iÓ¼yóæÏŸŸ˜¸°¥¥96&úZ!Üÿ¡>~`.@Ÿ DyLò¿îæýH,­†õz}EE…Z­ VÙl¶¤¤¤h§¾]o ?˜…Ïú1ÄÇ*:NZ$˜Ífº@=Ȳ,ÎxϦaôà ÍÑÄ4I­Vß½{—fA£££ÔƒÃá  Ä7 KØ 36WxðVˆ””Éó…ª5µ5---{öìÁË à³€xõSú1[!ìvºU£V †3Ÿ|úá‡Õ›7c+øÁlðl…°Û)ƒò²ܾÓ¿`á—¾**Ú„­0s³€8ðÿè­áóõÑ=áþû;ÿJHˆ ˜•?%³€8lÆëׯ{¾Éõà­®]ûÙ¹}DØßÊÞýÍî]7¯wº\X€ÌNâÌW’‡¸F,~p+„Ó©Rýé7æûï ‡„èfå‘ÃO̬MĪ×÷|Ö¶BȲ¼n}uYžF#Ÿ¯o\±Ü,ËØ ~0›S ßáë=û+ýðV•*‰¦F bKKK$l…˜+ç~h+DdddUU]O×`+øÝ\ `±‚0™Lyyyccc4_Òzx7ÒaôÃÌÍÅÄàö6@¿ÒÈûÊ)>üh. }盆ÅÄÔ£ühŽ LûŠUß7àÏæÃ‚Ÿ9€Ò°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÖ°†€5¬!` kXCÀÚ’;…¹¬kšIEND®B`‚PKõP G settings.xmlÝZQsâ6~ï¯ÈxúÐ>’\rI˜À !¡aŽKh ×^ß„µ€Yë‘äúë+C ØÄ'ÛNïánΖ¾oµZi¿]|õé5à/ CÑô޼>R&¦MïiÔ­]xŸZ?\ádÂ|hPô£„®)ÐÚ QfºPåë¦IÑ@¢˜j€jh¿!ˆÕ´ÆæèFL¶|òÊ™xnz3­ÃF½>ŸÏçQNëÇ———õøíjh(A(¢cƒónÎÙ¤õQLØ4/Êrôæ|D\m',~rttZ_þ5ZŒçå²ck>¡±yÌßøŠä…±cwV½´j¿í—kÛ“ÍÚ‘¯µŠ‡U´®ç,ÿ©1 ‘ƒä±µ±éÊÆ ƒù:z¼´yoç|eÊ: -Œ0ôV/õ"4/™Ð^ëäô䪾 ó]Ð}˜è4ìÚåÙEaðßÕ³4ô㓳ó…áï€Mg©ÖŸŸÌ _ HXc‚Â+Ðm*˜§ïT<Ç›\ä1æ=ºe¥Ò҄ײAqìæˆ_$£=•¸c ~ŒÈ¯¥eEà»Ŷ‡×à•#zO  GhYÊ·}…> SøBä” U‰ý»ÏdR”ইñŸàë®4+g 9BÕ,fÀ#uGå Ú|NïEo!²Ø[7’L‡æ¤ñìíq€[Î&ˆ†òEì¶¾y Û–.õÖ;;:r]Í.W[”ìGŸ,LÒÛÆ' >ž^#äÂkÕsÿ¹hºÙ207¤&ÿkúè?}ß”úûP÷ØÖæúW±÷ØAŽ»&öLjƒ¬0ߨ»ú³IÃÛ‰r†ÒÇs3nn4 <øÔõ@Æ¡ði®è©ŒŒ“;œùÏ#xÕ·”e&á"41AgFÄqY$T“CÎ(¨ÈGœ—º Ö-v†Úä"·C'¾sg}z's”k³ F©ÚÕQþßËÇÉ[.œ»«ä© ÓxSS:Ë?àÙ¦CïݺÏðbÈ{­v‡¶b56ú÷{SñK¢QVÈqcå•ÎR x[s|ûÖñ­šuôT¬v-Í­°b-³š+’@ z¢úÄàA¤Hƒ<6§<Ül d½Nú éèüí¤åƒHÆYû{úJí0ä‹'ò†hR¾ª¸fÚ,tdcá鱟Ñöøñ§ÈðsBPWI?T8vc5"F£ôdÛó´»‘¡,UMÆÒÚye¾é Q3gNêÈ qmh‡:]K˜Œìª€‚1Ð.–U¿fwïº(ÇŒRëØ(ÞËë©¥ÔÉFPÇ3ÓÁÈòg ÞÜ:J"ÙéÞ%¨9êÔk˜2a;[η‚î_ô}?Ê ˜óù™ºy>Q÷ê%ûË„:áåß³wDûîÃÌ5Ý)ÚÊÄÕ ¾Žªª{*nÿ\#>s¨¦½IpMüç* ìM޽­ôÂ$&™WÓF]¢K2·U•õ]¦uXN‚ôz»L‚8ÕØETòSC̑֌(q ‘æ»·u‰Ö;÷Uý„3Œ‡jiÄ*±ß¦I“-ïsWZ$ôEÁ·ÕG«Š7<2‚O1ÔV€c_g`4ÝT’p6Œ‚`o*Ð’¶þkD8ÓÛÞ)ÒŒaAöŒŠ±ß-}Ò'‹ÝËiµéç5SÑ ì* Q¦¾üb.Á‚޶K‚ïýdH^àëò³ŠÑᨪ8Rë¶súÝŸ”‚¹?x þR“pMJF„|OòÍ¿Ì@}ç“zÖWH­¿PKÆmSÔ)Ç$PKõP Gmeta.xmlTËŽ›0Ý÷+"Ú-øáaf×UGSiR©»Ø7©[°‘íLÒ¿/˜’&ª²`aßsî9÷aʧS×®ÞÁX©Õ& V ¸Rí7Á·íç0žª¥Þí$&4?t \Ø«WUY6…6ÁÁ(¦k+-Su–9Îtj¦°%šy¡éæÔJõküp®gÇèGÚì)Šùè ü‚ë¦õ(Á´0*XD"‚fìèðQS#vi©7`‡hí|S˱ä,si­/¦GÚÔobœ é<£m'ÛGGlÈuךM{ÕÓZÉîÑ4#öÆõÞÑÞÊà9FC×kW‡ïŽƒ«5øµÅ¥Úó,Õ¼eã8ªÒ…ðÞÂA*ŠÉ:Äyˆ‹-!ŒR¯£,É)I0Æ%ºÃ(g7TÊpÆ“<õÔ6©‚nx¡8Ÿ«úºM’ç8y=kÜįiü7oÁV$ù~¾ŸÀ{P0°µ©¾ÈÆÀ‹/%†ïÓsÍ_^¿¿òtµ¿õFÿîP“5Î婈I&hÆŠ†¤Ð §»XdMZ»ülà¯Ö¤}yÆvÜWë$_ù{݌ه:(· ÖE€ª] ÝûTPK†“‰ZÐFPKõP G content.xmlí\ÛŽã¸}ÏWZ$o²®¾¦»yê é È-Ñ6w(Qè¶{bóù’©‹I˲e·gÖíUà’E²xê°XE©ýðã6¦Æ+ÎrÂ’GÓ8¦“E$Y>š_>ÿÚ˜?>ýé-$ijˆ…ë'Ü YÂá·½“|V´>šë,™1”“|– ç3ÎXŠ“ª×L•žÉ¹Ššœ¿ÑÎÝ¥°Ú›ã-ïÚYÈj}ѼûÌRXíehÓµ³PÕî Öµó6§Ö‚êqŠ8ÙÓbKIòõÑ\qžÎl{³Ù 6þ€eKÛN§¶l­k¹tQ)…6¦XL–ÛîÀµ+ÙsÔU?!«ª”¬ã9Î:Cƒ8jX5Íp"°\AÌn©}4~½.;³ëuÙs¸BYgžIa*~Ô*~¤ö_µØwb‚FùñéyÇ«,î:—Õ  3’v^f!­ögŒÕªŠÅf—êzŽØEY‘Þßd„ãLЇˆ†5â,>ȹ6HXøUP¾ÞDˆ¼¥ƒg͵pµýïOÏ/á Çh'LN [$É9JvÈä1¡­²-¤E éL!ÛØ:™ C+âC;Ã)Ëxm E÷CfñjŒV<¦í.L´V¢Ë,ŠŠ‚:¾ î œ‰õJðæS;ŽsºGLéêOu‘BêYp´ƒëØB¦v'@ÕÝÁ•-ë³uÁÖITØ¡oSœÑ„¨ì6ÓFP­EÙC–ç±2‚vHL+ÏU/éà0ŒYqD† ËÒ™Ò[?ó²xÛm8±IY´ØqÏa…yîóC|øü/[´YâȇC­œI u<ó©Šk ?–ÛuÅâkBlE8¤ùÓCq>ÕÕFQz?šÏ; ¯ñ‚ðpˆT¢°5ßÍ¿ ”åÝ“+*MCZÈ[Kœàê2£D“H á0xE‘ì³»«C.:é&¿‡r?5¾$âMl|ziUn_°ƒrù[Îqüí>£^¼¡SÝðÞÙí6²•õhÍ™ðÈ¡%Ç©Y(?5]£Ô­'+µ,ãM+EKlV=ÕJ+…M…3NpnhÓ…_—™pàGs"dž­ÁÓµ‰±ù/8äùQñˆä)EoÆ2.BÃ#"R»*„\ š· ‚OÃ'q5£ÀTè^Þõðª´YaXÙM,~™5ȲÌPº"aU¢L$y²`Dt¡,ª¡)»¨¨ˆ’óŒ}ÅPúÿàÈÓ@Âa@iÝ:â_Ù"|4̉¬ËȯL¢d ~ú—uÎÉâm_ðUÌîÄba.¥ÄƱ€›° Y®xä5øq¢bl_±5k=«É«e_qfAÜ$ü$,¥QomH$ògà‡±‚𣙰wÄë Dü6DŽ­²À*Ö‡`…œüzÖ”Á76Â"=¼é»Ù{iÓ=©þïˆíÿŽhM¹•Ýò“v×YÈÓX°YL’Zu×ø£ŒÞYûŸ›Ê£ IjêU'˜Y\abõž1oÃa½wÞ¢lÓÅe¸"¶2à3Iù:6\HSÇãóyΡùä¥%yÉ=vMU€BÖOKÒÌ×”bn¢ÖcŢɷ8æÿþû[­ž2ˆ¢¤ì#xCÑZjw1*˜s|e/°¹^Þâ9£JëÃX9o,)Y’µt`‚áŸ%.ÇVzÞ;pÈSÉÎ1$j¸áþò¯†$¢w‰PpE„&w‰Ððjyƒà.] !ÿ.ñ_Ÿ;õÓ“«!Ü©Ÿž^¡ûôÓ®s5ˆ†ËQ+Íe¬m·ÞM– s½Õ5q{zi—¸ß*°2݃²[æŽj2'¯4ËD<‡”¤¼S½½‹1µPHSôÆÖ¼ìôÓ³ûÙ1K-BÈlYlå+”âæÜò†¬ÎyµóçªÆ7tÅÅ-qiFWXX”ë,²ªØîÕÿÁ€ÂŸ”4LK²è3=¥ni‚´Ô'+ñ”0²–˜Å˜gor,ñ¸ëo Fw ÇðÜ‘S~–ª.é[)# Ï™'ŽóÝ‘_|8FQ' î$ðÇeE1RY#?ËÙZÔˆN*Vâ‚fÙ®t¯äÞRX¦”¤yukP¯+•Ϻ¿Ts4>AÍ‘cüÇø§doÖ%L”$Íê]bÖ­+,¿6œ,k›zâðœÖ­^ÕZY¶ÖS(õô QVÞTâ¾g*ÛÅâ«u¤bq7´ç8(¸è£»Ûûr ’&s¶­M(×…¦+ ÁOç},O·éŒD&‰*1½t©8ާ3ÍéáGr†ŠùdÅxWQ:DEÂÛI´8Åk2ÕÓ˜êdj™;·qÕW<¿Ñwxš©ònºgë%l Y’à³ì‚s)«h-˜¶ãp0îsØÓ9ìÎxÁ`·´|¥Êx¡·ê‹êÑä-X‰R´÷”JUxRLÄý€z†*Q˳Ɠ±Ùd‹oŒ'“措¼“XÃëcËb ÿæba7îk|sÏ}¬qÃÞû^bŽL 4¦'™ÚÇ7ÅÖkøçÅÁwŠ5®Âµm5<}vÛTÃÁHÙT¾ÜÇ·TÜ;ÿ˶Óu¬?Ò¬?z·õµã?(Ë'àõ øýj«ÿô÷ý§ºÇw÷±çyÏÉ!ï9lñž£=ïéƒB¯£édå:ÓÉÿ ÕSc4vp¡¿„z5„ÔÆ»Œ£s`t§Ž³r]±š8ºŽk€€{ÿy¯ßç½—å½yÈÚ ïkßX7]Ÿ÷ÞòÁ÷Ë{'S'ïcj ßJ€ÞÑúSÍúÓw[¿Ðû½ÇZõÉÈR­ìô‹aœžc Ë=èôËô¡yÈÚ· {ÚK0ŽvòÕÅï¢{}ˆ~C!úhßeO÷¯õ=ÝeWß&D×¹º÷Æ–{’«×~8åõ§n'TS´þ¦/Â8­qÇÁ§S5-oâñT×­¥¿bæzï;Î̽>ÿýþù¯ný÷o¨\{}|nõ[dÀG|èÁÜÍm{𞟠¤},³àá5³à&e:,飿Ç:˜s’,÷¾Z*fâOúê¯ÕÚ}“ÊÁ¿¯³µ?Á³[¾³÷éÿPKH[j ôWPKõP G styles.xmlí]Í’Û¸¾ç)TÚZßHñOc·6Ù¤*Už+öž· ’¸¦IF>å rÈ!ï—'I (ðwH‰#i4WyF@ìþÐh4-ðÃOOoðˆÃÈ%þýPWµáû6q\u?üíëß”Ùð§ú@–Kׯw±·ìÇJï=  ±ÝñÊûá6ôïŠÜèÎGÝÅö °/ÝÉÔwìQ¼„uÖ´9#–[Çø)nÚ˜ÒfÚ¢Eó'3b¹µ¢]ÓÆ”0•›/IÓÆO‘§,‰b“M€b7ÇÅ“çúßî‡ë8îF£Ýn§îL•„«‘>ŸÏG¬6eØNé‚mè1*ÇaÓ‡E#]ÕG‚vƒcÔ”?J+³äo7 6†Ũ0ªAˆ# q©^6ëHn“ѯÇUcíz\UÀl¯QØXÏqVUL§¹ª˜ŽÜvƒâuÅøÎFPÉþ{øtЫpÓôY”6•ºAc19µÜž’²JðÉÎØ54ÍñÏõ®–|º1%r»–ÜFž"N6e > ?R•OåÞ¸^c©¶BIï6†žÒT5¤àWJ8…8 aœ²lntá)Fj2ÖñÆ«6´V®BÇ)%v̘˜¼Ê£‹w? 3«A½"ÌsŠÀLësM‘l{kèÚˆÒ¤ÓTã°P„«t)[’­ïðqà⧇.­Bkv—éA-Ñe²þI=dÌL™qÞ_ÿ9¢u ]ÂÀH'½H+·1ü(–é%%z‰l¬8Øö¢¸yM‹ü3eî~øÉ[͸|A>̰‚4}?|‡½ÏÑñÂá Ó5¥WVØia¦†dƒü EàÆ6زGºl0GÍYƒ.—x£„ç`îg ó¿ù.xKxð𥒹r¿C½a1+ó¿Ú¢9˜Ø`jã†ü—¿úU`UD~©ÆÓnE5ïÓè?ж7öÜ(kRs:$“yàB{œXYl=Ç^IËÁ#ò¼J¡[¢ûáÿþûïTá¤N$cm6®¯xh5éXO@€Q•ÑæBèöÁ/ûÍ‚xÃ&)km¬ñl–ÕIÚãØZ¡,0lÓ°áö2;CHçz~sY"4»I„Æ!d¨ÖM"4é !ó&ñ™v‡ÏÚéYgY7j§ç"t›vZ×:ƒhüº µTìØFU¯Úp<v;+*0ßE$[ˆ¤Pì ²¥|—’-K7(I1 ¬1o¯kÚ¬”!ç²°'}S$¢Ô> 7È;ô‡Èøé„O|ÜiéQdSÓTÅX×!Ù®ÖJrœ(?¢HïƒME<‚…DóêòrÑœjé³$òÁË„dY\ű ñ†-ä±ÑÝ.kÑ_2ÿp ûg¶Ó>‹•ÆlD¤$Z>!=2*šW%EýÁŠ8‡R®dÓ3©Íb ÁSCú4"%>Œ´ƒJ8RŠj@R’ HÒújP*H˜ÖáM°F\} ó+Äž‹—%ªJË4µŒ 1S!…Äž …‘ÅØŽwn ‹>—FÄD(…iªƒRˆƒœ4SõqEÜLc?%q±4h^Q›ÖGÔød® ¨™Ü¾·E“ —„3±pnä2•~‘Ø’ÚD#‰/#úsºÁ£šl¦4fýŒõß íwÊ>ýíú?í‹þ®…t¾ 7 <´Wän´O´õšÒ¿åF/8³¸8jS^— âì/Éi½³—¸)XHZKEÃéKWžLœOº*G›Úeƒÿ­ÅäÎóõ Ùb7‘Ý ˆ-VC8ÜØ»¨ah¢È–ÕJ‘©Hú%dª<ÊÒøRvæe³ù,âŽHÓá0Ú‡ñâkqê-i‡3ºÌ,—¶=Ÿ_×4™äü)ù ªW„ ÒŠ’ñ=.rÀÝlµ˜¬1r.ír4‚>AÓ2ªà4ôæµ›£‹˜ªË” žˆhÇ‚xN{è^Ȭ\-tVIÜÉa’Û§"ºÁ(چ瘯ÅÍw'[첬“Òv¹*ÒØ “}ë»q²?o:FFðK’-´@ö·UH3Tó# §Ï¿”·ÅKKCŒ'HÂ÷ãÑI5Iû9_:ÎYôIŒO­Ó?5m¶÷Pžïôgiw'ŸEZÑÑY‡R®dëÜ[>‹¨€äfÏ"„N,IÁ5ïÐóš{®Àz¹KÏx³²`I2Ó£uèúßèg(~&5´ Ç™RDó©‘µIIó+Ë81yô_ÿ9&ño|M¯5yÔ¨O¹™½V*O=F‡®&m«cê.yô•å$] ytr£É‘Ý¥No4õ¯»ôÑùMâÓ]ò¨®]‹¡¾ÞìQ]]¦ºûôÑÚœPæ-öá•3†WL£¯t^áPöá‰å HÞJx¥p|— ¯TŸ9•D7:°­V‹ƒÞBŠ®F,­<„ÔfÇ%¢šÝ ftƒ˜Ùòh¼±ÒÊìóEÌê1³ÄŒˆB¯µ¡êbØöXÄÆÝ fuƒX›ô‹K!6é±ñÛAlÚ b“·ƒØ¬Ħo±y7ˆÍÞbÑvQšÜùqWšÏñH[Ú‡lŽë8nxª•²Û_|Ò_|Ò_|r%gWýÅ'ýÅ'ýÅ'×wrÕ_|òjNЯö쪿øäÖ’ .sñ ¼‹/%õg\iwýWÆÕŸqIͯãŒë5TúhJMé£)}4åJê£)}4¥¦ôÑ”>šrÝõÑ”¢)%!’>rÆhˆUvÉF 9&bòúÞ|4¤’‰†Èá % ïOòÐŒH&èðó'í«A3·2o <0ÿkâÁôd*ø5"÷Ã5{µ¥à=®îh¦‹ªgâ²Ö=ÝüL-S|N ]SÇã‰(ß°V4Õ0“ÜÕÓxÐa™Ò­ 3‘Ù SÆ\Heªcmz ²RNZÕðÎÌY#tmì(÷¢Ää#½§¾ÖVD…ðâÊAÿü  KhŽÈÌ79dcÏ€èr¡Ä˜ó+©.vº‡W;Ó÷نȕS ËÔ¯Rxý:„Ÿ• ¯×ŠîÁŒŽlàzÙ‹Áô'(Ü’¼`œ©X ‰\XúîÏJüÑ zLzôuÅÀWá‹6­øÊLOqã4½‚ïpwy)É’øö(ñbòd“QJè v.»P´ÕµZ«ðr,–^CJž»ý…ª7èvjÀ`g ØóR_înÄ礮<³âÓþű ŠÑ25¼xÉÝÕè‰5o‰Å©_»b,ZëÅ©_¯;7—žIŸ‹IDµ†ÏŬä+M+â啇¥´ú^àÃ碦˜m”þÓîÂÖóHWÔÝ£¤kwx÷Ö¥+<|:ÛEf¯ æÜ')ôI }’ÂÕ Ô')ôI }’BŸ¤pY„ú$…>I¡y’B½³môÎvïl÷Îvïl_B½³Ý;Û½³Ý;Û½³}Ýõζ”\™J’TlP³›ñRvvã¡=-¢=>ócî¦ó¬ÊPy½ôf±4âØª’ÔBâÕP$o’£‰ƒŒj”—ƒž$N)\èì¡UvŽ’I Lãòõ4÷Fœ®íÓ3:–‘0ÍÚÄëífá#×8,ÃBÎ/š©óù<Ÿ^4Q§VZH6¤$%CÍ“wTœùÉô*í©u‘GÉ[XÏôä â}IÀë_† ó%s€%äGÇ™3lv˜ÛœÇ¹ªëfžGz‚lIyx~¶7–Y*8YÅI{Ë0‰¯ÔºþPK0aÂKâPKõP G3&¬¨//mimetypePKõP G·©0¥÷ ÷ UThumbnails/thumbnail.pngPKõP GÆmSÔ)Ç$ ‚ settings.xmlPKõP G†“‰ZÐFåmeta.xmlPKõP GH[j ôW ëcontent.xmlPKõP G‰´מO´ Žstyles.xmlPKõP Gd-Configurations2/menubar/PKõP Gš-Configurations2/toolpanel/PKõP GÒ-Configurations2/toolbar/PKõP G.Configurations2/floater/PKõP G>.Configurations2/images/Bitmaps/PKõP G{.Configurations2/statusbar/PKõP G³.Configurations2/popupmenu/PKõP Gë.Configurations2/progressbar/PKõP G'%/Configurations2/accelerator/current.xmlPKõP G0aÂKâ|/META-INF/manifest.xmlPK6Ò0maven-enforcer-1.4.2/enforcer-rules/src/site/apt/bannedRepositories.apt.vm0000664000175000017500000001105612347363553026235 0ustar ebourgebourg~~ 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. ------ Banned Specified Repositories ------ Simon Wang ------ June 2014 ------ Banned Specified Repositories This rule checks whether this maven session (defined in pom files or even settings.xml) include specified banned repository. * What's difference from "requireNoRepositories"? The purpose for "requireNoRepositories" is: Detect whether pom and pom’s parents contains repositories definition. That guide users to use correct convention (not define repositories in pom files). So it only analyze current pom and its parent pom files. But “BannedRepositories†is different purpose, it’s just like “BannedDependenciesâ€. It will detect banned repositories from maven session context instead of only pom.xml and parents. It's trying to avoid misuse incorrect repositories. It will detect banned repositories from current maven session context. * Support Parameters * banRepositories - Specify banned non-plugin repositories. This is a black list of http/https url patterns. * banPluginRepositories - Specify banned plugin repositories. This is a black list of http/https url patterns. * allowedRepositories - Specify explicitly allowed non-plugin repositories. This is a white list of http/https url patterns. * allowedPluginRepositories - Specify explicitly allowed plugin repositories. This is a white list of http/https url patternes. * Sample Configuration For example, one company want to limit repositories usage. But different developers might use different settings.xml. Even their projects' pom defined different repostories too. For this case, could leverage this enforcer rule to banned specified repositories or even use allowedRepositories/allowedPluginRepositories to banned others unexpected repositories. Ex. http://repo1/xyz is the repository that want to be banned. http://repo2/xyz is the repository that want to use now. Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-repositories enforce http://repo1/* http://repo1/* [...] +---+ * Worth to Note * http/https url patterns support wildcard "*" * This rule will detect banned repositories on maven session itself istead of pom or settings, so if users defined "mirrorOf" in settings.xml, even defined banned repositories in pom.xml, it won't be detected. +---+ nexus * http://.../nexus/.. +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/noSnapshots.apt.vm0000664000175000017500000000373411242234713024705 0ustar ebourgebourg~~ 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. ------ Require Release Dependencies ------ Brian Fox ------ November 2007 ------ Require Release Dependencies This rule checks the dependencies and fails if any snapshots are found. The following parameters are supported by this rule: * searchTransitive - if transitive dependencies should be checked. * message - an optional message to the user if the rule fails. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce No Snapshots Allowed! true [...] +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/alwaysFail.apt.vm0000664000175000017500000000317211242234713024456 0ustar ebourgebourg~~ 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. ------ Always Fail ------ Brian Fox ------ August 2008 ------ Always Fail This rule will always fail. It is useful for testing proper plugin configuration. Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce enforce true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireFileChecksum.apt.vm0000664000175000017500000000662713016402410026321 0ustar ebourgebourg~~ 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. ------ Require Files Checksum ------ Edward Samson, Lyubomyr Shaydariv ------ February 2016 ------ Require Files Checksum This rule checks that the specified file has an given checksum. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * file - A file to check. * checksum - Expected file checksum. * type - Type of hashing algorithm to calculate the checksum. May be one of "md5", "sha1", "sha256", "sha384", or "sha512". [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-checksum enforce ${project.build.outputDirectory}/foo.txt d41d8cd98f00b204e9800998ecf8427e md5 ${project.build.outputDirectory}/bar.txt da39a3ee5e6b4b0d3255bfef95601890afd80709 sha1 ${project.build.outputDirectory}/baz.txt e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 sha256 ${project.build.outputDirectory}/qux.txt 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b sha384 ${project.build.outputDirectory}/quux.txt cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e sha512 true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/bannedDependencies.apt.vm0000664000175000017500000001067712270531546026136 0ustar ebourgebourg~~ 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. ------ Banned Dependencies ------ Brian Fox ------ November 2007 ------ Banned Dependencies This rule checks the dependencies and fails if any of the matching excludes are found. The following parameters are supported by this rule: * searchTransitive - if transitive dependencies should be checked. Default is true. * excludes - a list of artifacts to ban. The format is groupId[:artifactId][:version][:type][:scope][:classifier] where artifactId, version, type, scope and classifier are optional. Wildcards may be used to replace an entire or just parts of a section. Examples: * org.apache.maven * org.apache.maven:badArtifact * org.apache.maven:artifact:badVersion * org.apache.maven:*:1.2 (exclude version 1.2 and above, equivalent to [1.2,) ) * org.apache.maven:*:[1.2] (explicit exclude of version 1.2) * org.apache.maven:*:*:jar:test * *:*:*:jar:compile:tests * org.apache.*:maven-*:* [] * includes - a list of artifacts to include. These are exceptions to the excludes. It is meant to allow wide exclusion rules with wildcards and fine tune using includes. If nothing has been excluded, then the includes have no effect. In otherwords, includes only subtract from artifacts that matched an exclude rule. For example, to ban all xerces except xerces-api you would exclude "xerces" (groupId) and include "xerces:xerces-api" * message - an optional message to the user if the rule fails. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-dependencies enforce org.apache.maven org.apache.maven:badArtifact *:badArtifact org.apache.maven:badArtifact:1.0 true [...] +---+ Example plugin configuration which ignores transitive dependencies: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-dependencies enforce commons-lang:commons-lang false true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/alwaysPass.apt.vm0000664000175000017500000000317411242234713024513 0ustar ebourgebourg~~ 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. ------ AlwaysPass ------ Brian Fox ------ August 2008 ------ Always Pass This rule will always succeed. It is useful for testing proper plugin configuration. Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce enforce true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireMavenVersion.apt.vm0000664000175000017500000000411012420465134026366 0ustar ebourgebourg~~ 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. ------ Require Maven Version ------ Brian Fox ------ June 2007 ------ Require Maven Version This rule enforces certain Maven versions. The rule uses the {{{./versionRanges.html}Enforcer version range syntax}} to define allowed versions. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * {{{../enforcer-rules/apidocs/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.html#version}version}} - {{{./versionRanges.html}range}} of allowed Maven versions. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-maven enforce 3.0 [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireFilesSize.apt.vm0000664000175000017500000000471111433600167025656 0ustar ebourgebourg~~ 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. ------ Require File Size ------ Brian Fox ------ August 2008 ------ Require File Size This rule checks that the specified list of files exist and are within the specified size range. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * files - A list of files to check. If this list is empty, the main project artifact will be checked. * maxsize - maximum size in bytes for this file * minsize - minimum size in bytes for this file * allowNulls - If null files should be allowed. If allowed, they will be treated as if they do exist. Default is false. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-file-size enforce 10000 90 \${project.build.outputDirectory}/foo.txt \${project.build.outputDirectory}/foo2.txt true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireActiveProfile.apt.vm0000664000175000017500000000563312263355600026522 0ustar ebourgebourg~~ 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. ------ Require Active Profile ------ Karl-Heinz Marbaise ------ December 2013 ------ Require Active Profile This rule checks that a specified list of profiles is activated. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * profiles - A comma separated list of profile to check. * all - Checks if all given profiles are active. Default is true. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-all-profiles-are-activated enforce first,second true [...] +---+ Sample Plugin Configuration to check if one of the given profiles is active: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-first-or-second-profile-is-active enforce first,second false true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/banTransitiveDependencies.apt.vm0000664000175000017500000000633112153704123027501 0ustar ebourgebourg~~ 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. ------ Ban Transitive Dependencies ------ ------ August 2012 ------ Ban Transitive Dependencies This rule bans all transitive dependencies. The following parameters are supported by this rule: * excludes - specify the dependencies that will be ignored.\ This can be a list of artifacts in the format groupId[:artifactId[:version[:type[:scope[:classifier]]]]] . Wildcard '*' can be used to in place of specific section (e.g. group:*:1.0 will match both 'group:artifact:1.0' and 'group:anotherArtifact:1.0') Version is a string representing standard maven version range. Empty patterns will be ignored. * includes - specify the dependencies that will be checked.\ These are exceptions to excludes intended for more convenient configuration. This can be a list of artifacts in the format groupId[:artifactId[:version[:type[:scope[:classifier]]]]] as above. * message - an optional message to the user if the rule fails. Will replace generated report message. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-dependencies enforce org.apache.maven:ignoredArtifact *:anotherIgnoredArtifact org.apache.maven:ignoredArtifact:[1.0] [...] +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireJavaVersion.apt.vm0000664000175000017500000000642012360230721026202 0ustar ebourgebourg~~ 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. ------ Require Java Version ------ Brian Fox ------ June 2007 ------ Require Java Version This rule enforces certain Java JDK versions. The rule uses the {{{./versionRanges.html}Enforcer version range syntax}} to define allowed versions. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * {{{../apidocs/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.html#version}version}} - {{{./versionRanges.html}range}} of allowed JDKs. [] The JDK version is retrieved and the following processing occurs before being checked: [[1]] Drop all non-numeric characters preceeding the first number. (build 1.5.0_07-b03 becomes 1.5.0_07-b03) [[2]] Replace all '_' and '-' with '.' (1.5.0_07-b03 becomes 1.5.0.07.b03) [[3]] Remove all non digit characters "[^0-9] and convert each section using Integer.parseInt() (1.5.0_07-b03 becomes 1.5.0.7.3) [[3]] Split the string on '.' and take the first 3 sections, separated by '.' and add '-' followed by the forth section (1.5.0.7.3 becomes 1.5.0-7) [] This preprocessing normalizes various JDK version strings into a standard x.y.z-b version number. Your required range should therefore use the x.y.z-b format for comparison. There is an easy way to see how your current JDK string will be normalized: +---+ mvn enforcer:display-info ... [enforcer:display-info] Maven Version: 2.0.8 JDK Version: 1.5.0_11 normalized as: 1.5.0-11 OS Info: Arch: x86 Family: windows Name: windows xp Version: 5.1 +---+ Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-java enforce 1.6.0 [...] +---+ If you would like to enforce a certain vendor string for the JDK, you would use the {{{./requireProperty.html}RequireProperty}} rule, and check the java.vendor property with a regular expression. maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireProperty.apt.vm0000664000175000017500000000551312054167207025611 0ustar ebourgebourg~~ 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. ------ Require Property ------ Brian Fox ------ June 2007 ------ Require Property This rule can enforce that a declared property is set and optionally evaluate it against a regular expression. The following parameters are supported by this rule: * property - the property to evaluate. * message - an optional message to the user if the rule fails. Default is: "Property 'xxx' is required for this build". * regex - a regular expression used to check the value of the property. * regexMessage - an optional message to the user if the regex check fails. [] The regex is applied to the entire value of the property (i.e. using the regex "match" method), and not just a substring of the property value. Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-property enforce basedir You must set a basedir property! .*\d.* The basedir property must contain at least one digit. project.version "Project version must be specified." .*(\d|-SNAPSHOT)$ "Project version must end in a number or -SNAPSHOT." true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/dependencyConvergence.apt.vm0000664000175000017500000001031012270530701026645 0ustar ebourgebourg ~~ 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. ----- Comparing against a specific artifact ----- ----- 2008-09-13 ----- Dependency Convergence This rule requires that dependency version numbers converge. If a project has two dependencies, A and B, both depending on the same artifact, C, this rule will fail the build if A depends on a different version of C then the version of C depended on by B. Here is a concrete example. This will cause a build to fail. +----------------------------------------------------------------------------------- org.slf4j slf4j-jdk14 1.6.1 org.slf4j slf4j-nop 1.6.0 +----------------------------------------------------------------------------------- With this being logged during compilation +----------------------------------------------------------------------------------- Dependency convergence error for org.slf4j:slf4j-api1.6.1 paths to dependency are: [ERROR] Dependency convergence error for org.slf4j:slf4j-api:1.6.1 paths to dependency are: +-org.myorg:my-project:1.0.0-SNAPSHOT +-org.slf4j:slf4j-jdk14:1.6.1 +-org.slf4j:slf4j-api:1.6.1 and +-org.myorg:my-project:1.0.0-SNAPSHOT +-org.slf4j:slf4j-nop:1.6.0 +-org.slf4j:slf4j-api:1.6.0 +----------------------------------------------------------------------------------- And this will succeed. +----------------------------------------------------------------------------------- org.slf4j slf4j-jdk14 1.6.1 org.slf4j slf4j-nop 1.6.0 org.slf4j slf4j-api +----------------------------------------------------------------------------------- Here is how a project should be setup to use this rule +----------------------------------------------------------------------------------- ... ... org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce enforce ... ... +----------------------------------------------------------------------------------- * Timestamped version By default the non-unique versions are matched, which means the <<>> instead of the timestamped versions. If you want to use the unique versions of the dependencies, you can set its property to <<>>. +--------------------------------------------- true +--------------------------------------------- maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireUpperBoundDeps.apt.vm0000664000175000017500000001072613120464057026664 0ustar ebourgebourg ~~ 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. ----- Require Upper Bound Dependencies ----- ----- 2012-02-08 ----- This rule requires that the version for each dependency resolved during a build, is equal to or higher than all transitive dependency declarations. The version of each dependency resolved during the build will normally be the version specified in the POM or the version with the least transitive steps (the "nearest" definition). For more information about Maven dependency resolution, see {{{http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html}the Maven site}}. Here is a concrete example. This will cause a build to fail: ----------------------------------------------------------------------------------- org.slf4j slf4j-api 1.4.0 ch.qos.logback logback-classic 0.9.9 ----------------------------------------------------------------------------------- Because the project will run logback-classic 0.9.9 with slf4j-api 1.4.0 and slf4j-api 1.4.0 is probably not forwards compatible with slf4j-api 1.5.0. This is the log message: ----------------------------------------------------------------------------------- Failed while enforcing RequireUpperBoundDeps. The error(s) are [ RequireUpperBoundDeps error for org.slf4j:slf4j-api:1.4.0 paths to dependency are: +-test:TestParent:1.0-SNAPSHOT +-org.slf4j:slf4j-api:1.4.0 and +-test:TestParent:1.0-SNAPSHOT +-ch.qos.logback:logback-classic:0.9.9 +-org.slf4j:slf4j-api:1.5.0 ] ----------------------------------------------------------------------------------- And this will succeed. ----------------------------------------------------------------------------------- org.slf4j slf4j-api 1.6.0 ch.qos.logback logback-classic 0.9.9 ----------------------------------------------------------------------------------- Here is how a project should be setup to use this rule ----------------------------------------------------------------------------------- ... ... org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce enforce ... ... ----------------------------------------------------------------------------------- maven-enforcer-1.4.2/enforcer-rules/src/site/apt/reactorModuleConvergence.apt.vm0000664000175000017500000001710612415731547027362 0ustar ebourgebourg~~ 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. ------ Reactor Module Convergence ------ Karl-Heinz Marbaise ------ March 2014 ------ Reactor Module Convergence This rule checks that the versions within the reactor are consistent furthermore it will check that every module within the project contains a parent and that the parent is part of the reactor build. Furthermore it will be checked if dependencies are intermodule dependencies that they using the same version as given by the reactor. The following parameters are supported by this rule: * message - an optional supplemental message to the user if the rule fails. * ignoreModuleDependencies - Ignore module dependencies which references modules within the the reactor (default: false). Note: The current state does not correctly handle a situation like this {{mvn -pl subproject validate}}. This will be handled correctly with the next major release (2.X) of enforcer. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-snapshots enforce The reactor is not valid true true [...] +---+ There are different situations within a multi module build which can lead to problems (for example not working with maven-release-plugin etc.). This rule is intended to prevent such problems. Let us assume we have the following (simple) project structure for a multi module setup. +----- root (pom.xml) +--- module1 (pom.xml) +--- module2 (pom.xml) +----- The root <> looks like this: +----- com.mycompany.project parent 1.0-SNAPSHOT (..) +----- The best practice in Maven is that all childs inherit the version from their parent and don't define a new version which looks like this: +----- ... ... 1.0-SNAPSHOT module1 (..) +----- But sometimes people mistaken things or violate the best-practice which looks like this: +----- ... ... 1.0-SNAPSHOT module1 1.1-SNAPSHOT +----- By using this rule you would get a message during the build with the following resulting output: +----- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: The reactor contains different versions. --> com.mycompany.project:myproject:pom:1.1-SNAPSHOT +----- The next which happens is that the parent in a reactor is sometimes the wrong one like the following situation: +----- ... ... 1.1-SNAPSHOT module1 1.0-SNAPSHOT (..) +----- This will prompted by the following message: +----- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: Reactor modules have parents which contain a wrong version. --> com.mycompany.project:myproject:pom:1.1-SNAPSHOT parent:com.mycompany.project:myproject:pom:1.0-SNAPSHOT +----- If you have only changed a parent by accident with the wrong version like this: +----- ... ... 1.1-SNAPSHOT module1 (..) +----- you will get the same message as above: +----- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: The reactor contains different versions. --> com.mycompany.project:myproject:pom:1.1-SNAPSHOT +----- An other things which happens that simply the parent will be forgotten which produces a message like this: +---- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: Reactor contains modules without parents. module: com.mycompany.project:myproject:pom:1.2-SNAPSHOT +---- In larger mutli-module builds it happens also that the defined parent is given but does not belong to the reactor like this: +----- org.apache.enforcer something-different 1.1 module1 (..) +----- Usually already the Maven warning like this should be paid attention to: +----- [WARNING] [WARNING] Some problems were encountered while building the effective model for org.apache.enforcer:pom:1.0.4-SNAPSHOT [WARNING] 'parent.relativePath' points at org.apache.enforcer:something-different instead of org.apache.enforcer:something-different, please verify your project structure @ line 7, column 11 [WARNING] +----- but this will oversight often. So the enforcer rule will break simply such mail formed build via the message (This required that the parent has the same version as the rest of the build which happens): +----- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: Module parents have been found which could not be found in the reactor. module: org.apache.enforcer:something-different:pom:1.0.4-SNAPSHOT +----- An other case which happens (for example by merging from a branch into trunk/master) is that an intermodule dependency contains the wrong version like this: +----- ... ... 1.2-SNAPSHOT module1 com.mycompany.project myproject 1.1 (..) (..) +----- This will result in the following message: +----- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message: Reactor modules contains dependencies which do not reference the reactor. module: com.mycompany.project:myproject-x:jar:1.2-SNAPSHOT dependency: com.mycompany.project:myproject:1.1 +----- maven-enforcer-1.4.2/enforcer-rules/src/site/apt/evaluateBeanshell.apt.vm0000664000175000017500000000436711433600167026017 0ustar ebourgebourg~~ 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. ------ Beanshell ------ Brian Fox ------ June 2007 ------ Beanshell This rule can execute a beanshell script and evaluate the result. The following parameters are supported by this rule: * condition - the beanshell statement to evaluate. * message - an optional message to the user if the rule fails. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-beanshell enforce \${project.artifactId} == foo true [...] +---+ The condition can be a complex script or a simple expression. As long as it results in True, the rule will succeed. This means code can be executed as long as the last line results in true. +---+ for (int i = 0;i!=10;i++){print ("Hello World "+i);};1==1 +---+maven-enforcer-1.4.2/enforcer-rules/src/site/apt/requireSnapshotVersion.apt.vm0000664000175000017500000000373412770317331027135 0ustar ebourgebourg~~ 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. ------ Require Snapshot Version ------ Guillaume Boue ------ September 2016 ------ Require Snapshot Version This rule checks that the current project is not a release. The following parameters are supported by this rule: * message - an optional message to the user if the rule fails. * failWhenParentIsRelease - if the parent should be checked. Default: true [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-no-releases enforce No Releases Allowed! true [...] +---+ maven-enforcer-1.4.2/enforcer-rules/src/site/apt/banDuplicatePomDependencyVersions.apt.vm0000664000175000017500000000372513017407725031174 0ustar ebourgebourg~~ 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. ------ Ban Duplicate Pom Dependency Versions ------ Guillaume Boue ------ November 2016 ------ Ban Duplicate Pom Dependency Versions This rule checks that there are no duplicate dependencies declared in the POM of the project. Duplicate dependencies are dependencies which have the same group id, artifact id, type and classifier. The following parameters are supported by this rule: * message - an optional supplemental message to the user if the rule fails. [] Sample Plugin Configuration: +------+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} no-duplicate-declared-dependencies enforce [...] +-------+ maven-enforcer-1.4.2/enforcer-rules/src/main/0000775000175000017500000000000013133666303020431 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/0000775000175000017500000000000013133666303021352 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/0000775000175000017500000000000013133666303022141 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/0000775000175000017500000000000013133666303023362 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/0000775000175000017500000000000013133666303024470 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/0000775000175000017500000000000013133666303026151 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/0000775000175000017500000000000013133666304027755 5ustar ebourgebourg././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.0000664000175000017500000000423012422541465033136 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule checks that certain properties are set. * * @author Paul Gier */ public class RequireProperty extends AbstractPropertyEnforcerRule { /** * Specify the required property. * * @see {@link #setProperty(String)} * @see {@link #getPropertyName()} */ private String property = null; public final void setProperty( String property ) { this.property = property; } @Override public Object resolveValue( EnforcerRuleHelper helper ) throws EnforcerRuleException { Object propValue = null; try { propValue = helper.evaluate( "${" + property + "}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to evaluate property: " + property, eee ); } return propValue; } protected String resolveValue() { return null; } @Override public String getPropertyName() { return property; } @Override public String getName() { return "Property"; } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractProperty0000775000175000017500000001074712566372145033232 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * Abstract enforcer rule that give a foundation to validate properties from multiple sources. * * @author Paul Gier * @author Marvin Froeder * @version $Id: AbstractPropertyEnforcerRule.java 1697215 2015-08-23 16:27:17Z khmarbaise $ */ public abstract class AbstractPropertyEnforcerRule extends AbstractNonCacheableEnforcerRule { /** * Match the property value to a given regular expression. Defaults to null (any value is ok). * * @see {@link #setRegex(String)} * @see {@link #getRegex()} */ private String regex = null; /** * Specify a warning message if the regular expression is not matched. * * @see {@link #setRegexMessage(String)} * @see {@link #getRegexMessage()} */ private String regexMessage = null; public AbstractPropertyEnforcerRule() { super(); } /** * Set the property value to a given regular expression. Defaults to null (any value is ok). * * @param regex The regular expression */ public final void setRegex( String regex ) { this.regex = regex; } /** * Get the property value to a given regular expression. Defaults to null (any value is ok). * * @return the regular expression */ public final String getRegex() { return regex; } /** * Set a warning message if the regular expression is not matched. * * @param regexMessage the regex message */ public final void setRegexMessage( String regexMessage ) { this.regexMessage = regexMessage; } /** * Get a warning message if the regular expression is not matched. * * @return the regex message */ public final String getRegexMessage() { return regexMessage; } /** * Execute the rule. * * @param helper the helper * @throws EnforcerRuleException the enforcer rule exception */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { Object propValue = resolveValue( helper ); // Check that the property is not null or empty string if ( propValue == null ) { String message = getMessage(); if ( message == null ) { message = getName() + " \"" + getPropertyName() + "\" is required for this build."; } throw new EnforcerRuleException( message ); } // If there is a regex, check that the property matches it if ( regex != null && !propValue.toString().matches( regex ) ) { if ( regexMessage == null ) { regexMessage = getName() + " \"" + getPropertyName() + "\" evaluates to \"" + propValue + "\". " + "This does not match the regular expression \"" + regex + "\""; } throw new EnforcerRuleException( regexMessage ); } } /** * How the property that is being evaluated is called */ public abstract String getName(); /** * The name of the property currently being evaluated, this is used for default message pourpouses only */ public abstract String getPropertyName(); /** * Resolves the property value * * @param helper * @throws EnforcerRuleException */ public abstract Object resolveValue( EnforcerRuleHelper helper ) throws EnforcerRuleException; } ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCache0000664000175000017500000000363411242355031033037 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRule; /** * The Class AbstractNonCacheableEnforcerRule. This is to be used by rules * that don't need caching... it saves implementing a bunch of methods. * * @author Brian Fox * @version $Id: AbstractNonCacheableEnforcerRule.java 805190 2009-08-17 22:30:49Z hboutemy $ */ public abstract class AbstractNonCacheableEnforcerRule extends AbstractStandardEnforcerRule { /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#getCacheId() */ public String getCacheId() { return "0"; } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable() */ public boolean isCacheable() { return false; } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule) */ public boolean isResultValid( EnforcerRule cachedRule ) { return false; } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDepen0000664000175000017500000001516712416005316033043 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; import org.apache.maven.shared.dependency.graph.DependencyNode; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import java.util.HashSet; import java.util.Set; /** * Abstract Rule for banning dependencies. * * @author Brian Fox * @version $Id: AbstractBanDependencies.java 1630934 2014-10-10 16:35:26Z khmarbaise $ */ public abstract class AbstractBanDependencies extends AbstractNonCacheableEnforcerRule { /** Specify if transitive dependencies should be searched (default) or only look at direct dependencies. */ private boolean searchTransitive = true; private transient DependencyGraphBuilder graphBuilder; /** * Execute the rule. * * @param helper the helper * @throws EnforcerRuleException the enforcer rule exception */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { // get the project MavenProject project = null; try { project = (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } try { graphBuilder = (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class ); } catch ( ComponentLookupException e ) { // real cause is probably that one of the Maven3 graph builder could not be initiated and fails with a // ClassNotFoundException try { graphBuilder = (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class.getName(), "maven2" ); } catch ( ComponentLookupException e1 ) { throw new EnforcerRuleException( "Unable to lookup DependencyGraphBuilder: ", e ); } } // get the correct list of dependencies Set dependencies = getDependenciesToCheck( project ); // look for banned dependencies Set foundExcludes = checkDependencies( dependencies, helper.getLog() ); // if any are found, fail the check but list all of them if ( foundExcludes != null && !foundExcludes.isEmpty() ) { String message = getMessage(); StringBuilder buf = new StringBuilder(); if ( message != null ) { buf.append( message + "\n" ); } for ( Artifact artifact : foundExcludes ) { buf.append( getErrorMessage( artifact ) ); } message = buf.toString() + "Use 'mvn dependency:tree' to locate the source of the banned dependencies."; throw new EnforcerRuleException( message ); } } protected CharSequence getErrorMessage( Artifact artifact ) { return "Found Banned Dependency: " + artifact.getId() + "\n"; } protected Set getDependenciesToCheck( MavenProject project ) { Set dependencies = null; try { DependencyNode node = graphBuilder.buildDependencyGraph( project, null ); if ( searchTransitive ) { dependencies = getAllDescendants( node ); } else if ( node.getChildren() != null ) { dependencies = new HashSet(); for ( DependencyNode depNode : node.getChildren() ) { dependencies.add( depNode.getArtifact() ); } } } catch ( DependencyGraphBuilderException e ) { // otherwise we need to change the signature of this protected method throw new RuntimeException( e ); } return dependencies; } private Set getAllDescendants( DependencyNode node ) { Set children = null; if ( node.getChildren() != null ) { children = new HashSet(); for ( DependencyNode depNode : node.getChildren() ) { children.add( depNode.getArtifact() ); Set subNodes = getAllDescendants( depNode ); if ( subNodes != null ) { children.addAll( subNodes ); } } } return children; } /** * Checks the set of dependencies against the list of excludes. * * @param dependencies the dependencies * @param log the log * @return the sets the * @throws EnforcerRuleException the enforcer rule exception */ protected abstract Set checkDependencies( Set dependencies, Log log ) throws EnforcerRuleException; /** * Checks if is search transitive. * * @return the searchTransitive */ public boolean isSearchTransitive() { return this.searchTransitive; } /** * Sets the search transitive. * * @param theSearchTransitive the searchTransitive to set */ public void setSearchTransitive( boolean theSearchTransitive ) { this.searchTransitive = theSearchTransitive; } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVers0000664000175000017500000000443213075342666033155 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule checks that the Maven version is allowed. * * @author Brian Fox * @version $Id: RequireMavenVersion.java 1791757 2017-04-18 07:52:22Z khmarbaise $ */ public class RequireMavenVersion extends AbstractVersionEnforcer { /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { MavenSession mavenSession = (MavenSession) helper.evaluate( "${session}" ); String mavenVersion = mavenSession.getSystemProperties().getProperty( "maven.version" ); helper.getLog().debug( "Detected Maven Version: " + mavenVersion ); DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion( mavenVersion ); enforceVersion( helper.getLog(), "Maven", getVersion(), detectedVersion ); } catch ( ExpressionEvaluationException e ) { e.printStackTrace(); } } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersi0000664000175000017500000001203312422541465033132 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * @author Robert Scholte * @since 1.3 */ public class RequireSameVersions extends AbstractNonCacheableEnforcerRule { private boolean uniqueVersions; private Set dependencies = new HashSet(); private Set plugins = new HashSet(); private Set buildPlugins = new HashSet(); private Set reportPlugins = new HashSet(); public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { // get the project MavenProject project = null; try { project = (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } // consider including profile based artifacts Map> versionMembers = new LinkedHashMap>(); Set buildPluginSet = new HashSet( buildPlugins ); buildPluginSet.addAll( plugins ); Set reportPluginSet = new HashSet( reportPlugins ); reportPluginSet.addAll( plugins ); // CHECKSTYLE_OFF: LineLength versionMembers.putAll( collectVersionMembers( project.getArtifacts(), dependencies, " (dependency)" ) ); versionMembers.putAll( collectVersionMembers( project.getPluginArtifacts(), buildPlugins, " (buildPlugin)" ) ); versionMembers.putAll( collectVersionMembers( project.getReportArtifacts(), reportPlugins, " (reportPlugin)" ) ); // CHECKSTYLE_ON: LineLength if ( versionMembers.size() > 1 ) { StringBuilder builder = new StringBuilder( "Found entries with different versions\n" ); for ( Map.Entry> entry : versionMembers.entrySet() ) { builder.append( "Entries with version " ).append( entry.getKey() ).append( '\n' ); for ( String conflictId : entry.getValue() ) { builder.append( "- " ).append( conflictId ).append( '\n' ); } } throw new EnforcerRuleException( builder.toString() ); } } private Map> collectVersionMembers( Set artifacts, Collection patterns, String source ) { Map> versionMembers = new LinkedHashMap>(); List regExs = new ArrayList(); for ( String pattern : patterns ) { String regex = pattern.replace( ".", "\\." ).replace( "*", ".*" ).replace( ":", "\\:" ).replace( '?', '.' ); // pattern is groupId[:artifactId[:type[:classifier]]] regExs.add( Pattern.compile( regex + "(\\:.+)?" ) ); } for ( Artifact artifact : artifacts ) { for ( Pattern regEx : regExs ) { if ( regEx.matcher( artifact.getDependencyConflictId() ).matches() ) { String version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); if ( !versionMembers.containsKey( version ) ) { versionMembers.put( version, new ArrayList() ); } versionMembers.get( version ).add( artifact.getDependencyConflictId() + source ); } } } return versionMembers; } }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDe0000664000175000017500000001607412566372145033104 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.artifact.filter.StrictPatternExcludesArtifactFilter; import org.apache.maven.shared.artifact.filter.StrictPatternIncludesArtifactFilter; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule checks that no snapshots are included. * * @author Brian Fox * @version $Id: RequireReleaseDeps.java 1697215 2015-08-23 16:27:17Z khmarbaise $ */ public class RequireReleaseDeps extends AbstractBanDependencies { /** * Allows this rule to execute only when this project is a release. * * @parameter * * @see {@link #setOnlyWhenRelease(boolean)} * @see {@link #isOnlyWhenRelease()} */ private boolean onlyWhenRelease = false; /** * Allows this rule to fail when the parent is defined as a snapshot. * * @parameter * * @see {@link #setFailWhenParentIsSnapshot(boolean)} * @see {@link #isFailWhenParentIsSnapshot()} */ private boolean failWhenParentIsSnapshot = true; /** * Dependencies to ignore when checking for release versions. For example, inter-module dependencies * can be excluded from the check and therefore allowed to contain snapshot versions. * * @see {@link #setExcludes(List)} * @see {@link #getExcludes()} */ private List excludes = null; /** * Dependencies to include when checking for release versions. If any of the included dependencies * have snapshot versions, the rule will fail. * * @see {@link #setIncludes(List)} * @see {@link #getIncludes()} */ private List includes = null; /** * Override parent to allow optional ignore of this rule. * * @param helper the enforcerRuleHelper * @throws EnforcerRuleException when an exception occurs */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { boolean callSuper; MavenProject project = null; if ( onlyWhenRelease ) { // get the project project = getProject( helper ); // only call super if this project is a release callSuper = !project.getArtifact().isSnapshot(); } else { callSuper = true; } if ( callSuper ) { super.execute( helper ); if ( failWhenParentIsSnapshot ) { if ( project == null ) { project = getProject( helper ); } Artifact parentArtifact = project.getParentArtifact(); if ( parentArtifact != null && parentArtifact.isSnapshot() ) { throw new EnforcerRuleException( "Parent Cannot be a snapshot: " + parentArtifact.getId() ); } } } } /** * @param helper * @return The evaluated {@link MavenProject}. * @throws EnforcerRuleException */ private MavenProject getProject( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { return (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } } /** * {@inheritDoc} */ protected Set checkDependencies( Set dependencies, Log log ) throws EnforcerRuleException { Set foundSnapshots = new HashSet(); Set filteredDependencies = filterArtifacts( dependencies ); for ( Artifact artifact : filteredDependencies ) { if ( artifact.isSnapshot() ) { foundSnapshots.add( artifact ); } } return foundSnapshots; } /* * Filter the dependency artifacts according to the includes and excludes * If includes and excludes are both null, the original set is returned. * * @param dependencies the list of dependencies to filter * @return the resulting set of dependencies */ public Set filterArtifacts( Set dependencies ) { if ( includes == null && excludes == null ) { return dependencies; } AndArtifactFilter filter = new AndArtifactFilter( ); if ( includes != null ) { filter.add( new StrictPatternIncludesArtifactFilter( includes ) ); } if ( excludes != null ) { filter.add( new StrictPatternExcludesArtifactFilter( excludes ) ); } Set result = new HashSet(); for ( Artifact artifact : dependencies ) { if ( filter.include( artifact ) ) { result.add( artifact ); } } return result; } public final boolean isOnlyWhenRelease() { return onlyWhenRelease; } public final void setOnlyWhenRelease( boolean onlyWhenRelease ) { this.onlyWhenRelease = onlyWhenRelease; } public final boolean isFailWhenParentIsSnapshot() { return failWhenParentIsSnapshot; } public final void setFailWhenParentIsSnapshot( boolean failWhenParentIsSnapshot ) { this.failWhenParentIsSnapshot = failWhenParentIsSnapshot; } public final void setExcludes( List excludes ) { this.excludes = excludes; } public final List getExcludes() { return excludes; } public void setIncludes( List includes ) { this.includes = includes; } public List getIncludes() { return includes; } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandard0000664000175000017500000000333112416344524033124 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerLevel; import org.apache.maven.enforcer.rule.api.EnforcerRule2; /** * The Class AbstractStandardEnforcerRule. */ public abstract class AbstractStandardEnforcerRule implements EnforcerRule2 { /** * Specify a friendly message if the rule fails. * * @see {@link #setMessage(String)} * @see {@link #getMessage()} */ private String message; private EnforcerLevel level = EnforcerLevel.ERROR; public final void setMessage( String message ) { this.message = message; } public final String getMessage() { return message; } /** * Returns the level of enforcement. * * @return level */ public EnforcerLevel getLevel() { return level; } public void setLevel( EnforcerLevel level ) { this.level = level; } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExist.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExis0000664000175000017500000000274212157410307033130 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; /** * The Class RequireFilesExist. */ public class RequireFilesExist extends AbstractRequireFiles { /* * (non-Javadoc) * * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#checkFile(java.io.File) */ boolean checkFile( File file ) { // if we get here and the handle is null, treat it as a success return file == null ? true : file.exists(); } /* * (non-Javadoc) * * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#getErrorMsg() */ String getErrorMsg() { return "Some required files are missing:\n"; } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConver0000664000175000017500000002227312573470625033147 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactCollector; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugins.enforcer.utils.DependencyVersionMap; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.dependency.tree.DependencyNode; import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.i18n.I18N; /** * @author Rex Hoffman */ public class DependencyConvergence implements EnforcerRule { private static Log log; private static I18N i18n; private boolean uniqueVersions; public void setUniqueVersions( boolean uniqueVersions ) { this.uniqueVersions = uniqueVersions; } // CHECKSTYLE_OFF: LineLength /** * Uses the {@link EnforcerRuleHelper} to populate the values of the * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} * factory method.
* This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do. * * @param helper * @return a Dependency Node which is the root of the project's dependency tree * @throws EnforcerRuleException */ // CHECKSTYLE_ON: LineLength private DependencyNode getNode( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); DependencyTreeBuilder dependencyTreeBuilder = (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class ); ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" ); ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); ArtifactMetadataSource metadataSource = (ArtifactMetadataSource) helper.getComponent( ArtifactMetadataSource.class ); ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class ); ArtifactFilter filter = null; // we need to evaluate all scopes DependencyNode node = dependencyTreeBuilder.buildDependencyTree( project, repository, factory, metadataSource, filter, collector ); return node; } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e ); } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( DependencyTreeBuilderException e ) { throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e ); } } public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { if ( log == null ) { log = helper.getLog(); } try { if ( i18n == null ) { i18n = (I18N) helper.getComponent( I18N.class ); } DependencyNode node = getNode( helper ); DependencyVersionMap visitor = new DependencyVersionMap( log ); visitor.setUniqueVersions( uniqueVersions ); node.accept( visitor ); List errorMsgs = new ArrayList(); errorMsgs.addAll( getConvergenceErrorMsgs( visitor.getConflictedVersionNumbers() ) ); for ( CharSequence errorMsg : errorMsgs ) { log.warn( errorMsg ); } if ( errorMsgs.size() > 0 ) { throw new EnforcerRuleException( "Failed while enforcing releasability. " + "See above detailed error message." ); } } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( Exception e ) { throw new EnforcerRuleException( e.getLocalizedMessage(), e ); } } private String getFullArtifactName( Artifact artifact ) { return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion(); } private StringBuilder buildTreeString( DependencyNode node ) { List loc = new ArrayList(); DependencyNode currentNode = node; while ( currentNode != null ) { loc.add( getFullArtifactName( currentNode.getArtifact() ) ); currentNode = currentNode.getParent(); } Collections.reverse( loc ); StringBuilder builder = new StringBuilder(); for ( int i = 0; i < loc.size(); i++ ) { for ( int j = 0; j < i; j++ ) { builder.append( " " ); } builder.append( "+-" + loc.get( i ) ); builder.append( "\n" ); } return builder; } private List getConvergenceErrorMsgs( List> errors ) { List errorMsgs = new ArrayList(); for ( List nodeList : errors ) { errorMsgs.add( buildConvergenceErrorMsg( nodeList ) ); } return errorMsgs; } private String buildConvergenceErrorMsg( List nodeList ) { StringBuilder builder = new StringBuilder(); builder.append( "\nDependency convergence error for " + getFullArtifactName( nodeList.get( 0 ).getArtifact() ) + " paths to dependency are:\n" ); if ( nodeList.size() > 0 ) { builder.append( buildTreeString( nodeList.get( 0 ) ) ); } for ( DependencyNode node : nodeList.subList( 1, nodeList.size() ) ) { builder.append( "and\n" ); builder.append( buildTreeString( node ) ); } return builder.toString(); } /** * If your rule is cacheable, you must return a unique id when parameters or conditions change that would cause the * result to be different. Multiple cached results are stored based on their id. The easiest way to do this is to * return a hash computed from the values of your parameters. If your rule is not cacheable, then the result here is * not important, you may return anything. */ public String getCacheId() { return ""; } /** * This tells the system if the results are cacheable at all. Keep in mind that during forked builds and other * things, a given rule may be executed more than once for the same project. This means that even things that change * from project to project may still be cacheable in certain instances. */ public boolean isCacheable() { return false; } /** * If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to * allow double checking of the results. Most of the time this can be done by generating unique ids, but sometimes * the results of objects returned by the helper need to be queried. You may for example, store certain objects in * your rule and then query them later. * * @param rule */ public boolean isResultValid( EnforcerRule rule ) { return false; } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileCheck0000664000175000017500000001014313016402410033033 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import org.apache.commons.codec.digest.DigestUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.util.IOUtil; /** * Rule to validate a file to match the specified checksum. * * @author Edward Samson * @author Lyubomyr Shaydariv */ public class RequireFileChecksum extends AbstractNonCacheableEnforcerRule { private File file; private String checksum; private String type; public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { if ( this.file == null ) { throw new EnforcerRuleException( "Input file unspecified" ); } if ( this.type == null ) { throw new EnforcerRuleException( "Hash type unspecified" ); } if ( this.checksum == null ) { throw new EnforcerRuleException( "Checksum unspecified" ); } InputStream inputStream = null; try { if ( this.file.isDirectory() || !this.file.canRead() ) { throw new EnforcerRuleException( "Cannot read file: " + this.file.getAbsolutePath() ); } inputStream = new FileInputStream( this.file ); String checksum; if ( "md5".equals( this.type ) ) { checksum = DigestUtils.md5Hex( inputStream ); } else if ( "sha1".equals( this.type ) ) { checksum = DigestUtils.shaHex( inputStream ); } else if ( "sha256".equals( this.type ) ) { checksum = DigestUtils.sha256Hex( inputStream ); } else if ( "sha384".equals( this.type ) ) { checksum = DigestUtils.sha384Hex( inputStream ); } else if ( "sha512".equals( this.type ) ) { checksum = DigestUtils.sha512Hex( inputStream ); } else { throw new EnforcerRuleException( "Unsupported hash type: " + this.type ); } if ( !checksum.equalsIgnoreCase( this.checksum ) ) { throw new EnforcerRuleException( this.type + " hash of " + this.file + " was " + checksum + " but expected " + this.checksum ); } } catch ( IOException e ) { throw new EnforcerRuleException( "Unable to calculate checksum", e ); } finally { IOUtil.close( inputStream ); } } /** * The file to check. * * @param file file */ public void setFile( File file ) { this.file = file; } /** * The expected checksum value. * * @param checksum checksum */ public void setChecksum( String checksum ) { this.checksum = checksum; } /** * The checksum algorithm to use. Possible values: "md5", "sha1", "sha256", "sha384", "sha512". * * @param type algorithm */ public void setType( String type ) { this.type = type; } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.ja0000664000175000017500000000271613075342666033037 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.project.MavenProject; /** * This rule checks that lists of plugins are not included. * * @author Marvin Froeder */ public class BannedPlugins extends BannedDependencies { protected Set getDependenciesToCheck( MavenProject project ) { return project.getPluginArtifacts(); } protected CharSequence getErrorMessage( Artifact artifact ) { return "Found Banned Plugin: " + artifact.getId() + "\n"; } } ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomD0000664000175000017500000001732512416336312033017 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Dependency; import org.apache.maven.model.Model; import org.apache.maven.model.Profile; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * Since Maven 3 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique. Early versions of Maven * 3 already warn, this rule can force to break a build for this reason. * * @author Robert Scholte * @since 1.3 */ public class BanDuplicatePomDependencyVersions extends AbstractNonCacheableEnforcerRule { public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { // get the project MavenProject project; try { project = (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } // re-read model, because M3 uses optimized model MavenXpp3Reader modelReader = new MavenXpp3Reader(); FileReader pomReader = null; Model model; try { pomReader = new FileReader( project.getFile() ); model = modelReader.read( pomReader ); } catch ( FileNotFoundException e ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", e ); } catch ( IOException e ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", e ); } catch ( XmlPullParserException e ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", e ); } finally { IOUtil.close( pomReader ); } // @todo reuse ModelValidator when possible // Object modelValidator = null; // try // { // modelValidator = helper.getComponent( "org.apache.maven.model.validation.ModelValidator" ); // } // catch ( ComponentLookupException e1 ) // { // // noop // } // if( modelValidator == null ) // { maven2Validation( helper, model ); // } // else // { // } } private void maven2Validation( EnforcerRuleHelper helper, Model model ) throws EnforcerRuleException { List dependencies = model.getDependencies(); Map duplicateDependencies = validateDependencies( dependencies ); int duplicates = duplicateDependencies.size(); StringBuilder summary = new StringBuilder(); messageBuilder( duplicateDependencies, "dependencies.dependency", summary ); if ( model.getDependencyManagement() != null ) { List managementDependencies = model.getDependencies(); Map duplicateManagementDependencies = validateDependencies( managementDependencies ); duplicates += duplicateManagementDependencies.size(); messageBuilder( duplicateManagementDependencies, "dependencyManagement.dependencies.dependency", summary ); } List profiles = model.getProfiles(); for ( Profile profile : profiles ) { List profileDependencies = profile.getDependencies(); Map duplicateProfileDependencies = validateDependencies( profileDependencies ); duplicates += duplicateProfileDependencies.size(); messageBuilder( duplicateProfileDependencies, "profiles.profile[" + profile.getId() + "].dependencies.dependency", summary ); if ( model.getDependencyManagement() != null ) { List profileManagementDependencies = profile.getDependencies(); Map duplicateProfileManagementDependencies = validateDependencies( profileManagementDependencies ); duplicates += duplicateProfileManagementDependencies.size(); messageBuilder( duplicateProfileManagementDependencies, "profiles.profile[" + profile.getId() + "].dependencyManagement.dependencies.dependency", summary ); } } if ( summary.length() > 0 ) { StringBuilder message = new StringBuilder(); message.append( "Found " ) .append( duplicates ) .append( " duplicate dependency " ); message.append( duplicateDependencies.size() == 1 ? "declaration" : "declarations" ) .append( " in this project:\n" ); message.append( summary ); throw new EnforcerRuleException( message.toString() ); } } private void messageBuilder( Map duplicateDependencies, String prefix, StringBuilder message ) { if ( !duplicateDependencies.isEmpty() ) { for ( Map.Entry entry : duplicateDependencies.entrySet() ) { message.append( " - " ) .append( prefix ) .append( '[' ) .append( entry.getKey() ) .append( "] ( " ) .append( entry.getValue() ) .append( " times )\n" ); } } } private Map validateDependencies( List dependencies ) throws EnforcerRuleException { Map duplicateDeps = new HashMap(); Set deps = new HashSet(); for ( Dependency dependency : dependencies ) { String key = dependency.getManagementKey(); if ( deps.contains( key ) ) { int times = 1; if ( duplicateDeps.containsKey( key ) ) { times = duplicateDeps.get( key ); } duplicateDeps.put( key, times + 1 ); } else { deps.add( key ); } } return duplicateDeps; } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequis0000664000175000017500000001117312422541465033217 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.List; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Prerequisites; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * @author Robert Scholte * @since 1.3 */ public class RequirePrerequisite extends AbstractNonCacheableEnforcerRule { /** * Only the projects with one of these packagings will be enforced to have the correct prerequisite. * * @since 1.4 */ private List packagings; /** * Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)} */ private String mavenVersion; /** * Set the mavenVersion Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)} * * @param mavenVersion the version or {@code null} */ public void setMavenVersion( String mavenVersion ) { this.mavenVersion = mavenVersion; } /** * Only the projects with one of these packagings will be enforced to have the correct prerequisite. * * @since 1.4 * @param packagings the list of packagings */ public void setPackagings( List packagings ) { this.packagings = packagings; } /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( "pom".equals( project.getPackaging() ) ) { helper.getLog().debug( "Packaging is pom, skipping requirePrerequisite rule" ); return; } if ( packagings != null && !packagings.contains( project.getPackaging() ) ) { // CHECKSTYLE_OFF: LineLength helper.getLog().debug( "Packaging is " + project.getPackaging() + ", skipping requirePrerequisite rule" ); return; // CHECKSTYLE_ON: LineLength } Prerequisites prerequisites = project.getPrerequisites(); if ( prerequisites == null ) { throw new EnforcerRuleException( "Requires prerequisite not set" ); } if ( mavenVersion != null ) { VersionRange requiredVersionRange = VersionRange.createFromVersionSpec( mavenVersion ); if ( !requiredVersionRange.hasRestrictions() ) { requiredVersionRange = VersionRange.createFromVersionSpec( "[" + mavenVersion + ",)" ); } VersionRange specifiedVersion = VersionRange.createFromVersionSpec( prerequisites.getMaven() ); VersionRange restrictedVersionRange = requiredVersionRange.restrict( specifiedVersion ); if ( restrictedVersionRange.getRecommendedVersion() == null ) { throw new EnforcerRuleException( "The specified Maven prerequisite( " + specifiedVersion + " ) doesn't match the required version: " + mavenVersion ); } } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } catch ( InvalidVersionSpecificationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } } } maven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/0000775000175000017500000000000013133666303031114 5ustar ebourgebourg././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrap0000664000175000017500000000573712422541465033144 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.model.Plugin; import org.apache.maven.model.ReportPlugin; /** * @author Brian Fox * */ public class PluginWrapper { private String groupId; private String artifactId; private String version; private String source; public static List addAll( List plugins, String source ) { List results = null; if ( !plugins.isEmpty() ) { results = new ArrayList( plugins.size() ); for ( Object o : plugins ) { if ( o instanceof Plugin ) { results.add( new PluginWrapper( (Plugin) o, source ) ); } else { if ( o instanceof ReportPlugin ) { results.add( new PluginWrapper( (ReportPlugin) o, source ) ); } } } } return results; } public PluginWrapper( Plugin plugin, String source ) { setGroupId( plugin.getGroupId() ); setArtifactId( plugin.getArtifactId() ); setVersion( plugin.getVersion() ); setSource( source ); } public PluginWrapper( ReportPlugin plugin, String source ) { setGroupId( plugin.getGroupId() ); setArtifactId( plugin.getArtifactId() ); setVersion( plugin.getVersion() ); setSource( source ); } public String getGroupId() { return groupId; } public void setGroupId( String groupId ) { this.groupId = groupId; } public String getArtifactId() { return artifactId; } public void setArtifactId( String artifactId ) { this.artifactId = artifactId; } public String getVersion() { return version; } public void setVersion( String version ) { this.version = version; } public String getSource() { return source; } public void setSource( String source ) { this.source = source; } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRu0000664000175000017500000003076712422541465033127 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.io.Reader; import java.util.ArrayList; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Model; import org.apache.maven.model.Parent; import org.apache.maven.model.Plugin; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; // TODO: Auto-generated Javadoc /** * The Class EnforcerRuleUtils. * * @author Brian Fox */ public class EnforcerRuleUtils { /** The factory. */ ArtifactFactory factory; /** The resolver. */ ArtifactResolver resolver; /** The local. */ ArtifactRepository local; /** The remote repositories. */ List remoteRepositories; /** The log. */ Log log; /** The project. */ MavenProject project; private EnforcerRuleHelper helper; /** * Instantiates a new enforcer rule utils. * * @param theFactory the the factory * @param theResolver the the resolver * @param theLocal the the local * @param theRemoteRepositories the the remote repositories * @param project the project * @param theLog the the log */ public EnforcerRuleUtils( ArtifactFactory theFactory, ArtifactResolver theResolver, ArtifactRepository theLocal, List theRemoteRepositories, MavenProject project, Log theLog ) { super(); this.factory = theFactory; this.resolver = theResolver; this.local = theLocal; this.remoteRepositories = theRemoteRepositories; this.log = theLog; this.project = project; } /** * Instantiates a new enforcer rule utils. * * @param helper the helper */ @SuppressWarnings( "unchecked" ) public EnforcerRuleUtils( EnforcerRuleHelper helper ) { this.helper = helper; // get the various expressions out of the // helper. try { factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); resolver = (ArtifactResolver) helper.getComponent( ArtifactResolver.class ); local = (ArtifactRepository) helper.evaluate( "${localRepository}" ); project = (MavenProject) helper.evaluate( "${project}" ); remoteRepositories = project.getRemoteArtifactRepositories(); } catch ( ComponentLookupException e ) { // TODO Auto-generated catch block e.printStackTrace(); } catch ( ExpressionEvaluationException e ) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * Gets the pom model for this file. * * @param pom the pom * @return the model * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ private Model readModel( File pom ) throws IOException, XmlPullParserException { Reader reader = ReaderFactory.newXmlReader( pom ); MavenXpp3Reader xpp3 = new MavenXpp3Reader(); Model model = null; try { model = xpp3.read( reader ); } finally { reader.close(); reader = null; } return model; } /** * This method gets the model for the defined artifact. Looks first in the filesystem, then tries to get it from the * repo. * * @param groupId the group id * @param artifactId the artifact id * @param version the version * @param pom the pom * @return the pom model * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws XmlPullParserException the xml pull parser exception * @throws IOException Signals that an I/O exception has occurred. */ private Model getPomModel( String groupId, String artifactId, String version, File pom ) throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { Model model = null; // do we want to look in the reactor like the // project builder? Would require @aggregator goal // which causes problems in maven core right now // because we also need dependency resolution in // other // rules. (MNG-2277) // look in the location specified by pom first. boolean found = false; try { model = readModel( pom ); // i found a model, lets make sure it's the one // I want found = checkIfModelMatches( groupId, artifactId, version, model ); } catch ( IOException e ) { // nothing here, but lets look in the repo // before giving up. } catch ( XmlPullParserException e ) { // nothing here, but lets look in the repo // before giving up. } // i didn't find it in the local file system, go // look in the repo if ( !found ) { Artifact pomArtifact = factory.createArtifact( groupId, artifactId, version, null, "pom" ); resolver.resolve( pomArtifact, remoteRepositories, local ); model = readModel( pomArtifact.getFile() ); } return model; } /** * This method loops through all the parents, getting each pom model and then its parent. * * @param groupId the group id * @param artifactId the artifact id * @param version the version * @param pom the pom * @return the models recursively * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ public List getModelsRecursively( String groupId, String artifactId, String version, File pom ) throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { List models = null; Model model = getPomModel( groupId, artifactId, version, pom ); Parent parent = model.getParent(); // recurse into the parent if ( parent != null ) { // get the relative path String relativePath = parent.getRelativePath(); if ( StringUtils.isEmpty( relativePath ) ) { relativePath = "../pom.xml"; } // calculate the recursive path File parentPom = new File( pom.getParent(), relativePath ); // if relative path is a directory, append pom.xml if ( parentPom.isDirectory() ) { parentPom = new File( parentPom, "pom.xml" ); } //@formatter:off models = getModelsRecursively( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parentPom ); //@formatter:on } else { // only create it here since I'm not at the top models = new ArrayList(); } models.add( model ); return models; } /** * Make sure the model is the one I'm expecting. * * @param groupId the group id * @param artifactId the artifact id * @param version the version * @param model Model being checked. * @return true, if check if model matches */ protected boolean checkIfModelMatches( String groupId, String artifactId, String version, Model model ) { // try these first. String modelGroup = model.getGroupId(); String modelArtifactId = model.getArtifactId(); String modelVersion = model.getVersion(); try { if ( StringUtils.isEmpty( modelGroup ) ) { modelGroup = model.getParent().getGroupId(); } else { // MENFORCER-30, handle cases where the value is a property like ${project.parent.groupId} modelGroup = (String) helper.evaluate( modelGroup ); } if ( StringUtils.isEmpty( modelVersion ) ) { modelVersion = model.getParent().getVersion(); } else { // MENFORCER-30, handle cases where the value is a property like ${project.parent.version} modelVersion = (String) helper.evaluate( modelVersion ); } // Is this only required for Maven2? modelArtifactId = (String) helper.evaluate( modelArtifactId ); } catch ( NullPointerException e ) { // this is probably bad. I don't have a valid // group or version and I can't find a // parent???? // lets see if it's what we're looking for // anyway. } catch ( ExpressionEvaluationException e ) { // as above } // CHECKSTYLE_OFF: LineLength return ( StringUtils.equals( groupId, modelGroup ) && StringUtils.equals( version, modelVersion ) && StringUtils.equals( artifactId, modelArtifactId ) ); // CHECKSTYLE_ON: LineLength } private void resolve( Plugin plugin ) { try { plugin.setGroupId( (String) helper.evaluate( plugin.getGroupId() ) ); plugin.setArtifactId( (String) helper.evaluate( plugin.getArtifactId() ) ); plugin.setVersion( (String) helper.evaluate( plugin.getVersion() ) ); } catch ( ExpressionEvaluationException e ) { // this should have gone already before } } private void resolve( ReportPlugin plugin ) { try { plugin.setGroupId( (String) helper.evaluate( plugin.getGroupId() ) ); plugin.setArtifactId( (String) helper.evaluate( plugin.getArtifactId() ) ); plugin.setVersion( (String) helper.evaluate( plugin.getVersion() ) ); } catch ( ExpressionEvaluationException e ) { // this should have gone already before } } public List resolvePlugins( List plugins ) { for ( Plugin plugin : plugins ) { resolve( plugin ); } return plugins; } public List resolveReportPlugins( List reportPlugins ) { for ( ReportPlugin plugin : reportPlugins ) { resolve( plugin ); } return reportPlugins; } } ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/Distributi0000664000175000017500000000577212561645371033202 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.model.DistributionManagement; import org.apache.maven.project.MavenProject; /** * @author Karl Heinz Marbaise khmarbaise@apache.org */ public class DistributionManagementCheck { private DistributionManagement distributionManagement; public DistributionManagementCheck( MavenProject project ) { this.distributionManagement = project.getOriginalModel().getDistributionManagement(); } public void execute( boolean isAllowRepository, boolean isAllowSnapshotRepository, boolean isAllowSite ) throws EnforcerRuleException { if ( hasDistributionManagement() ) { if ( !isAllowRepository && hasRepository() ) { throw new EnforcerRuleException( "You have defined a repository in distributionManagement." ); } else if ( !isAllowSnapshotRepository && hasSnapshotRepository() ) { throw new EnforcerRuleException( "You have defined a snapshotRepository in distributionManagement." ); } else if ( !isAllowSite && hasSite() ) { throw new EnforcerRuleException( "You have defined a site in distributionManagement." ); } } } private boolean hasRepository() { return getDistributionManagement().getRepository() != null; } public DistributionManagement getDistributionManagement() { return distributionManagement; } public void setDistributionManagement( DistributionManagement distributionManagement ) { this.distributionManagement = distributionManagement; } private boolean hasSnapshotRepository() { return getDistributionManagement().getSnapshotRepository() != null; } private boolean hasSite() { return getDistributionManagement().getSite() != null; } private boolean hasDistributionManagement() { return getDistributionManagement() != null; } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/Dependency0000664000175000017500000000736412422541465033130 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.logging.Log; import org.apache.maven.shared.dependency.tree.DependencyNode; import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor; /** * @author Brian Fox * */ public class DependencyVersionMap implements DependencyNodeVisitor { private Log log; private boolean uniqueVersions; private Map> idsToNode; public DependencyVersionMap( Log log ) { this.log = log; idsToNode = new HashMap>(); } public void setUniqueVersions( boolean uniqueVersions ) { this.uniqueVersions = uniqueVersions; } public boolean visit( DependencyNode node ) { addDependency( node ); return !containsConflicts( node ); } public boolean endVisit( DependencyNode node ) { return true; } private String constructKey( DependencyNode node ) { return constructKey( node.getArtifact() ); } private String constructKey( Artifact artifact ) { return artifact.getGroupId() + ":" + artifact.getArtifactId(); } public void addDependency( DependencyNode node ) { String key = constructKey( node ); List nodes = idsToNode.get( key ); if ( nodes == null ) { nodes = new ArrayList(); idsToNode.put( key, nodes ); } nodes.add( node ); } private String getVersion( Artifact artifact ) { return uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } private boolean containsConflicts( DependencyNode node ) { return containsConflicts( node.getArtifact() ); } private boolean containsConflicts( Artifact artifact ) { return containsConflicts( idsToNode.get( constructKey( artifact ) ) ); } private boolean containsConflicts( List nodes ) { String version = null; for ( DependencyNode node : nodes ) { if ( version == null ) { version = getVersion( node.getArtifact() ); } else { if ( version.compareTo( getVersion( node.getArtifact() ) ) != 0 ) { return true; } } } return false; } public List> getConflictedVersionNumbers() { List> output = new ArrayList>(); for ( List nodes : idsToNode.values() ) { if ( containsConflicts( nodes ) ) { output.add( nodes ); } } return output; } }././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMa0000664000175000017500000001563412473146352033066 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugins.enforcer.AbstractVersionEnforcer; import java.util.Collection; import java.util.LinkedList; /** * This class is used for matching Artifacts against a list of patterns. * * @author Jakub Senko * @see org.apache.maven.plugins.enforcer.BanTransitiveDependencies */ public final class ArtifactMatcher { /** * @author I don't know */ public static class Pattern { private String pattern; private String[] parts; public Pattern( String pattern ) { if ( pattern == null ) { throw new NullPointerException( "pattern" ); } this.pattern = pattern; parts = pattern.split( ":", 7 ); if ( parts.length == 7 ) { throw new IllegalArgumentException( "Pattern contains too many delimiters." ); } for ( String part : parts ) { if ( "".equals( part ) ) { throw new IllegalArgumentException( "Pattern or its part is empty." ); } } } public boolean match( Artifact artifact ) throws InvalidVersionSpecificationException { if ( artifact == null ) { throw new NullPointerException( "artifact" ); } switch ( parts.length ) { case 6: String classifier = artifact.getClassifier(); if ( !matches( parts[5], classifier ) ) { return false; } case 5: String scope = artifact.getScope(); if ( scope == null || scope.equals( "" ) ) { scope = Artifact.SCOPE_COMPILE; } if ( !matches( parts[4], scope ) ) { return false; } case 4: String type = artifact.getType(); if ( type == null || type.equals( "" ) ) { type = "jar"; } if ( !matches( parts[3], type ) ) { return false; } case 3: if ( !matches( parts[2], artifact.getVersion() ) ) { // CHECKSTYLE_OFF: LineLength if ( !AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( parts[2] ), new DefaultArtifactVersion( artifact.getVersion() ) ) ) // CHECKSTYLE_ON: LineLength { return false; } } case 2: if ( !matches( parts[1], artifact.getArtifactId() ) ) { return false; } case 1: return matches( parts[0], artifact.getGroupId() ); default: throw new AssertionError(); } } private boolean matches( String expression, String input ) { String regex = expression.replace( ".", "\\." ).replace( "*", ".*" ).replace( ":", "\\:" ).replace( '?', '.' ) .replace( "[", "\\[" ).replace( "]", "\\]" ).replace( "(", "\\(" ).replace( ")", "\\)" ); // TODO: Check if this can be done better or prevented earlier. if ( input == null ) { input = ""; } return java.util.regex.Pattern.matches( regex, input ); } @Override public String toString() { return pattern; } } private Collection patterns = new LinkedList(); private Collection ignorePatterns = new LinkedList(); /** * Construct class by providing patterns as strings. Empty strings are ignored. * * @throws NullPointerException if any of the arguments is null */ public ArtifactMatcher( final Collection patterns, final Collection ignorePatterns ) { if ( patterns == null ) { throw new NullPointerException( "patterns" ); } if ( ignorePatterns == null ) { throw new NullPointerException( "ignorePatterns" ); } for ( String pattern : patterns ) { if ( pattern != null && !"".equals( pattern ) ) { this.patterns.add( new Pattern( pattern ) ); } } for ( String ignorePattern : ignorePatterns ) { if ( ignorePattern != null && !"".equals( ignorePattern ) ) { this.ignorePatterns.add( new Pattern( ignorePattern ) ); } } } /** * Check if artifact matches patterns. * * @throws InvalidVersionSpecificationException */ public boolean match( Artifact artifact ) throws InvalidVersionSpecificationException { for ( Pattern pattern : patterns ) { if ( pattern.match( artifact ) ) { for ( Pattern ignorePattern : ignorePatterns ) { if ( ignorePattern.match( artifact ) ) { return false; } } return true; } } return false; } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionManagement.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionM0000664000175000017500000001153012561645371033122 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugins.enforcer.utils.DistributionManagementCheck; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule will check if a pom contains a distributionManagement part. This should be by best practice * only defined once. It could happen that you like to check the parent as well. This can be activated by using the * ignoreParent which is by default turned off (true) which means not to check the parent. * * @author Karl Heinz Marbaise * @since 1.4 */ public class BanDistributionManagement extends AbstractNonCacheableEnforcerRule { /** * If we turn on the ignoreParent the parent will be ignored. * @deprecated */ private boolean ignoreParent = true; /** * Allow using a repository entry in the distributionManagement area. */ private boolean allowRepository = false; /** * Allow snapshotRepository entry in the distributionManagement area. */ private boolean allowSnapshotRepository = false; /** * Allow site entry in the distributionManagement area. */ private boolean allowSite = false; private Log logger; /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { // Does it make sense to check something? If yes please make a JIRA ticket for it. logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); if ( !isIgnoreParent() ) { logger.warn( "You have configured not to ignore the parent." ); logger.warn( "This configuration is deprecated and will be ignored." ); } } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } } public boolean isIgnoreParent() { return ignoreParent; } public void setIgnoreParent( boolean ignoreParent ) { this.ignoreParent = ignoreParent; } public boolean isAllowRepository() { return allowRepository; } public void setAllowRepository( boolean allowRepository ) { this.allowRepository = allowRepository; } public boolean isAllowSnapshotRepository() { return allowSnapshotRepository; } public void setAllowSnapshotRepository( boolean allowSnapshotRepository ) { this.allowSnapshotRepository = allowSnapshotRepository; } public boolean isAllowSite() { return allowSite; } public void setAllowSite( boolean allowSite ) { this.allowSite = allowSite; } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoReposit0000664000175000017500000002133012566372145033164 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Model; import org.apache.maven.model.Repository; import org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * This rule checks that this pom or its parents don't define a repository. * * @author Brian Fox */ public class RequireNoRepositories extends AbstractNonCacheableEnforcerRule { /** * Whether to ban non-plugin repositories. By default they are banned. * * @see #setBanRepositories(boolean) */ private boolean banRepositories = true; /** * Whether to ban plugin repositories. By default they are banned. * * @see #setBanPluginRepositories(boolean) */ private boolean banPluginRepositories = true; /** * Specify explicitly allowed non-plugin repositories. This is a list of ids. * * @see #setAllowedRepositories(List) */ private List allowedRepositories = Collections.emptyList(); /** * Specify explicitly allowed plugin repositories. This is a list of ids. * * @see #setAllowedPluginRepositories(List) */ private List allowedPluginRepositories = Collections.emptyList(); /** * Whether to allow repositories which only resolve snapshots. By default they are banned. * * @see #setAllowSnapshotRepositories(boolean) */ private boolean allowSnapshotRepositories = false; /** * Whether to allow plugin repositories which only resolve snapshots. By default they are banned. * * @see {@link #setAllowSnapshotPluginRepositories(boolean)} */ private boolean allowSnapshotPluginRepositories = false; public final void setBanRepositories( boolean banRepositories ) { this.banRepositories = banRepositories; } public final void setBanPluginRepositories( boolean banPluginRepositories ) { this.banPluginRepositories = banPluginRepositories; } public final void setAllowedRepositories( List allowedRepositories ) { this.allowedRepositories = allowedRepositories; } public final void setAllowedPluginRepositories( List allowedPluginRepositories ) { this.allowedPluginRepositories = allowedPluginRepositories; } public final void setAllowSnapshotRepositories( boolean allowSnapshotRepositories ) { this.allowSnapshotRepositories = allowSnapshotRepositories; } public final void setAllowSnapshotPluginRepositories( boolean allowSnapshotPluginRepositories ) { this.allowSnapshotPluginRepositories = allowSnapshotPluginRepositories; } /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { EnforcerRuleUtils utils = new EnforcerRuleUtils( helper ); MavenProject project; try { project = (MavenProject) helper.evaluate( "${project}" ); List models = utils.getModelsRecursively( project.getGroupId(), project.getArtifactId(), project.getVersion(), new File( project.getBasedir(), "pom.xml" ) ); List badModels = new ArrayList(); StringBuffer newMsg = new StringBuffer(); newMsg.append( "Some poms have repositories defined:\n" ); for ( Model model : models ) { if ( banRepositories ) { List repos = model.getRepositories(); if ( repos != null && !repos.isEmpty() ) { List bannedRepos = findBannedRepositories( repos, allowedRepositories, allowSnapshotRepositories ); if ( !bannedRepos.isEmpty() ) { badModels.add( model ); newMsg.append( model.getGroupId() + ":" + model.getArtifactId() + " version:" + model.getVersion() + " has repositories " + bannedRepos ); } } } if ( banPluginRepositories ) { List repos = model.getPluginRepositories(); if ( repos != null && !repos.isEmpty() ) { List bannedRepos = findBannedRepositories( repos, allowedPluginRepositories, allowSnapshotPluginRepositories ); if ( !bannedRepos.isEmpty() ) { badModels.add( model ); newMsg.append( model.getGroupId() + ":" + model.getArtifactId() + " version:" + model.getVersion() + " has plugin repositories " + bannedRepos ); } } } } // if anything was found, log it then append the // optional message. if ( !badModels.isEmpty() ) { String message = getMessage(); if ( StringUtils.isNotEmpty( message ) ) { newMsg.append( message ); } throw new EnforcerRuleException( newMsg.toString() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( ArtifactResolutionException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( ArtifactNotFoundException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( IOException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( XmlPullParserException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } } /** * * @param repos all repositories, never {@code null} * @param allowedRepos allowed repositories, never {@code null} * @param allowSnapshots * @return List of banned repositoreis. */ private static List findBannedRepositories( List repos, List allowedRepos, boolean allowSnapshots ) { List bannedRepos = new ArrayList( allowedRepos.size() ); for ( Repository r : repos ) { if ( !allowedRepos.contains( r.getId() ) ) { if ( !allowSnapshots || r.getReleases() == null || r.getReleases().isEnabled() ) { // if we are not allowing snapshots and this repo is enabled for releases // it is banned. We don't care whether it is enabled for snapshots // if you define a repo and don't enable it for anything, then we have nothing // to worry about bannedRepos.add( r.getId() ); } } } return bannedRepos; } } maven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysFail.java0000664000175000017500000000317412157404630032656 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * Always fail. This rule is useful for testing the Enforcer configuration, or to always fail the build if a particular * profile is enabled. * @author Ben Lidgey */ public class AlwaysFail extends AbstractNonCacheableEnforcerRule { /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { String message = getMessage(); StringBuffer buf = new StringBuffer(); if ( message != null ) { buf.append( message ).append( '\n' ); } buf.append( "Always fails!" ); throw new EnforcerRuleException( buf.toString() ); } } maven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysPass.java0000664000175000017500000000320012157404630032677 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; /** * Always pass. This rule is useful for testing the Enforcer configuration. * @author Ben Lidgey */ public class AlwaysPass extends AbstractNonCacheableEnforcerRule { /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { final Log log = helper.getLog(); String message = getMessage(); StringBuffer buf = new StringBuffer(); if ( message != null ) { buf.append( message ).append( '\n' ); } buf.append( "Always pass!" ); log.info( buf.toString() ); } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionE0000664000175000017500000001726213075342666033135 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.List; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.Restriction; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.util.StringUtils; /** * Contains the common code to compare a version against a version range. * * @author Brian Fox * @version $Id: AbstractVersionEnforcer.java 1791757 2017-04-18 07:52:22Z khmarbaise $ */ public abstract class AbstractVersionEnforcer extends AbstractStandardEnforcerRule { /** * Specify the required version. Some examples are: *

    *
  • 2.0.4 Version 2.0.4 and higher (different from Maven meaning)
  • *
  • [2.0,2.1) Versions 2.0 (included) to 2.1 (not included)
  • *
  • [2.0,2.1] Versions 2.0 to 2.1 (both included)
  • *
  • [2.0.5,) Versions 2.0.5 and higher
  • *
  • (,2.0.5],[2.1.1,) Versions up to 2.0.5 (included) and 2.1.1 or higher
  • *
* * @see {@link #setVersion(String)} * @see {@link #getVersion()} */ private String version; /** * Compares the specified version to see if it is allowed by the defined version range. * * @param log the log * @param variableName name of variable to use in messages (Example: "Maven" or "Java" etc). * @param requiredVersionRange range of allowed versions. * @param actualVersion the version to be checked. * @throws EnforcerRuleException the enforcer rule exception */ // CHECKSTYLE_OFF: LineLength public void enforceVersion( Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion ) throws EnforcerRuleException // CHECKSTYLE_ON: LineLength { if ( StringUtils.isEmpty( requiredVersionRange ) ) { throw new EnforcerRuleException( variableName + " version can't be empty." ); } else { VersionRange vr; String msg = "Detected " + variableName + " Version: " + actualVersion; // short circuit check if the strings are exactly equal if ( actualVersion.toString().equals( requiredVersionRange ) ) { log.debug( msg + " is allowed in the range " + requiredVersionRange + "." ); } else { try { vr = VersionRange.createFromVersionSpec( requiredVersionRange ); if ( containsVersion( vr, actualVersion ) ) { log.debug( msg + " is allowed in the range " + requiredVersionRange + "." ); } else { String message = getMessage(); if ( StringUtils.isEmpty( message ) ) { message = msg + " is not in the allowed range " + vr + "."; } throw new EnforcerRuleException( message ); } } catch ( InvalidVersionSpecificationException e ) { throw new EnforcerRuleException( "The requested " + variableName + " version " + requiredVersionRange + " is invalid.", e ); } } } } /** * Copied from Artifact.VersionRange. This is tweaked to handle singular ranges properly. Currently the default * containsVersion method assumes a singular version means allow everything. This method assumes that "2.0.4" == * "[2.0.4,)" * * @param allowedRange range of allowed versions. * @param theVersion the version to be checked. * @return true if the version is contained by the range. */ public static boolean containsVersion( VersionRange allowedRange, ArtifactVersion theVersion ) { boolean matched = false; ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion(); if ( recommendedVersion == null ) { List restrictions = allowedRange.getRestrictions(); for ( Restriction restriction : restrictions ) { if ( restriction.containsVersion( theVersion ) ) { matched = true; break; } } } else { // only singular versions ever have a recommendedVersion @SuppressWarnings( "unchecked" ) int compareTo = recommendedVersion.compareTo( theVersion ); matched = ( compareTo <= 0 ); } return matched; } /* * (non-Javadoc) * @see org.apache.maven.enforcer.rule.api.EnforcerRule#getCacheId() */ public String getCacheId() { if ( StringUtils.isNotEmpty( version ) ) { // return the hashcodes of the parameter that matters return "" + version.hashCode(); } else { return "0"; } } /* * (non-Javadoc) * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable() */ public boolean isCacheable() { // the maven version is not going to change between projects in the same build. return true; } /* * (non-Javadoc) * @see * org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule) */ public boolean isResultValid( EnforcerRule theCachedRule ) { // i will always return the hash of the parameters as my id. If my parameters are the same, this // rule must always have the same result. return true; } /** * Gets the required version. * * @return the required version */ public final String getVersion() { return this.version; } /** * Specify the required version. Some examples are: *
    *
  • 2.0.4 Version 2.0.4 and higher (different from Maven meaning)
  • *
  • [2.0,2.1) Versions 2.0 (included) to 2.1 (not included)
  • *
  • [2.0,2.1] Versions 2.0 to 2.1 (both included)
  • *
  • [2.0.5,) Versions 2.0.5 and higher
  • *
  • (,2.0.5],[2.1.1,) Versions up to 2.0.5 (included) and 2.1.1 or higher
  • *
* * @param theVersion the required version to set */ public final void setVersion( String theVersion ) { this.version = theVersion; } } ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleCon0000664000175000017500000004535713075342666033132 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Dependency; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.StringUtils; /** * This rule will check if a multi module build will follow the best practices. * * @author Karl-Heinz Marbaise * @since 1.4 */ public class ReactorModuleConvergence extends AbstractNonCacheableEnforcerRule { private boolean ignoreModuleDependencies = false; private Log logger; public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); MavenSession session; try { session = (MavenSession) helper.evaluate( "${session}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenSession: ", eee ); } List sortedProjects = session.getSortedProjects(); if ( sortedProjects != null && !sortedProjects.isEmpty() ) { checkReactor( sortedProjects ); checkParentsInReactor( sortedProjects ); checkMissingParentsInReactor( sortedProjects ); checkParentsPartOfTheReactor( sortedProjects ); if ( !isIgnoreModuleDependencies() ) { checkDependenciesWithinReactor( sortedProjects ); } } } private void checkParentsPartOfTheReactor( List sortedProjects ) throws EnforcerRuleException { List parentsWhichAreNotPartOfTheReactor = existParentsWhichAreNotPartOfTheReactor( sortedProjects ); if ( !parentsWhichAreNotPartOfTheReactor.isEmpty() ) { StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR ); addMessageIfExist( sb ); for ( MavenProject mavenProject : parentsWhichAreNotPartOfTheReactor ) { sb.append( " module: " ); sb.append( mavenProject.getId() ); sb.append( SystemUtils.LINE_SEPARATOR ); } throw new EnforcerRuleException( "Module parents have been found which could not be found in the reactor." + sb.toString() ); } } /** * Convenience method to create a user readable message. * * @param sortedProjects The list of reactor projects. * @throws EnforcerRuleException In case of a violation. */ private void checkMissingParentsInReactor( List sortedProjects ) throws EnforcerRuleException { List modulesWithoutParentsInReactor = existModulesWithoutParentsInReactor( sortedProjects ); if ( !modulesWithoutParentsInReactor.isEmpty() ) { StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR ); addMessageIfExist( sb ); for ( MavenProject mavenProject : modulesWithoutParentsInReactor ) { sb.append( " module: " ); sb.append( mavenProject.getId() ); sb.append( SystemUtils.LINE_SEPARATOR ); } throw new EnforcerRuleException( "Reactor contains modules without parents." + sb.toString() ); } } private void checkDependenciesWithinReactor( List sortedProjects ) throws EnforcerRuleException { // After we are sure having consistent version we can simply use the first one? String reactorVersion = sortedProjects.get( 0 ).getVersion(); Map> areThereDependenciesWhichAreNotPartOfTheReactor = areThereDependenciesWhichAreNotPartOfTheReactor( reactorVersion, sortedProjects ); if ( !areThereDependenciesWhichAreNotPartOfTheReactor.isEmpty() ) { StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR ); addMessageIfExist( sb ); // CHECKSTYLE_OFF: LineLength for ( Entry> item : areThereDependenciesWhichAreNotPartOfTheReactor.entrySet() ) { sb.append( " module: " ); sb.append( item.getKey().getId() ); sb.append( SystemUtils.LINE_SEPARATOR ); for ( Dependency dependency : item.getValue() ) { String id = dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion(); sb.append( " dependency: " ); sb.append( id ); sb.append( SystemUtils.LINE_SEPARATOR ); } } throw new EnforcerRuleException( "Reactor modules contains dependencies which do not reference the reactor." + sb.toString() ); // CHECKSTYLE_ON: LineLength } } /** * Convenience method to create a user readable message. * * @param sortedProjects The list of reactor projects. * @throws EnforcerRuleException In case of a violation. */ private void checkParentsInReactor( List sortedProjects ) throws EnforcerRuleException { // After we are sure having consistent version we can simply use the first one? String reactorVersion = sortedProjects.get( 0 ).getVersion(); List areParentsFromTheReactor = areParentsFromTheReactor( reactorVersion, sortedProjects ); if ( !areParentsFromTheReactor.isEmpty() ) { StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR ); addMessageIfExist( sb ); for ( MavenProject mavenProject : areParentsFromTheReactor ) { sb.append( " --> " ); sb.append( mavenProject.getId() ); sb.append( " parent:" ); sb.append( mavenProject.getParent().getId() ); sb.append( SystemUtils.LINE_SEPARATOR ); } throw new EnforcerRuleException( "Reactor modules have parents which contain a wrong version." + sb.toString() ); } } /** * Convenience method to create user readable message. * * @param sortedProjects The list of reactor projects. * @throws EnforcerRuleException In case of a violation. */ private void checkReactor( List sortedProjects ) throws EnforcerRuleException { List consistenceCheckResult = isReactorVersionConsistent( sortedProjects ); if ( !consistenceCheckResult.isEmpty() ) { StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR ); addMessageIfExist( sb ); for ( MavenProject mavenProject : consistenceCheckResult ) { sb.append( " --> " ); sb.append( mavenProject.getId() ); sb.append( SystemUtils.LINE_SEPARATOR ); } throw new EnforcerRuleException( "The reactor contains different versions." + sb.toString() ); } } private List areParentsFromTheReactor( String reactorVersion, List sortedProjects ) { List result = new ArrayList(); for ( MavenProject mavenProject : sortedProjects ) { logger.debug( "Project: " + mavenProject.getId() ); if ( hasParent( mavenProject ) ) { if ( !mavenProject.isExecutionRoot() ) { MavenProject parent = mavenProject.getParent(); if ( !reactorVersion.equals( parent.getVersion() ) ) { logger.debug( "The project: " + mavenProject.getId() + " has a parent which version does not match the other elements in reactor" ); result.add( mavenProject ); } } } else { // This situation is currently ignored, cause it's handled by existModulesWithoutParentsInReactor() } } return result; } private List existParentsWhichAreNotPartOfTheReactor( List sortedProjects ) { List result = new ArrayList(); for ( MavenProject mavenProject : sortedProjects ) { logger.debug( "Project: " + mavenProject.getId() ); if ( hasParent( mavenProject ) ) { if ( !mavenProject.isExecutionRoot() ) { MavenProject parent = mavenProject.getParent(); if ( !isProjectPartOfTheReactor( parent, sortedProjects ) ) { result.add( mavenProject ); } } } } return result; } /** * This will check of the groupId/artifactId can be found in any reactor project. The version will be ignored cause * versions are checked before. * * @param project The project which should be checked if it is contained in the sortedProjects. * @param sortedProjects The list of existing projects. * @return true if the project has been found within the list false otherwise. */ private boolean isProjectPartOfTheReactor( MavenProject project, List sortedProjects ) { return isGAPartOfTheReactor( project.getGroupId(), project.getArtifactId(), sortedProjects ); } private boolean isDependencyPartOfTheReactor( Dependency dependency, List sortedProjects ) { return isGAPartOfTheReactor( dependency.getGroupId(), dependency.getArtifactId(), sortedProjects ); } /** * This will check if the given groupId/artifactId is part of the current reactor. * * @param groupId The groupId * @param artifactId The artifactId * @param sortedProjects The list of projects within the reactor. * @return true if the groupId/artifactId is part of the reactor false otherwise. */ private boolean isGAPartOfTheReactor( String groupId, String artifactId, List sortedProjects ) { boolean result = false; for ( MavenProject mavenProject : sortedProjects ) { String parentId = groupId + ":" + artifactId; String projectId = mavenProject.getGroupId() + ":" + mavenProject.getArtifactId(); if ( parentId.equals( projectId ) ) { result = true; } } return result; } /** * Assume we have a module which is a child of a multi module build but this child does not have a parent. This * method will exactly search for such cases. * * @param sortedProjects The sorted list of the reactor modules. * @return The resulting list will contain the modules in the reactor which do not have a parent. The list will * never null. If the list is empty no violation have happened. */ private List existModulesWithoutParentsInReactor( List sortedProjects ) { List result = new ArrayList(); for ( MavenProject mavenProject : sortedProjects ) { logger.debug( "Project: " + mavenProject.getId() ); if ( !hasParent( mavenProject ) ) { // TODO: Should add an option to force having a parent? if ( mavenProject.isExecutionRoot() ) { logger.debug( "The root does not need having a parent." ); } else { logger.debug( "The module: " + mavenProject.getId() + " has no parent." ); result.add( mavenProject ); } } } return result; } /** * Convenience method to handle adding a dependency to the Map of List. * * @param result The result List which should be handled. * @param project The MavenProject which will be added. * @param dependency The dependency which will be added. */ private void addDep( Map> result, MavenProject project, Dependency dependency ) { if ( result.containsKey( project ) ) { List list = result.get( project ); if ( list == null ) { list = new ArrayList(); } list.add( dependency ); result.put( project, list ); } else { List list = new ArrayList(); list.add( dependency ); result.put( project, list ); } } /** * Go through the list of modules in the builds and check if we have dependencies. If yes we will check every * dependency based on groupId/artifactId if it belongs to the multi module build. In such a case it will be checked * if the version does fit the version in the rest of build. * * @param reactorVersion The version of the reactor. * @param sortedProjects The list of existing projects within this build. * @return List of violations. Never null. If the list is empty than no violation has happened. */ // CHECKSTYLE_OFF: LineLength private Map> areThereDependenciesWhichAreNotPartOfTheReactor( String reactorVersion, List sortedProjects ) // CHECKSTYLE_ON: LineLength { Map> result = new HashMap>(); for ( MavenProject mavenProject : sortedProjects ) { logger.debug( "Project: " + mavenProject.getId() ); @SuppressWarnings( "unchecked" ) List dependencies = mavenProject.getDependencies(); if ( hasDependencies( dependencies ) ) { for ( Dependency dependency : dependencies ) { logger.debug( " -> Dep:" + dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion() ); if ( isDependencyPartOfTheReactor( dependency, sortedProjects ) ) { if ( !dependency.getVersion().equals( reactorVersion ) ) { addDep( result, mavenProject, dependency ); } } } } } return result; } /** * This method will check the following situation within a multi-module build. * *
     *  <parent>
     *    <groupId>...</groupId>
     *    <artifactId>...</artifactId>
     *    <version>1.0-SNAPSHOT</version>
     *  </parent>
     *  
     *  <version>1.1-SNAPSHOT</version>
     * 
* * @param projectList The sorted list of the reactor modules. * @return The resulting list will contain the modules in the reactor which do the thing in the example above. The * list will never null. If the list is empty no violation have happened. */ private List isReactorVersionConsistent( List projectList ) { List result = new ArrayList(); if ( projectList != null && !projectList.isEmpty() ) { String version = projectList.get( 0 ).getVersion(); logger.debug( "First version:" + version ); for ( MavenProject mavenProject : projectList ) { logger.debug( " -> checking " + mavenProject.getId() ); if ( !version.equals( mavenProject.getVersion() ) ) { result.add( mavenProject ); } } } return result; } private boolean hasDependencies( List dependencies ) { return dependencies != null && !dependencies.isEmpty(); } private boolean hasParent( MavenProject mavenProject ) { return mavenProject.getParent() != null; } public boolean isIgnoreModuleDependencies() { return ignoreModuleDependencies; } public void setIgnoreModuleDependencies( boolean ignoreModuleDependencies ) { this.ignoreModuleDependencies = ignoreModuleDependencies; } /** * This will add the given user message to the output. * * @param sb The already initialized exception message part. */ private void addMessageIfExist( StringBuilder sb ) { if ( !StringUtils.isEmpty( getMessage() ) ) { sb.append( getMessage() ); sb.append( SystemUtils.LINE_SEPARATOR ); } } }maven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java0000664000175000017500000002521312422541465032501 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Iterator; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Activation; import org.apache.maven.model.ActivationOS; import org.apache.maven.model.Profile; import org.apache.maven.plugin.logging.Log; import org.apache.maven.profiles.activation.OperatingSystemProfileActivator; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; /** * This rule checks that the OS is allowed by combinations of family, name, version and cpu architecture. The behavior * is exactly the same as the Maven Os profile activation so the same values are allowed here. * * @author Brian Fox * @version $Id: RequireOS.java 1634140 2014-10-24 21:23:01Z khmarbaise $ */ public class RequireOS extends AbstractStandardEnforcerRule { /** * The OS family type desired
* Possible values: *
    *
  • dos
  • *
  • mac
  • *
  • netware
  • *
  • os/2
  • *
  • tandem
  • *
  • unix
  • *
  • windows
  • *
  • win9x
  • *
  • z/os
  • *
  • os/400
  • *
* * @see {@link #setFamily(String)} * @see {@link #getFamily()} */ private String family = null; /** * The OS name desired. * * @see {@link #setName(String)} * @see {@link #getName()} */ private String name = null; /** * The OS version desired. * * @see {@link #setVersion(String)} * @see {@link #getVersion()} */ private String version = null; /** * The OS architecture desired. * * @see {@link #setArch(String)} * @see {@link #getArch()} */ private String arch = null; /** * Display detected OS information. * * @see {@link #setDisplay(boolean)} * @see {@link #isDisplay()} */ private boolean display = false; /** * Instantiates a new RequireOS. */ public RequireOS() { } /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { displayOSInfo( helper.getLog(), display ); if ( allParamsEmpty() ) { throw new EnforcerRuleException( "All parameters can not be empty. " + "You must pick at least one of (family, name, version, arch) " + "or use -Denforcer.os.display=true to see the current OS information." ); } if ( isValidFamily( this.family ) ) { if ( !isAllowed() ) { String message = getMessage(); if ( StringUtils.isEmpty( message ) ) { //@formatter:off message = ( "OS Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: " + Os.OS_VERSION + " is not allowed by" + ( arch != null ? " Arch=" + arch : "" ) + ( family != null ? " Family=" + family : "" ) + ( name != null ? " Name=" + name : "" ) + ( version != null ? " Version=" + version : "" ) ); //@formatter:on } throw new EnforcerRuleException( message ); } } else { final int minimumBufferSize = 50; StringBuilder buffer = new StringBuilder( minimumBufferSize ); Iterator iter = Os.getValidFamilies().iterator(); while ( iter.hasNext() ) { buffer.append( iter.next() ); buffer.append( ", " ); } String help = StringUtils.stripEnd( buffer.toString().trim(), "." ); throw new EnforcerRuleException( "Invalid Family type used. Valid family types are: " + help ); } } /** * Log the current OS information. * * @param log the log * @param info the info */ public void displayOSInfo( Log log, boolean info ) { String string = "OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: " + Os.OS_VERSION; if ( !info ) { log.debug( string ); } else { log.info( string ); } } /** * Helper method to determine if the current OS is allowed based on the injected values for family, name, version * and arch. * * @return true if the version is allowed. */ public boolean isAllowed() { OperatingSystemProfileActivator activator = new OperatingSystemProfileActivator(); return activator.isActive( createProfile() ); } /** * Helper method to check that at least one of family, name, version or arch is set. * * @return true if all parameters are empty. */ public boolean allParamsEmpty() { // CHECKSTYLE_OFF: LineLength return ( StringUtils.isEmpty( family ) && StringUtils.isEmpty( arch ) && StringUtils.isEmpty( name ) && StringUtils.isEmpty( version ) ); // CHECKSTYLE_ON: LineLength } /** * Creates a Profile object that contains the activation information. * * @return a properly populated profile to be used for OS validation. */ private Profile createProfile() { Profile profile = new Profile(); profile.setActivation( createActivation() ); return profile; } /** * Creates an Activation object that contains the ActivationOS information. * * @return a properly populated Activation object. */ private Activation createActivation() { Activation activation = new Activation(); activation.setActiveByDefault( false ); activation.setOs( createOsBean() ); return activation; } /** * Creates an ActivationOS object containing family, name, version and arch. * * @return a properly populated ActivationOS object. */ private ActivationOS createOsBean() { ActivationOS os = new ActivationOS(); os.setArch( arch ); os.setFamily( family ); os.setName( name ); os.setVersion( version ); return os; } /** * Helper method to check if the given family is in the following list: *
    *
  • dos
  • *
  • mac
  • *
  • netware
  • *
  • os/2
  • *
  • tandem
  • *
  • unix
  • *
  • windows
  • *
  • win9x
  • *
  • z/os
  • *
  • os/400
  • *
* Note: '!' is allowed at the beginning of the string and still considered valid. * * @param theFamily the family to check. * @return true if one of the valid families. */ public boolean isValidFamily( String theFamily ) { // in case they are checking !family theFamily = StringUtils.stripStart( theFamily, "!" ); return ( StringUtils.isEmpty( theFamily ) || Os.getValidFamilies().contains( theFamily ) ); } /** * Gets the arch. * * @return the arch */ public String getArch() { return this.arch; } /** * Sets the arch. * * @param theArch the arch to set */ public void setArch( String theArch ) { this.arch = theArch; } /** * Gets the family. * * @return the family */ public String getFamily() { return this.family; } /** * Sets the family. * * @param theFamily the family to set */ public void setFamily( String theFamily ) { this.family = theFamily; } /** * Gets the name. * * @return the name */ public String getName() { return this.name; } /** * Sets the name. * * @param theName the name to set */ public void setName( String theName ) { this.name = theName; } /** * Gets the version. * * @return the version */ public String getVersion() { return this.version; } /** * Sets the version. * * @param theVersion the version to set */ public void setVersion( String theVersion ) { this.version = theVersion; } /** * @param display The value for the display. */ public final void setDisplay( boolean display ) { this.display = display; } public final boolean isDisplay() { return display; } /** * {@inheritDoc} */ public String getCacheId() { // return the hashcodes of all the parameters StringBuffer b = new StringBuffer(); if ( StringUtils.isNotEmpty( version ) ) { b.append( version.hashCode() ); } if ( StringUtils.isNotEmpty( name ) ) { b.append( name.hashCode() ); } if ( StringUtils.isNotEmpty( arch ) ) { b.append( arch.hashCode() ); } if ( StringUtils.isNotEmpty( family ) ) { b.append( family.hashCode() ); } return b.toString(); } /** * {@inheritDoc} */ public boolean isCacheable() { // the os is not going to change between projects in the same build. return true; } /** * {@inheritDoc} */ public boolean isResultValid( EnforcerRule theCachedRule ) { // i will always return the hash of the parameters as my id. If my parameters are the same, this // rule must always have the same result. return true; } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersi0000664000175000017500000000755713076207711033144 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.apache.commons.lang3.SystemUtils; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.util.StringUtils; /** * This rule checks that the Java version is allowed. * * @author Brian Fox * @version $Id: RequireJavaVersion.java 1792138 2017-04-20 19:45:13Z khmarbaise $ */ public class RequireJavaVersion extends AbstractVersionEnforcer { /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { String javaVersion = SystemUtils.JAVA_VERSION; Log log = helper.getLog(); log.debug( "Detected Java String: '" + javaVersion + "'" ); javaVersion = normalizeJDKVersion( javaVersion ); log.debug( "Normalized Java String: '" + javaVersion + "'" ); ArtifactVersion detectedJdkVersion = new DefaultArtifactVersion( javaVersion ); log.debug( "Parsed Version: Major: " + detectedJdkVersion.getMajorVersion() + " Minor: " + detectedJdkVersion.getMinorVersion() + " Incremental: " + detectedJdkVersion.getIncrementalVersion() + " Build: " + detectedJdkVersion.getBuildNumber() + " Qualifier: " + detectedJdkVersion.getQualifier() ); enforceVersion( helper.getLog(), "JDK", getVersion(), detectedJdkVersion ); } /** * Converts a jdk string from 1.5.0-11b12 to a single 3 digit version like 1.5.0-11 * * @param theJdkVersion to be converted. * @return the converted string. */ public static String normalizeJDKVersion( String theJdkVersion ) { theJdkVersion = theJdkVersion.replaceAll( "_|-", "." ); String tokenArray[] = StringUtils.split( theJdkVersion, "." ); List tokens = Arrays.asList( tokenArray ); StringBuffer buffer = new StringBuffer( theJdkVersion.length() ); Iterator iter = tokens.iterator(); for ( int i = 0; i < tokens.size() && i < 4; i++ ) { String section = (String) iter.next(); section = section.replaceAll( "[^0-9]", "" ); if ( StringUtils.isNotEmpty( section ) ) { buffer.append( Integer.parseInt( section ) ); if ( i != 2 ) { buffer.append( '.' ); } else { buffer.append( '-' ); } } } String version = buffer.toString(); version = StringUtils.stripEnd( version, "-" ); return StringUtils.stripEnd( version, "." ); } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshel0000664000175000017500000000723412422541465033116 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.StringUtils; import bsh.EvalError; import bsh.Interpreter; /** * Rule for Maven Enforcer using Beanshell to evaluate a conditional expression. * * @author hugonnem */ public class EvaluateBeanshell extends AbstractNonCacheableEnforcerRule { /** Beanshell interpreter. */ private static final Interpreter BSH = new Interpreter(); /** The condition to be evaluated. * * @see {@link #setCondition(String)} * @see {@link #getCondition()} * */ private String condition; public final void setCondition( String condition ) { this.condition = condition; } public final String getCondition() { return condition; } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { Log log = helper.getLog(); try { log.debug( "Echo condition : " + this.condition ); // Evaluate condition within Plexus Container String script = (String) helper.evaluate( this.condition ); log.debug( "Echo script : " + script ); if ( !evaluateCondition( script, log ) ) { String message = getMessage(); if ( StringUtils.isEmpty( message ) ) { message = "The expression \"" + condition + "\" is not true."; } throw new EnforcerRuleException( message ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to evaluate an expression '" + condition + "'", e ); } } /** * Evaluate expression using Beanshell. * * @param script the expression to be evaluated * @param log the logger * @return boolean the evaluation of the expression * @throws EnforcerRuleException if the script could not be evaluated */ protected boolean evaluateCondition( String script, Log log ) throws EnforcerRuleException { Boolean evaluation = Boolean.FALSE; try { evaluation = (Boolean) BSH.eval( script ); log.debug( "Echo evaluating : " + evaluation ); } catch ( EvalError ex ) { throw new EnforcerRuleException( "Couldn't evaluate condition: " + script, ex ); } return evaluation.booleanValue(); } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoun0000664000175000017500000003425113120464057033156 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactCollector; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.OverConstrainedVersionException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.dependency.tree.DependencyNode; import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.i18n.I18N; /** * Rule to enforce that the resolved dependency is also the most recent one of all transitive dependencies. * * @author Geoffrey De Smet * @since 1.1 */ public class RequireUpperBoundDeps extends AbstractNonCacheableEnforcerRule { private static Log log; private static I18N i18n; /** * @since 1.3 */ private boolean uniqueVersions; /** * Dependencies to ignore. * * @since TBD */ private List excludes = null; /** * Set to {@code true} if timestamped snapshots should be used. * * @param uniqueVersions * @since 1.3 */ public void setUniqueVersions( boolean uniqueVersions ) { this.uniqueVersions = uniqueVersions; } /** * Sets dependencies to exclude. * @param excludes a list of {@code groupId:artifactId} names */ public void setExcludes( List excludes ) { this.excludes = excludes; } // CHECKSTYLE_OFF: LineLength /** * Uses the {@link EnforcerRuleHelper} to populate the values of the * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} * factory method.
* This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do. * * @param helper * @return a Dependency Node which is the root of the project's dependency tree * @throws EnforcerRuleException when the build should fail */ // CHECKSTYLE_ON: LineLength private DependencyNode getNode( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); DependencyTreeBuilder dependencyTreeBuilder = (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class ); ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" ); ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); ArtifactMetadataSource metadataSource = (ArtifactMetadataSource) helper.getComponent( ArtifactMetadataSource.class ); ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class ); ArtifactFilter filter = null; // we need to evaluate all scopes DependencyNode node = dependencyTreeBuilder.buildDependencyTree( project, repository, factory, metadataSource, filter, collector ); return node; } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e ); } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( DependencyTreeBuilderException e ) { throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e ); } } public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { if ( log == null ) { log = helper.getLog(); } try { if ( i18n == null ) { i18n = (I18N) helper.getComponent( I18N.class ); } DependencyNode node = getNode( helper ); RequireUpperBoundDepsVisitor visitor = new RequireUpperBoundDepsVisitor(); visitor.setUniqueVersions( uniqueVersions ); node.accept( visitor ); List errorMessages = buildErrorMessages( visitor.getConflicts() ); if ( errorMessages.size() > 0 ) { throw new EnforcerRuleException( "Failed while enforcing RequireUpperBoundDeps. The error(s) are " + errorMessages ); } } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( Exception e ) { throw new EnforcerRuleException( e.getLocalizedMessage(), e ); } } private List buildErrorMessages( List> conflicts ) { List errorMessages = new ArrayList( conflicts.size() ); for ( List conflict : conflicts ) { Artifact artifact = conflict.get( 0 ).getArtifact(); String groupArt = artifact.getGroupId() + ":" + artifact.getArtifactId(); if ( excludes != null && excludes.contains( groupArt ) ) { log.info( "Ignoring requireUpperBoundDeps in " + groupArt ); } else { errorMessages.add( buildErrorMessage( conflict ) ); } } return errorMessages; } private String buildErrorMessage( List conflict ) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append( "\nRequire upper bound dependencies error for " + getFullArtifactName( conflict.get( 0 ), false ) + " paths to dependency are:\n" ); if ( conflict.size() > 0 ) { errorMessage.append( buildTreeString( conflict.get( 0 ) ) ); } for ( DependencyNode node : conflict.subList( 1, conflict.size() ) ) { errorMessage.append( "and\n" ); errorMessage.append( buildTreeString( node ) ); } return errorMessage.toString(); } private StringBuilder buildTreeString( DependencyNode node ) { List loc = new ArrayList(); DependencyNode currentNode = node; while ( currentNode != null ) { StringBuilder line = new StringBuilder( getFullArtifactName( currentNode, false ) ); if ( currentNode.getPremanagedVersion() != null ) { line.append( " (managed) <-- " ); line.append( getFullArtifactName( currentNode, true ) ); } loc.add( line.toString() ); currentNode = currentNode.getParent(); } Collections.reverse( loc ); StringBuilder builder = new StringBuilder(); for ( int i = 0; i < loc.size(); i++ ) { for ( int j = 0; j < i; j++ ) { builder.append( " " ); } builder.append( "+-" ).append( loc.get( i ) ); builder.append( "\n" ); } return builder; } private String getFullArtifactName( DependencyNode node, boolean usePremanaged ) { Artifact artifact = node.getArtifact(); String version = node.getPremanagedVersion(); if ( !usePremanaged || version == null ) { version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version; } private static class RequireUpperBoundDepsVisitor implements DependencyNodeVisitor { private boolean uniqueVersions; public void setUniqueVersions( boolean uniqueVersions ) { this.uniqueVersions = uniqueVersions; } private Map> keyToPairsMap = new LinkedHashMap>(); public boolean visit( DependencyNode node ) { DependencyNodeHopCountPair pair = new DependencyNodeHopCountPair( node ); String key = pair.constructKey(); List pairs = keyToPairsMap.get( key ); if ( pairs == null ) { pairs = new ArrayList(); keyToPairsMap.put( key, pairs ); } pairs.add( pair ); Collections.sort( pairs ); return true; } public boolean endVisit( DependencyNode node ) { return true; } public List> getConflicts() { List> output = new ArrayList>(); for ( List pairs : keyToPairsMap.values() ) { if ( containsConflicts( pairs ) ) { List outputSubList = new ArrayList( pairs.size() ); for ( DependencyNodeHopCountPair pair : pairs ) { outputSubList.add( pair.getNode() ); } output.add( outputSubList ); } } return output; } @SuppressWarnings( "unchecked" ) private boolean containsConflicts( List pairs ) { DependencyNodeHopCountPair resolvedPair = pairs.get( 0 ); // search for artifact with lowest hopCount for ( DependencyNodeHopCountPair hopPair : pairs.subList( 1, pairs.size() ) ) { if ( hopPair.getHopCount() < resolvedPair.getHopCount() ) { resolvedPair = hopPair; } } ArtifactVersion resolvedVersion = resolvedPair.extractArtifactVersion( uniqueVersions, false ); for ( DependencyNodeHopCountPair pair : pairs ) { ArtifactVersion version = pair.extractArtifactVersion( uniqueVersions, true ); if ( resolvedVersion.compareTo( version ) < 0 ) { return true; } } return false; } } private static class DependencyNodeHopCountPair implements Comparable { private DependencyNode node; private int hopCount; private DependencyNodeHopCountPair( DependencyNode node ) { this.node = node; countHops(); } private void countHops() { hopCount = 0; DependencyNode parent = node.getParent(); while ( parent != null ) { hopCount++; parent = parent.getParent(); } } private String constructKey() { Artifact artifact = node.getArtifact(); return artifact.getGroupId() + ":" + artifact.getArtifactId(); } public DependencyNode getNode() { return node; } private ArtifactVersion extractArtifactVersion( boolean uniqueVersions, boolean usePremanagedVersion ) { if ( usePremanagedVersion && node.getPremanagedVersion() != null ) { return new DefaultArtifactVersion( node.getPremanagedVersion() ); } Artifact artifact = node.getArtifact(); String version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); if ( version != null ) { return new DefaultArtifactVersion( version ); } try { return artifact.getSelectedVersion(); } catch ( OverConstrainedVersionException e ) { throw new RuntimeException( "Version ranges problem with " + node.getArtifact(), e ); } } public int getHopCount() { return hopCount; } public int compareTo( DependencyNodeHopCountPair other ) { return Integer.valueOf( hopCount ).compareTo( Integer.valueOf( other.getHopCount() ) ); } } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironme0000775000175000017500000000460312566372145033213 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * This rule checks that certain environment variable is set. * * @author Marvin Froeder */ public class RequireEnvironmentVariable extends AbstractPropertyEnforcerRule { /** * Specify the required variable. */ private String variableName = null; /** * @param variableName the variable name * * @see #setVariableName(String) * @see #getVariableName() */ public final void setVariableName( String variableName ) { this.variableName = variableName; } public final String getVariableName() { return variableName; } @Override public String resolveValue( EnforcerRuleHelper helper ) { String envValue = System.getenv( variableName ); return envValue; } public boolean isCacheable() { // environment variables won't change while maven is on the run return true; } public boolean isResultValid( EnforcerRule cachedRule ) { // this rule shall always have the same result, since environment // variables are set before maven is launched return true; } public String getCacheId() { return variableName; } @Override public String getPropertyName() { return variableName; } @Override public String getName() { return "Environment variable"; } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDontExist.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDont0000664000175000017500000000274512157410307033127 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; /** * The Class RequireFilesDontExist. */ public class RequireFilesDontExist extends AbstractRequireFiles { /* * (non-Javadoc) * * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#checkFile(java.io.File) */ boolean checkFile( File file ) { // if we get here and the handle is null, treat it as a success return file == null ? true : !file.exists(); } /* * (non-Javadoc) * * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#getErrorMsg() */ String getErrorMsg() { return "Some files should not exist:\n"; } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotV0000664000175000017500000000576412770317331033175 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule checks that the current project is not a release. */ public class RequireSnapshotVersion extends AbstractNonCacheableEnforcerRule { /** * Allows this rule to fail when the parent is defined as a release. */ private boolean failWhenParentIsRelease = true; public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { MavenProject project = getProject( helper ); Artifact artifact = project.getArtifact(); if ( !artifact.isSnapshot() ) { String message = getMessage(); StringBuilder sb = new StringBuilder(); if ( message != null ) { sb.append( message ).append( '\n' ); } sb.append( "This project cannot be a release:" ).append( artifact.getId() ); throw new EnforcerRuleException( sb.toString() ); } if ( failWhenParentIsRelease ) { Artifact parentArtifact = project.getParentArtifact(); if ( parentArtifact != null && !parentArtifact.isSnapshot() ) { throw new EnforcerRuleException( "Parent cannot be a release: " + parentArtifact.getId() ); } } } private MavenProject getProject( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { return (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } } public boolean isFailWhenParentIsRelease() { return failWhenParentIsRelease; } public void setFailWhenParentIsRelease( boolean failWhenParentIsRelease ) { this.failWhenParentIsRelease = failWhenParentIsRelease; } } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireF0000664000175000017500000001405412416337542033114 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * Contains the common code to compare an array of files against a requirement. * * @author Brian Fox */ public abstract class AbstractRequireFiles extends AbstractStandardEnforcerRule { /** Array of files to check. */ private File[] files; /** if null file handles should be allowed. If they are allowed, it means treat it as a success. */ private boolean allowNulls = false; // check the file for the specific condition /** * Check one file. * * @param file the file * @return true if successful */ abstract boolean checkFile( File file ); // return standard error message /** * Gets the error msg. * * @return the error msg */ abstract String getErrorMsg(); /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { if ( !allowNulls && files.length == 0 ) { throw new EnforcerRuleException( "The file list is empty and Null files are disabled." ); } List failures = new ArrayList(); for ( File file : files ) { if ( !allowNulls && file == null ) { failures.add( file ); } else if ( !checkFile( file ) ) { failures.add( file ); } } // if anything was found, log it with the optional message. if ( !failures.isEmpty() ) { String message = getMessage(); StringBuilder buf = new StringBuilder(); if ( message != null ) { buf.append( message + "\n" ); } buf.append( getErrorMsg() ); for ( File file : failures ) { if ( file != null ) { buf.append( file.getAbsolutePath() + "\n" ); } else { buf.append( "(an empty filename was given and allowNulls is false)\n" ); } } throw new EnforcerRuleException( buf.toString() ); } } /** * If your rule is cacheable, you must return a unique id when parameters or conditions change that would cause the * result to be different. Multiple cached results are stored based on their id. The easiest way to do this is to * return a hash computed from the values of your parameters. If your rule is not cacheable, then the result here is * not important, you may return anything. * * @return the cache id */ public String getCacheId() { return Integer.toString( hashCode( files ) ); } /** * Calculates a hash code for the specified array as Arrays.hashCode() would do. Unfortunately, the * mentioned method is only available for Java 1.5 and later. * * @param items The array for which to compute the hash code, may be null. * @return The hash code for the array. */ private static int hashCode( Object[] items ) { int hash = 0; if ( items != null ) { hash = 1; for ( int i = 0; i < items.length; i++ ) { Object item = items[i]; hash = 31 * hash + ( item == null ? 0 : item.hashCode() ); } } return hash; } /** * This tells the system if the results are cacheable at all. Keep in mind that during forked builds and other * things, a given rule may be executed more than once for the same project. This means that even things that change * from project to project may still be cacheable in certain instances. * * @return true if rule is cacheable */ public boolean isCacheable() { return true; } /** * If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to * allow double checking of the results. Most of the time this can be done by generating unique ids, but sometimes * the results of objects returned by the helper need to be queried. You may for example, store certain objects in * your rule and then query them later. * * @param cachedRule the cached rule * @return true if the stored results are valid for the same id. */ public boolean isResultValid( EnforcerRule cachedRule ) { return true; } public File[] getFiles() { return files; } public void setFiles( File[] files ) { this.files = files; } public boolean isAllowNulls() { return allowNulls; } public void setAllowNulls( boolean allowNulls ) { this.allowNulls = allowNulls; } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVe0000664000175000017500000000674612566372145033133 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * This rule checks that the current project is not a snapshot. * * @author Brian Fox */ public class RequireReleaseVersion extends AbstractNonCacheableEnforcerRule { /** * Allows this rule to fail when the parent is defined as a snapshot. * * @parameter * * @see {@link #setFailWhenParentIsSnapshot(boolean)} * @see {@link #isFailWhenParentIsSnapshot()} */ private boolean failWhenParentIsSnapshot = true; /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper theHelper ) throws EnforcerRuleException { MavenProject project = getProject( theHelper ); if ( project.getArtifact().isSnapshot() ) { String message = getMessage(); StringBuffer buf = new StringBuffer(); if ( message != null ) { buf.append( message ).append( '\n' ); } buf.append( "This project cannot be a snapshot:" ).append( project.getArtifact().getId() ); throw new EnforcerRuleException( buf.toString() ); } if ( failWhenParentIsSnapshot ) { Artifact parentArtifact = project.getParentArtifact(); if ( parentArtifact != null && parentArtifact.isSnapshot() ) { throw new EnforcerRuleException( "Parent Cannot be a snapshot: " + parentArtifact.getId() ); } } } /** * @param helper * @return The evaluated {@link MavenProject}. * @throws EnforcerRuleException */ private MavenProject getProject( EnforcerRuleHelper helper ) throws EnforcerRuleException { try { return (MavenProject) helper.evaluate( "${project}" ); } catch ( ExpressionEvaluationException eee ) { throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee ); } } public final boolean isFailWhenParentIsSnapshot() { return failWhenParentIsSnapshot; } public final void setFailWhenParentIsSnapshot( boolean failWhenParentIsSnapshot ) { this.failWhenParentIsSnapshot = failWhenParentIsSnapshot; } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforceme0000664000175000017500000001207012422541465033110 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.List; import java.util.Map; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; /** * Default implementation of the EnforcementRuleHelper interface. This is used to help retrieve information from the * session and provide useful elements like the log. * * @author Brian Fox * @version $Id: DefaultEnforcementRuleHelper.java 1634140 2014-10-24 21:23:01Z khmarbaise $ */ public class DefaultEnforcementRuleHelper implements EnforcerRuleHelper { /** The log. */ private Log log; /** The evaluator. */ private ExpressionEvaluator evaluator; /** The session. */ private MavenSession session; /** The container. */ private PlexusContainer container; /** * Instantiates a new default enforcement rule helper. * * @param session the session * @param evaluator the evaluator * @param log the log * @param container the container */ public DefaultEnforcementRuleHelper( MavenSession session, ExpressionEvaluator evaluator, Log log, PlexusContainer container ) { this.evaluator = evaluator; this.log = log; this.session = session; if ( container != null ) { this.container = container; } else { this.container = session.getContainer(); } } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#getLog() */ public Log getLog() { return log; } /* * (non-Javadoc) * * @see org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator#alignToBaseDirectory(java.io.File) */ public File alignToBaseDirectory( File theFile ) { return evaluator.alignToBaseDirectory( theFile ); } /* * (non-Javadoc) * * @see org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator#evaluate(java.lang.String) */ public Object evaluate( String theExpression ) throws ExpressionEvaluationException { return evaluator.evaluate( theExpression ); } /* * (non-Javadoc) * * @see org.apache.maven.shared.enforcer.rule.api.EnforcerRuleHelper#getRuntimeInformation() */ public Object getComponent( Class clazz ) throws ComponentLookupException { return getComponent( clazz.getName() ); } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#lookup(java.lang.String) */ public Object getComponent( String theComponentKey ) throws ComponentLookupException { return container.lookup( theComponentKey ); } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#lookup(java.lang.String, java.lang.String) */ public Object getComponent( String theRole, String theRoleHint ) throws ComponentLookupException { return container.lookup( theRole, theRoleHint ); } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#lookupList(java.lang.String) */ public List getComponentList( String theRole ) throws ComponentLookupException { return container.lookupList( theRole ); } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#lookupMap(java.lang.String) */ public Map getComponentMap( String theRole ) throws ComponentLookupException { return container.lookupMap( theRole ); } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRuleHelper#getContainer() */ public PlexusContainer getContainer() { return container; } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize0000664000175000017500000001054412422541465033136 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; /** * Rule to validate the main artifact is within certain size constraints. * * @author brianf * @author Roman Stumm */ public class RequireFilesSize extends AbstractRequireFiles { private static final long MAXSIZE = 10000; /** the max size allowed. */ private long maxsize = MAXSIZE; /** the min size allowed. */ private long minsize = 0; /** The error msg. */ private String errorMsg; /** The log. */ private Log log; /** * {@inheritDoc} */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { this.log = helper.getLog(); // if the file is already defined, use that. Otherwise get the main artifact. if ( getFiles().length == 0 ) { try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); setFiles( new File[1] ); getFiles()[0] = project.getArtifact().getFile(); super.execute( helper ); } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to retrieve the project.", e ); } } else { super.execute( helper ); } } /** * {@inheritDoc} */ public boolean isCacheable() { return false; } /** * {@inheritDoc} */ public boolean isResultValid( EnforcerRule cachedRule ) { return false; } /** * {@inheritDoc} */ boolean checkFile( File file ) { if ( file == null ) { // if we get here and it's null, treat it as a success. return true; } // check the file now if ( file.exists() ) { long length = file.length(); if ( length < minsize ) { this.errorMsg = ( file + " size (" + length + ") too small. Min. is " + minsize ); return false; } else if ( length > maxsize ) { this.errorMsg = ( file + " size (" + length + ") too large. Max. is " + maxsize ); return false; } else { this.log.debug( file + " size (" + length + ") is OK (" + ( minsize == maxsize || minsize == 0 ? ( "max. " + maxsize ) : ( "between " + minsize + " and " + maxsize ) ) + " byte)." ); return true; } } else { this.errorMsg = ( file + " does not exist!" ); return false; } } /** * {@inheritDoc} */ String getErrorMsg() { return this.errorMsg; } public long getMaxsize() { return maxsize; } public void setMaxsize( long maxsize ) { this.maxsize = maxsize; } public long getMinsize() { return minsize; } public void setMinsize( long minsize ) { this.minsize = minsize; } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositori0000664000175000017500000001722713075342666033167 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.StringUtils; /** * This rule checks that this project's maven session whether have banned repositories. * * @author Simon Wang */ public class BannedRepositories extends AbstractNonCacheableEnforcerRule { // ---------------------------------------------------------------------- // Mojo parameters // ---------------------------------------------------------------------- /** * Specify explicitly banned non-plugin repositories. This is a list of repository url patterns. Support wildcard * "*". * * @see {@link #setBannedRepositories(List)} */ private List bannedRepositories = Collections.emptyList(); /** * Specify explicitly banned plugin repositories. This is a list of repository url patterns. Support wildcard "*". * * @see {@link #setBannedPluginRepositories(List)} */ private List bannedPluginRepositories = Collections.emptyList(); /** * Specify explicitly allowed non-plugin repositories, then all others repositories would be banned. This is a list * of repository url patterns. Support wildcard "*". * * @see {@link #setAllowedRepositories(List)} */ private List allowedRepositories = Collections.emptyList(); /** * Specify explicitly allowed plugin repositories, then all others repositories would be banned. This is a list of * repository url patterns. Support wildcard "*". * * @see {@link #setAllowedPluginRepositories(List)} */ private List allowedPluginRepositories = Collections.emptyList(); // ---------------------------------------------------------------------- // Public methods // ---------------------------------------------------------------------- /* * (non-Javadoc) * @see * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { MavenProject project; try { project = (MavenProject) helper.evaluate( "${project}" ); List resultBannedRepos = checkRepositories( project.getRemoteArtifactRepositories(), this.allowedRepositories, this.bannedRepositories ); List resultBannedPluginRepos = checkRepositories( project.getPluginArtifactRepositories(), this.allowedPluginRepositories, this.bannedPluginRepositories ); String repoErrMsg = populateErrorMessage( resultBannedRepos, " " ); String pluginRepoErrMsg = populateErrorMessage( resultBannedPluginRepos, " plugin " ); String errMsg = repoErrMsg + pluginRepoErrMsg; if ( errMsg != null && !StringUtils.isEmpty( errMsg.toString() ) ) { throw new EnforcerRuleException( errMsg.toString() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } } // ---------------------------------------------------------------------- // Protected methods // ---------------------------------------------------------------------- protected void setBannedRepositories( List bannedRepositories ) { this.bannedRepositories = bannedRepositories; } protected void setBannedPluginRepositories( List bannedPluginRepositories ) { this.bannedPluginRepositories = bannedPluginRepositories; } protected void setAllowedRepositories( List allowedRepositories ) { this.allowedRepositories = allowedRepositories; } protected void setAllowedPluginRepositories( List allowedPluginRepositories ) { this.allowedPluginRepositories = allowedPluginRepositories; } // ---------------------------------------------------------------------- // Private methods // ---------------------------------------------------------------------- /** * Check whether specified repositories have banned repositories. * * @param repositories: candidate repositories. * @param includes : 'include' patterns. * @param excludes : 'exclude' patterns. * @return Banned repositories. */ private List checkRepositories( List repositories, List includes, List excludes ) { List bannedRepos = new ArrayList(); for ( ArtifactRepository repo : repositories ) { String url = repo.getUrl().trim(); if ( includes.size() > 0 && !match( url, includes ) ) { bannedRepos.add( repo ); continue; } if ( excludes.size() > 0 && match( url, excludes ) ) { bannedRepos.add( repo ); } } return bannedRepos; } private boolean match( String url, List patterns ) { for ( String pattern : patterns ) { if ( this.match( url, pattern ) ) { return true; } } return false; } private boolean match( String text, String pattern ) { return text.matches( pattern.replace( "?", ".?" ).replace( "*", ".*?" ) ); } private String populateErrorMessage( List resultBannedRepos, String errorMessagePrefix ) { StringBuffer errMsg = new StringBuffer( "" ); if ( !resultBannedRepos.isEmpty() ) { errMsg.append( "Current maven session contains banned" + errorMessagePrefix + "repository urls, please double check your pom or settings.xml:\n" + getRepositoryUrlString( resultBannedRepos ) + "\n\n" ); } return errMsg.toString(); } private String getRepositoryUrlString( List resultBannedRepos ) { StringBuffer urls = new StringBuffer( "" ); for ( ArtifactRepository repo : resultBannedRepos ) { urls.append( repo.getId() + " - " + repo.getUrl() + "\n" ); } return urls.toString(); } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVer0000664000175000017500000012600712566372145033164 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Map.Entry; import org.apache.maven.BuildFailureException; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.lifecycle.Lifecycle; import org.apache.maven.lifecycle.LifecycleExecutionException; import org.apache.maven.lifecycle.LifecycleExecutor; import org.apache.maven.lifecycle.mapping.LifecycleMapping; import org.apache.maven.model.BuildBase; import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.Profile; import org.apache.maven.model.ReportPlugin; import org.apache.maven.plugin.InvalidPluginException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.PluginManager; import org.apache.maven.plugin.PluginManagerException; import org.apache.maven.plugin.PluginNotFoundException; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.version.PluginVersionNotFoundException; import org.apache.maven.plugin.version.PluginVersionResolutionException; import org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils; import org.apache.maven.plugins.enforcer.utils.PluginWrapper; import org.apache.maven.project.MavenProject; import org.apache.maven.settings.Settings; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.util.ReflectionUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * This rule will enforce that all plugins specified in the poms have a version declared. * * @author Brian Fox * @version $Id: RequirePluginVersions.java 1697215 2015-08-23 16:27:17Z khmarbaise $ */ public class RequirePluginVersions extends AbstractNonCacheableEnforcerRule { /** * Don't allow the LATEST identifier. * * @see {@link #setBanLatest(boolean)} * @see {@link #isBanLatest()} */ private boolean banLatest = true; /** * Don't allow the RELEASE identifier. * * @see {@link #setBanRelease(boolean)} * @see {@link #isBanRelease()} */ private boolean banRelease = true; /** * Don't allow snapshot plugins. * * @see {@link #setBanSnapshots(boolean)} * @see {@link #isBanSnapshots()} */ private boolean banSnapshots = true; /** * Don't allow timestamp snapshot plugins. * * @see {@link #setBanTimestamps(boolean)} * @see {@link #isBanTimestamps()} */ private boolean banTimestamps = true; /** * The comma separated list of phases that should be used to find lifecycle plugin bindings. The default value is * "clean,deploy,site". * * @see {@link #setPhases(String)} * @see {@link #getPhases()} */ private String phases = "clean,deploy,site"; /** * Additional plugins to enforce have versions. These are plugins that may not be in the poms but are used anyway, * like help, eclipse etc.
* The plugins should be specified in the form: group:artifactId. * * @see {@link #setAdditionalPlugins(List)} * @see {@link #getAdditionalPlugins()} */ private List additionalPlugins; /** * Plugins to skip for version enforcement. The plugins should be specified in the form: * group:artifactId. NOTE: This is deprecated, use unCheckedPluginList instead. * * @see {@link #setUnCheckedPlugins(List)} * @see {@link #getUnCheckedPlugins()} */ private List unCheckedPlugins; /** * Same as unCheckedPlugins but as a comma list to better support properties. Sample form: * group:artifactId,group2:artifactId2 * * @since 1.0-beta-1 * @see {@link #setUnCheckedPlugins(List)} * @see {@link #getUnCheckedPlugins()} */ private String unCheckedPluginList; /** The plugin manager. */ private PluginManager pluginManager; /** The phase to lifecycle map. */ private Map phaseToLifecycleMap; /** The lifecycles. */ private Collection lifecycles; /** The factory. */ ArtifactFactory factory; /** The resolver. */ ArtifactResolver resolver; /** The local. */ ArtifactRepository local; /** The remote repositories. */ List remoteRepositories; /** The log. */ Log log; /** The session. */ MavenSession session; /** The utils. */ EnforcerRuleUtils utils; /* * (non-Javadoc) * @see * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { log = helper.getLog(); MavenProject project; try { // get the various expressions out of the helper. project = (MavenProject) helper.evaluate( "${project}" ); LifecycleExecutor life; life = (LifecycleExecutor) helper.getComponent( LifecycleExecutor.class ); // The lifecycle API changed from Maven 2 to 3 so we have to do a hack to figure // out which one we're using. Field field = ReflectionUtils.getFieldByNameIncludingSuperclasses( "defaultLifeCycles", life.getClass() ); if ( field != null ) // Using Maven 3 { Object defaultLifeCycles = ReflectionUtils.getValueIncludingSuperclasses( "defaultLifeCycles", life ); Map lifecyclesMap = (Map) ReflectionUtils.getValueIncludingSuperclasses( "lifecycles", defaultLifeCycles ); lifecycles = lifecyclesMap.values(); } else // Using Maven 2 { lifecycles = (Collection) ReflectionUtils.getValueIncludingSuperclasses( "lifecycles", life ); } session = (MavenSession) helper.evaluate( "${session}" ); pluginManager = (PluginManager) helper.getComponent( PluginManager.class ); factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); resolver = (ArtifactResolver) helper.getComponent( ArtifactResolver.class ); local = (ArtifactRepository) helper.evaluate( "${localRepository}" ); remoteRepositories = project.getRemoteArtifactRepositories(); utils = new EnforcerRuleUtils( helper ); // get all the plugins that are bound to the specified lifecycles Set allPlugins = getBoundPlugins( life, project, phases ); // insert any additional plugins specified by the user. allPlugins = addAdditionalPlugins( allPlugins, additionalPlugins ); allPlugins.addAll( getProfilePlugins( project ) ); // pull out any we should skip allPlugins = (Set) removeUncheckedPlugins( combineUncheckedPlugins( unCheckedPlugins, unCheckedPluginList ), allPlugins ); // there's nothing to do here if ( allPlugins.isEmpty() ) { log.info( "No plugin bindings found." ); return; } else { log.debug( "All Plugins in use: " + allPlugins ); } // get all the plugins that are mentioned in the pom (and parents) List pluginWrappers = getAllPluginEntries( project ); // now look for the versions that aren't valid and add to a list. List failures = new ArrayList(); for ( Plugin plugin : allPlugins ) { if ( !hasValidVersionSpecified( helper, plugin, pluginWrappers ) ) { failures.add( plugin ); } } // if anything was found, log it then append the optional message. if ( !failures.isEmpty() ) { StringBuilder newMsg = new StringBuilder(); newMsg.append( "Some plugins are missing valid versions:" ); if ( banLatest || banRelease || banSnapshots || banTimestamps ) { newMsg.append( "(" ); if ( banLatest ) { newMsg.append( "LATEST " ); } if ( banRelease ) { newMsg.append( "RELEASE " ); } if ( banSnapshots || banTimestamps ) { newMsg.append( "SNAPSHOT " ); } newMsg.append( "are not allowed )\n" ); } for ( Plugin plugin : failures ) { newMsg.append( plugin.getGroupId() ); newMsg.append( ":" ); newMsg.append( plugin.getArtifactId() ); try { newMsg.append( ". \tThe version currently in use is " ); Plugin currentPlugin = findCurrentPlugin( plugin, project ); if ( currentPlugin != null ) { newMsg.append( currentPlugin.getVersion() ); } else { newMsg.append( "unknown" ); } } catch ( Exception e ) { // lots can go wrong here. Don't allow any issues trying to // determine the issue stop me log.debug( "Exception while determining plugin Version.", e ); newMsg.append( ". Unable to determine the plugin version." ); } newMsg.append( "\n" ); } String message = getMessage(); if ( StringUtils.isNotEmpty( message ) ) { newMsg.append( message ); } throw new EnforcerRuleException( newMsg.toString() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to Evaluate an Expression:" + e.getLocalizedMessage() ); } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component:" + e.getLocalizedMessage() ); } catch ( IllegalAccessException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( LifecycleExecutionException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( PluginNotFoundException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( ArtifactResolutionException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( ArtifactNotFoundException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( IOException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( XmlPullParserException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } catch ( MojoExecutionException e ) { throw new EnforcerRuleException( e.getLocalizedMessage() ); } } /** * Remove the plugins that the user doesn't want to check. * * @param uncheckedPlugins * @param plugins * @throws MojoExecutionException * @return The plugins which have been removed. */ public Collection removeUncheckedPlugins( Collection uncheckedPlugins, Collection plugins ) throws MojoExecutionException { if ( uncheckedPlugins != null && !uncheckedPlugins.isEmpty() ) { for ( String pluginKey : uncheckedPlugins ) { Plugin plugin = parsePluginString( pluginKey, "UncheckedPlugins" ); plugins.remove( plugin ); } } return plugins; } /** * Combines the old Collection with the new comma separated list. * * @param uncheckedPlugins * @param uncheckedPluginsList * @return List of unchecked plugins. */ // CHECKSTYLE_OFF: LineLength public Collection combineUncheckedPlugins( Collection uncheckedPlugins, String uncheckedPluginsList ) // CHECKSTYLE_ON: LineLength { // if the comma list is empty, then there's nothing to do here. if ( StringUtils.isNotEmpty( uncheckedPluginsList ) ) { // make sure there is a collection to add to. if ( uncheckedPlugins == null ) { uncheckedPlugins = new HashSet(); } else if ( !uncheckedPlugins.isEmpty() && log != null ) { log.warn( "The parameter 'unCheckedPlugins' is deprecated. Use 'unCheckedPluginList' instead" ); } uncheckedPlugins.addAll( Arrays.asList( uncheckedPluginsList.split( "," ) ) ); } return uncheckedPlugins; } /** * Add the additional plugins if they don't exist yet. * * @param existing the existing * @param additional the additional * @return the sets the * @throws MojoExecutionException the mojo execution exception */ public Set addAdditionalPlugins( Set existing, List additional ) throws MojoExecutionException { if ( additional != null ) { for ( String pluginString : additional ) { Plugin plugin = parsePluginString( pluginString, "AdditionalPlugins" ); if ( existing == null ) { existing = new HashSet(); existing.add( plugin ); } else if ( !existing.contains( plugin ) ) { existing.add( plugin ); } } } return existing; } /** * Helper method to parse and inject a Plugin. * * @param pluginString * @param field * @throws MojoExecutionException * @return the plugin */ protected Plugin parsePluginString( String pluginString, String field ) throws MojoExecutionException { if ( pluginString != null ) { String[] pluginStrings = pluginString.split( ":" ); if ( pluginStrings.length == 2 ) { Plugin plugin = new Plugin(); plugin.setGroupId( StringUtils.strip( pluginStrings[0] ) ); plugin.setArtifactId( StringUtils.strip( pluginStrings[1] ) ); return plugin; } else { throw new MojoExecutionException( "Invalid " + field + " string: " + pluginString ); } } else { throw new MojoExecutionException( "Invalid " + field + " string: " + pluginString ); } } /** * Finds the plugins that are listed in active profiles. * * @param project the project * @return the profile plugins */ public Set getProfilePlugins( MavenProject project ) { Set result = new HashSet(); @SuppressWarnings( "unchecked" ) List profiles = project.getActiveProfiles(); if ( profiles != null && !profiles.isEmpty() ) { for ( Profile p : profiles ) { BuildBase b = p.getBuild(); if ( b != null ) { List plugins = b.getPlugins(); if ( plugins != null ) { result.addAll( plugins ); } } } } return result; } /** * Given a plugin, this will retrieve the matching plugin artifact from the model. * * @param plugin plugin to lookup * @param project project to search * @return matching plugin, null if not found. */ protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project ) { Plugin found = null; try { Model model = project.getModel(); @SuppressWarnings( "unchecked" ) Map plugins = model.getBuild().getPluginsAsMap(); found = plugins.get( plugin.getKey() ); } catch ( NullPointerException e ) { // nothing to do here } if ( found == null ) { found = resolvePlugin( plugin, project ); } return found; } /** * Resolve plugin. * * @param plugin the plugin * @param project the project * @return the plugin */ protected Plugin resolvePlugin( Plugin plugin, MavenProject project ) { @SuppressWarnings( "unchecked" ) List pluginRepositories = project.getPluginArtifactRepositories(); Artifact artifact = factory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifactId(), VersionRange.createFromVersion( "LATEST" ) ); try { this.resolver.resolve( artifact, pluginRepositories, this.local ); plugin.setVersion( artifact.getVersion() ); } catch ( ArtifactResolutionException e ) { //What does this mean? } catch ( ArtifactNotFoundException e ) { //What does this mean? } return plugin; } /** * Gets the plugins that are bound to the defined phases. This does not find plugins bound in the pom to a phase * later than the plugin is executing. * * @param life the life * @param project the project * @param thePhases the the phases * @return the bound plugins * @throws PluginNotFoundException the plugin not found exception * @throws LifecycleExecutionException the lifecycle execution exception * @throws IllegalAccessException the illegal access exception */ protected Set getBoundPlugins( LifecycleExecutor life, MavenProject project, String thePhases ) throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException { Set allPlugins = new HashSet(); // lookup the bindings for all the passed in phases String[] lifecyclePhases = thePhases.split( "," ); for ( int i = 0; i < lifecyclePhases.length; i++ ) { String lifecyclePhase = lifecyclePhases[i]; if ( StringUtils.isNotEmpty( lifecyclePhase ) ) { try { Lifecycle lifecycle = getLifecycleForPhase( lifecyclePhase ); allPlugins.addAll( getAllPlugins( project, lifecycle ) ); } catch ( BuildFailureException e ) { // i'm going to swallow this because the // user may have declared a phase that // doesn't exist for every module. } } } return allPlugins; } /* * Checks to see if the version is specified for the plugin. Can optionally ban "RELEASE" or "LATEST" even if * specified. */ /** * Checks for valid version specified. * * @param helper the helper * @param source the source * @param pluginWrappers the plugins * @return true, if successful */ protected boolean hasValidVersionSpecified( EnforcerRuleHelper helper, Plugin source, List pluginWrappers ) { boolean found = false; boolean status = false; for ( PluginWrapper plugin : pluginWrappers ) { // find the matching plugin entry if ( source.getArtifactId().equals( plugin.getArtifactId() ) && source.getGroupId().equals( plugin.getGroupId() ) ) { found = true; // found the entry. now see if the version is specified String version = plugin.getVersion(); try { version = (String) helper.evaluate( version ); } catch ( ExpressionEvaluationException e ) { return false; } if ( StringUtils.isNotEmpty( version ) && !StringUtils.isWhitespace( version ) ) { if ( banRelease && version.equals( "RELEASE" ) ) { return false; } if ( banLatest && version.equals( "LATEST" ) ) { return false; } if ( banSnapshots && isSnapshot( version ) ) { return false; } // the version was specified and not // banned. It's ok. Keep looking through the list to make // sure it's not using a banned version somewhere else. status = true; if ( !banRelease && !banLatest && !banSnapshots ) { // no need to keep looking break; } } } } if ( !found ) { log.debug( "plugin " + source.getGroupId() + ":" + source.getArtifactId() + " not found" ); } return status; } /** * Checks if is snapshot. * * @param baseVersion the base version * @return true, if is snapshot */ protected boolean isSnapshot( String baseVersion ) { if ( banTimestamps ) { return Artifact.VERSION_FILE_PATTERN.matcher( baseVersion ).matches() || baseVersion.endsWith( Artifact.SNAPSHOT_VERSION ); } else { return baseVersion.endsWith( Artifact.SNAPSHOT_VERSION ); } } /* * Uses borrowed lifecycle code to get a list of all plugins bound to the lifecycle. */ /** * Gets the all plugins. * * @param project the project * @param lifecycle the lifecycle * @return the all plugins * @throws PluginNotFoundException the plugin not found exception * @throws LifecycleExecutionException the lifecycle execution exception */ @SuppressWarnings( "unchecked" ) private Set getAllPlugins( MavenProject project, Lifecycle lifecycle ) throws PluginNotFoundException, LifecycleExecutionException { log.debug( "RequirePluginVersions.getAllPlugins:" ); Set plugins = new HashSet(); // first, bind those associated with the packaging Map mappings = findMappingsForLifecycle( project, lifecycle ); Iterator iter = mappings.entrySet().iterator(); while ( iter.hasNext() ) { Entry entry = (Entry) iter.next(); log.debug( " lifecycleMapping = " + entry.getKey() ); String pluginsForLifecycle = (String) entry.getValue(); log.debug( " plugins = " + pluginsForLifecycle ); if ( StringUtils.isNotEmpty( pluginsForLifecycle ) ) { String pluginList[] = pluginsForLifecycle.split( "," ); for ( String plugin : pluginList ) { plugin = StringUtils.strip( plugin ); log.debug( " plugin = " + plugin ); String tokens[] = plugin.split( ":" ); log.debug( " GAV = " + Arrays.asList( tokens ) ); Plugin p = new Plugin(); p.setGroupId( tokens[0] ); p.setArtifactId( tokens[1] ); plugins.add( p ); } } } List mojos = findOptionalMojosForLifecycle( project, lifecycle ); for ( String value : mojos ) { String tokens[] = value.split( ":" ); Plugin plugin = new Plugin(); plugin.setGroupId( tokens[0] ); plugin.setArtifactId( tokens[1] ); plugins.add( plugin ); } plugins.addAll( project.getBuildPlugins() ); return plugins; } /* * NOTE: All the code following this point was scooped from the DefaultLifecycleExecutor. There must be a better way * but for now it should work. */ /** * Gets the phase to lifecycle map. * * @return the phase to lifecycle map * @throws LifecycleExecutionException the lifecycle execution exception */ public Map getPhaseToLifecycleMap() throws LifecycleExecutionException { if ( phaseToLifecycleMap == null ) { phaseToLifecycleMap = new HashMap(); for ( Lifecycle lifecycle : lifecycles ) { @SuppressWarnings( "unchecked" ) List phases = lifecycle.getPhases(); for ( String phase : phases ) { if ( phaseToLifecycleMap.containsKey( phase ) ) { Lifecycle prevLifecycle = (Lifecycle) phaseToLifecycleMap.get( phase ); throw new LifecycleExecutionException( "Phase '" + phase + "' is defined in more than one lifecycle: '" + lifecycle.getId() + "' and '" + prevLifecycle.getId() + "'" ); } else { phaseToLifecycleMap.put( phase, lifecycle ); } } } } return phaseToLifecycleMap; } /** * Gets the lifecycle for phase. * * @param phase the phase * @return the lifecycle for phase * @throws BuildFailureException the build failure exception * @throws LifecycleExecutionException the lifecycle execution exception */ private Lifecycle getLifecycleForPhase( String phase ) throws BuildFailureException, LifecycleExecutionException { Lifecycle lifecycle = (Lifecycle) getPhaseToLifecycleMap().get( phase ); if ( lifecycle == null ) { throw new BuildFailureException( "Unable to find lifecycle for phase '" + phase + "'" ); } return lifecycle; } /** * Find mappings for lifecycle. * * @param project the project * @param lifecycle the lifecycle * @return the map * @throws LifecycleExecutionException the lifecycle execution exception * @throws PluginNotFoundException the plugin not found exception */ private Map findMappingsForLifecycle( MavenProject project, Lifecycle lifecycle ) throws LifecycleExecutionException, PluginNotFoundException { String packaging = project.getPackaging(); Map mappings = null; LifecycleMapping m = (LifecycleMapping) findExtension( project, LifecycleMapping.ROLE, packaging, session.getSettings(), session.getLocalRepository() ); if ( m != null ) { mappings = m.getPhases( lifecycle.getId() ); } Map defaultMappings = lifecycle.getDefaultPhases(); if ( mappings == null ) { try { m = (LifecycleMapping) session.lookup( LifecycleMapping.ROLE, packaging ); mappings = m.getPhases( lifecycle.getId() ); } catch ( ComponentLookupException e ) { if ( defaultMappings == null ) { throw new LifecycleExecutionException( "Cannot find lifecycle mapping for packaging: \'" + packaging + "\'.", e ); } } } if ( mappings == null ) { if ( defaultMappings == null ) { throw new LifecycleExecutionException( "Cannot find lifecycle mapping for packaging: \'" + packaging + "\', and there is no default" ); } else { mappings = defaultMappings; } } return mappings; } /** * Find optional mojos for lifecycle. * * @param project the project * @param lifecycle the lifecycle * @return the list * @throws LifecycleExecutionException the lifecycle execution exception * @throws PluginNotFoundException the plugin not found exception */ @SuppressWarnings( "unchecked" ) private List findOptionalMojosForLifecycle( MavenProject project, Lifecycle lifecycle ) throws LifecycleExecutionException, PluginNotFoundException { String packaging = project.getPackaging(); List optionalMojos = null; LifecycleMapping m = (LifecycleMapping) findExtension( project, LifecycleMapping.ROLE, packaging, session.getSettings(), session.getLocalRepository() ); if ( m != null ) { optionalMojos = m.getOptionalMojos( lifecycle.getId() ); } if ( optionalMojos == null ) { try { m = (LifecycleMapping) session.lookup( LifecycleMapping.ROLE, packaging ); optionalMojos = m.getOptionalMojos( lifecycle.getId() ); } catch ( ComponentLookupException e ) { log.debug( "Error looking up lifecycle mapping to retrieve optional mojos. Lifecycle ID: " + lifecycle.getId() + ". Error: " + e.getMessage(), e ); } } if ( optionalMojos == null ) { optionalMojos = Collections.emptyList(); } return optionalMojos; } /** * Find extension. * * @param project the project * @param role the role * @param roleHint the role hint * @param settings the settings * @param localRepository the local repository * @return the object * @throws LifecycleExecutionException the lifecycle execution exception * @throws PluginNotFoundException the plugin not found exception */ private Object findExtension( MavenProject project, String role, String roleHint, Settings settings, ArtifactRepository localRepository ) throws LifecycleExecutionException, PluginNotFoundException { Object pluginComponent = null; @SuppressWarnings( "unchecked" ) List buildPlugins = project.getBuildPlugins(); for ( Plugin plugin : buildPlugins ) { if ( plugin.isExtensions() ) { verifyPlugin( plugin, project, settings, localRepository ); // TODO: if moved to the plugin manager we // already have the descriptor from above // and so do can lookup the container // directly try { pluginComponent = pluginManager.getPluginComponent( plugin, role, roleHint ); if ( pluginComponent != null ) { break; } } catch ( ComponentLookupException e ) { log.debug( "Unable to find the lifecycle component in the extension", e ); } catch ( PluginManagerException e ) { throw new LifecycleExecutionException( "Error getting extensions from the plugin '" + plugin.getKey() + "': " + e.getMessage(), e ); } } } return pluginComponent; } /** * Verify plugin. * * @param plugin the plugin * @param project the project * @param settings the settings * @param localRepository the local repository * @return the plugin descriptor * @throws LifecycleExecutionException the lifecycle execution exception * @throws PluginNotFoundException the plugin not found exception */ private PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings, ArtifactRepository localRepository ) throws LifecycleExecutionException, PluginNotFoundException { PluginDescriptor pluginDescriptor; try { pluginDescriptor = pluginManager.verifyPlugin( plugin, project, settings, localRepository ); } catch ( PluginManagerException e ) { throw new LifecycleExecutionException( "Internal error in the plugin manager getting plugin '" + plugin.getKey() + "': " + e.getMessage(), e ); } catch ( PluginVersionResolutionException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } catch ( InvalidVersionSpecificationException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } catch ( InvalidPluginException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } catch ( ArtifactNotFoundException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } catch ( ArtifactResolutionException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } catch ( PluginVersionNotFoundException e ) { throw new LifecycleExecutionException( e.getMessage(), e ); } return pluginDescriptor; } /** * Gets all plugin entries in build.plugins, build.pluginManagement.plugins, profile.build.plugins, reporting and * profile.reporting in this project and all parents * * @param project the project * @return the all plugin entries wrapped in a PluginWrapper Object * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ protected List getAllPluginEntries( MavenProject project ) throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { List plugins = new ArrayList(); // get all the pom models String pomName = null; try { pomName = project.getFile().getName(); } catch ( Exception e ) { pomName = "pom.xml"; } List models = utils.getModelsRecursively( project.getGroupId(), project.getArtifactId(), project.getVersion(), new File( project.getBasedir(), pomName ) ); // now find all the plugin entries, either in // build.plugins or build.pluginManagement.plugins, profiles.plugins and reporting for ( Model model : models ) { try { List modelPlugins = model.getBuild().getPlugins(); plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId() + ".build.plugins" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } try { List modelReportPlugins = model.getReporting().getPlugins(); // add the reporting plugins plugins.addAll( PluginWrapper.addAll( utils.resolveReportPlugins( modelReportPlugins ), model.getId() + ".reporting" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } try { List modelPlugins = model.getBuild().getPluginManagement().getPlugins(); plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId() + ".build.pluginManagement.plugins" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } // Add plugins in profiles List profiles = model.getProfiles(); for ( Profile profile : profiles ) { try { List modelPlugins = profile.getBuild().getPlugins(); plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId() + ".profiles.profile[" + profile.getId() + "].build.plugins" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } try { List modelReportPlugins = profile.getReporting().getPlugins(); // add the reporting plugins plugins.addAll( PluginWrapper.addAll( utils.resolveReportPlugins( modelReportPlugins ), model.getId() + "profile[" + profile.getId() + "].reporting.plugins" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } try { List modelPlugins = profile.getBuild().getPluginManagement().getPlugins(); plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), model.getId() + "profile[" + profile.getId() + "].build.pluginManagement.plugins" ) ); } catch ( NullPointerException e ) { // guess there are no plugins here. } } } return plugins; } /** * Checks if is ban latest. * * @return the banLatest */ protected boolean isBanLatest() { return this.banLatest; } /** * Sets the ban latest. * * @param theBanLatest the banLatest to set */ protected void setBanLatest( boolean theBanLatest ) { this.banLatest = theBanLatest; } /** * Checks if is ban release. * * @return the banRelease */ protected boolean isBanRelease() { return this.banRelease; } /** * Sets the ban release. * * @param theBanRelease the banRelease to set */ protected void setBanRelease( boolean theBanRelease ) { this.banRelease = theBanRelease; } /** * Gets the utils. * * @return the utils */ protected EnforcerRuleUtils getUtils() { return this.utils; } /** * Sets the utils. * * @param theUtils the utils to set */ protected void setUtils( EnforcerRuleUtils theUtils ) { this.utils = theUtils; } /** * Checks if is ban snapshots. * * @return the banSnapshots */ public boolean isBanSnapshots() { return this.banSnapshots; } /** * Sets the ban snapshots. * * @param theBanSnapshots the banSnapshots to set */ public void setBanSnapshots( boolean theBanSnapshots ) { this.banSnapshots = theBanSnapshots; } /** * Checks if is ban timestamps. * * @return the banTimestamps */ public boolean isBanTimestamps() { return this.banTimestamps; } /** * Sets the ban timestamps. * * @param theBanTimestamps the banTimestamps to set */ public void setBanTimestamps( boolean theBanTimestamps ) { this.banTimestamps = theBanTimestamps; } public List getUnCheckedPlugins() { return unCheckedPlugins; } public void setUnCheckedPlugins( List unCheckedPlugins ) { this.unCheckedPlugins = unCheckedPlugins; } public final void setPhases( String phases ) { this.phases = phases; } public final String getPhases() { return phases; } public final void setAdditionalPlugins( List additionalPlugins ) { this.additionalPlugins = additionalPlugins; } public final List getAdditionalPlugins() { return additionalPlugins; } }././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDep0000664000175000017500000001634412422541465033112 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Collections; import java.util.List; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugins.enforcer.utils.ArtifactMatcher; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; import org.apache.maven.shared.dependency.graph.DependencyNode; import org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.logging.console.ConsoleLogger; /** * This rule bans all transitive dependencies. There is a configuration option to exclude certain artifacts from being * checked. * * @author Jakub Senko */ public class BanTransitiveDependencies extends AbstractNonCacheableEnforcerRule implements EnforcerRule { private EnforcerRuleHelper helper; /** * Specify the dependencies that will be ignored. This can be a list of artifacts in the format * groupId[:artifactId][:version][:type][:scope]. Wildcard '*' can be used to in place of specific * section (ie group:*:1.0 will match both 'group:artifact:1.0' and 'group:anotherArtifact:1.0')
* You can override this patterns by using includes. Version is a string representing standard maven version range. * Empty patterns will be ignored. */ private List excludes; /** * Specify the dependencies that will be checked. These are exceptions to excludes intended for more convenient and * finer settings. This can be a list of artifacts in the format * groupId[:artifactId][:version][:type][:scope]. Wildcard '*' can be used to in place of specific * section (ie group:*:1.0 will match both 'group:artifact:1.0' and 'group:anotherArtifact:1.0')
* Version is a string representing standard maven version range. Empty patterns will be ignored. */ private List includes; /** * Searches dependency tree recursively for transitive dependencies that are not excluded, while generating nice * info message along the way. * * @throws InvalidVersionSpecificationException */ private static boolean searchTree( DependencyNode node, int level, ArtifactMatcher excludes, StringBuilder message ) throws InvalidVersionSpecificationException { List children = node.getChildren(); /* * if the node is deeper than direct dependency and is empty, it is transitive. */ boolean hasTransitiveDependencies = level > 1; boolean excluded = false; /* * holds recursive message from children, will be appended to current message if this node has any transitive * descendants if message is null, don't generate recursive message. */ StringBuilder messageFromChildren = message == null ? null : new StringBuilder(); if ( excludes.match( node.getArtifact() ) ) { // is excluded, we don't care about descendants excluded = true; hasTransitiveDependencies = false; } else { for ( DependencyNode childNode : children ) { /* * if any of the children has transitive d. so does the parent */ hasTransitiveDependencies = ( searchTree( childNode, level + 1, excludes, messageFromChildren ) || hasTransitiveDependencies ); } } if ( ( excluded || hasTransitiveDependencies ) && message != null ) // then generate message { for ( int i = 0; i < level; i++ ) { message.append( " " ); } message.append( node.getArtifact() ); if ( excluded ) { message.append( " [excluded]\n" ); } if ( hasTransitiveDependencies ) { if ( level == 1 ) { message.append( " has transitive dependencies:" ); } message.append( "\n" ).append( messageFromChildren ); } } return hasTransitiveDependencies; } public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { this.helper = helper; if ( excludes == null ) { excludes = Collections.emptyList(); } if ( includes == null ) { includes = Collections.emptyList(); } final ArtifactMatcher exclusions = new ArtifactMatcher( excludes, includes ); DependencyNode rootNode = null; try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); rootNode = createDependencyGraphBuilder().buildDependencyGraph( project, null ); } catch ( Exception e ) { throw new EnforcerRuleException( "Error: Could not construct dependency tree.", e ); } String message = getMessage(); StringBuilder generatedMessage = null; if ( message == null ) { generatedMessage = new StringBuilder(); } try { if ( searchTree( rootNode, 0, exclusions, generatedMessage ) ) { throw new EnforcerRuleException( message == null ? generatedMessage.toString() : message ); } } catch ( InvalidVersionSpecificationException e ) { throw new EnforcerRuleException( "Error: Invalid version range.", e ); } } private DependencyGraphBuilder createDependencyGraphBuilder() throws ComponentLookupException { // CHECKSTYLE_OFF: LineLength DefaultDependencyGraphBuilder builder = (DefaultDependencyGraphBuilder) helper.getContainer().lookup( DependencyGraphBuilder.class.getCanonicalName(), "default" ); // CHECKSTYLE_ON: LineLength builder.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, "DefaultDependencyGraphBuilder" ) ); return builder; } } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActivePro0000664000175000017500000001124312422541465033132 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Profile; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.util.StringUtils; /** * This rule checks that some profiles are active. * * @author Brian Fox */ public class RequireActiveProfile extends AbstractNonCacheableEnforcerRule { /** Comma separated list of profiles to check. * * @see {@link #setProfiles(String)} * @see {@link #getProfiles()} */ private String profiles = null; /** If all profiles must be active. If false, only one must be active * * @see {@link #setAll(boolean)} * @see {@link #isAll()} */ private boolean all = true; public final String getProfiles() { return profiles; } public final void setProfiles( String profiles ) { this.profiles = profiles; } public final boolean isAll() { return all; } public final void setAll( boolean all ) { this.all = all; } /* * (non-Javadoc) * * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper) */ public void execute( EnforcerRuleHelper theHelper ) throws EnforcerRuleException { List missingProfiles = new ArrayList(); try { MavenProject project = (MavenProject) theHelper.evaluate( "${project}" ); if ( StringUtils.isNotEmpty( profiles ) ) { String[] profs = profiles.split( "," ); for ( String profile : profs ) { if ( !isProfileActive( project, profile ) ) { missingProfiles.add( profile ); } } boolean fail = false; if ( !missingProfiles.isEmpty() ) { if ( all || missingProfiles.size() == profs.length ) { fail = true; } } if ( fail ) { String message = getMessage(); StringBuilder buf = new StringBuilder(); if ( message != null ) { buf.append( message + "\n" ); } for ( String profile : missingProfiles ) { buf.append( "Profile \"" + profile + "\" is not activated.\n" ); } throw new EnforcerRuleException( buf.toString() ); } } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to retrieve the project.", e ); } } /** * Checks if profile is active. * * @param project the project * @param profileName the profile name * @return true if profile is active, otherwise false */ protected boolean isProfileActive( MavenProject project, String profileName ) { @SuppressWarnings( "unchecked" ) List activeProfiles = project.getActiveProfiles(); if ( activeProfiles != null && !activeProfiles.isEmpty() ) { for ( Profile profile : activeProfiles ) { if ( profile.getId().equals( profileName ) ) { return true; } } } return false; } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenci0000664000175000017500000001606013120463255033045 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugins.enforcer.utils.ArtifactMatcher; import org.apache.maven.plugins.enforcer.utils.ArtifactMatcher.Pattern; /** * This rule checks that lists of dependencies are not included. * * @author Brian Fox * @version $Id: BannedDependencies.java 1798818 2017-06-15 10:51:25Z stephenc $ */ public class BannedDependencies extends AbstractBanDependencies { /** * Specify the banned dependencies. This can be a list of artifacts in the format * groupId[:artifactId][:version]. Any of the sections can be a wildcard * by using '*' (ie group:*:1.0)
* The rule will fail if any dependency matches any exclude, unless it also matches * an include rule. * * @see {@link #setExcludes(List)} * @see {@link #getExcludes()} */ private List excludes = null; /** * Specify the allowed dependencies. This can be a list of artifacts in the format * groupId[:artifactId][:version]. Any of the sections can be a wildcard * by using '*' (ie group:*:1.0)
* Includes override the exclude rules. It is meant to allow wide exclusion rules * with wildcards and still allow a * smaller set of includes.
* For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api" * * @see {@link #setIncludes(List)} * @see {@link #getIncludes()} */ private List includes = null; /** * {@inheritDoc} */ protected Set checkDependencies( Set theDependencies, Log log ) throws EnforcerRuleException { Set excluded = checkDependencies( theDependencies, excludes ); // anything specifically included should be removed // from the ban list. if ( excluded != null ) { Set included = checkDependencies( theDependencies, includes ); if ( included != null ) { excluded.removeAll( included ); } } return excluded; } /** * Checks the set of dependencies against the list of patterns. * * @param thePatterns the patterns * @param dependencies the dependencies * @return a set containing artifacts matching one of the patterns or null * @throws EnforcerRuleException the enforcer rule exception */ private Set checkDependencies( Set dependencies, List thePatterns ) throws EnforcerRuleException { Set foundMatches = null; if ( thePatterns != null && thePatterns.size() > 0 ) { for ( String pattern : thePatterns ) { String[] subStrings = pattern.split( ":" ); subStrings = StringUtils.stripAll( subStrings ); String resultPattern = StringUtils.join( subStrings, ":" ); for ( Artifact artifact : dependencies ) { if ( compareDependency( resultPattern, artifact ) ) { // only create if needed if ( foundMatches == null ) { foundMatches = new HashSet(); } foundMatches.add( artifact ); } } } } return foundMatches; } /** * Compares the given pattern against the given artifact. The pattern should follow the format * groupId:artifactId:version:type:scope:classifier. * * @param pattern The pattern to compare the artifact with. * @param artifact the artifact * @return true if the artifact matches one of the patterns * @throws EnforcerRuleException the enforcer rule exception */ protected boolean compareDependency( String pattern, Artifact artifact ) throws EnforcerRuleException { ArtifactMatcher.Pattern am = new Pattern( pattern ); boolean result; try { result = am.match( artifact ); } catch ( InvalidVersionSpecificationException e ) { throw new EnforcerRuleException( "Invalid Version Range: ", e ); } return result; } /** * Gets the excludes. * * @return the excludes */ public List getExcludes() { return this.excludes; } /** * Specify the banned dependencies. This can be a list of artifacts in the format * groupId[:artifactId][:version]. Any of the sections can be a wildcard * by using '*' (ie group:*:1.0)
* The rule will fail if any dependency matches any exclude, unless it also matches an * include rule. * * @see #getExcludes() * @param theExcludes the excludes to set */ public void setExcludes( List theExcludes ) { this.excludes = theExcludes; } /** * Gets the includes. * * @return the includes */ public List getIncludes() { return this.includes; } /** * Specify the allowed dependencies. This can be a list of artifacts in the format * groupId[:artifactId][:version]. Any of the sections can be a wildcard * by using '*' (ie group:*:1.0)
* Includes override the exclude rules. It is meant to allow wide exclusion rules with * wildcards and still allow a * smaller set of includes.
* For example, to ban all xerces except xerces-api → exclude "xerces", * include "xerces:xerces-api" * * @see #setIncludes(List) * @param theIncludes the includes to set */ public void setIncludes( List theIncludes ) { this.includes = theIncludes; } } maven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/NoSnapshots.java0000664000175000017500000000331311762221225033072 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; /** * This rule is deprecated. Use requireReleaseVersions. * * @author Brian Fox * @version $Id: NoSnapshots.java 1345332 2012-06-01 20:14:13Z rfscholte $ * @deprecated replaced by {@link RequireReleaseDeps} */ public class NoSnapshots extends AbstractBanDependencies { /** * {@inheritDoc} */ protected Set checkDependencies( Set dependencies, Log log ) throws EnforcerRuleException { log.warn( "The \"NoSnapshots\" rule is deprecated. Use \"requireReleaseDeps\" instead" ); RequireReleaseDeps rule = new RequireReleaseDeps(); return rule.checkDependencies( dependencies, log ); } } ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.javamaven-enforcer-1.4.2/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressi0000664000175000017500000000521312451607305033165 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.PluginParameterExpressionEvaluator; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.project.MavenProject; import org.apache.maven.project.path.PathTranslator; /** * The Class EnforcerExpressionEvaluator. This class wraps the PluginParameterExpressionEvaluator because it can't be * accessed directly in 2.0.x so we must create a new one. * * @author Brian Fox */ public class EnforcerExpressionEvaluator extends PluginParameterExpressionEvaluator { /** * The Constructor. * * @param theContext {@link MavenSession} * @param thePathTranslator {@link PathTranslator} * @param theProject {@link MavenProject} * @param theExecution {@link MojoExecution} */ public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator, MavenProject theProject, MojoExecution theExecution ) { super( theContext, theExecution, thePathTranslator, null, theProject, theContext.getExecutionProperties() ); } /** * This constructor is kept for backward compatibility. * * @param theContext {@link MavenSession} * @param thePathTranslator {@link PathTranslator} * @param theProject {@link MavenProject} * * @deprecated Will be removed with 2.0 */ public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator, MavenProject theProject ) { super( theContext, new MojoExecution( new MojoDescriptor() ), thePathTranslator, null, theProject, theContext.getExecutionProperties() ); } } maven-enforcer-1.4.2/enforcer-rules/src/test/0000775000175000017500000000000013133666303020464 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/0000775000175000017500000000000013133666303021405 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/0000775000175000017500000000000013133666303022174 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/0000775000175000017500000000000013133666303023415 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/0000775000175000017500000000000013133666303024523 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/0000775000175000017500000000000013133666303026204 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/0000775000175000017500000000000013133666303030007 5ustar ebourgebourg././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireProperty.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePrope0000664000175000017500000000655512157415723033232 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; // TODO: Auto-generated Javadoc /** * The Class TestRequireProperty. * * @author Paul Gier */ public class TestRequireProperty extends TestCase { /** * Test rule. * * @throws EnforcerRuleException the enforcer rule exception */ public void testRule() throws EnforcerRuleException { MockProject project = new MockProject(); project.setProperty( "testProp", "This is a test." ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); RequireProperty rule = new RequireProperty(); // this property should not be set rule.setProperty( "testPropJunk" ); try { rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { // expected to catch this. } // this property should be set by the surefire // plugin rule.setProperty( "testProp" ); try { rule.execute( helper ); } catch ( EnforcerRuleException e ) { fail( "This should not throw an exception" ); } } /** * Test rule with regex. * * @throws EnforcerRuleException the enforcer rule exception */ public void testRuleWithRegex() throws EnforcerRuleException { MockProject project = new MockProject(); project.setProperty( "testProp", "This is a test." ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); RequireProperty rule = new RequireProperty(); rule.setProperty( "testProp" ); // This expression should not match the property // value rule.setRegex( "[^abc]" ); try { rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { // expected to catch this. } // this expr should match the property rule.setRegex( "[This].*[.]" ); try { rule.execute( helper ); } catch ( EnforcerRuleException e ) { fail( "This should not throw an exception" ); } } /** * Test id. */ public void testId() { RequireProperty rule = new RequireProperty(); rule.getCacheId(); } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.ja0000664000175000017500000000676112445342642033055 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Iterator; import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.logging.SystemStreamLog; import org.codehaus.plexus.util.Os; /** * Exhaustively check the OS mojo. * * @author Brian Fox */ public class TestRequireOS extends TestCase { /** * Test os. */ public void testOS() { Log log = new SystemStreamLog(); RequireOS rule = new RequireOS(); rule.displayOSInfo( log, true ); Iterator iter = Os.getValidFamilies().iterator(); String validFamily = null; String invalidFamily = null; while ( iter.hasNext() ) { String fam = (String) iter.next(); if ( !Os.isFamily( fam ) ) { invalidFamily = fam; break; } } validFamily = Os.OS_FAMILY; log.info( "Testing Mojo Using Valid Family: " + validFamily + " Invalid Family: " + invalidFamily ); rule.setFamily( validFamily ); assertTrue( rule.isAllowed() ); rule.setFamily( invalidFamily ); assertFalse( rule.isAllowed() ); rule.setFamily( "!" + invalidFamily ); assertTrue( rule.isAllowed() ); rule.setFamily( "junk" ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Expected MojoExecution Exception becuase of invalid family type" ); } catch ( EnforcerRuleException e ) { log.info( "Caught Expected Exception:" + e.getLocalizedMessage() ); } rule.setFamily( null ); rule.setArch( Os.OS_ARCH ); assertTrue( rule.isAllowed() ); rule.setArch( "somecrazyarch" ); assertFalse( rule.isAllowed() ); rule.setArch( "!somecrazyarch" ); assertTrue( rule.isAllowed() ); rule.setArch( null ); rule.setName( Os.OS_NAME ); assertTrue( rule.isAllowed() ); rule.setName( "somecrazyname" ); assertFalse( rule.isAllowed() ); rule.setName( "!somecrazyname" ); assertTrue( rule.isAllowed() ); rule.setName( null ); rule.setVersion( Os.OS_VERSION ); assertTrue( rule.isAllowed() ); rule.setVersion( "somecrazyversion" ); assertFalse( rule.isAllowed() ); rule.setVersion( "!somecrazyversion" ); assertTrue( rule.isAllowed() ); } /** * Test id. */ public void testId() { RequireOS rule = new RequireOS(); rule.getCacheId(); } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireRelea0000664000175000017500000000546711242355031033163 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.TestEnforcerRuleUtils; // TODO: Auto-generated Javadoc /** * The Class TestRequireReleaseVersion. * * @author Brian Fox */ public class TestRequireReleaseVersion extends TestCase { /** * Test mojo. * * @throws IOException Signals that an I/O exception has occurred. */ public void testMojo() throws IOException { ArtifactStubFactory factory = new ArtifactStubFactory(); MockProject project = new MockProject(); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); project.setArtifact( factory.getReleaseArtifact() ); EnforcerRule rule = new RequireReleaseVersion(); TestEnforcerRuleUtils.execute( rule, helper, false ); project.setArtifact( factory.getSnapshotArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, true ); project.setArtifact( factory.getReleaseArtifact() ); MockProject parent = new MockProject(); parent.setArtifact( factory.getSnapshotArtifact() ); project.setParent( parent ); helper = EnforcerTestUtils.getHelper(project); ( (RequireReleaseVersion) rule ).setFailWhenParentIsSnapshot( true ); TestEnforcerRuleUtils.execute( rule, helper, true ); ( (RequireReleaseVersion) rule ).setFailWhenParentIsSnapshot( false ); TestEnforcerRuleUtils.execute( rule, helper, false ); } /** * Test cache. */ public void testCache() { EnforcerRule rule = new RequireReleaseVersion(); assertFalse( rule.isCacheable() ); assertFalse( rule.isResultValid( null ) ); assertEquals( "0", rule.getCacheId() ); } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockRuntimeInformation.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockRuntimeInfor0000664000175000017500000000271211242355031033157 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.execution.RuntimeInformation; /** * Just a mock object hard coded to return version 2.0.5 * * @author Brian Fox */ public class MockRuntimeInformation implements RuntimeInformation { /* * (non-Javadoc) * * @see org.apache.maven.execution.RuntimeInformation#getApplicationVersion() */ public ArtifactVersion getApplicationVersion() { return new DefaultArtifactVersion( "2.0.5" ); } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBean0000664000175000017500000001136412263361007033127 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import static org.mockito.Mockito.*; /** * The Class TestEvaluateBeanshell. * * @author hugonnem */ public class TestEvaluateBeanshell extends TestCase { private MockProject project; public void setUp() { project = new MockProject(); project.setProperty( "env", "\"This is a test.\"" ); } /** * Test rule. */ public void testRulePass() throws EnforcerRuleException, ExpressionEvaluationException { EvaluateBeanshell rule = new EvaluateBeanshell(); // this property should not be set rule.setCondition( "${env} == \"This is a test.\"" ); rule.setMessage( "We have a variable : ${env}" ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); rule.execute( helper ); } public void testRuleFail() throws EnforcerRuleException, ExpressionEvaluationException { EvaluateBeanshell rule = new EvaluateBeanshell(); // this property should be set by the surefire // plugin rule.setCondition( "${env} == null" ); rule.setMessage( "We have a variable : ${env}" ); try { EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { assertEquals( e.getLocalizedMessage(), rule.getMessage() ); } } public void testRuleFailNoMessage() throws EnforcerRuleException, ExpressionEvaluationException { EvaluateBeanshell rule = new EvaluateBeanshell(); // this property should be set by the surefire // plugin rule.setCondition( "${env} == null" ); try { EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { assertEquals( e.getLocalizedMessage(), "The expression \"${env} == null\" is not true." ); assertTrue( e.getLocalizedMessage().length() > 0 ); } } public void testRuleInvalidExpression() throws EnforcerRuleException, ExpressionEvaluationException { EvaluateBeanshell rule = new EvaluateBeanshell(); rule.setCondition( "${env} == null" ); rule.setMessage( "We have a variable : ${env}" ); ExpressionEvaluator eval = mock( ExpressionEvaluator.class ); when( eval.evaluate( rule.getCondition() ) ).thenThrow( new ExpressionEvaluationException( "expected error" ) ); try { EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project, eval ); rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { assertFalse( e.getLocalizedMessage().equals( rule.getMessage() ) ); } } public void testRuleInvalidBeanshell() throws EnforcerRuleException, ExpressionEvaluationException { EvaluateBeanshell rule = new EvaluateBeanshell(); rule.setCondition( "this is not valid beanshell" ); rule.setMessage( "We have a variable : ${env}" ); try { EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { assertFalse( e.getLocalizedMessage().equals( rule.getMessage() ) ); } } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFiles0000664000175000017500000000727212416337542033204 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import junit.framework.TestCase; /** * Test the "require files exist" rule. * * @author Brett Porter */ public class TestRequireFilesExist extends TestCase { RequireFilesExist rule = new RequireFilesExist(); public void testFileExists() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); rule.setFiles( new File[] { f } ); rule.execute( EnforcerTestUtils.getHelper() ); f.delete(); } public void testEmptyFile() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testEmptyFileAllowNull() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); rule.setAllowNulls( true ); try { rule.execute( EnforcerTestUtils.getHelper() ); } catch ( EnforcerRuleException e ) { fail( "Unexpected Exception:" + e.getLocalizedMessage() ); } } public void testEmptyFileList() throws EnforcerRuleException, IOException { rule.setFiles( new File[] {} ); assertEquals( 0, rule.getFiles().length ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testEmptyFileListAllowNull() throws EnforcerRuleException, IOException { rule.setFiles( new File[] {} ); assertEquals( 0, rule.getFiles().length ); rule.setAllowNulls( true ); try { rule.execute( EnforcerTestUtils.getHelper() ); } catch ( EnforcerRuleException e ) { fail( "Unexpected Exception:" + e.getLocalizedMessage() ); } } public void testFileDoesNotExist() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.delete(); assertTrue( !f.exists() ); rule.setFiles( new File[] { f } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } /** * Test id. */ public void testId() { rule.getCacheId(); } } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFiles0000664000175000017500000001237012416337542033177 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.testing.ArtifactStubFactory; import junit.framework.TestCase; /** * Test the "require files exist" rule. * * @author Brian Fox */ public class TestRequireFilesSize extends TestCase { RequireFilesSize rule = new RequireFilesSize(); public void testFileExists() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); rule.setFiles( new File[] { f } ); rule.execute( EnforcerTestUtils.getHelper() ); f.delete(); } public void testEmptyFile() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testEmptyFileAllowNull() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); rule.setAllowNulls( true ); try { rule.execute( EnforcerTestUtils.getHelper() ); } catch ( EnforcerRuleException e ) { fail( "Unexpected Exception:" + e.getLocalizedMessage() ); } } public void testEmptyFileList() throws EnforcerRuleException, IOException { rule.setFiles( new File[] {} ); assertEquals( 0, rule.getFiles().length ); MockProject project = new MockProject(); File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); ArtifactStubFactory factory = new ArtifactStubFactory(); Artifact a = factory.getReleaseArtifact(); a.setFile( f ); project.setArtifact( a ); // sanity check the mockProject assertSame( f, project.getArtifact().getFile() ); rule.execute( EnforcerTestUtils.getHelper( project ) ); } public void testFileDoesNotExist() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.delete(); assertTrue( !f.exists() ); rule.setFiles( new File[] { f } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testFileTooSmall() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); rule.setFiles( new File[] { f } ); rule.setMinsize( 10 ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testFileTooBig() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); try { // Create file FileWriter fstream = new FileWriter( f ); BufferedWriter out = new BufferedWriter( fstream ); out.write( "123456789101112131415" ); // Close the output stream out.close(); fstream.close(); } catch ( Exception e ) {// Catch exception if any System.err.println( "Error: " + e.getMessage() ); } rule.setFiles( new File[] { f } ); rule.setMaxsize( 10 ); assertTrue( f.length() > 10 ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } /** * Test id. */ public void testId() { rule.getCacheId(); } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion0000664000175000017500000000423013075342666033215 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import junit.framework.TestCase; /** * The Class TestMavenVersion. * * @author Brian Fox */ public class TestMavenVersion extends TestCase { /** * Test rule. * * @throws EnforcerRuleException the enforcer rule exception */ public void testRule() throws EnforcerRuleException { RequireMavenVersion rule = new RequireMavenVersion(); rule.setVersion( "2.0.5" ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); // test the singular version rule.execute( helper ); // exclude this version rule.setVersion( "(2.0.5" ); try { rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { // expected to catch this. } // this shouldn't crash rule.setVersion( SystemUtils.JAVA_VERSION ); rule.execute( helper ); } /** * Test id. */ public void testId() { RequireMavenVersion rule = new RequireMavenVersion(); rule.getCacheId(); } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysPass.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysPass.j0000664000175000017500000000271611242355031033107 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; /** * Test AlwaysPass rule. * @author Ben Lidgey * @see AlwaysPass */ public class TestAlwaysPass extends TestCase { public void testExecute() { final AlwaysPass rule = new AlwaysPass(); try { // execute rule -- should NOT throw EnforcerRuleException rule.execute( EnforcerTestUtils.getHelper() ); assertTrue( true ); } catch ( EnforcerRuleException e ) { fail( "Should NOT throw EnforcerRuleException" ); } } } ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActiveProfileTest.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActivePro0000664000175000017500000001363012363302446033165 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Profile; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.Before; import org.junit.Test; /** * Check the profile rule. * * @author Karl Heinz Marbaise */ public class RequireActiveProfileTest { private MavenProject project; private EnforcerRuleHelper helper; private RequireActiveProfile rule; @Before public void before() throws ExpressionEvaluationException { project = mock( MavenProject.class ); helper = mock( EnforcerRuleHelper.class ); when( helper.evaluate( "${project}" ) ).thenReturn( project ); rule = new RequireActiveProfile(); } @Test public void testNoActiveProfilesInProjectAndNoProfilesExpectedToBeActivated() throws EnforcerRuleException { when( project.getActiveProfiles() ).thenReturn( Collections. emptyList() ); rule.execute( helper ); assertTrue( true ); } @Test public void testActiveProfileAndExpectedActiveProfile() throws EnforcerRuleException { List profiles = Collections. singletonList( createProfile( "profile-2" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-2" ); rule.execute( helper ); assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void testNoActiveProfileButTheRuleRequestedAnActiveProfile() throws EnforcerRuleException { when( project.getActiveProfiles() ).thenReturn( Collections. emptyList() ); rule.setProfiles( "profile-2" ); rule.execute( helper ); // intentionally no assertTrue(...) } @Test( expected = EnforcerRuleException.class ) public void testNoActiveProfileButWeExpectToGetAnExceptionWithAll() throws EnforcerRuleException { when( project.getActiveProfiles() ).thenReturn( Collections. emptyList() ); rule.setProfiles( "profile-2" ); rule.setAll( true ); rule.execute( helper ); // intentionally no assertTrue(...) } @Test public void testTwoActiveProfilesWithOneRequiredProfile() throws EnforcerRuleException { List profiles = Arrays.asList( createProfile( "profile-1" ), createProfile( "profile-2" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-2" ); rule.execute( helper ); assertTrue( true ); } @Test public void testTwoActiveProfilesWhereOneProfileIsRequiredToBeActivated() throws EnforcerRuleException { List profiles = Arrays.asList( createProfile( "profile-1" ), createProfile( "profile-2" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-2" ); rule.setAll( true ); rule.execute( helper ); assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void testTwoActiveProfilesWithTwoRequiredProfilesWhereOneOfThemIsNotPartOfTheActiveProfiles() throws EnforcerRuleException, ExpressionEvaluationException { List profiles = Arrays.asList( createProfile( "profile-X" ), createProfile( "profile-Y" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-Z,profile-X" ); rule.setAll( true ); rule.execute( helper ); // intentionally no assertTrue(..) } @Test( expected = EnforcerRuleException.class ) public void testOneActiveProfilesWithTwoRequiredProfiles() throws EnforcerRuleException, ExpressionEvaluationException { List profiles = Collections.singletonList( createProfile( "profile-X" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-X,profile-Y" ); rule.setAll( true ); rule.execute( helper ); // intentionally no assertTrue(..) } @Test public void testOneActiveProfileWithTwoProfilesButNotAll() throws EnforcerRuleException, ExpressionEvaluationException { List profiles = Collections.singletonList( createProfile( "profile-X" ) ); when( project.getActiveProfiles() ).thenReturn( profiles ); rule.setProfiles( "profile-X,profile-Y" ); rule.setAll( false ); rule.execute( helper ); // intentionally no assertTrue(..) } private Profile createProfile( String profileId ) { Profile p = new Profile(); p.setId( profileId ); return p; } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaV0000664000175000017500000001153713076207711033145 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.assertj.core.api.Assertions.assertThat; import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.junit.Ignore; import org.junit.Test; /** * The Class TestRequireJavaVersion. * * @author Brian Fox */ public class TestRequireJavaVersion { /** * Test fix jdk version. */ @Test public void testFixJDKVersion() { // test that we only take the first 3 versions for // comparison assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0_11" ) ).isEqualTo( "1.5.0-11" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.1" ) ).isEqualTo( "1.5.1" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.2-1.b11" ) ).isEqualTo( "1.5.2-1" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.3_11" ) ).isEqualTo( "1.5.3-11" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.4.5_11" ) ).isEqualTo( "1.5.4-5" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.5.6_11.2" ) ).isEqualTo( "1.5.5-6" ); // test for non-standard versions assertThat( RequireJavaVersion.normalizeJDKVersion( "1-5-0-11" ) ).isEqualTo( "1.5.0-11" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1-_5-_0-_11" ) ).isEqualTo( "1.5.0-11" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1_5_0_11" ) ).isEqualTo( "1.5.0-11" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-07" ) ).isEqualTo( "1.5.0-7" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-b7" ) ).isEqualTo( "1.5.0-7" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-;7" ) ).isEqualTo( "1.5.0-7" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp" ) ).isEqualTo( "1.6.0" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp2" ) ).isEqualTo( "1.6.0-2" ); assertThat( RequireJavaVersion.normalizeJDKVersion( "1.8.0_73" ) ).isEqualTo( "1.8.0-73" ); } /** * Test rule. * * @throws EnforcerRuleException the enforcer rule exception */ @Test public void settingsTheJavaVersionAsNormalizedVersionShouldNotFail() throws EnforcerRuleException { String normalizedJDKVersion = RequireJavaVersion.normalizeJDKVersion( SystemUtils.JAVA_VERSION ); RequireJavaVersion rule = new RequireJavaVersion(); rule.setVersion( normalizedJDKVersion ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); // test the singular version rule.execute( helper ); // intentionally no assertThat(...) because we don't expect and exception. } @Test( expected = EnforcerRuleException.class ) public void excludingTheCurrentJavaVersionViaRangeThisShouldFailWithException() throws EnforcerRuleException { String thisVersion = RequireJavaVersion.normalizeJDKVersion( SystemUtils.JAVA_VERSION ); RequireJavaVersion rule = new RequireJavaVersion(); // exclude this version rule.setVersion( "(" + thisVersion ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); rule.execute( helper ); // intentionally no assertThat(...) because we expect and exception. } @Test @Ignore // TODO: Think about the intention of this test? What should it prove? public void thisShouldNotCrash() throws EnforcerRuleException { RequireJavaVersion rule = new RequireJavaVersion(); rule.setVersion( SystemUtils.JAVA_VERSION ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); rule.execute( helper ); // intentionally no assertThat(...) because we don't expect and exception. } /** * Test id. */ @Test public void testId() { RequireJavaVersion rule = new RequireJavaVersion(); assertThat( rule.getCacheId() ).isEqualTo( "0" ); } } ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenciesTestSetup.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenci0000664000175000017500000000646412320351742033105 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.project.MavenProject; public class BannedDependenciesTestSetup { public BannedDependenciesTestSetup() throws IOException { this.excludes = new ArrayList(); this.includes = new ArrayList(); ArtifactStubFactory factory = new ArtifactStubFactory(); MockProject project = new MockProject(); project.setArtifacts( factory.getMixedArtifacts() ); project.setDependencyArtifacts( factory.getScopedArtifacts() ); this.helper = EnforcerTestUtils.getHelper( project ); this.rule = newBannedDependenciesRule(); this.rule.setMessage( null ); this.rule.setExcludes( this.excludes ); this.rule.setIncludes( this.includes ); } private List excludes; private List includes; private BannedDependencies rule; private EnforcerRuleHelper helper; public void setSearchTransitive( boolean searchTransitive ) { rule.setSearchTransitive( searchTransitive ); } public void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { excludes.add( toAdd ); rule.execute( helper ); } public void addIncludeExcludeAndRunRule (String incAdd, String excAdd) throws EnforcerRuleException { excludes.add( excAdd ); includes.add( incAdd ); rule.execute( helper ); } public List getExcludes() { return excludes; } public void setExcludes( List excludes ) { this.excludes = excludes; } private BannedDependencies newBannedDependenciesRule() { BannedDependencies rule = new BannedDependencies() { @SuppressWarnings( "unchecked" ) @Override protected Set getDependenciesToCheck( MavenProject project ) { // the integration with dependencyGraphTree is verified with the integration tests // for unit-testing return isSearchTransitive() ? project.getArtifacts() : project.getDependencyArtifacts(); } }; return rule; } } ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionM0000664000175000017500000002404212561645371033157 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.DeploymentRepository; import org.apache.maven.model.DistributionManagement; import org.apache.maven.model.Model; import org.apache.maven.model.Site; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.Test; /** * This class is intended to test the {@link BanDistributionManagement} rule. * * @author Karl Heinz Marbaise */ public class BanDistributionManagementTest { private MavenProject project; private EnforcerRuleHelper helper; @Test public void shouldNotFailWithoutDistributionManagement() throws Exception { BanDistributionManagement rule = setupProjectWithoutDistributionManagement(); rule.execute( helper ); // intentionally no assert cause in case of an exception the test will be red. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     * </distributionManagement>
     * 
* * @throws Exception */ @Test( expected = EnforcerRuleException.class ) public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepository() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), null, null ); rule.execute( helper ); // intentionally no assert cause we expect an exception. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     *   <snapshotRepository>
     *    ...
     *   </snapshotRepository>
     * </distributionManagement>
     * 
*/ @Test( expected = EnforcerRuleException.class ) public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepositorySnapshotRepository() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), new DeploymentRepository(), null ); rule.execute( helper ); // intentionally no assert cause we expect an exception. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     *   <snapshotRepository>
     *    ...
     *   </snapshotRepository>
     *   <site>
     *    ...
     *   </site>
     * </distributionManagement>
     * 
*/ @Test( expected = EnforcerRuleException.class ) public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepositorySnapshotRepositorySite() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), new DeploymentRepository(), new Site() ); rule.execute( helper ); // intentionally no assert cause we expect an exception. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     * </distributionManagement>
     * 
*/ @Test public void shouldAllowDistributionManagementHavingRepository() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), null, null ); rule.setAllowRepository( true ); rule.execute( helper ); // intentionally no assert cause in case of an exception the test will be red. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     *   <snapshotRepository>
     *    ...
     *   </snapshotRepository>
     * </distributionManagement>
     * 
*/ @Test public void shouldAllowDistributionManagementHavingRepositorySnapshotRepository() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), new DeploymentRepository(), null ); rule.setAllowRepository( true ); rule.setAllowSnapshotRepository( true ); rule.execute( helper ); // intentionally no assert cause in case of an exception the test will be red. } /** *
     * <distributionManagement>
     *   <repository>
     *    ...
     *   </repository>
     *   <snapshotRepository>
     *    ...
     *   </snapshotRepository>
     *   <site>
     *    ...
     *   </site>
     * </distributionManagement>
     * 
*/ @Test public void shouldAllowDistributionManagementHavingRepositorySnapshotRepositorySite() throws Exception { BanDistributionManagement rule = setupProjectWithDistributionManagement( new DeploymentRepository(), new DeploymentRepository(), new Site() ); rule.setAllowRepository( true ); rule.setAllowSnapshotRepository( true ); rule.setAllowSite( true ); rule.execute( helper ); // intentionally no assert cause in case of an exception the test will be red. } @Test public void shouldThrowExceptionCauseParentProjectHasDistributionManagementSnapshotRepository() throws Exception { BanDistributionManagement rule = setupProjectWithParentDistributionManagement( null, new DeploymentRepository(), null ); rule.setIgnoreParent( false ); rule.setAllowSnapshotRepository( true ); rule.execute( helper ); } private BanDistributionManagement setupProjectWithParentDistributionManagement( DeploymentRepository repository, DeploymentRepository snapshotRepository, Site site ) throws ExpressionEvaluationException { project = setupProject( null ); DistributionManagement dmParent = mock( DistributionManagement.class ); when( dmParent.getRepository() ).thenReturn( repository ); when( dmParent.getSnapshotRepository() ).thenReturn( snapshotRepository ); when( dmParent.getSite() ).thenReturn( site ); MavenProject parentProject = mock( MavenProject.class ); Model model = mock( Model.class ); when( model.getDistributionManagement() ).thenReturn( dmParent ); when( parentProject.getOriginalModel() ).thenReturn( model ); when( project.getParent() ).thenReturn( parentProject ); BanDistributionManagement rule = setupEnforcerRule(); return rule; } private BanDistributionManagement setupProjectWithoutDistributionManagement() throws ExpressionEvaluationException { project = setupProject( null ); BanDistributionManagement rule = setupEnforcerRule(); return rule; } private BanDistributionManagement setupProjectWithDistributionManagement( DeploymentRepository repository, DeploymentRepository snapshotRepository, Site site ) throws ExpressionEvaluationException { DistributionManagement dm = mock( DistributionManagement.class ); when( dm.getRepository() ).thenReturn( repository ); when( dm.getSnapshotRepository() ).thenReturn( snapshotRepository ); when( dm.getSite() ).thenReturn( site ); project = setupProject( dm ); when( project.getParent() ).thenReturn( mock( MavenProject.class ) ); when( project.isExecutionRoot() ).thenReturn( true ); BanDistributionManagement rule = setupEnforcerRule(); return rule; } private MavenProject setupProject( DistributionManagement distributionManagement ) { MavenProject project = mock( MavenProject.class ); when( project.getPackaging() ).thenReturn( "jar" ); Model mavenModel = mock( Model.class ); when( project.getOriginalModel() ).thenReturn( mavenModel ); when( mavenModel.getDistributionManagement() ).thenReturn( distributionManagement ); return project; } private BanDistributionManagement setupEnforcerRule() throws ExpressionEvaluationException { helper = mock( EnforcerRuleHelper.class ); when( helper.evaluate( "${project}" ) ).thenReturn( project ); BanDistributionManagement rule = new BanDistributionManagement(); when( helper.getLog() ).thenReturn( mock( Log.class ) ); return rule; } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockPlexusContainer.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockPlexusContai0000664000175000017500000004131113075342666033172 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.Reader; import java.util.Date; import java.util.List; import java.util.Map; import org.apache.maven.execution.RuntimeInformation; import org.apache.maven.project.MavenProject; import org.codehaus.classworlds.ClassRealm; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainerException; import org.codehaus.plexus.component.composition.UndefinedComponentComposerException; import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener; import org.codehaus.plexus.component.factory.ComponentInstantiationException; import org.codehaus.plexus.component.repository.ComponentDescriptor; import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.configuration.PlexusConfigurationResourceException; import org.codehaus.plexus.context.Context; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.LoggerManager; /** * The Class MockPlexusContainer. * * @author Brian Fox */ public class MockPlexusContainer implements PlexusContainer { /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#lookup(java.lang.String) */ public Object lookup( String theComponentKey ) throws ComponentLookupException { if ( theComponentKey.equals( MavenProject.class.getName() ) ) { return new MavenProject(); } else if ( theComponentKey.equals( RuntimeInformation.class.getName() ) ) { return new MockRuntimeInformation(); } return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#addComponentDescriptor(org.codehaus.plexus.component.repository.ComponentDescriptor) */ public void addComponentDescriptor( ComponentDescriptor theComponentDescriptor ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#addContextValue(java.lang.Object, java.lang.Object) */ public void addContextValue( Object theKey, Object theValue ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#addJarRepository(java.io.File) */ public void addJarRepository( File theRepository ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#addJarResource(java.io.File) */ public void addJarResource( File theResource ) throws PlexusContainerException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#composeComponent(java.lang.Object, * org.codehaus.plexus.component.repository.ComponentDescriptor) */ public void composeComponent( Object theComponent, ComponentDescriptor theComponentDescriptor ) throws UndefinedComponentComposerException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#createChildContainer(java.lang.String, java.util.List, java.util.Map) */ public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext ) throws PlexusContainerException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#createChildContainer(java.lang.String, java.util.List, java.util.Map, * java.util.List) */ public PlexusContainer createChildContainer( String theName, List theClasspathJars, Map theContext, List theDiscoveryListeners ) throws PlexusContainerException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#createComponentInstance(org.codehaus.plexus.component.repository.ComponentDescriptor) */ public Object createComponentInstance( ComponentDescriptor theComponentDescriptor ) throws ComponentInstantiationException, ComponentLifecycleException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#dispose() */ public void dispose() { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getChildContainer(java.lang.String) */ public PlexusContainer getChildContainer( String theName ) { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptor(java.lang.String) */ public ComponentDescriptor getComponentDescriptor( String theComponentKey ) { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptorList(java.lang.String) */ public List getComponentDescriptorList( String theRole ) { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getComponentDescriptorMap(java.lang.String) */ public Map getComponentDescriptorMap( String theRole ) { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getComponentRealm(java.lang.String) */ public ClassRealm getComponentRealm( String theComponentKey ) { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getContext() */ public Context getContext() { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getCreationDate() */ public Date getCreationDate() { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getLogger() */ public Logger getLogger() { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#getLoggerManager() */ public LoggerManager getLoggerManager() { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#hasChildContainer(java.lang.String) */ public boolean hasChildContainer( String theName ) { // TODO Auto-generated method stub return false; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#hasComponent(java.lang.String) */ public boolean hasComponent( String theComponentKey ) { // TODO Auto-generated method stub return false; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#hasComponent(java.lang.String, java.lang.String) */ public boolean hasComponent( String theRole, String theRoleHint ) { // TODO Auto-generated method stub return false; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#initialize() */ public void initialize() throws PlexusContainerException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#isInitialized() */ public boolean isInitialized() { // TODO Auto-generated method stub return false; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#isStarted() */ public boolean isStarted() { // TODO Auto-generated method stub return false; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#lookup(java.lang.String, java.lang.String) */ public Object lookup( String theRole, String theRoleHint ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#lookupList(java.lang.String) */ public List lookupList( String theRole ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#lookupMap(java.lang.String) */ public Map lookupMap( String theRole ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#registerComponentDiscoveryListener(org.codehaus.plexus.component.discovery.ComponentDiscoveryListener) */ public void registerComponentDiscoveryListener( ComponentDiscoveryListener theListener ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#release(java.lang.Object) */ public void release( Object theComponent ) throws ComponentLifecycleException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#releaseAll(java.util.Map) */ public void releaseAll( Map theComponents ) throws ComponentLifecycleException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#releaseAll(java.util.List) */ public void releaseAll( List theComponents ) throws ComponentLifecycleException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#removeChildContainer(java.lang.String) */ public void removeChildContainer( String theName ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#removeComponentDiscoveryListener(org.codehaus.plexus.component.discovery.ComponentDiscoveryListener) */ public void removeComponentDiscoveryListener( ComponentDiscoveryListener theListener ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#resume(java.lang.Object) */ public void resume( Object theComponent ) throws ComponentLifecycleException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#setConfigurationResource(java.io.Reader) */ public void setConfigurationResource( Reader theConfiguration ) throws PlexusConfigurationResourceException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#setLoggerManager(org.codehaus.plexus.logging.LoggerManager) */ public void setLoggerManager( LoggerManager theLoggerManager ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#setParentPlexusContainer(org.codehaus.plexus.PlexusContainer) */ public void setParentPlexusContainer( PlexusContainer theParentContainer ) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#start() */ public void start() throws PlexusContainerException { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.codehaus.plexus.PlexusContainer#suspend(java.lang.Object) */ public void suspend( Object theComponent ) throws ComponentLifecycleException { // TODO Auto-generated method stub } @Override public T lookup( Class role ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } @Override public T lookup( Class role, String hint ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } @Override public T lookup( Class type, String role, String hint ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } @Override public List lookupList( Class role ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } @Override public Map lookupMap( Class role ) throws ComponentLookupException { // TODO Auto-generated method stub return null; } @Override public boolean hasComponent( Class role ) { // TODO Auto-generated method stub return false; } @Override public boolean hasComponent( Class role, String hint ) { // TODO Auto-generated method stub return false; } @Override public boolean hasComponent( Class type, String role, String hint ) { // TODO Auto-generated method stub return false; } @Override public void addComponent( Object component, String role ) { // TODO Auto-generated method stub } @Override public void addComponent( T component, Class role, String hint ) { // TODO Auto-generated method stub } @Override public ComponentDescriptor getComponentDescriptor( String role, String hint ) { // TODO Auto-generated method stub return null; } @Override public ComponentDescriptor getComponentDescriptor( Class type, String role, String hint ) { // TODO Auto-generated method stub return null; } @Override public List> getComponentDescriptorList( Class type, String role ) { // TODO Auto-generated method stub return null; } @Override public Map> getComponentDescriptorMap( Class type, String role ) { // TODO Auto-generated method stub return null; } @Override public List> discoverComponents( org.codehaus.plexus.classworlds.realm.ClassRealm classRealm ) throws PlexusConfigurationException { // TODO Auto-generated method stub return null; } @Override public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm() { // TODO Auto-generated method stub return null; } @Override public org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm( org.codehaus.plexus.classworlds.realm.ClassRealm realm ) { // TODO Auto-generated method stub return null; } @Override public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm() { // TODO Auto-generated method stub return null; } @Override public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm( String id ) { // TODO Auto-generated method stub return null; } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDependencies.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDepend0000664000175000017500000002155612267010416033105 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.junit.Before; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; /** * The Class TestBannedDependencies. * * @author Brian Fox */ @RunWith( Enclosed.class ) public class TestBannedDependencies { public static class ExcludesDoNotUseTransitiveDependencies { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( false ); } private void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { this.setup.addExcludeAndRunRule( toAdd ); } @Test public void testGroupIdArtifactIdVersion() throws Exception { addExcludeAndRunRule( "testGroupId:release:1.0" ); } @Test public void testGroupIdArtifactId() throws Exception { addExcludeAndRunRule( "testGroupId:release" ); } @Test public void testGroupId() throws Exception { addExcludeAndRunRule( "testGroupId" ); } } public static class ExcludesUsingTransitiveDependencies { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( true ); } private void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { this.setup.addExcludeAndRunRule( toAdd ); } @Test( expected = EnforcerRuleException.class ) public void testGroupIdArtifactIdVersion() throws Exception { addExcludeAndRunRule( "testGroupId:release:1.0" ); } @Test( expected = EnforcerRuleException.class ) public void testGroupIdArtifactId() throws Exception { addExcludeAndRunRule( "testGroupId:release" ); } @Test( expected = EnforcerRuleException.class ) public void testGroupId() throws Exception { addExcludeAndRunRule( "testGroupId" ); } @Test( expected = EnforcerRuleException.class ) public void testSpaceTrimmingGroupIdArtifactIdVersion() throws Exception { addExcludeAndRunRule( " testGroupId : release : 1.0 " ); } @Test( expected = EnforcerRuleException.class ) public void groupIdArtifactIdVersionType() throws Exception { addExcludeAndRunRule( "g:a:1.0:war" ); } @Test( expected = EnforcerRuleException.class ) public void groupIdArtifactIdVersionTypeScope() throws Exception { addExcludeAndRunRule( "g:a:1.0:war:compile" ); } // @Test(expected = EnforcerRuleException.class) // public void groupIdArtifactIdVersionTypeScopeClassifier() throws Exception { // addExcludeAndRunRule("g:compile:1.0:jar:compile:one"); // } // } public static class WildcardExcludesUsingTransitiveDependencies { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( true ); } private void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { this.setup.addExcludeAndRunRule( toAdd ); } @Test public void testWildcardForGroupIdArtifactIdVersion() throws Exception { addExcludeAndRunRule( "*:release:1.2" ); } @Test( expected = EnforcerRuleException.class ) public void testWildCardForGroupIdArtifactId() throws Exception { addExcludeAndRunRule( "*:release" ); } @Test( expected = EnforcerRuleException.class ) public void testWildcardForGroupIdWildcardForArtifactIdVersion() throws Exception { addExcludeAndRunRule( "*:*:1.0" ); } @Test( expected = EnforcerRuleException.class ) public void testWildcardForGroupIdArtifactIdWildcardForVersion() throws Exception { addExcludeAndRunRule( "*:release:*" ); } } public static class PartialWildcardExcludesUsingTransitiveDependencies { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( true ); } private void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { this.setup.addExcludeAndRunRule( toAdd ); } @Test( expected = EnforcerRuleException.class ) public void groupIdArtifactIdWithWildcard() throws EnforcerRuleException { addExcludeAndRunRule( "testGroupId:re*" ); } @Test( expected = EnforcerRuleException.class ) public void groupIdArtifactIdVersionTypeWildcardScope() throws EnforcerRuleException { addExcludeAndRunRule( "g:a:1.0:war:co*" ); } @Test( expected = EnforcerRuleException.class ) public void groupIdArtifactIdVersionWildcardTypeScope() throws EnforcerRuleException { addExcludeAndRunRule( "g:a:1.0:w*:compile" ); } } public static class IllegalFormatsTests { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( true ); } private void addExcludeAndRunRule( String toAdd ) throws EnforcerRuleException { this.setup.addExcludeAndRunRule( toAdd ); } @Test( expected = IllegalArgumentException.class ) public void onlyThreeColonsWithoutAnythingElse() throws EnforcerRuleException { addExcludeAndRunRule( ":::" ); } @Test( expected = IllegalArgumentException.class ) public void onlySevenColonsWithoutAnythingElse() throws EnforcerRuleException { addExcludeAndRunRule( ":::::::" ); } } public static class IncludesExcludesNoTransitive { private BannedDependenciesTestSetup setup; @Before public void beforeMethod() throws IOException { this.setup = new BannedDependenciesTestSetup(); this.setup.setSearchTransitive( false ); } private void addIncludeExcludeAndRunRule( String incAdd, String excAdd ) throws EnforcerRuleException { this.setup.addIncludeExcludeAndRunRule( incAdd, excAdd ); } @Test public void includeEverythingAndExcludeEverythign() throws EnforcerRuleException { addIncludeExcludeAndRunRule( "*", "*" ); } @Test public void includeEverythingAndExcludeEveryGroupIdAndScopeRuntime() throws EnforcerRuleException { addIncludeExcludeAndRunRule( "*", "*:runtime" ); } @Test( expected = EnforcerRuleException.class ) public void includeEverythingAndExcludeEveryGroupIdAndScopeRuntimeYYYY() throws EnforcerRuleException { addIncludeExcludeAndRunRule( "*:test", "*:runtime" ); } } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireRelea0000664000175000017500000000725312445342642033170 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import java.util.Set; import junit.framework.TestCase; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.TestEnforcerRuleUtils; import org.apache.maven.project.MavenProject; /** * The Class TestNoSnapshots. * * @author Brian Fox */ public class TestRequireReleaseDeps extends TestCase { /** * Test rule. * * @throws IOException Signals that an I/O exception has occurred. */ public void testRule() throws IOException { ArtifactStubFactory factory = new ArtifactStubFactory(); MockProject project = new MockProject(); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); project.setArtifacts( factory.getMixedArtifacts() ); project.setDependencyArtifacts( factory.getScopedArtifacts() ); RequireReleaseDeps rule = newRequireReleaseDeps(); rule.setSearchTransitive( false ); TestEnforcerRuleUtils.execute( rule, helper, false ); rule.setSearchTransitive( true ); TestEnforcerRuleUtils.execute( rule, helper, true ); // test onlyWhenRelease in each case project.setArtifact( factory.getSnapshotArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, true ); rule.setOnlyWhenRelease( true ); TestEnforcerRuleUtils.execute( rule, helper, false ); project.setArtifact( factory.getReleaseArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, true ); MockProject parent = new MockProject(); parent.setArtifact( factory.getSnapshotArtifact() ); project.setParent( parent ); project.setArtifacts( null ); project.setDependencyArtifacts( null ); helper = EnforcerTestUtils.getHelper(project); rule.setFailWhenParentIsSnapshot( true ); TestEnforcerRuleUtils.execute( rule, helper, true ); rule.setFailWhenParentIsSnapshot( false ); TestEnforcerRuleUtils.execute( rule, helper, false ); } private RequireReleaseDeps newRequireReleaseDeps() { RequireReleaseDeps rule = new RequireReleaseDeps() { protected Set getDependenciesToCheck( MavenProject project ) { // the integration with dependencyGraphTree is verified with the integration tests // for unit-testing return isSearchTransitive() ? project.getArtifacts() : project.getDependencyArtifacts(); } }; return rule; } /** * Test id. */ public void testId() { RequireReleaseDeps rule = newRequireReleaseDeps(); rule.getCacheId(); } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePluginVersions.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePlugi0000664000175000017500000004547312154414241033216 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils; import org.apache.maven.plugins.enforcer.utils.PluginWrapper; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; // TODO: Auto-generated Javadoc /** * The Class TestRequirePluginVersions. * * @author Brian Fox */ public class TestRequirePluginVersions extends AbstractMojoTestCase { /** * Test has version specified. */ public void testHasVersionSpecified() { Plugin source = new Plugin(); source.setArtifactId( "foo" ); source.setGroupId( "group" ); // setup the plugins. I'm setting up the foo group // with a few bogus entries and then a real one. // this is to test that the list is exhaustively // searched for versions before giving up. // banLatest/Release will fail if it is found // anywhere in the list List plugins = new ArrayList(); plugins.add( EnforcerTestUtils.newPlugin( "group", "a-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", null ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", "" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "b-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "c-artifact", "LATEST" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "c-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "d-artifact", "RELEASE" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "d-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "e-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "e-artifact", "RELEASE" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "f-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "f-artifact", "LATEST" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "f-artifact", "1.0-SNAPSHOT" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "g-artifact", "1.0-12345678.123456-1" ) ); List pluginWrappers = PluginWrapper.addAll( plugins, "unit" ); RequirePluginVersions rule = new RequirePluginVersions(); rule.setBanLatest( false ); rule.setBanRelease( false ); rule.setBanSnapshots( false ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that LATEST is allowed source.setArtifactId( "c-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that LATEST is banned rule.setBanLatest( true ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that LATEST is exhausively checked rule.setBanSnapshots( false ); source.setArtifactId( "f-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); rule.setBanLatest( false ); rule.setBanSnapshots( true ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that TIMESTAMP is allowed rule.setBanTimestamps( false ); source.setArtifactId( "g-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that RELEASE is allowed source.setArtifactId( "d-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that RELEASE is banned rule.setBanRelease( true ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // check that RELEASE is exhaustively checked source.setArtifactId( "e-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); } /** * Test has version specified with properties. */ public void testHasVersionSpecifiedWithProperties() { Plugin source = new Plugin(); source.setGroupId( "group" ); // setup the plugins. List plugins = new ArrayList(); plugins.add( EnforcerTestUtils.newPlugin( "group", "a-artifact", "1.0-${SNAPSHOT}" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "b-artifact", "${1.0}" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "c-artifact", "${LATEST}" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "d-artifact", "${RELEASE}" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "e-artifact", "${}" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "f-artifact", "${ }" ) ); List pluginWrappers = PluginWrapper.addAll( plugins, "unit" ); RequirePluginVersions rule = new RequirePluginVersions(); rule.setBanLatest( false ); rule.setBanRelease( false ); rule.setBanSnapshots( false ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( true ); source.setArtifactId( "a-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); source.setArtifactId( "b-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); source.setArtifactId( "c-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); source.setArtifactId( "d-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // this one checks empty property values source.setArtifactId( "e-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // this one checks empty property values source.setArtifactId( "f-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); rule.setBanLatest( true ); source.setArtifactId( "c-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); rule.setBanRelease( true ); source.setArtifactId( "d-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); rule.setBanSnapshots( true ); source.setArtifactId( "a-artifact" ); assertFalse( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); // release versions should pass everything source.setArtifactId( "b-artifact" ); assertTrue( rule.hasValidVersionSpecified( helper, source, pluginWrappers ) ); } /** * Test get all plugins. * * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ public void testGetAllPlugins() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { RequirePluginVersions rule = new RequirePluginVersions(); String path = "target/test-classes/requirePluginVersions/getPomRecursively/b/c"; StringUtils.replace( path, "/", File.separator ); File projectDir = new File( getBasedir(), path ); MockProject project = new MockProject(); project.setArtifactId( "c" ); project.setGroupId( "group" ); project.setVersion( "1.0" ); project.setBaseDir( projectDir ); rule.setUtils( new EnforcerRuleUtils( EnforcerTestUtils.getHelper( project ) ) ); List plugins = rule.getAllPluginEntries( project ); // there should be 3 assertEquals( 3, plugins.size() ); } /** * Test get additional plugins null. * * @throws MojoExecutionException the mojo execution exception */ public void testGetAdditionalPluginsNull() throws MojoExecutionException { RequirePluginVersions rule = new RequirePluginVersions(); rule.addAdditionalPlugins( null, null ); } /** * Test get additional plugins invalid format. */ public void testGetAdditionalPluginsInvalidFormat() { RequirePluginVersions rule = new RequirePluginVersions(); List additional = new ArrayList(); // invalid format (not enough sections) additional.add( "group" ); Set plugins = new HashSet(); try { rule.addAdditionalPlugins( plugins, additional ); fail( "Expected Exception because the format is invalid" ); } catch ( MojoExecutionException e ) { } // invalid format (too many sections) additional.clear(); additional.add( "group:i:i" ); try { rule.addAdditionalPlugins( plugins, additional ); fail( "Expected Exception because the format is invalid" ); } catch ( MojoExecutionException e ) { } } /** * Test get additional plugins empty set. * * @throws MojoExecutionException the mojo execution exception */ public void testGetAdditionalPluginsEmptySet() throws MojoExecutionException { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( EnforcerTestUtils.newPlugin( "group", "a-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", null ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo2", "" ) ); List additional = new ArrayList(); additional.add( "group:a-artifact" ); additional.add( "group:another-artifact" ); // make sure a null set can be handled Set results = rule.addAdditionalPlugins( null, additional ); assertNotNull( results ); assertContainsPlugin( "group", "a-artifact", results ); assertContainsPlugin( "group", "another-artifact", results ); } /** * Test get additional plugins. * * @throws MojoExecutionException the mojo execution exception */ public void testGetAdditionalPlugins() throws MojoExecutionException { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( EnforcerTestUtils.newPlugin( "group", "a-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", null ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo2", "" ) ); List additional = new ArrayList(); additional.add( "group:a-artifact" ); additional.add( "group:another-artifact" ); Set results = rule.addAdditionalPlugins( plugins, additional ); // make sure only one new plugin has been added assertNotNull( results ); assertEquals( 4, results.size() ); assertContainsPlugin( "group", "a-artifact", results ); assertContainsPlugin( "group", "another-artifact", results ); } /** * Test remove Unchecked plugins. * * @throws MojoExecutionException the mojo execution exception */ public void testGetUncheckedPlugins() throws MojoExecutionException { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( EnforcerTestUtils.newPlugin( "group", "a-artifact", "1.0" ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo", null ) ); plugins.add( EnforcerTestUtils.newPlugin( "group", "foo2", "" ) ); List unchecked = new ArrayList(); //intentionally inserting spaces to make sure they are handled correctly. unchecked.add( "group : a-artifact" ); Collection results = rule.removeUncheckedPlugins( unchecked, plugins ); // make sure only one new plugin has been added assertNotNull( results ); assertEquals( 2, results.size() ); assertContainsPlugin( "group", "foo", results ); assertContainsPlugin( "group", "foo2", results ); assertNotContainPlugin( "group", "a-artifact", results ); } /** * Test combining values from both lists */ public void testCombinePlugins() { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( "group:a-artifact" ); plugins.add( "group:foo" ); plugins.add( "group:foo2" ); Collection results = rule.combineUncheckedPlugins( plugins, "group2:a,group3:b" ); // make sure only one new plugin has been added assertNotNull( results ); assertEquals( 5, results.size() ); assertTrue( results.contains( "group:foo") ); assertTrue( results.contains( "group:foo2") ); assertTrue( results.contains( "group:a-artifact") ); assertTrue( results.contains( "group2:a") ); assertTrue( results.contains( "group3:b") ); } /** * Test combining with an empty list */ public void testCombinePlugins1() { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); Collection results = rule.combineUncheckedPlugins( plugins, "group2:a,group3:b" ); // make sure only one new plugin has been added assertNotNull( results ); assertEquals( 2, results.size() ); assertTrue( results.contains( "group2:a") ); assertTrue( results.contains( "group3:b") ); } /** * Test combining with a null list */ public void testCombinePlugins2() { RequirePluginVersions rule = new RequirePluginVersions(); Collection results = rule.combineUncheckedPlugins( null, "group2:a,group3:b" ); // make sure only one new plugin has been added assertNotNull( results ); assertEquals( 2, results.size() ); assertTrue( results.contains( "group2:a") ); assertTrue( results.contains( "group3:b") ); } /** * Test combining with an empty string */ public void testCombinePlugins3() { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( "group:a-artifact" ); plugins.add( "group:foo" ); plugins.add( "group:foo2" ); Collection results = rule.combineUncheckedPlugins( plugins, "" ); assertNotNull( results ); assertEquals( 3, results.size() ); assertTrue( results.contains( "group:foo") ); assertTrue( results.contains( "group:foo2") ); assertTrue( results.contains( "group:a-artifact") ); } /** * Test combining with a null string */ public void testCombinePlugins4() { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( "group:a-artifact" ); plugins.add( "group:foo" ); plugins.add( "group:foo2" ); Collection results = rule.combineUncheckedPlugins( plugins, null ); assertNotNull( results ); assertEquals( 3, results.size() ); assertTrue( results.contains( "group:foo") ); assertTrue( results.contains( "group:foo2") ); assertTrue( results.contains( "group:a-artifact") ); } /** * Test combining with an invalid plugin string */ public void testCombinePlugins5() { RequirePluginVersions rule = new RequirePluginVersions(); Set plugins = new HashSet(); plugins.add( "group:a-artifact" ); plugins.add( "group:foo" ); plugins.add( "group:foo2" ); Collection results = rule.combineUncheckedPlugins( plugins, "a" ); assertNotNull( results ); assertEquals( 4, results.size() ); assertTrue( results.contains( "group:foo") ); assertTrue( results.contains( "group:foo2") ); //this should be here, the checking of a valid plugin string happens in another method. assertTrue( results.contains( "a") ); } /** * Assert contains plugin. * * @param group the group * @param artifact the artifact * @param theSet the the set */ private void assertContainsPlugin( String group, String artifact, Collection theSet ) { Plugin p = new Plugin(); p.setGroupId( group ); p.setArtifactId( artifact ); assertTrue( theSet.contains( p ) ); } /** * Assert doesn't contain plugin. * * @param group the group * @param artifact the artifact * @param theSet the the set */ private void assertNotContainPlugin( String group, String artifact, Collection theSet ) { Plugin p = new Plugin(); p.setGroupId( group ); p.setArtifactId( artifact ); assertFalse( theSet.contains( p ) ); } /** * Test id. */ public void testId() { RequirePluginVersions rule = new RequirePluginVersions(); rule.getCacheId(); } } maven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/0000775000175000017500000000000013133666303031147 5ustar ebourgebourg././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestEnforcerRuleUtils.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestEnforc0000664000175000017500000002276411242355031033151 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.List; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Model; import org.apache.maven.model.Parent; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugins.enforcer.EnforcerTestUtils; import org.apache.maven.plugins.enforcer.MockProject; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; // TODO: Auto-generated Javadoc /** * The Class TestEnforcerRuleUtils. * * @author Brian Fox */ public class TestEnforcerRuleUtils extends AbstractMojoTestCase { /** * Test check if model matches. */ public void testCheckIfModelMatches() { EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper() ); Model model = new Model(); model.setArtifactId( "" ); model.setGroupId( "" ); model.setVersion( "" ); // should generate internal NPE on the parent, but // will still // compare the raw values assertTrue( utils.checkIfModelMatches( "", "", "", model ) ); assertFalse( utils.checkIfModelMatches( "", "", "1.0", model ) ); // now setup a parent Parent parent = new Parent(); parent.setArtifactId( "foo" ); parent.setGroupId( "foo-group" ); parent.setVersion( "1.0" ); model.setParent( parent ); // should NOT pickup the parent artifact assertFalse( utils.checkIfModelMatches( "foo-group", "foo", "1.0", model ) ); // check that the version and group are inherited // from the parent. assertTrue( utils.checkIfModelMatches( "foo-group", "", "1.0", model ) ); // check handling of nulls assertFalse( utils.checkIfModelMatches( "foo-group", null, "1.0", model ) ); } /** * Test get models recursively bottom. * * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ public void testGetModelsRecursivelyBottom() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { String path = "target/test-classes/requirePluginVersions/getPomRecursively/b/c"; StringUtils.replace( path, "/", File.separator ); File pom = new File( getBasedir() + File.separator + path, "pom.xml" ); EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper() ); List models = utils.getModelsRecursively( "group", "c", "1.0", pom ); // there should be 3 assertEquals( 3, models.size() ); // now make sure they are all there Model m = new Model(); m.setGroupId( "group" ); m.setVersion( "1.0" ); m.setArtifactId( "c" ); models.contains( m ); m.setArtifactId( "b" ); models.contains( m ); m.setArtifactId( "a" ); models.contains( m ); } /** * Test get models recursively top. * * @throws ArtifactResolutionException the artifact resolution exception * @throws ArtifactNotFoundException the artifact not found exception * @throws IOException Signals that an I/O exception has occurred. * @throws XmlPullParserException the xml pull parser exception */ public void testGetModelsRecursivelyTop() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { String path = "target/test-classes/requirePluginVersions/getPomRecursively"; StringUtils.replace( path, "/", File.separator ); File pom = new File( getBasedir() + File.separator + path, "pom.xml" ); EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper() ); List models = utils.getModelsRecursively( "group", "a", "1.0", pom ); // there should be 1 assertEquals( 1, models.size() ); // now make sure they are all there Model m = new Model(); m.setGroupId( "group" ); m.setVersion( "1.0" ); m.setArtifactId( "a" ); models.contains( m ); } public void testGetModelsRecursivelyParentExpression() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { String path = "target/test-classes/requirePluginVersions/parentExpression/child"; StringUtils.replace( path, "/", File.separator ); File pom = new File( getBasedir() + File.separator + path, "pom.xml" ); // bit backwards - the project here should really be the one read in the first stage of getModelsRecursively MockProject parent = new MockProject(); parent.setGroupId( "org.apache.maven.plugins.enforcer.test" ); parent.setArtifactId( "parent" ); parent.setVersion( "1.0-SNAPSHOT" ); MockProject project = new MockProject(); project.setParent( parent ); EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper( project ) ); List models = utils.getModelsRecursively( "org.apache.maven.plugins.enforcer.test", "child", "1.0-SNAPSHOT", pom ); // there should be 2 assertEquals( 2, models.size() ); } public void testGetModelsRecursivelyParentRelativePath() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { String path = "target/test-classes/requirePluginVersions/parentRelativePath"; StringUtils.replace( path, "/", File.separator ); File pom = new File( getBasedir() + File.separator + path, "pom.xml" ); // bit backwards - the project here should really be the one read in the first stage of getModelsRecursively MockProject parent = new MockProject(); parent.setGroupId( "org.apache.maven.plugins.enforcer.test" ); parent.setArtifactId( "parent" ); parent.setVersion( "1.0-SNAPSHOT" ); MockProject project = new MockProject(); project.setParent( parent ); EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper( project ) ); List models = utils.getModelsRecursively( "org.apache.maven.plugins.enforcer.test", "aggregate", "1.0-SNAPSHOT", pom ); // there should be 2 assertEquals( 2, models.size() ); } public void testGetModelsRecursivelyParentRelativePathDirectory() throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException { String path = "target/test-classes/requirePluginVersions/parentRelativePathDirectory"; StringUtils.replace( path, "/", File.separator ); File pom = new File( getBasedir() + File.separator + path, "pom.xml" ); // bit backwards - the project here should really be the one read in the first stage of getModelsRecursively MockProject parent = new MockProject(); parent.setGroupId( "org.apache.maven.plugins.enforcer.test" ); parent.setArtifactId( "parent" ); parent.setVersion( "1.0-SNAPSHOT" ); MockProject project = new MockProject(); project.setParent( parent ); EnforcerRuleUtils utils = new EnforcerRuleUtils( EnforcerTestUtils.getHelper( project ) ); List models = utils.getModelsRecursively( "org.apache.maven.plugins.enforcer.test", "aggregate", "1.0-SNAPSHOT", pom ); // there should be 2 assertEquals( 2, models.size() ); } /** * Simpler wrapper to execute and deal with the expected result. * * @param rule the rule * @param helper the helper * @param shouldFail the should fail */ public static void execute( EnforcerRule rule, EnforcerRuleHelper helper, boolean shouldFail ) { try { rule.execute( helper ); if ( shouldFail ) { fail( "Exception expected." ); } } catch ( EnforcerRuleException e ) { if ( !shouldFail ) { fail( "No Exception expected:" + e.getLocalizedMessage() ); } helper.getLog().debug( e.getMessage() ); } } } ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEnforcerExpressionEvaluator.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEn0000664000175000017500000000454411242355031033105 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugins.enforcer.EnforcerExpressionEvaluator; import org.apache.maven.plugins.enforcer.EnforcerTestUtils; import org.apache.maven.plugins.enforcer.MockPathTranslator; import org.apache.maven.plugins.enforcer.MockProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; // TODO: Auto-generated Javadoc /** * The Class TestMockEnforcerExpressionEvaluator. */ public class TestMockEnforcerExpressionEvaluator extends TestCase { /** * Test evaluate. */ public void testEvaluate() { MavenSession session = EnforcerTestUtils.getMavenSession(); EnforcerExpressionEvaluator ev = new MockEnforcerExpressionEvaluator( session, new MockPathTranslator(), new MockProject() ); assertMatch( ev, "SNAPSHOT" ); assertMatch( ev, "RELEASE" ); assertMatch( ev, "SNAPSHOT" ); assertMatch( ev, "LATEST" ); assertMatch( ev, "1.0" ); } /** * Assert match. * * @param ev the ev * @param exp the exp */ public void assertMatch( EnforcerExpressionEvaluator ev, String exp ) { // the mock enforcer should return the name of the expression as the value. try { assertEquals( exp, ev.evaluate( "${" + exp + "}" ) ); } catch ( ExpressionEvaluationException e ) { fail( e.getLocalizedMessage() ); } } } ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/MockEnforcerExpressionEvaluator.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/MockEnforc0000664000175000017500000000465612451603436033133 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.descriptor.MojoDescriptor; import org.apache.maven.plugins.enforcer.EnforcerExpressionEvaluator; import org.apache.maven.project.MavenProject; import org.apache.maven.project.path.PathTranslator; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; // TODO: Auto-generated Javadoc /** * The Class MockEnforcerExpressionEvaluator. */ public class MockEnforcerExpressionEvaluator extends EnforcerExpressionEvaluator { /** * Instantiates a new mock enforcer expression evaluator. * * @param theContext the the context * @param thePathTranslator the the path translator * @param theProject the the project */ public MockEnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator, MavenProject theProject ) { super( theContext, thePathTranslator, theProject, new MojoExecution( new MojoDescriptor() ) ); // TODO Auto-generated constructor stub } /* * (non-Javadoc) * * @see org.apache.maven.plugin.PluginParameterExpressionEvaluator#evaluate(java.lang.String) */ public Object evaluate( String expr ) throws ExpressionEvaluationException { if ( expr != null ) { // just remove the ${ } and return the name as the value return expr.replaceAll( "\\$\\{|}", "" ); } else { return expr; } } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifactMatcher.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifa0000664000175000017500000001514112266547456033157 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugins.enforcer.utils.ArtifactMatcher.Pattern; import java.util.ArrayList; import java.util.Collection; public class TestArtifactMatcher extends TestCase { private ArtifactMatcher matcher; Collection patterns = new ArrayList(); Collection ignorePatterns = new ArrayList(); public void testPatternInvalidInput() throws InvalidVersionSpecificationException { try { new Pattern(null); fail("NullPointerException expected."); } catch(NullPointerException e){} try { new Pattern("a:b:c:d:e:f:g"); fail("IllegalArgumentException expected."); } catch(IllegalArgumentException e){} try { new Pattern("a::"); fail("IllegalArgumentException expected."); } catch(IllegalArgumentException e){} try { Pattern p = new Pattern("*"); p.match(null); fail("NullPointerException expected."); } catch(NullPointerException e){} } public void testPattern() throws InvalidVersionSpecificationException { executePatternMatch("groupId:artifactId:1.0:jar:compile", "groupId", "artifactId", "1.0", "compile", "jar", true); executePatternMatch("groupId:artifactId:1.0:jar:compile", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("groupId:artifactId:1.0", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("groupId:artifactId:1.0", "groupId", "artifactId", "1.1", "", "", true); executePatternMatch("groupId:artifactId:[1.0]", "groupId", "artifactId", "1.1", "", "", false); executePatternMatch("groupId:*:1.0", "groupId", "artifactId", "1.0", "test", "", true); executePatternMatch("*:*:1.0", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("*:artifactId:*", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("*", "groupId", "artifactId", "1.0", "", "", true); // MENFORCER-74/75 executePatternMatch("*:*:*:jar:compile:tests", "groupId", "artifactId", "1.0", "", "", "tests", true); // MENFORCER-83 executePatternMatch("*upId", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("gr*pId:?rt?f?ct?d:1.0", "groupId", "artifactId", "1.0", "", "", true); executePatternMatch("org.apache.*:maven-*:*", "org.apache.maven", "maven-core", "3.0", "", "", true); } public void testMatch() throws InvalidVersionSpecificationException { patterns.add("groupId:artifactId:1.0"); patterns.add("*:anotherArtifact"); ignorePatterns.add("badGroup:*:*:test"); ignorePatterns.add("*:anotherArtifact:1.1"); matcher = new ArtifactMatcher(patterns, ignorePatterns); executeMatch(matcher, "groupId", "artifactId", "1.0", "", "", true); executeMatch(matcher, "groupId", "anotherArtifact", "1.0", "", "", true); executeMatch(matcher, "badGroup", "artifactId", "1.0", "", "test", false); executeMatch(matcher, "badGroup", "anotherArtifact", "1.0", "", "", true); executeMatch(matcher, "groupId", "anotherArtifact", "1.1", "", "", false); } private void executePatternMatch( final String pattern, final String groupId, final String artifactId, final String versionRange, final String scope, final String type, boolean expectedResult ) throws InvalidVersionSpecificationException { executePatternMatch( pattern, groupId, artifactId, versionRange, scope, type, "", expectedResult ); } private void executePatternMatch( final String pattern, final String groupId, final String artifactId, final String versionRange, final String scope, final String type, final String classifier, boolean expectedResult ) throws InvalidVersionSpecificationException { assertEquals( expectedResult, new ArtifactMatcher.Pattern( pattern ).match( createMockArtifact( groupId, artifactId, versionRange, scope, type, classifier ) ) ); } private void executeMatch( final ArtifactMatcher matcher, final String groupId, final String artifactId, final String versionRange, final String scope, final String type, final boolean expectedResult ) throws InvalidVersionSpecificationException { assertEquals( expectedResult, matcher.match( createMockArtifact( groupId, artifactId, versionRange, scope, type, "" ) ) ); } private static Artifact createMockArtifact( final String groupId, final String artifactId, final String versionRange, final String scope, final String type, final String classifier ) { ArtifactHandler artifactHandler = new DefaultArtifactHandler(); VersionRange version = VersionRange.createFromVersion( versionRange ); return new DefaultArtifact( groupId, artifactId, version, scope, type, classifier, artifactHandler ); } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtils.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtil0000664000175000017500000001272213075342666033207 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.Properties; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenExecutionResult; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.PluginParameterExpressionEvaluator; import org.apache.maven.plugin.logging.SystemStreamLog; import org.apache.maven.plugins.enforcer.utils.MockEnforcerExpressionEvaluator; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.sonatype.aether.RepositorySystemSession; /** * The Class EnforcerTestUtils. * * @author Brian Fox */ public final class EnforcerTestUtils { /** * Gets the maven session. * * @return the maven session */ public static MavenSession getMavenSession() { PlexusContainer mock = mock( PlexusContainer.class ); try { when( mock.lookup( "xx" ) ).thenReturn( new MavenProject() ); } catch ( ComponentLookupException e ) { e.printStackTrace(); } MavenExecutionRequest mer = mock( MavenExecutionRequest.class ); Properties systemProperties = new Properties(); systemProperties.put( "maven.version", "3.0" ); when( mer.getUserProperties() ).thenReturn( new Properties() ); when(mer.getSystemProperties()).thenReturn( systemProperties ); MavenExecutionResult meresult = mock( MavenExecutionResult.class ); return new MavenSession( mock, (RepositorySystemSession) null, mer, meresult ); // return new MavenSession( new MockPlexusContainer(), (MavenExecutionRequest)null, null, // null ); // new MavenSession(); // return new MavenSession( new MockPlexusContainer(), null, null, null, null, null, null, new Properties(), // new Date() ); } /** * Gets the helper. * * @return the helper */ public static EnforcerRuleHelper getHelper() { return getHelper( new MockProject(), false ); } /** * Gets the helper. * * @param mockExpression the mock expression * @return the helper */ public static EnforcerRuleHelper getHelper( boolean mockExpression ) { return getHelper( new MockProject(), mockExpression ); } /** * Gets the helper. * * @param project the project * @return the helper */ public static EnforcerRuleHelper getHelper( MavenProject project ) { return getHelper( project, false ); } /** * Gets the helper. * * @param project the project * @param mockExpression the mock expression * @return the helper */ public static EnforcerRuleHelper getHelper( MavenProject project, boolean mockExpression ) { MavenSession session = getMavenSession(); ExpressionEvaluator eval; if ( mockExpression ) { eval = new MockEnforcerExpressionEvaluator( session, new MockPathTranslator(), project ); } else { // eval = new DefaultExpressionEvaluator(); MojoExecution mockExecution = mock( MojoExecution.class ); session.setCurrentProject( project ); eval = new PluginParameterExpressionEvaluator( session, mockExecution ); } return new DefaultEnforcementRuleHelper( session, eval, new SystemStreamLog(), null ); } /** * Gets the helper. * * @param project the project * @param eval the expression evaluator to use * @return the helper */ public static EnforcerRuleHelper getHelper( MavenProject project, ExpressionEvaluator eval ) { MavenSession session = getMavenSession(); return new DefaultEnforcementRuleHelper( session, eval, new SystemStreamLog(), null ); } /** * New plugin. * * @param groupId the group id * @param artifactId the artifact id * @param version the version * @return the plugin */ public static Plugin newPlugin( String groupId, String artifactId, String version ) { Plugin plugin = new Plugin(); plugin.setArtifactId( artifactId ); plugin.setGroupId( groupId ); plugin.setVersion( version ); return plugin; } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRepositories.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRep0000664000175000017500000001740112157415723033160 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.Collections; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.PlexusTestCase; /** * Test the "require no repositories" rule. * * @author Brett Porter */ public class TestRequireNoRepositories extends PlexusTestCase { private EnforcerRuleHelper helper; private RequireNoRepositories rule; private MockProject project; public void setUp() throws Exception { super.setUp(); rule = new RequireNoRepositories(); rule.setMessage( "my message" ); project = new MockProject(); project.setGroupId( "org.apache.maven.plugins.enforcer.test" ); project.setVersion( "1.0-SNAPSHOT" ); helper = EnforcerTestUtils.getHelper( project ); } public void testAllBannedNoRepositories() throws EnforcerRuleException { project.setArtifactId( "no-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/no-repositories/child" ) ); rule.execute( helper ); } public void testAllBannedWithRepositories() throws EnforcerRuleException { project.setArtifactId( "with-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-repositories/child" ) ); try { rule.execute( helper ); fail( "Should have exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testAllBannedWithAllowedRepositories() throws EnforcerRuleException { rule.setAllowedRepositories( Collections.singletonList( "repo" ) ); project.setArtifactId( "with-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-repositories/child" ) ); rule.execute( helper ); } public void testAllBannedWithAllowedPluginRepositories() throws EnforcerRuleException { rule.setAllowedPluginRepositories( Collections.singletonList( "repo" ) ); project.setArtifactId( "with-plugin-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-plugin-repositories/child" ) ); rule.execute( helper ); } public void testReposNotBannedNoRepositories() throws EnforcerRuleException { rule.setBanRepositories( false ); project.setArtifactId( "no-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/no-repositories/child" ) ); rule.execute( helper ); } public void testReposNotBannedWithRepositories() throws EnforcerRuleException { rule.setBanRepositories( false ); project.setArtifactId( "with-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-repositories/child" ) ); rule.execute( helper ); } public void testReposNotBannedWithPluginRepositories() throws EnforcerRuleException { rule.setBanRepositories( false ); project.setArtifactId( "with-plugin-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-plugin-repositories/child" ) ); try { rule.execute( helper ); fail( "Should have exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testPluginReposNotBannedNoRepositories() throws EnforcerRuleException { rule.setBanPluginRepositories( false ); project.setArtifactId( "no-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/no-repositories/child" ) ); rule.execute( helper ); } public void testPluginReposNotBannedWithRepositories() throws EnforcerRuleException { rule.setBanPluginRepositories( false ); project.setArtifactId( "with-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-repositories/child" ) ); try { rule.execute( helper ); fail( "Should have exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testPluginReposNotBannedWithPluginRepositories() throws EnforcerRuleException { rule.setBanPluginRepositories( false ); project.setArtifactId( "with-plugin-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/with-plugin-repositories/child" ) ); rule.execute( helper ); } public void testReposNotAllowedWithSnapshotRepositories() throws EnforcerRuleException { rule.setAllowSnapshotRepositories( true ); project.setArtifactId( "snapshot-plugin-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/snapshot-plugin-repositories/child" ) ); try { rule.execute( helper ); fail( "Should have exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testReposAllowedWithSnapshotRepositories() throws EnforcerRuleException { rule.setAllowSnapshotRepositories( true ); project.setArtifactId( "snapshot-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/snapshot-repositories/child" ) ); rule.execute( helper ); } public void testPluginReposNotAllowedWithSnapshotRepositories() throws EnforcerRuleException { rule.setAllowSnapshotPluginRepositories( true ); project.setArtifactId( "snapshot-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/snapshot-repositories/child" ) ); try { rule.execute( helper ); fail( "Should have exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testPluginReposAllowedWithSnapshotPluginRepositories() throws EnforcerRuleException { rule.setAllowSnapshotPluginRepositories( true ); project.setArtifactId( "snapshot-plugin-repositories-child" ); project.setBaseDir( getTestFile( "target/test-classes/requireNoRepositories/snapshot-plugin-repositories/child" ) ); rule.execute( helper ); } /** * Test id. */ public void testId() { RequireNoRepositories rule = new RequireNoRepositories(); rule.getCacheId(); } } maven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockProject.java0000664000175000017500000012354012347363553033106 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.io.Writer; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.model.Build; import org.apache.maven.model.CiManagement; import org.apache.maven.model.Contributor; import org.apache.maven.model.DependencyManagement; import org.apache.maven.model.Developer; import org.apache.maven.model.DistributionManagement; import org.apache.maven.model.IssueManagement; import org.apache.maven.model.License; import org.apache.maven.model.MailingList; import org.apache.maven.model.Model; import org.apache.maven.model.Organization; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginManagement; import org.apache.maven.model.Prerequisites; import org.apache.maven.model.Reporting; import org.apache.maven.model.Resource; import org.apache.maven.model.Scm; import org.apache.maven.project.MavenProject; import org.apache.maven.project.artifact.InvalidDependencyVersionException; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.xml.Xpp3Dom; /** * very simple stub of maven project, going to take a lot of work to make it useful as a stub though. */ public class MockProject extends MavenProject { /** The group id. */ private String groupId; /** The artifact id. */ private String artifactId; /** The name. */ private String name; /** The model. */ private Model model; /** The parent. */ private MavenProject parent; /** The dependencies. */ private List dependencies; /** The file. */ private File file; /** The collected projects. */ private List collectedProjects; /** The attached artifacts. */ private List attachedArtifacts; /** The compile source roots. */ private List compileSourceRoots; /** The test compile source roots. */ private List testCompileSourceRoots; /** The script source roots. */ private List scriptSourceRoots; /** The plugin artifact repositories. */ private List pluginArtifactRepositories; /** The artifact repositories. */ private List artifactRepositories; // private ArtifactRepository releaseArtifactRepository; // private ArtifactRepository snapshotArtifactRepository; /** The active profiles. */ private List activeProfiles; /** The dependency artifacts. */ private Set dependencyArtifacts; /** The dependency management. */ private DependencyManagement dependencyManagement; /** The artifact. */ private Artifact artifact; // private Map artifactMap; /** The original model. */ private Model originalModel; // private Map pluginArtifactMap; // private Map reportArtifactMap; // private Map extensionArtifactMap; // private Map projectReferences; // private Build buildOverlay; /** The execution root. */ private boolean executionRoot; /** The compile artifacts. */ private List compileArtifacts; /** The compile dependencies. */ private List compileDependencies; /** The system dependencies. */ private List systemDependencies; /** The test classpath elements. */ private List testClasspathElements; /** The test dependencies. */ private List testDependencies; /** The system classpath elements. */ private List systemClasspathElements; /** The system artifacts. */ private List systemArtifacts; /** The test artifacts. */ private List testArtifacts; /** The runtime artifacts. */ private List runtimeArtifacts; /** The runtime dependencies. */ private List runtimeDependencies; /** The runtime classpath elements. */ private List runtimeClasspathElements; /** The model version. */ private String modelVersion; /** The packaging. */ private String packaging; /** The inception year. */ private String inceptionYear; /** The url. */ private String url; /** The description. */ private String description; /** The version. */ private String version; /** The default goal. */ private String defaultGoal; /** The artifacts. */ private Set artifacts; /** The properties. */ private Properties properties = new Properties(); /** The base dir. */ private File baseDir = null; /** * Instantiates a new mock project. */ public MockProject() { super( (Model) null ); } // kinda dangerous... /** * Instantiates a new mock project. * * @param model the model */ public MockProject( Model model ) { // super(model); super( (Model) null ); } // kinda dangerous... /** * Instantiates a new mock project. * * @param project the project */ public MockProject( MavenProject project ) { // super(project); super( (Model) null ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getModulePathAdjustment(org.apache.maven.project.MavenProject) */ public String getModulePathAdjustment( MavenProject mavenProject ) throws IOException { return ""; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getArtifact() */ public Artifact getArtifact() { return artifact; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setArtifact(org.apache.maven.artifact.Artifact) */ public void setArtifact( Artifact artifact ) { this.artifact = artifact; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getModel() */ public Model getModel() { return model; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getParent() */ public MavenProject getParent() { return parent; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setParent(org.apache.maven.project.MavenProject) */ public void setParent( MavenProject mavenProject ) { this.parent = mavenProject; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setRemoteArtifactRepositories(java.util.List) */ public void setRemoteArtifactRepositories( List list ) { this.artifactRepositories = list; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getRemoteArtifactRepositories() */ public List getRemoteArtifactRepositories() { return artifactRepositories; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#hasParent() */ public boolean hasParent() { if ( parent != null ) { return true; } else { return false; } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getFile() */ public File getFile() { return file; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setFile(java.io.File) */ public void setFile( File file ) { this.file = file; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getBasedir() */ public File getBasedir() { if ( baseDir == null ) { baseDir = new File( PlexusTestCase.getBasedir() ); } return baseDir; } /** * Sets the base dir. * * @param base the new base dir */ public void setBaseDir( File base ) { baseDir = base; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setDependencies(java.util.List) */ public void setDependencies( List list ) { dependencies = list; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDependencies() */ public List getDependencies() { if ( dependencies == null ) { dependencies = Collections.EMPTY_LIST; } return dependencies; } /** * Sets the dependency management. * * @param depMgt the new dependency management */ public void setDependencyManagement( DependencyManagement depMgt ) { this.dependencyManagement = depMgt; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDependencyManagement() */ public DependencyManagement getDependencyManagement() { if ( dependencyManagement == null ) { dependencyManagement = new DependencyManagement(); } return dependencyManagement; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addCompileSourceRoot(java.lang.String) */ public void addCompileSourceRoot( String string ) { if ( compileSourceRoots == null ) { compileSourceRoots = Collections.singletonList( string ); } else { compileSourceRoots.add( string ); } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addScriptSourceRoot(java.lang.String) */ public void addScriptSourceRoot( String string ) { if ( scriptSourceRoots == null ) { scriptSourceRoots = Collections.singletonList( string ); } else { scriptSourceRoots.add( string ); } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addTestCompileSourceRoot(java.lang.String) */ public void addTestCompileSourceRoot( String string ) { if ( testCompileSourceRoots == null ) { testCompileSourceRoots = Collections.singletonList( string ); } else { testCompileSourceRoots.add( string ); } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCompileSourceRoots() */ public List getCompileSourceRoots() { return compileSourceRoots; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getScriptSourceRoots() */ public List getScriptSourceRoots() { return scriptSourceRoots; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getTestCompileSourceRoots() */ public List getTestCompileSourceRoots() { return testCompileSourceRoots; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCompileClasspathElements() */ public List getCompileClasspathElements() throws DependencyResolutionRequiredException { return compileSourceRoots; } /** * Sets the compile artifacts. * * @param compileArtifacts the new compile artifacts */ public void setCompileArtifacts( List compileArtifacts ) { this.compileArtifacts = compileArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCompileArtifacts() */ public List getCompileArtifacts() { return compileArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCompileDependencies() */ public List getCompileDependencies() { return compileDependencies; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getTestClasspathElements() */ public List getTestClasspathElements() throws DependencyResolutionRequiredException { return testClasspathElements; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getTestArtifacts() */ public List getTestArtifacts() { return testArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getTestDependencies() */ public List getTestDependencies() { return testDependencies; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getRuntimeClasspathElements() */ public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException { return runtimeClasspathElements; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getRuntimeArtifacts() */ public List getRuntimeArtifacts() { return runtimeArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getRuntimeDependencies() */ public List getRuntimeDependencies() { return runtimeDependencies; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getSystemClasspathElements() */ public List getSystemClasspathElements() throws DependencyResolutionRequiredException { return systemClasspathElements; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getSystemArtifacts() */ public List getSystemArtifacts() { return systemArtifacts; } /** * Sets the runtime classpath elements. * * @param runtimeClasspathElements the new runtime classpath elements */ public void setRuntimeClasspathElements( List runtimeClasspathElements ) { this.runtimeClasspathElements = runtimeClasspathElements; } /** * Sets the attached artifacts. * * @param attachedArtifacts the new attached artifacts */ public void setAttachedArtifacts( List attachedArtifacts ) { this.attachedArtifacts = attachedArtifacts; } /** * Sets the compile source roots. * * @param compileSourceRoots the new compile source roots */ public void setCompileSourceRoots( List compileSourceRoots ) { this.compileSourceRoots = compileSourceRoots; } /** * Sets the test compile source roots. * * @param testCompileSourceRoots the new test compile source roots */ public void setTestCompileSourceRoots( List testCompileSourceRoots ) { this.testCompileSourceRoots = testCompileSourceRoots; } /** * Sets the script source roots. * * @param scriptSourceRoots the new script source roots */ public void setScriptSourceRoots( List scriptSourceRoots ) { this.scriptSourceRoots = scriptSourceRoots; } /** * Sets the artifact map. * * @param artifactMap the new artifact map */ public void setArtifactMap( Map artifactMap ) { // this.artifactMap = artifactMap; } /** * Sets the plugin artifact map. * * @param pluginArtifactMap the new plugin artifact map */ public void setPluginArtifactMap( Map pluginArtifactMap ) { // this.pluginArtifactMap = pluginArtifactMap; } /** * Sets the report artifact map. * * @param reportArtifactMap the new report artifact map */ public void setReportArtifactMap( Map reportArtifactMap ) { // this.reportArtifactMap = reportArtifactMap; } /** * Sets the extension artifact map. * * @param extensionArtifactMap the new extension artifact map */ public void setExtensionArtifactMap( Map extensionArtifactMap ) { // this.extensionArtifactMap = extensionArtifactMap; } /** * Sets the project references. * * @param projectReferences the new project references */ public void setProjectReferences( Map projectReferences ) { // this.projectReferences = projectReferences; } /** * Sets the builds the overlay. * * @param buildOverlay the new builds the overlay */ public void setBuildOverlay( Build buildOverlay ) { // this.buildOverlay = buildOverlay; } /** * Sets the compile dependencies. * * @param compileDependencies the new compile dependencies */ public void setCompileDependencies( List compileDependencies ) { this.compileDependencies = compileDependencies; } /** * Sets the system dependencies. * * @param systemDependencies the new system dependencies */ public void setSystemDependencies( List systemDependencies ) { this.systemDependencies = systemDependencies; } /** * Sets the test classpath elements. * * @param testClasspathElements the new test classpath elements */ public void setTestClasspathElements( List testClasspathElements ) { this.testClasspathElements = testClasspathElements; } /** * Sets the test dependencies. * * @param testDependencies the new test dependencies */ public void setTestDependencies( List testDependencies ) { this.testDependencies = testDependencies; } /** * Sets the system classpath elements. * * @param systemClasspathElements the new system classpath elements */ public void setSystemClasspathElements( List systemClasspathElements ) { this.systemClasspathElements = systemClasspathElements; } /** * Sets the system artifacts. * * @param systemArtifacts the new system artifacts */ public void setSystemArtifacts( List systemArtifacts ) { this.systemArtifacts = systemArtifacts; } /** * Sets the test artifacts. * * @param testArtifacts the new test artifacts */ public void setTestArtifacts( List testArtifacts ) { this.testArtifacts = testArtifacts; } /** * Sets the runtime artifacts. * * @param runtimeArtifacts the new runtime artifacts */ public void setRuntimeArtifacts( List runtimeArtifacts ) { this.runtimeArtifacts = runtimeArtifacts; } /** * Sets the runtime dependencies. * * @param runtimeDependencies the new runtime dependencies */ public void setRuntimeDependencies( List runtimeDependencies ) { this.runtimeDependencies = runtimeDependencies; } /** * Sets the model. * * @param model the new model */ public void setModel( Model model ) { this.model = model; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getSystemDependencies() */ public List getSystemDependencies() { return systemDependencies; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setModelVersion(java.lang.String) */ public void setModelVersion( String string ) { this.modelVersion = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getModelVersion() */ public String getModelVersion() { return modelVersion; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getId() */ public String getId() { return ""; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setGroupId(java.lang.String) */ public void setGroupId( String string ) { this.groupId = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getGroupId() */ public String getGroupId() { return groupId; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setArtifactId(java.lang.String) */ public void setArtifactId( String string ) { this.artifactId = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getArtifactId() */ public String getArtifactId() { return artifactId; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setName(java.lang.String) */ public void setName( String string ) { this.name = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getName() */ public String getName() { return name; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setVersion(java.lang.String) */ public void setVersion( String string ) { this.version = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getVersion() */ public String getVersion() { return version; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPackaging() */ public String getPackaging() { return packaging; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setPackaging(java.lang.String) */ public void setPackaging( String string ) { this.packaging = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setInceptionYear(java.lang.String) */ public void setInceptionYear( String string ) { this.inceptionYear = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getInceptionYear() */ public String getInceptionYear() { return inceptionYear; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setUrl(java.lang.String) */ public void setUrl( String string ) { this.url = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getUrl() */ public String getUrl() { return url; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPrerequisites() */ public Prerequisites getPrerequisites() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setIssueManagement(org.apache.maven.model.IssueManagement) */ public void setIssueManagement( IssueManagement issueManagement ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCiManagement() */ public CiManagement getCiManagement() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setCiManagement(org.apache.maven.model.CiManagement) */ public void setCiManagement( CiManagement ciManagement ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getIssueManagement() */ public IssueManagement getIssueManagement() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setDistributionManagement(org.apache.maven.model.DistributionManagement) */ public void setDistributionManagement( DistributionManagement distributionManagement ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDistributionManagement() */ public DistributionManagement getDistributionManagement() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setDescription(java.lang.String) */ public void setDescription( String string ) { this.description = string; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDescription() */ public String getDescription() { return description; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setOrganization(org.apache.maven.model.Organization) */ public void setOrganization( Organization organization ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getOrganization() */ public Organization getOrganization() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm) */ public void setScm( Scm scm ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getScm() */ public Scm getScm() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setMailingLists(java.util.List) */ public void setMailingLists( List list ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getMailingLists() */ public List getMailingLists() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addMailingList(org.apache.maven.model.MailingList) */ public void addMailingList( MailingList mailingList ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setDevelopers(java.util.List) */ public void setDevelopers( List list ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDevelopers() */ public List getDevelopers() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addDeveloper(org.apache.maven.model.Developer) */ public void addDeveloper( Developer developer ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setContributors(java.util.List) */ public void setContributors( List list ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getContributors() */ public List getContributors() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addContributor(org.apache.maven.model.Contributor) */ public void addContributor( Contributor contributor ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setBuild(org.apache.maven.model.Build) */ public void setBuild( Build build ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getBuild() */ public Build getBuild() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getResources() */ public List getResources() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getTestResources() */ public List getTestResources() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addResource(org.apache.maven.model.Resource) */ public void addResource( Resource resource ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addTestResource(org.apache.maven.model.Resource) */ public void addTestResource( Resource resource ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setReporting(org.apache.maven.model.Reporting) */ public void setReporting( Reporting reporting ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getReporting() */ public Reporting getReporting() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setLicenses(java.util.List) */ public void setLicenses( List list ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getLicenses() */ public List getLicenses() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addLicense(org.apache.maven.model.License) */ public void addLicense( License license ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setArtifacts(java.util.Set) */ public void setArtifacts( Set set ) { this.artifacts = set; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getArtifacts() */ public Set getArtifacts() { if ( artifacts == null ) { return Collections.EMPTY_SET; } else { return artifacts; } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getArtifactMap() */ public Map getArtifactMap() { return Collections.singletonMap( "", "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setPluginArtifacts(java.util.Set) */ public void setPluginArtifacts( Set set ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPluginArtifacts() */ public Set getPluginArtifacts() { return Collections.singleton( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPluginArtifactMap() */ public Map getPluginArtifactMap() { return Collections.singletonMap( "", "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setReportArtifacts(java.util.Set) */ public void setReportArtifacts( Set set ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getReportArtifacts() */ public Set getReportArtifacts() { return Collections.singleton( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getReportArtifactMap() */ public Map getReportArtifactMap() { return Collections.singletonMap( "", "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setExtensionArtifacts(java.util.Set) */ public void setExtensionArtifacts( Set set ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getExtensionArtifacts() */ public Set getExtensionArtifacts() { return Collections.singleton( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getExtensionArtifactMap() */ public Map getExtensionArtifactMap() { return Collections.singletonMap( "", "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setParentArtifact(org.apache.maven.artifact.Artifact) */ public void setParentArtifact( Artifact artifact ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getParentArtifact() */ public Artifact getParentArtifact() { if (parent !=null) { return parent.getArtifact(); } else return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getRepositories() */ public List getRepositories() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getReportPlugins() */ public List getReportPlugins() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getBuildPlugins() */ public List getBuildPlugins() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getModules() */ public List getModules() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPluginManagement() */ public PluginManagement getPluginManagement() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addPlugin(org.apache.maven.model.Plugin) */ public void addPlugin( Plugin plugin ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#injectPluginManagementInfo(org.apache.maven.model.Plugin) */ public void injectPluginManagementInfo( Plugin plugin ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getCollectedProjects() */ public List getCollectedProjects() { return collectedProjects; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setCollectedProjects(java.util.List) */ public void setCollectedProjects( List list ) { this.collectedProjects = list; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setPluginArtifactRepositories(java.util.List) */ public void setPluginArtifactRepositories( List list ) { this.pluginArtifactRepositories = list; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPluginArtifactRepositories() */ public List getPluginArtifactRepositories() { return pluginArtifactRepositories; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDistributionManagementArtifactRepository() */ public ArtifactRepository getDistributionManagementArtifactRepository() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getPluginRepositories() */ public List getPluginRepositories() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setActiveProfiles(java.util.List) */ public void setActiveProfiles( List list ) { activeProfiles = list; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getActiveProfiles() */ public List getActiveProfiles() { return activeProfiles; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact) */ public void addAttachedArtifact( Artifact theArtifact ) { if ( attachedArtifacts == null ) { this.attachedArtifacts = Collections.singletonList( theArtifact ); } else { attachedArtifacts.add( theArtifact ); } } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getAttachedArtifacts() */ public List getAttachedArtifacts() { return attachedArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getGoalConfiguration(java.lang.String, java.lang.String, * java.lang.String, java.lang.String) */ public Xpp3Dom getGoalConfiguration( String string, String string1, String string2, String string3 ) { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getReportConfiguration(java.lang.String, java.lang.String, * java.lang.String) */ public Xpp3Dom getReportConfiguration( String string, String string1, String string2 ) { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getExecutionProject() */ public MavenProject getExecutionProject() { return null; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setExecutionProject(org.apache.maven.project.MavenProject) */ public void setExecutionProject( MavenProject mavenProject ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#writeModel(java.io.Writer) */ public void writeModel( Writer writer ) throws IOException { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#writeOriginalModel(java.io.Writer) */ public void writeOriginalModel( Writer writer ) throws IOException { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDependencyArtifacts() */ public Set getDependencyArtifacts() { return dependencyArtifacts; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setDependencyArtifacts(java.util.Set) */ public void setDependencyArtifacts( Set set ) { this.dependencyArtifacts = set; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setReleaseArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) */ public void setReleaseArtifactRepository( ArtifactRepository artifactRepository ) { // this.releaseArtifactRepository = artifactRepository; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setSnapshotArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) */ public void setSnapshotArtifactRepository( ArtifactRepository artifactRepository ) { // this.snapshotArtifactRepository = artifactRepository; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setOriginalModel(org.apache.maven.model.Model) */ public void setOriginalModel( Model model ) { this.originalModel = model; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getOriginalModel() */ public Model getOriginalModel() { return originalModel; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getBuildExtensions() */ public List getBuildExtensions() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory, * java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter) */ public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter ) throws InvalidDependencyVersionException { return Collections.EMPTY_SET; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#addProjectReference(org.apache.maven.project.MavenProject) */ public void addProjectReference( MavenProject mavenProject ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#attachArtifact(java.lang.String, java.lang.String, java.io.File) */ public void attachArtifact( String string, String string1, File theFile ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getProperties() */ public Properties getProperties() { return this.properties; } /** * Sets the property. * * @param key the key * @param value the value */ public void setProperty( String key, String value ) { properties.setProperty( key, value ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getFilters() */ public List getFilters() { return Collections.singletonList( "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getProjectReferences() */ public Map getProjectReferences() { return Collections.singletonMap( "", "" ); } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#isExecutionRoot() */ public boolean isExecutionRoot() { return executionRoot; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#setExecutionRoot(boolean) */ public void setExecutionRoot( boolean b ) { this.executionRoot = b; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#getDefaultGoal() */ public String getDefaultGoal() { return defaultGoal; } /* * (non-Javadoc) * * @see org.apache.maven.project.MavenProject#replaceWithActiveArtifact(org.apache.maven.artifact.Artifact) */ public Artifact replaceWithActiveArtifact( Artifact theArtifact ) { return null; } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergenceTest.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleCon0000664000175000017500000003204613075342666033154 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Dependency; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * Check reactorModuleConvergence rule. * * @author Karl Heinz Marbaise */ public class ReactorModuleConvergenceTest { private MavenProject project; private MavenSession session; private EnforcerRuleHelper helper; private ReactorModuleConvergence rule; @Before public void before() throws ExpressionEvaluationException { project = mock( MavenProject.class ); session = mock( MavenSession.class ); helper = mock( EnforcerRuleHelper.class ); when( helper.evaluate( "${project}" ) ).thenReturn( project ); when( helper.evaluate( "${session}" ) ).thenReturn( session ); when( helper.getLog() ).thenReturn( mock( Log.class ) ); rule = new ReactorModuleConvergence(); } @Test public void shouldNotFailWithNoProject() throws EnforcerRuleException { when( session.getSortedProjects() ).thenReturn( Collections. emptyList() ); rule.execute( helper ); //intentionally only assertTrue cause we don't expect an exception. assertTrue( true ); } @Test public void shouldNotFailWithAValidProject() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject mp2 = createProjectChild1( mp1 ); MavenProject mp3 = createProjectChild2( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally only assertTrue cause we don't expect an exception. assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void shouldFailWithWrongVersionInOneChild() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject mp2 = createProjectChild1( mp1 ); MavenProject mp3 = createProjectChild2WithWrongVersion( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally no assertTrue() cause we expect getting an exception. } @Test( expected = EnforcerRuleException.class ) public void shouldFailWithWrongParent() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject wrongParentVerison = mock( MavenProject.class ); when( wrongParentVerison.getGroupId() ).thenReturn( "org.apache.enforcer" ); when( wrongParentVerison.getArtifactId() ).thenReturn( "m1" ); when( wrongParentVerison.getVersion() ).thenReturn( "1.1-SNAPSHOT" ); when( wrongParentVerison.getId() ).thenReturn( "org.apache.enforcer:m1:jar:1.1-SNAPSHOT" ); when( wrongParentVerison.getDependencies() ).thenReturn( Collections.emptyList() ); MavenProject mp2 = createProjectChild2( wrongParentVerison ); MavenProject mp3 = createProjectChild2( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally no assertTrue() cause we expect getting an exception. } @Test public void shouldNotFailWithACompanyParent() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject companyParent = createCompanyParent(); MavenProject mp1 = createProjectParent( companyParent ); MavenProject mp2 = createProjectChild1( mp1 ); MavenProject mp3 = createProjectChild2( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally only assertTrue cause we don't expect an exception. assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void shouldFailWithMissingParentsInReactory() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject mp2 = createProjectChild1( mp1 ); MavenProject mp3 = createProjectChild2( null ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally only assertTrue cause we don't expect an exception. assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void shouldFailWithAParentWhichIsNotPartOfTheReactory() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject wrongParentVerison = mock( MavenProject.class ); when( wrongParentVerison.getGroupId() ).thenReturn( "org.apache" ); when( wrongParentVerison.getArtifactId() ).thenReturn( "m1" ); when( wrongParentVerison.getVersion() ).thenReturn( "1.0-SNAPSHOT" ); when( wrongParentVerison.getId() ).thenReturn( "org.apache.enforcer:m1:jar:1.0-SNAPSHOT" ); when( wrongParentVerison.getDependencies() ).thenReturn( Collections.emptyList() ); MavenProject mp2 = createProjectChild2( wrongParentVerison ); MavenProject mp3 = createProjectChild2( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally no assertTrue() cause we expect getting an exception. } @Test public void shouldNotFailWithDependencyInReactory() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject mp2 = createProjectChild1( mp1 ); Dependency goodDependency = createDependency( "org.junit", "junit", "2.0" ); List depListMP2 = Arrays.asList( goodDependency ); when( mp2.getDependencies() ).thenReturn( depListMP2 ); MavenProject mp3 = createProjectChild2( mp1 ); Dependency dep1_MP3 = createDependency( "org.apache.commons", "commons-io", "1.0.4" ); List depListMP3 = Arrays.asList( dep1_MP3 ); when( mp3.getDependencies() ).thenReturn( depListMP3 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally no assertTrue() cause we do not expect to get an exception. assertTrue( true ); } @Test( expected = EnforcerRuleException.class ) public void shouldFailWithWrongDependencyInReactor() throws EnforcerRuleException, ExpressionEvaluationException { MavenProject mp1 = createProjectParent(); MavenProject mp2 = createProjectChild1( mp1 ); Dependency goodDependency = createDependency( "org.junit", "junit", "2.0" ); Dependency wrongDepFromReactor = createDependency( "org.apache.enforcer", "m2", "1.1-SNAPSHOT" ); List depList = Arrays.asList( goodDependency, wrongDepFromReactor ); when( mp2.getDependencies() ).thenReturn( depList ); MavenProject mp3 = createProjectChild2( mp1 ); List theList = Arrays.asList( mp1, mp2, mp3 ); when( session.getSortedProjects() ).thenReturn( theList ); rule.execute( helper ); //intentionally no assertTrue() cause we expect getting an exception. } /** * This small setup is equivalent to the following situation: * *
     *  <parent>
     *    <groupId>...</groupId>
     *    <artifactId>...</artifactId>
     *    <version>1.0-SNAPSHOT</version>
     *  </parent>
     *  
     *  <version>1.1-SNAPSHOT</version>
     * 
* * @param parent * @return Create MavenProject mock. */ private MavenProject createProjectChild2WithWrongVersion( MavenProject parent ) { MavenProject mp2 = mock( MavenProject.class ); when( mp2.getParent() ).thenReturn( parent ); when( mp2.getGroupId() ).thenReturn( "org.apache.enforcer" ); when( mp2.getArtifactId() ).thenReturn( "m1" ); when( mp2.getVersion() ).thenReturn( "1.1-SNAPSHOT" ); when( mp2.getId() ).thenReturn( "org.apache.enforcer:m1:jar:1.1-SNAPSHOT" ); when( mp2.getDependencies() ).thenReturn( Collections.emptyList() ); return mp2; } private MavenProject createProjectChild2( MavenProject parent ) { MavenProject mp3 = mock( MavenProject.class ); when( mp3.getParent() ).thenReturn( parent ); when( mp3.getGroupId() ).thenReturn( "org.apache.enforcer" ); when( mp3.getArtifactId() ).thenReturn( "m2" ); when( mp3.getVersion() ).thenReturn( "1.0-SNAPSHOT" ); when( mp3.getId() ).thenReturn( "org.apache.enforcer:m2:jar:1.0-SNAPSHOT" ); when( mp3.getDependencies() ).thenReturn( Collections.emptyList() ); return mp3; } private MavenProject createProjectChild1( MavenProject parent ) { MavenProject mp2 = mock( MavenProject.class ); when( mp2.getParent() ).thenReturn( parent ); when( mp2.getGroupId() ).thenReturn( "org.apache.enforcer" ); when( mp2.getArtifactId() ).thenReturn( "m1" ); when( mp2.getVersion() ).thenReturn( "1.0-SNAPSHOT" ); when( mp2.getId() ).thenReturn( "org.apache.enforcer:m1:jar:1.0-SNAPSHOT" ); when( mp2.getDependencies() ).thenReturn( Collections.emptyList() ); return mp2; } private MavenProject createCompanyParent() { MavenProject nonReactorParent = mock( MavenProject.class ); when( nonReactorParent.getGroupId() ).thenReturn("org.apache.enforcer.parent"); when( nonReactorParent.getArtifactId() ).thenReturn("parent"); when( nonReactorParent.getVersion() ).thenReturn( "1.1" ); when( nonReactorParent.getId() ).thenReturn("org.apache.enforcer.parent:parent:jar:1.1"); when( nonReactorParent.getDependencies() ).thenReturn(Collections.emptyList()); return nonReactorParent; } private MavenProject createProjectParent( MavenProject nonReactorParent ) { MavenProject m = createProjectParent(); when( m.isExecutionRoot() ).thenReturn( true ); when( m.getParent() ).thenReturn( nonReactorParent ); return m; } private MavenProject createProjectParent() { MavenProject mp1 = mock( MavenProject.class ); when( mp1.isExecutionRoot() ).thenReturn( true ); when( mp1.getParent() ).thenReturn( null ); when( mp1.getGroupId() ).thenReturn( "org.apache.enforcer" ); when( mp1.getArtifactId() ).thenReturn( "parent" ); when( mp1.getVersion() ).thenReturn( "1.0-SNAPSHOT" ); when( mp1.getId() ).thenReturn( "org.apache.enforcer:parent:pom:1.0-SNAPSHOT" ); when( mp1.getDependencies() ).thenReturn( Collections.emptyList() ); return mp1; } private Dependency createDependency( String groupId, String artifactId, String version ) { Dependency dep = mock( Dependency.class ); when( dep.getGroupId() ).thenReturn( groupId ); when( dep.getArtifactId() ).thenReturn( artifactId ); when( dep.getVersion() ).thenReturn( version ); return dep; } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.j0000664000175000017500000000270611242355031033053 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; /** * Test AlwaysFail rule. * @author Ben Lidgey * @see AlwaysFail */ public class TestAlwaysFail extends TestCase { public void testExecute() { final AlwaysFail rule = new AlwaysFail(); try { // execute rule -- should throw EnforcerRuleException rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should throw EnforcerRuleException" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockPathTranslator.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockPathTranslat0000664000175000017500000000431312445342642033154 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.apache.maven.model.Model; import org.apache.maven.project.path.PathTranslator; /** * The Class MockPathTranslator. * * @author Brian Fox */ public class MockPathTranslator implements PathTranslator { /* * (non-Javadoc) * * @see org.apache.maven.project.path.PathTranslator#alignToBaseDirectory(org.apache.maven.model.Model, * java.io.File) */ public void alignToBaseDirectory( Model theModel, File theBasedir ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.path.PathTranslator#alignToBaseDirectory(java.lang.String, java.io.File) */ public String alignToBaseDirectory( String thePath, File theBasedir ) { return theBasedir.getAbsolutePath(); } /* * (non-Javadoc) * * @see org.apache.maven.project.path.PathTranslator#unalignFromBaseDirectory(org.apache.maven.model.Model, * java.io.File) */ public void unalignFromBaseDirectory( Model theModel, File theBasedir ) { } /* * (non-Javadoc) * * @see org.apache.maven.project.path.PathTranslator#unalignFromBaseDirectory(java.lang.String, java.io.File) */ public String unalignFromBaseDirectory( String theDirectory, File theBasedir ) { return theBasedir.getAbsolutePath(); } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequis0000664000175000017500000001237312416344524033255 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.util.Collections; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Prerequisites; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.Before; import org.junit.Test; public class RequirePrerequisiteTest { private MavenProject project; private EnforcerRuleHelper helper; @Before public void before() throws ExpressionEvaluationException { project = mock( MavenProject.class ); when( project.getPackaging() ).thenReturn( "maven-plugin" ); helper = mock( EnforcerRuleHelper.class ); when( helper.evaluate( "${project}" ) ).thenReturn( project ); } @Test( expected = EnforcerRuleException.class ) public void testNoPrerequisite() throws Exception { RequirePrerequisite rule = new RequirePrerequisite(); rule.execute( helper ); } @Test public void testNoSpecifiedPrerequisite() throws Exception { when( project.getPrerequisites() ).thenReturn( new Prerequisites() ); RequirePrerequisite rule = new RequirePrerequisite(); rule.execute( helper ); } @Test( expected = EnforcerRuleException.class ) public void testLowerMavenPrerequisite() throws Exception { when( project.getPrerequisites() ).thenReturn( new Prerequisites() ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setMavenVersion( "3.0" ); rule.execute( helper ); } @Test( expected = EnforcerRuleException.class ) public void testLowerMavenRangePrerequisite() throws Exception { when( project.getPrerequisites() ).thenReturn( new Prerequisites() ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setMavenVersion( "[3.0,)" ); rule.execute( helper ); } @Test( expected = EnforcerRuleException.class ) public void testMavenRangesPrerequisite() throws Exception { Prerequisites prerequisites = new Prerequisites(); prerequisites.setMaven( "2.2.0" ); when( project.getPrerequisites() ).thenReturn( prerequisites ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setMavenVersion( "[2.0.6,2.1.0),(2.1.0,2.2.0),(2.2.0,)" ); rule.execute( helper ); } @Test public void testValidPrerequisite() throws Exception { Prerequisites prerequisites = new Prerequisites(); prerequisites.setMaven( "3.0" ); when( project.getPrerequisites() ).thenReturn( prerequisites ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setMavenVersion( "2.2.1" ); rule.execute( helper ); } @Test public void testPomPackaging() throws Exception { when( project.getPackaging() ).thenReturn( "pom" ); Log log = mock( Log.class ); when( helper.getLog() ).thenReturn( log ); RequirePrerequisite rule = new RequirePrerequisite(); rule.execute( helper ); verify( log ).debug( "Packaging is pom, skipping requirePrerequisite rule" ); } @Test( expected = EnforcerRuleException.class ) public void testMatchingPackagings() throws Exception { when( project.getPackaging() ).thenReturn( "maven-plugin" ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setPackagings( Collections.singletonList( "maven-plugin" ) ); rule.execute( helper ); } @Test public void testNotMatchingPackagings() throws Exception { when( project.getPackaging() ).thenReturn( "jar" ); Log log = mock( Log.class ); when( helper.getLog() ).thenReturn( log ); RequirePrerequisite rule = new RequirePrerequisite(); rule.setPackagings( Collections.singletonList( "maven-plugin" ) ); rule.execute( helper ); verify( log ).debug( "Packaging is jar, skipping requirePrerequisite rule" ); } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestNoSnapshots.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestNoSnapshots.0000664000175000017500000000551512161273406033133 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import java.util.Set; import junit.framework.TestCase; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.TestEnforcerRuleUtils; import org.apache.maven.project.MavenProject; /** * The Class TestNoSnapshots. * * @author Brian Fox */ public class TestNoSnapshots extends TestCase { /** * Test rule. * * @throws IOException Signals that an I/O exception has occurred. */ public void testRule() throws IOException { ArtifactStubFactory factory = new ArtifactStubFactory(); MockProject project = new MockProject(); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); project.setArtifacts( factory.getMixedArtifacts() ); project.setDependencyArtifacts( factory.getScopedArtifacts() ); NoSnapshots rule = newNoSnapshots(); rule.setSearchTransitive( false ); TestEnforcerRuleUtils.execute( rule, helper, false ); rule.setSearchTransitive( true ); TestEnforcerRuleUtils.execute( rule, helper, true ); project.setArtifact( factory.getSnapshotArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, true ); } private NoSnapshots newNoSnapshots() { NoSnapshots rule = new NoSnapshots() { protected Set getDependenciesToCheck( MavenProject project ) { // the integration with dependencyGraphTree is verified with the integration tests // for unit-testing return isSearchTransitive() ? project.getArtifacts() : project.getDependencyArtifacts(); } }; return rule; } /** * Test id. */ public void testId() { NoSnapshots rule = newNoSnapshots(); rule.getCacheId(); } } ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVersionEnforcer.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVers0000664000175000017500000001662711242355031033201 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.logging.SystemStreamLog; // TODO: Auto-generated Javadoc /** * The Class TestAbstractVersionEnforcer. * * @author Brian Fox */ public class TestAbstractVersionEnforcer extends TestCase { /** * Test contains version. * * @throws InvalidVersionSpecificationException the invalid version specification exception */ public void testContainsVersion() throws InvalidVersionSpecificationException { ArtifactVersion version = new DefaultArtifactVersion( "2.0.5" ); // test ranges assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.5,)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.4,)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.4,2.0.5]" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.4,2.0.6]" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.4,2.0.6)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0,)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.0,)" ), version ) ); // not matching versions assertFalse( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.4,2.0.5)" ), version ) ); assertFalse( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.0.6,)" ), version ) ); assertFalse( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "(2.0.5,)" ), version ) ); // test singular versions -> 2.0.5 == [2.0.5,) or x >= 2.0.5 assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "2.0" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "2.0.4" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "2.0.5" ), version ) ); assertFalse( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "2.0.6" ), version ) ); version = new DefaultArtifactVersion( "1.5.0-7" ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[1.5.0,)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[1.5,1.6)" ), version ) ); version = new DefaultArtifactVersion( RequireJavaVersion.normalizeJDKVersion( "1.5.0-07" ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[1.5.0,)" ), version ) ); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[1.5,1.6)" ), version ) ); //MENFORCER-50 version = new DefaultArtifactVersion ("2.1.0-M1-RC12"); assertTrue( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.1.0-M1-RC12,)" ), version ) ); assertFalse( AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( "[2.1.0-M1,)" ), version ) ); } /** * Enforce false. * * @param rule the rule * @param log the log * @param var the var * @param range the range * @param version the version */ private void enforceFalse( AbstractVersionEnforcer rule, Log log, String var, String range, ArtifactVersion version ) { try { rule.enforceVersion( log, var, range, version ); fail( "Expected to receive EnforcerRuleException because:" + version + " is not contained by " + range ); } catch ( Exception e ) { if ( e instanceof EnforcerRuleException ) { // log.info( "Caught Expected Exception: " + // e.getLocalizedMessage() ); } else { fail( "Received wrong exception. Expected EnforcerRuleExeption. Received:" + e.toString() ); } } } /** * Test enforce version. */ public void testEnforceVersion() { RequireMavenVersion rule = new RequireMavenVersion(); ArtifactVersion version = new DefaultArtifactVersion( "2.0.5" ); SystemStreamLog log = new SystemStreamLog(); // test ranges // not matching versions try { rule.enforceVersion( log, "test", "[2.0.5,)", version ); rule.enforceVersion( log, "test", "[2.0.4,)", version ); rule.enforceVersion( log, "test", "[2.0.4,2.0.5]", version ); rule.enforceVersion( log, "test", "[2.0.4,2.0.6]", version ); rule.enforceVersion( log, "test", "[2.0.4,2.0.6)", version ); rule.enforceVersion( log, "test", "[2.0,)", version ); rule.enforceVersion( log, "test", "[2.0.0,)", version ); // test singular versions -> 2.0.5 == [2.0.5,) or x >= 2.0.5 rule.enforceVersion( log, "test", "2.0", version ); rule.enforceVersion( log, "test", "2.0.4", version ); rule.enforceVersion( log, "test", "2.0.5", version ); } catch ( Exception e ) { fail( "No Exception expected. Caught:" + e.getLocalizedMessage() ); } enforceFalse( rule, log, "test", "[2.0.6,)", version ); enforceFalse( rule, log, "test", "(2.0.5,)", version ); enforceFalse( rule, log, "test", "2.0.6", version ); enforceFalse( rule, log, "test", "[2.0.4,2.0.5)", version ); // make sure to handle the invalid range specification enforceFalse( rule, log, "test", "[[2.0.4,2.0.5)", version ); } } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvironmentVariable.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvir0000775000175000017500000000632412157410307033216 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; /** * Unit test for {@link RequireEnvironmentVariable}} * * @author Marvin Froeder */ public class TestRequireEnvironmentVariable extends TestCase { /** * Test rule. * * @throws EnforcerRuleException the enforcer rule exception */ public void testRule() throws EnforcerRuleException { MockProject project = new MockProject(); project.setProperty( "testProp", "This is a test." ); EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project ); RequireEnvironmentVariable rule = new RequireEnvironmentVariable(); // this env variable should not be set rule.setVariableName( "JUNK" ); try { rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { // expected to catch this. } // PATH shall be common to windows and linux rule.setVariableName( "PATH" ); try { rule.execute( helper ); } catch ( EnforcerRuleException e ) { fail( "This should not throw an exception" ); } } /** * Test rule with regex. * * @throws EnforcerRuleException the enforcer rule exception */ public void testRuleWithRegex() throws EnforcerRuleException { EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); RequireEnvironmentVariable rule = new RequireEnvironmentVariable(); rule.setVariableName( "PATH" ); // This expression should not match the property // value rule.setRegex( "[^abc]" ); try { rule.execute( helper ); fail( "Expected an exception." ); } catch ( EnforcerRuleException e ) { // expected to catch this. } // can't really predict what a PATH will looks like, just enforce it ain't empty rule.setRegex( ".{1,}" ); try { rule.execute( helper ); } catch ( EnforcerRuleException e ) { fail( "This should not throw an exception" ); } } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedRepositories.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedReposi0000664000175000017500000001234412347363553033156 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.PlexusTestCase; /** * Test the "banned repositories" rule. * * @author Simon Wang */ public class TestBannedRepositories extends PlexusTestCase { private EnforcerRuleHelper helper; private BannedRepositories rule; private MockProject project; public void setUp() throws Exception { super.setUp(); rule = new BannedRepositories(); rule.setMessage( "my message" ); project = new MockProject(); project.setGroupId( "org.apache.maven.plugins.enforcer.test" ); project.setVersion( "1.0-SNAPSHOT" ); helper = EnforcerTestUtils.getHelper( project ); } public void testNoCheckRules() throws EnforcerRuleException { DefaultArtifactRepository repo1 = new DefaultArtifactRepository( "repo1", "http://repo1/", null ); List repos = new ArrayList(); repos.add( repo1 ); project.setRemoteArtifactRepositories( repos ); project.setPluginArtifactRepositories( repos ); rule.execute( helper ); } public void testBannedRepositories() { DefaultArtifactRepository repo1 = new DefaultArtifactRepository( "repo1", "http://repo1/", null ); DefaultArtifactRepository repo2 = new DefaultArtifactRepository( "repo1", "http://repo1/test", null ); DefaultArtifactRepository repo3 = new DefaultArtifactRepository( "repo1", "http://repo2/test", null ); List repos = new ArrayList(); repos.add( repo1 ); repos.add( repo2 ); repos.add( repo3 ); project.setRemoteArtifactRepositories( repos ); project.setPluginArtifactRepositories( repos ); List bannedRepositories = new ArrayList(); String pattern1 = "http://repo1/*"; bannedRepositories.add( pattern1 ); rule.setBannedRepositories( bannedRepositories ); try { rule.execute( helper ); fail( "should throw exception" ); } catch ( EnforcerRuleException e ) { } } public void testAllowedRepositoriesAllOK() throws EnforcerRuleException { DefaultArtifactRepository repo1 = new DefaultArtifactRepository( "repo1", "http://repo1/", null ); DefaultArtifactRepository repo2 = new DefaultArtifactRepository( "repo1", "http://repo1/test", null ); List repos = new ArrayList(); repos.add( repo1 ); repos.add( repo2 ); project.setRemoteArtifactRepositories( repos ); project.setPluginArtifactRepositories( repos ); List bannedRepositories = new ArrayList(); String pattern1 = "http://repo1/*"; bannedRepositories.add( pattern1 ); rule.setAllowedRepositories( bannedRepositories ); rule.setAllowedPluginRepositories( bannedRepositories ); rule.execute( helper ); } public void testAllowedRepositoriesException() { DefaultArtifactRepository repo1 = new DefaultArtifactRepository( "repo1", "http://repo1/", null ); DefaultArtifactRepository repo2 = new DefaultArtifactRepository( "repo1", "http://repo1/test", null ); DefaultArtifactRepository repo3 = new DefaultArtifactRepository( "repo1", "http://repo2/test", null ); List repos = new ArrayList(); repos.add( repo1 ); repos.add( repo2 ); repos.add( repo3 ); project.setRemoteArtifactRepositories( repos ); project.setPluginArtifactRepositories( repos ); List patterns = new ArrayList(); String pattern1 = "http://repo1/*"; patterns.add( pattern1 ); rule.setAllowedPluginRepositories( patterns ); rule.setAllowedRepositories( patterns ); try { rule.execute( helper ); fail( "should throw exception" ); } catch ( EnforcerRuleException e ) { } } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnapshotVersion.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnaps0000664000175000017500000000622212770317331033215 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.TestEnforcerRuleUtils; import org.apache.maven.project.MavenProject; import org.junit.Before; import org.junit.Test; import java.io.IOException; /** * Test class for the RequireSnapshotVersion rule. */ public class TestRequireSnapshotVersion { private MavenProject project; private EnforcerRuleHelper helper; private ArtifactStubFactory factory; private RequireSnapshotVersion rule; @Before public void before() { project = new MockProject(); helper = EnforcerTestUtils.getHelper( project ); factory = new ArtifactStubFactory(); rule = new RequireSnapshotVersion(); } @Test public void testRequireSnapshot() throws IOException { project.setArtifact( factory.getReleaseArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, true ); project.setArtifact( factory.getSnapshotArtifact() ); TestEnforcerRuleUtils.execute( rule, helper, false ); } @Test public void testWithParentShouldFail() throws IOException { project.setArtifact( factory.getSnapshotArtifact() ); rule.setFailWhenParentIsRelease( true ); MockProject parent = new MockProject(); parent.setArtifact( factory.getReleaseArtifact() ); project.setParent( parent ); TestEnforcerRuleUtils.execute( rule, helper, true ); parent = new MockProject(); parent.setArtifact( factory.getSnapshotArtifact() ); project.setParent( parent ); TestEnforcerRuleUtils.execute( rule, helper, false ); } @Test public void testWithParentShouldPass() throws IOException { project.setArtifact( factory.getSnapshotArtifact() ); rule.setFailWhenParentIsRelease( false ); MockProject parent = new MockProject(); parent.setArtifact( factory.getReleaseArtifact() ); project.setParent( parent ); TestEnforcerRuleUtils.execute( rule, helper, false ); parent = new MockProject(); parent.setArtifact( factory.getSnapshotArtifact() ); project.setParent( parent ); TestEnforcerRuleUtils.execute( rule, helper, false ); } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileChecksum.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileC0000664000175000017500000001601113016402410033073 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.codehaus.plexus.util.FileUtils; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; /** * Test the "RequireFileChecksum" rule * * @author Lyubomyr Shaydariv */ public class TestRequireFileChecksum { private RequireFileChecksum rule = new RequireFileChecksum(); @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule public ExpectedException expectedException = ExpectedException.none(); @Test public void testFileChecksumMd5() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "78e731027d8fd50ed642340b7c9a63b3" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5UpperCase() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "78E731027D8FD50ED642340B7C9A63B3" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5NoFileFailure() throws IOException, EnforcerRuleException { File f = new File( "foo" ) { private static final long serialVersionUID = 6987790643999338089L; @Override public boolean canRead() { return false; } }; expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "Cannot read file: " + f.getAbsolutePath() ); rule.setFile( f ); rule.setChecksum( "78e731027d8fd50ed642340b7c9a63b3" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5GivenFileIsADirectoryFailure() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFolder(); expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "Cannot read file: " + f.getAbsolutePath() ); rule.setFile( f ); rule.setChecksum( "78e731027d8fd50ed642340b7c9a63b3" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5NoFileSpecifiedFailure() throws IOException, EnforcerRuleException { expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "Input file unspecified" ); rule.setChecksum( "78e731027d8fd50ed642340b7c9a63b3" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5NoChecksumSpecifiedFailure() throws IOException, EnforcerRuleException { expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "Checksum unspecified" ); File f = temporaryFolder.newFile(); rule.setFile( f ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5NoTypeSpecifiedFailure() throws IOException, EnforcerRuleException { expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "Hash type unspecified" ); File f = temporaryFolder.newFile(); rule.setFile( f ); rule.setChecksum( "78e731027d8fd50ed642340b7c9a63b3" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumMd5ChecksumMismatchFailure() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); expectedException.expect( EnforcerRuleException.class ); expectedException.expectMessage( "md5 hash of " + f.getAbsolutePath() + " was 78e731027d8fd50ed642340b7c9a63b3 but expected ffeeddccbbaa99887766554433221100" ); rule.setFile( f ); rule.setChecksum( "ffeeddccbbaa99887766554433221100" ); rule.setType( "md5" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumSha1() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "6f9b9af3cd6e8b8a73c2cdced37fe9f59226e27d" ); rule.setType( "sha1" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumSha256() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "ab530a13e45914982b79f9b7e3fba994cfd1f3fb22f71cea1afbf02b460c6d1d" ); rule.setType( "sha256" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumSha384() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "353eb7516a27ef92e96d1a319712d84b902eaa828819e53a8b09af7028103a9978ba8feb6161e33c3619c5da4c4666a5" ); rule.setType( "sha384" ); rule.execute( EnforcerTestUtils.getHelper() ); } @Test public void testFileChecksumSha512() throws IOException, EnforcerRuleException { File f = temporaryFolder.newFile(); FileUtils.fileWrite( f, "message" ); rule.setFile( f ); rule.setChecksum( "f8daf57a3347cc4d6b9d575b31fe6077e2cb487f60a96233c08cb479dbf31538cc915ec6d48bdbaa96ddc1a16db4f4f96f37276cfcb3510b8246241770d5952c" ); rule.setType( "sha512" ); rule.execute( EnforcerTestUtils.getHelper() ); } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.javamaven-enforcer-1.4.2/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFiles0000664000175000017500000000753312416337542033204 0ustar ebourgebourgpackage org.apache.maven.plugins.enforcer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import junit.framework.TestCase; /** * Test the "require files don't exist" rule. * * @author Brian Fox */ public class TestRequireFilesDontExist extends TestCase { RequireFilesDontExist rule = new RequireFilesDontExist(); public void testFileExists() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.deleteOnExit(); rule.setFiles( new File[] { f } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Expected an Exception." ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } f.delete(); } public void testEmptyFile() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testEmptyFileAllowNull() throws EnforcerRuleException, IOException { rule.setFiles( new File[] { null } ); rule.setAllowNulls( true ); try { rule.execute( EnforcerTestUtils.getHelper() ); } catch ( EnforcerRuleException e ) { fail( "Unexpected Exception:" + e.getLocalizedMessage() ); } } public void testEmptyFileList() throws EnforcerRuleException, IOException { rule.setFiles( new File[] {} ); assertEquals( 0, rule.getFiles().length ); try { rule.execute( EnforcerTestUtils.getHelper() ); fail( "Should get exception" ); } catch ( EnforcerRuleException e ) { assertTrue( true ); } } public void testEmptyFileListAllowNull() throws EnforcerRuleException, IOException { rule.setFiles( new File[] {} ); assertEquals( 0, rule.getFiles().length ); rule.setAllowNulls( true ); try { rule.execute( EnforcerTestUtils.getHelper() ); } catch ( EnforcerRuleException e ) { fail( "Unexpected Exception:" + e.getLocalizedMessage() ); } } public void testFileDoesNotExist() throws EnforcerRuleException, IOException { File f = File.createTempFile( "enforcer", "tmp" ); f.delete(); assertTrue( !f.exists() ); rule.setFiles( new File[] { f } ); rule.execute( EnforcerTestUtils.getHelper() ); } /** * Test id. */ public void testId() { rule.getCacheId(); } } maven-enforcer-1.4.2/enforcer-rules/src/test/resources/0000775000175000017500000000000013133666303022476 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/0000775000175000017500000000000013133666303027057 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/no-repositories/0000775000175000017500000000000013133666303032220 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/no-repositories/child/0000775000175000017500000000000013133666303033303 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/no-repositories/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/no-repositories/child/p0000664000175000017500000000242712166625524033477 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test no-repositories 1.0-SNAPSHOT no-repositories-child maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/no-repositories/pom.xml0000664000175000017500000000230412166625524033541 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test no-repositories 1.0-SNAPSHOT maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/0000775000175000017500000000000013133666303032557 5ustar ebourgebourg././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/child/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/child0000775000175000017500000000000013133666303033563 5ustar ebourgebourg././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/child0000664000175000017500000000243312166625524033574 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test with-repositories 1.0-SNAPSHOT with-repositories-child ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-repositories/pom.x0000664000175000017500000000251112166625524033547 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test with-repositories 1.0-SNAPSHOT repo http://example.com/repo ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositories/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositorie0000775000175000017500000000000013133666303033611 5ustar ebourgebourg././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositories/child/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositorie0000775000175000017500000000000013133666303033611 5ustar ebourgebourg././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositories/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositorie0000664000175000017500000000245112166625524033622 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test with-plugin-repositories 1.0-SNAPSHOT with-plugin-repositories-child ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositories/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/with-plugin-repositorie0000664000175000017500000000255012166625524033622 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test with-plugin-repositories 1.0-SNAPSHOT repo http://example.com/repo ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-repositories/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-reposit0000775000175000017500000000000013133666303033616 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-repositories/child/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-reposit0000775000175000017500000000000013133666303033616 5ustar ebourgebourg././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-repositories/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-reposit0000664000175000017500000000246112166625524033630 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test snapshot-plugin-repositories 1.0-SNAPSHOT snapshot-plugin-repositories-child ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-repositories/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-plugin-reposit0000664000175000017500000000276512166625524033637 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test snapshot-plugin-repositories 1.0-SNAPSHOT repo http://example.com/repo false true maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/0000775000175000017500000000000013133666303033443 5ustar ebourgebourg././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/child/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/c0000775000175000017500000000000013133666303033606 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/c0000664000175000017500000000244312166625524033620 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test snapshot-repositories 1.0-SNAPSHOT snapshot-repositories-child ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requireNoRepositories/snapshot-repositories/p0000664000175000017500000000272612166625524033641 0ustar ebourgebourg org.apache.maven.plugins.enforcer.test snapshot-repositories 1.0-SNAPSHOT repo http://example.com/repo false true maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/0000775000175000017500000000000013133666303027062 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/0000775000175000017500000000000013133666303032433 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/child/0000775000175000017500000000000013133666303033516 5ustar ebourgebourg././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/child/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/child/0000664000175000017500000000266512166625524033536 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parentExpression 1.0-SNAPSHOT ${project.parent.groupId} child ${project.parent.version} MENFORCER-30 ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentExpression/pom.xm0000664000175000017500000000242412166625524033603 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parentExpression 1.0-SNAPSHOT MENFORCER-30 ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginVersionProfile/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginVersionProfi0000775000175000017500000000000013133666303033605 5ustar ebourgebourg././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginVersionProfile/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginVersionProfi0000664000175000017500000000557512166625524033630 0ustar ebourgebourg 4.0.0 a group 1.0 2.2-SNAPSHOT RELEASE LATEST SNAPSHOT org.apache.maven.plugins maven-enforcer-plugin 1.0-${my.snap} enforce none prof org.apache.maven.plugins maven-site-plugin RELEASE site validate maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/0000775000175000017500000000000013133666303032552 5ustar ebourgebourg././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/pom.x0000664000175000017500000000246312166625524033550 0ustar ebourgebourg a group 1.0 org.apache.maven.plugins maven-dependency-plugin maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/0000775000175000017500000000000013133666303032773 5ustar ebourgebourg././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/pom0000664000175000017500000000254212166625524033521 0ustar ebourgebourg a group 1.0 b org.apache.maven.plugins maven-clean-plugin maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/c/0000775000175000017500000000000013133666303033215 5ustar ebourgebourg././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/c/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/getPomRecursively/b/c/p0000664000175000017500000000262412166625524033410 0ustar ebourgebourg b group 1.0 c org.apache.maven.plugins maven-deploy-plugin maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/0000775000175000017500000000000013133666303032664 5ustar ebourgebourg././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/pom.0000664000175000017500000000266512166625524033476 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parent 1.0-SNAPSHOT parent/pom.xml org.apache.maven.plugins.enforcer.test aggregate 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/parent/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/pare0000775000175000017500000000000013133666303033534 5ustar ebourgebourg././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/parent/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePath/pare0000664000175000017500000000240012166625524033537 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parent 1.0-SNAPSHOT pom ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginPropertyVersion/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginPropertyVers0000775000175000017500000000000013133666303033644 5ustar ebourgebourg././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginPropertyVersion/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/checkPluginPropertyVers0000664000175000017500000000576512166625524033670 0ustar ebourgebourg 4.0.0 a group 1.0 2.2-SNAPSHOT RELEASE LATEST SNAPSHOT org.apache.maven.plugins maven-install-plugin ${my.latest} org.apache.maven.plugins maven-clean-plugin ${my.release} org.apache.maven.plugins maven-jar-plugin ${my.version} org.apache.maven.plugins maven-enforcer-plugin 1.0-${my.snap} enforce org.apache.maven.plugins:maven-enforcer-plugin ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirectory/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirec0000775000175000017500000000000013133666303033554 5ustar ebourgebourg././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirectory/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirec0000664000175000017500000000265512166625524033573 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parent 1.0-SNAPSHOT parent org.apache.maven.plugins.enforcer.test aggregate 1.0-SNAPSHOT ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirectory/parent/maven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirec0000775000175000017500000000000013133666303033554 5ustar ebourgebourg././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirectory/parent/pom.xmlmaven-enforcer-1.4.2/enforcer-rules/src/test/resources/requirePluginVersions/parentRelativePathDirec0000664000175000017500000000240012166625524033557 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.enforcer.test parent 1.0-SNAPSHOT pom maven-enforcer-1.4.2/LICENSE0000664000175000017500000002613612166077714015007 0ustar ebourgebourg Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed 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. maven-enforcer-1.4.2/README.TXT0000664000175000017500000000147212164123667015331 0ustar ebourgebourgDeploying web site ------------------- You can use the deploySite(.sh|.bat) script Without any profile, the site will be deployed to http://maven.apache.org/enforcer-archives/enforcer-${project.version} sh ./deploySite.sh -Preporting To deploy main version http://maven.apache.org/enforcer, use sh ./deploySite.sh -Preporting -Psite-release Note you can add arguments to the script to pass your svn credentials: -Dusername= -Dpassword= Workflow for site when releasing -------------------------------- Once release staged, you can publish a staged site. cd target/checkout sh ./deploySite.sh -Preporting content will be in http://maven.apache.org/enforcer-archives/enforcer-${project.version} Once vote passed, redeploy main site: cd target/checkout (or use the version tag) sh ./deploySite.sh -Preporting -Psite-release maven-enforcer-1.4.2/deploySite.sh0000775000175000017500000000155112566366204016453 0ustar ebourgebourg#!/bin/sh # # 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. # mvn -Preporting clean site site:stage $@ mvn scm-publish:publish-scm $@ maven-enforcer-1.4.2/enforcer-api/0000775000175000017500000000000013133666303016335 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/pom.xml0000664000175000017500000000540713122035147017652 0ustar ebourgebourg 4.0.0 org.apache.maven.enforcer enforcer 1.4.2 enforcer-api jar Apache Maven Enforcer API This component provides the generic interfaces needed to implement custom rules for the maven-enforcer-plugin. org.apache.maven maven-plugin-api org.codehaus.plexus plexus-container-default 1.0-alpha-9 com.google.code.findbugs jsr305 3.0.0 provided org.apache.maven.plugins maven-assembly-plugin custom-rule pre-site single custom-rule target/site src/main/assembly/custom-rule-sample.xml false maven-enforcer-1.4.2/enforcer-api/src/0000775000175000017500000000000013133666303017124 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/0000775000175000017500000000000013133666303022662 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/usage-pom.xml0000664000175000017500000000473412166625524025316 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins maven-enforcer-plugin-sample-usage 1 jar org.apache.maven.plugins maven-enforcer-plugin 1.0-beta-1 custom-rule custom-rule-sample 1.0 enforce false enforce maven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/pom.xml0000664000175000017500000000500012166625524024177 0ustar ebourgebourg 4.0.0 custom-rule custom-rule-sample jar 1.0 My Custom Rule This is my custom rule. 1.0-beta-1 2.0.9 org.apache.maven.enforcer enforcer-api ${api.version} org.apache.maven maven-project ${maven.version} org.apache.maven maven-core ${maven.version} org.apache.maven maven-artifact ${maven.version} org.apache.maven maven-plugin-api ${maven.version} org.codehaus.plexus plexus-container-default 1.0-alpha-9 junit junit 3.8.1 test maven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/0000775000175000017500000000000013133666303023451 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/usage-pom.xml0000664000175000017500000000430212166625524026074 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins maven-enforcer-plugin-it1 1 pom org.apache.maven.plugins maven-enforcer-plugin 1.0-SNAPSHOT custom-rule custom-rule-sample 1.0 enforce [1.3,1.6] 2.0.6 true enforce maven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/0000775000175000017500000000000013133666303024375 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/0000775000175000017500000000000013133666303025316 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/0000775000175000017500000000000013133666303026105 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/0000775000175000017500000000000013133666303027326 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/0000775000175000017500000000000013133666303030434 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/enforcer/0000775000175000017500000000000013133666303032237 5ustar ebourgebourg././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/enforcer/rule/maven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/enforcer/rul0000775000175000017500000000000013133666303032762 5ustar ebourgebourg././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/enforcer/rule/MyCustomRule.javamaven-enforcer-1.4.2/enforcer-api/src/custom-rule-sample/src/main/java/org/apache/maven/enforcer/rul0000664000175000017500000001150312166625524032771 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.execution.RuntimeInformation; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; /** * @author Brian Fox */ public class MyCustomRule implements EnforcerRule { /** * Simple param. This rule will fail if the value is true. */ private boolean shouldIfail = false; public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { Log log = helper.getLog(); try { // get the various expressions out of the helper. MavenProject project = (MavenProject) helper.evaluate( "${project}" ); MavenSession session = (MavenSession) helper.evaluate( "${session}" ); String target = (String) helper.evaluate( "${project.build.directory}" ); String artifactId = (String) helper.evaluate( "${project.artifactId}" ); // retreive any component out of the session directly ArtifactResolver resolver = (ArtifactResolver) helper.getComponent( ArtifactResolver.class ); RuntimeInformation rti = (RuntimeInformation) helper.getComponent( RuntimeInformation.class ); log.info( "Retrieved Target Folder: " + target ); log.info( "Retrieved ArtifactId: " +artifactId ); log.info( "Retrieved Project: " + project ); log.info( "Retrieved RuntimeInfo: " + rti ); log.info( "Retrieved Session: " + session ); log.info( "Retrieved Resolver: " + resolver ); if ( this.shouldIfail ) { throw new EnforcerRuleException( "Failing because my param said so." ); } } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e ); } } /** * If your rule is cacheable, you must return a unique id when parameters or conditions * change that would cause the result to be different. Multiple cached results are stored * based on their id. * * The easiest way to do this is to return a hash computed from the values of your parameters. * * If your rule is not cacheable, then the result here is not important, you may return anything. */ public String getCacheId() { //no hash on boolean...only parameter so no hash is needed. return ""+this.shouldIfail; } /** * This tells the system if the results are cacheable at all. Keep in mind that during * forked builds and other things, a given rule may be executed more than once for the same * project. This means that even things that change from project to project may still * be cacheable in certain instances. */ public boolean isCacheable() { return false; } /** * If the rule is cacheable and the same id is found in the cache, the stored results * are passed to this method to allow double checking of the results. Most of the time * this can be done by generating unique ids, but sometimes the results of objects returned * by the helper need to be queried. You may for example, store certain objects in your rule * and then query them later. */ public boolean isResultValid( EnforcerRule arg0 ) { return false; } } maven-enforcer-1.4.2/enforcer-api/src/site/0000775000175000017500000000000013133666303020070 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/site/site.xml0000664000175000017500000000216712573360174021570 0ustar ebourgebourg maven-enforcer-1.4.2/enforcer-api/src/site/apt/0000775000175000017500000000000013133666303020654 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/site/apt/index.apt0000664000175000017500000000233611237260714022474 0ustar ebourgebourg~~ 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. ------ Introduction ------ Brian Fox ------ Mar 2007 ------ Maven Enforcer Rule API - Extending The Loving Iron Fist of Maven\x99 Custom rules are easy to make with the <<>>. These rules can then be invoked with the {{{../../plugins/maven-enforcer-plugin/}maven-enforcer-plugin}}. See {{{./writing-a-custom-rule.html}Writing a Custom Rule}} for instructions on how to make your own rule. maven-enforcer-1.4.2/enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm0000664000175000017500000002373212027133334026162 0ustar ebourgebourg~~ 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. ------ Writing a custom rule ------ Brian Fox ------ Nov 2007 ------ Writing a custom rule Custom rules are easy to make with the <<>>. These rules can then be invoked with the {{{http://maven.apache.org/plugins/maven-enforcer-plugin/}maven-enforcer-plugin}}. Note: The files shown below may be downloaded here: {{{./custom-rule.zip}custom-rule.zip}} [[1]] First make a new jar project starting with the sample pom below: +---+ 4.0.0 custom-rule custom-rule-sample jar 1.0 My Custom Rule This is my custom rule. ${project.version} 2.0.9 org.apache.maven.enforcer enforcer-api ${api.version} org.apache.maven maven-project ${maven.version} org.apache.maven maven-core ${maven.version} org.apache.maven maven-artifact ${maven.version} org.apache.maven maven-plugin-api ${maven.version} org.codehaus.plexus plexus-container-default 1.0-alpha-9 junit junit 3.8.2 test +---+ [[2]] Create your rule class. The rule must implement the {{{./apidocs/index.html}EnforcerRule}} interface. The rule can get access to components and the log via the {{{./apidocs/index.html}EnforcerRuleHelper}} interface. If the rule succeeds, it should just simply return. If the rule fails, it should throw an {{{./apidocs/index.html}EnforcerRuleException}} with a descriptive message telling the user why the rule failed. There are several methods that must be implemented related to caching. Here's a sample class that shows how to access the helper methods and retrieve components by class name from the helper: +---+ package org.apache.maven.enforcer.rule; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.execution.RuntimeInformation; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; /** * @author Brian Fox */ public class MyCustomRule implements EnforcerRule { /** * Simple param. This rule will fail if the value is true. */ private boolean shouldIfail = false; public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { Log log = helper.getLog(); try { // get the various expressions out of the helper. MavenProject project = (MavenProject) helper.evaluate( "\${project}" ); MavenSession session = (MavenSession) helper.evaluate( "${session}" ); String target = (String) helper.evaluate( "\${project.build.directory}" ); String artifactId = (String) helper.evaluate( "\${project.artifactId}" ); // retrieve any component out of the session directly ArtifactResolver resolver = (ArtifactResolver) helper.getComponent( ArtifactResolver.class ); RuntimeInformation rti = (RuntimeInformation) helper.getComponent( RuntimeInformation.class ); log.info( "Retrieved Target Folder: " + target ); log.info( "Retrieved ArtifactId: " +artifactId ); log.info( "Retrieved Project: " + project ); log.info( "Retrieved RuntimeInfo: " + rti ); log.info( "Retrieved Session: " + session ); log.info( "Retrieved Resolver: " + resolver ); if ( this.shouldIfail ) { throw new EnforcerRuleException( "Failing because my param said so." ); } } catch ( ComponentLookupException e ) { throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e ); } } /** * If your rule is cacheable, you must return a unique id when parameters or conditions * change that would cause the result to be different. Multiple cached results are stored * based on their id. * * The easiest way to do this is to return a hash computed from the values of your parameters. * * If your rule is not cacheable, then the result here is not important, you may return anything. */ public String getCacheId() { //no hash on boolean...only parameter so no hash is needed. return ""+this.shouldIfail; } /** * This tells the system if the results are cacheable at all. Keep in mind that during * forked builds and other things, a given rule may be executed more than once for the same * project. This means that even things that change from project to project may still * be cacheable in certain instances. */ public boolean isCacheable() { return false; } /** * If the rule is cacheable and the same id is found in the cache, the stored results * are passed to this method to allow double checking of the results. Most of the time * this can be done by generating unique ids, but sometimes the results of objects returned * by the helper need to be queried. You may for example, store certain objects in your rule * and then query them later. */ public boolean isResultValid( EnforcerRule arg0 ) { return false; } } +---+ [[3]] Build and Install or Deploy your custom rule. [[4]] Add your custom-rule artifact as a dependency of the <<>> in your build: +---+ ... org.apache.maven.plugins maven-enforcer-plugin ${project.version} custom-rule custom-rule-sample 1.0 ... ... +---+ [[5]] Add your rule to the configuration section of the <<>>. The name of your class will be the name of the rule, and you must add an <<>> hint that contains the fully qualified class name: +---+ ... true ... +---+ [[6]] That's it. The full plugin config may look like this: +---+ ... org.apache.maven.plugins maven-enforcer-plugin ${project.version} custom-rule custom-rule-sample 1.0 enforce false enforce ... +---+maven-enforcer-1.4.2/enforcer-api/src/main/0000775000175000017500000000000013133666303020050 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/assembly/0000775000175000017500000000000013133666303021667 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/assembly/custom-rule-sample.xml0000664000175000017500000000266012166625524026160 0ustar ebourgebourg sample false zip src/custom-rule-sample /custom-rule-sample maven-enforcer-1.4.2/enforcer-api/src/main/java/0000775000175000017500000000000013133666303020771 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/0000775000175000017500000000000013133666303021560 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/0000775000175000017500000000000013133666303023001 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/0000775000175000017500000000000013133666303024107 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/0000775000175000017500000000000013133666303025712 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/0000775000175000017500000000000013133666303026661 5ustar ebourgebourgmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/0000775000175000017500000000000013133666303027432 5ustar ebourgebourg././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleException.javamaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleExcep0000664000175000017500000000604212166112127032732 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule.api; /* * 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. */ /** * An exception occurring during the execution of a rule. Based off of * EnforcerRuleException, but separated to keep the rule dependencies to a * minimum. * * @author Brian Fox */ public class EnforcerRuleException extends Exception { /** serialVersionUID. */ private static final long serialVersionUID = 1L; /** The source. */ protected Object source; /** The long message. */ protected String longMessage; /** * Gets the long message. * * @return the long message */ public String getLongMessage() { return longMessage; } /** * Gets the source. * * @return the source */ public Object getSource() { return source; } /** * Construct a new EnforcerRuleException exception providing * the source and a short and long message. * * @param source the source * @param shortMessage the short message * @param longMessage the long message */ public EnforcerRuleException( Object source, String shortMessage, String longMessage ) { super( shortMessage ); this.source = source; this.longMessage = longMessage; } /** * Construct a new EnforcerRuleException exception wrapping * an underlying Exception and providing a * message. * * @param message the message * @param cause the cause */ public EnforcerRuleException( String message, Exception cause ) { super( message, cause ); } /** * Construct a new EnforcerRuleException exception wrapping * an underlying Throwable and providing a * message. * * @param message the message * @param cause the cause */ public EnforcerRuleException( String message, Throwable cause ) { super( message, cause ); } /** * Construct a new EnforcerRuleException exception providing * a message. * * @param message the message */ public EnforcerRuleException( String message ) { super( message ); } }././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.javamaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.jav0000664000175000017500000000241512475421232032611 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule.api; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import javax.annotation.Nonnull; /** * Interface to be implemented by any rules as of version 2.0 executed by the enforcer. * * @author Mirko Friedenhagen * @version $Id: EnforcerRule2.java 1663790 2015-03-03 21:07:38Z khmarbaise $ * @since 1.4 */ public interface EnforcerRule2 extends EnforcerRule { /** * Returns the level of enforcement. * * @return level */ @Nonnull EnforcerLevel getLevel(); } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.javamaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.jav0000664000175000017500000000211312363157625032672 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule.api; /* * 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. */ /** * Levels steering whether a rule should fail a build or just display a warning. * * @author Mirko Friedenhagen * * @since 1.4 */ public enum EnforcerLevel { /** Fail the build. */ ERROR, /** Just warn. */ WARN } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootmaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.javamaven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelpe0000664000175000017500000000614512475421232032732 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule.api; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; /** * This is the interface that all helpers will use. This * provides access to the log, session and components to the * rules. * * @author Brian Fox */ public interface EnforcerRuleHelper extends ExpressionEvaluator { /** * Gets the log. * * @return the log */ @Nonnull Log getLog (); /** * Gets the component. * * @param clazz the clazz * * @return the component * * @throws ComponentLookupException the component lookup exception */ @Nonnull Object getComponent ( Class clazz ) throws ComponentLookupException; /** * Gets the component. * * @param componentKey the component key * * @return the component * * @throws ComponentLookupException the component lookup exception */ @Nonnull Object getComponent ( String componentKey ) throws ComponentLookupException; /** * Gets the component. * * @param role the role * @param roleHint the role hint * * @return the component * * @throws ComponentLookupException the component lookup exception */ Object getComponent ( String role, String roleHint ) throws ComponentLookupException; /** * Gets the component map. * * @param role the role * * @return the component map * * @throws ComponentLookupException the component lookup exception */ Map getComponentMap ( String role ) throws ComponentLookupException; /** * Gets the component list. * * @param role the role * * @return the component list * * @throws ComponentLookupException the component lookup exception */ List getComponentList ( String role ) throws ComponentLookupException; /** * Gets the container. * * @return the container */ PlexusContainer getContainer(); } maven-enforcer-1.4.2/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java0000664000175000017500000000610312475421232032666 0ustar ebourgebourgpackage org.apache.maven.enforcer.rule.api; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * Interface to be implemented by any rules executed by the enforcer. * * @author Brian Fox * @version $Id: EnforcerRule.java 1663790 2015-03-03 21:07:38Z khmarbaise $ */ public interface EnforcerRule { /** * This is the interface into the rule. This method should throw an exception * containing a reason message if the rule fails the check. The plugin will * then decide based on the fail flag if it should stop or just log the * message as a warning. * * @param helper The helper provides access to the log, MavenSession and has * helpers to get common components. It is also able to lookup components * by class name. * * @throws EnforcerRuleException the enforcer rule exception */ void execute( @Nonnull EnforcerRuleHelper helper ) throws EnforcerRuleException; /** * This method tells the enforcer if the rule results may be cached. If the result is true, * the results will be remembered for future executions in the same build (ie children). Subsequent * iterations of the rule will be queried to see if they are also cacheable. This will allow the rule to be * uncached further down the tree if needed. * * @return true if rule is cacheable */ boolean isCacheable(); /** * Checks if cached result is valid. * * @param cachedRule the last cached instance of the rule. This is to be used by the rule to * potentially determine if the results are still valid (ie if the configuration has been overridden) * * @return true if the stored results are valid for the same id. */ boolean isResultValid( @Nonnull EnforcerRule cachedRule ); /** * If the rule is to be cached, this id is used as part of the key. This can allow rules to take parameters * that allow multiple results of the same rule to be cached. * * @return id to be used by the enforcer to determine uniqueness of cache results. The ids only need to be unique * within a given rule implementation as the full key will be [classname]-[id] */ @Nullable String getCacheId(); } maven-enforcer-1.4.2/pom.xml0000664000175000017500000001725513122035147015304 0ustar ebourgebourg 4.0.0 maven-parent org.apache.maven 30 ../pom/maven/pom.xml org.apache.maven.enforcer enforcer 1.4.2 pom Apache Maven Enforcer Enforcer is a build rule execution framework. http://maven.apache.org/enforcer/ 2007 enforcer-api enforcer-rules maven-enforcer-plugin scm:svn:http://svn.apache.org/repos/asf/maven/enforcer/tags/enforcer-1.4.2 scm:svn:https://svn.apache.org/repos/asf/maven/enforcer/tags/enforcer-1.4.2 http://svn.apache.org/viewvc/maven/enforcer/tags/enforcer-1.4.2 jira https://issues.apache.org/jira/browse/MENFORCER Jenkins https://builds.apache.org/hudson/job/maven-enforcer/ apache.website scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path} 3.0 3.3 enforcer-archives/enforcer-LATEST org.apache.maven.enforcer enforcer-api ${project.version} org.apache.maven.enforcer enforcer-rules ${project.version} org.apache.maven.enforcer enforcer-rules ${project.version} test-jar test org.apache.maven maven-artifact ${maven.version} org.apache.maven maven-plugin-api ${maven.version} org.apache.maven maven-core ${maven.version} org.apache.maven maven-compat ${maven.version} org.apache.maven.shared maven-common-artifact-filters 3.0.1 org.codehaus.plexus plexus-utils 3.0.24 junit junit 4.11 org.mockito mockito-core 1.9.5 test commons-lang commons-lang 2.6 commons-codec commons-codec 1.6 org.apache.maven.plugin-testing maven-plugin-testing-harness 2.1 test org.apache.maven.shared maven-dependency-tree 2.2 org.assertj assertj-core 1.7.1 Simon Wang wangyf2010@gmail.com eBay Inc. maven-plugin-plugin ${mavenPluginPluginVersion} maven-release-plugin https://svn.apache.org/repos/asf/maven/enforcer/tags org.apache.maven.plugins maven-site-plugin scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path} org.apache.maven.plugins maven-enforcer-plugin org.codehaus.mojo extra-enforcer-rules 1.0-beta-6 org.apache.maven.plugins maven-javadoc-plugin true true aggregate false aggregate maven-enforcer-1.4.2/.gitignore0000664000175000017500000000012512455021476015753 0ustar ebourgebourgtarget .project .classpath .settings .idea/ .svn *.iml .settings .classpath .project maven-enforcer-1.4.2/src/0000775000175000017500000000000013133666303014552 5ustar ebourgebourgmaven-enforcer-1.4.2/src/site/0000775000175000017500000000000013133666303015516 5ustar ebourgebourgmaven-enforcer-1.4.2/src/site/xdoc/0000775000175000017500000000000013133666303016453 5ustar ebourgebourgmaven-enforcer-1.4.2/src/site/xdoc/download.xml.vm0000664000175000017500000001137212541123065021424 0ustar ebourgebourg Download ${project.name} Source

${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.

You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24 hours to reach all mirrors.

In order to guard against corrupted downloads/installations, it is highly recommended to verify the signature of the release bundles against the public KEYS used by the Apache Maven developers.

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

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

[if-any logo] logo [end] The currently selected mirror is [preferred]. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available.

Other mirrors:

You may also consult the complete list of mirrors.

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

Link Checksum Signature
${project.name} ${project.version} (Source zip) maven/archetype/${project.artifactId}-${project.version}-source-release.zip maven/archetype/${project.artifactId}-${project.version}-source-release.zip.md5 maven/archetype/${project.artifactId}-${project.version}-source-release.zip.asc

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

maven-enforcer-1.4.2/src/site/site.xml0000664000175000017500000000300713121176075017203 0ustar ebourgebourg true https://maven.apache.org/enforcer/ maven-enforcer-1.4.2/src/site/resources/0000775000175000017500000000000013133666303017530 5ustar ebourgebourgmaven-enforcer-1.4.2/src/site/resources/download.cgi0000664000175000017500000000166412352363612022031 0ustar ebourgebourg#!/bin/sh # # 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. # # Just call the standard mirrors.cgi script. It will use download.html # as the input template. exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*maven-enforcer-1.4.2/deploySite.bat0000664000175000017500000000210412270711135016564 0ustar ebourgebourg@REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM http://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- mvn -Preporting clean site site:stage %* mvn scm-publish:publish-scm %*