Skip to content

Commit c07ca87

Browse files
bvfalconslawekjaranowski
authored andcommitted
[MINVOKER-306] - Fixed bug if only exclude-patterns specified
1 parent c4ea51c commit c07ca87

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23+
<modelVersion>4.0.0</modelVersion>
24+
<groupId>org.apache.maven.plugins.invoker.its</groupId>
25+
<artifactId>minvoker-138</artifactId>
26+
<version>0.1-SNAPSHOT</version>
27+
<packaging>pom</packaging>
28+
29+
<properties>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
</properties>
32+
33+
<build>
34+
<plugins>
35+
<plugin>
36+
<groupId>org.apache.maven.plugins</groupId>
37+
<artifactId>maven-enforcer-plugin</artifactId>
38+
<version>3.1.0</version>
39+
<executions>
40+
<execution>
41+
<goals>
42+
<goal>enforce</goal>
43+
</goals>
44+
<configuration>
45+
<rules>
46+
<AlwaysPass/>
47+
</rules>
48+
</configuration>
49+
</execution>
50+
</executions>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
</project>

src/it/invocation-cmdline-exclude/src/it/minvoker-140/pom.xml renamed to src/it/invocation-cmdline-exclude/src/it/minvoker-140-ignorable/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ under the License.
3535
<plugin>
3636
<groupId>org.apache.maven.plugins</groupId>
3737
<artifactId>maven-enforcer-plugin</artifactId>
38-
<version>1.1.1</version>
38+
<version>3.1.0</version>
3939
<executions>
4040
<execution>
4141
<goals>

src/it/invocation-cmdline-exclude/test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
invoker.test = !minvoker-140
18+
invoker.test = !*-ignorable
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
assert new File(basedir, 'target/invoker-reports/BUILD-minvoker-140-executable.xml').exists()
20+
assert !new File(basedir, 'target/invoker-reports/BUILD-minvoker-140-ignorable.xml').exists()
21+

src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,10 @@ private List<BuildJob> scanProjectsDirectory( List<String> includes, List<String
24312431
}
24322432
if ( excludes != null )
24332433
{
2434+
if ( ( includes == null || includes.isEmpty() ) && !excludes.isEmpty() )
2435+
{
2436+
scanner.setIncludes( new String[] { "*" } );
2437+
}
24342438
scanner.setExcludes( excludes.toArray( new String[0] ) );
24352439
}
24362440
scanner.addDefaultExcludes();

0 commit comments

Comments
 (0)