Skip to content

Commit ab53fd9

Browse files
committed
[MENFORCER-357] RequirePluginVersions not recognizing versions-from-properties
1 parent 1b8ca8f commit ab53fd9

File tree

2 files changed

+239
-0
lines changed
  • maven-enforcer-plugin/src/it/projects/require-plugin-versions-expressions2

2 files changed

+239
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*
20+
-->
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<parent>
27+
<groupId>org.apache.maven.enforcer.its</groupId>
28+
<artifactId>project</artifactId>
29+
<version>4.0.0-SNAPSHOT</version>
30+
</parent>
31+
32+
<artifactId>module1</artifactId>
33+
<packaging>pom</packaging>
34+
35+
<properties>
36+
<maven.compiler.source>1.8</maven.compiler.source>
37+
<maven.compiler.target>1.8</maven.compiler.target>
38+
<checkstyle.plugin.version>3.1.1</checkstyle.plugin.version>
39+
<pmd.plugin.version>3.13.0</pmd.plugin.version>
40+
<surefire.version>3.0.0-M4</surefire.version>
41+
</properties>
42+
43+
<build>
44+
<pluginManagement>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-antrun-plugin</artifactId>
49+
<version>${maven.antrun.plugin.version}</version>
50+
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-checkstyle-plugin</artifactId>
54+
<version>${checkstyle.plugin.version}</version>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-failsafe-plugin</artifactId>
59+
<version>${surefire.version}</version>
60+
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-pmd-plugin</artifactId>
64+
<version>${pmd.plugin.version}</version>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-surefire-plugin</artifactId>
69+
<version>${surefire.version}</version>
70+
</plugin>
71+
</plugins>
72+
</pluginManagement>
73+
<plugins>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-compiler-plugin</artifactId>
77+
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-surefire-plugin</artifactId>
81+
</plugin>
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-failsafe-plugin</artifactId>
85+
<executions>
86+
<execution>
87+
<goals>
88+
<goal>integration-test</goal>
89+
<goal>verify</goal>
90+
</goals>
91+
</execution>
92+
</executions>
93+
</plugin>
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-pmd-plugin</artifactId>
97+
</plugin>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-checkstyle-plugin</artifactId>
101+
</plugin>
102+
</plugins>
103+
</build>
104+
105+
</project>
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*
20+
-->
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.enforcer.its</groupId>
27+
<artifactId>project</artifactId>
28+
<version>4.0.0-SNAPSHOT</version>
29+
<packaging>pom</packaging>
30+
31+
<url>https://issues.apache.org/jira/browse/MENFORCER-357</url>
32+
33+
<modules>
34+
<module>module1</module>
35+
</modules>
36+
37+
<properties>
38+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
39+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
40+
<maven.antrun.plugin.version>3.0.0</maven.antrun.plugin.version>
41+
</properties>
42+
43+
<build>
44+
<pluginManagement>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-clean-plugin</artifactId>
49+
<version>3.1.0</version>
50+
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-compiler-plugin</artifactId>
54+
<version>3.8.1</version>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-dependency-plugin</artifactId>
59+
<version>3.1.2</version>
60+
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-deploy-plugin</artifactId>
64+
<version>3.0.0-M1</version>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-enforcer-plugin</artifactId>
69+
<version>3.0.0-M3</version>
70+
</plugin>
71+
<plugin>
72+
<groupId>org.apache.maven.plugins</groupId>
73+
<artifactId>maven-install-plugin</artifactId>
74+
<version>3.0.0-M1</version>
75+
</plugin>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-jar-plugin</artifactId>
79+
<version>3.2.0</version>
80+
</plugin>
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-project-info-reports-plugin</artifactId>
84+
<version>3.1.0</version>
85+
</plugin>
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-release-plugin</artifactId>
89+
<version>3.0.0-M1</version>
90+
</plugin>
91+
<plugin>
92+
<groupId>org.apache.maven.plugins</groupId>
93+
<artifactId>maven-site-plugin</artifactId>
94+
<version>3.9.1</version>
95+
</plugin>
96+
</plugins>
97+
</pluginManagement>
98+
<plugins>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-enforcer-plugin</artifactId>
102+
<version>@project.version@</version>
103+
<executions>
104+
<execution>
105+
<id>enforce-versions</id>
106+
<goals>
107+
<goal>enforce</goal>
108+
</goals>
109+
<configuration>
110+
<rules>
111+
<requirePluginVersions>
112+
<message>Best Practice is to always define plugin
113+
versions!</message>
114+
<phases>clean,deploy,site</phases>
115+
<unCheckedPluginList>org.apache.maven.plugins:maven-enforcer-plugin</unCheckedPluginList>
116+
</requirePluginVersions>
117+
</rules>
118+
</configuration>
119+
</execution>
120+
</executions>
121+
</plugin>
122+
</plugins>
123+
</build>
124+
125+
<reporting>
126+
<plugins>
127+
<plugin>
128+
<groupId>org.apache.maven.plugins</groupId>
129+
<artifactId>maven-dependency-plugin</artifactId>
130+
</plugin>
131+
</plugins>
132+
</reporting>
133+
134+
</project>

0 commit comments

Comments
 (0)