Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit ee9a453

Browse files
committed
Fix handling of bundle and test-jar packaging
Changes the skip filter for reactor dependencies to only compare based on Maven coordinates rather than the full ID of each artifact. Previously, the group ID, artifact ID, version, packaging, type, and classifier had to match, but unfortunately Maven doesn't have packaging information when resolving upstream reactor dependencies. This caused problems for `bundle` and `test-jar` packaging (which both end up being "jar" packaging under the hood). The new approach just uses coordinates of group ID, artifact ID, and version; this should work fine since it's unlikely that one would want a dependency outside the reactor that exactly matches the coordinates of a project inside the reactor during the same build. Signed-off-by: Kortanul <kortanul@protonmail.com>
1 parent 7c9043e commit ee9a453

File tree

33 files changed

+778
-59
lines changed

33 files changed

+778
-59
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<groupId>org.simplify4u.plugins</groupId>
2929
<artifactId>pgpverify-maven-plugin</artifactId>
30-
<version>1.3.0-wren1</version>
30+
<version>1.3.0-wren2</version>
3131
<packaging>maven-plugin</packaging>
3232

3333
<name>Verify PGP signatures plugin</name>

src/it/reactorProcessBundle/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<groupId>test</groupId>
22+
<artifactId>test-parent</artifactId>
23+
<version>0.0.1</version>
24+
<packaging>pom</packaging>
25+
26+
<modules>
27+
<module>project-bundle</module>
28+
<module>project-verifier</module>
29+
</modules>
30+
</project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>test</groupId>
23+
<artifactId>test-parent</artifactId>
24+
<version>0.0.1</version>
25+
</parent>
26+
27+
<groupId>test</groupId>
28+
<artifactId>project-bundle</artifactId>
29+
<version>0.0.1</version>
30+
<packaging>bundle</packaging>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.apache.felix</groupId>
36+
<artifactId>maven-bundle-plugin</artifactId>
37+
<version>3.5.0</version>
38+
<extensions>true</extensions>
39+
<configuration>
40+
<instructions>
41+
<Export-Package>com.demo.hello.*</Export-Package>
42+
</instructions>
43+
</configuration>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.simplify4u.plugins;
2+
3+
class Main {
4+
public static void main(String[] args) {
5+
System.out.println("This is a fake class.");
6+
}
7+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>test</groupId>
23+
<artifactId>test-parent</artifactId>
24+
<version>0.0.1</version>
25+
</parent>
26+
27+
<groupId>test</groupId>
28+
<artifactId>project-verifier</artifactId>
29+
<version>0.0.1</version>
30+
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.simplify4u.plugins</groupId>
35+
<artifactId>pgpverify-maven-plugin</artifactId>
36+
<version>@project.version@</version>
37+
<configuration>
38+
<failNoSignature>true</failNoSignature>
39+
<verifyReactorDependencies>true</verifyReactorDependencies>
40+
</configuration>
41+
<executions>
42+
<execution>
43+
<goals>
44+
<goal>check</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
</plugins>
50+
</build>
51+
52+
<dependencies>
53+
<dependency>
54+
<groupId>test</groupId>
55+
<artifactId>project-bundle</artifactId>
56+
<version>0.0.1</version>
57+
</dependency>
58+
</dependencies>
59+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright 2018 Wren Security
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
invoker.buildResult = failure

src/it/reactorProcessJar/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<groupId>test</groupId>
22+
<artifactId>test-parent</artifactId>
23+
<version>0.0.1</version>
24+
<packaging>pom</packaging>
25+
26+
<modules>
27+
<module>project-jar</module>
28+
<module>project-verifier</module>
29+
</modules>
30+
</project>

src/it/reactorSkip/projectB/pom.xml renamed to src/it/reactorProcessJar/project-jar/pom.xml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
</parent>
2626

2727
<groupId>test</groupId>
28-
<artifactId>projectB</artifactId>
28+
<artifactId>project-jar</artifactId>
2929
<version>0.0.1</version>
30-
<packaging>pom</packaging>
31-
32-
<dependencies>
33-
<dependency>
34-
<groupId>test</groupId>
35-
<artifactId>projectA</artifactId>
36-
<version>0.0.1</version>
37-
<type>pom</type>
38-
</dependency>
39-
</dependencies>
4030
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.simplify4u.plugins;
2+
3+
class Main {
4+
public static void main(String[] args) {
5+
System.out.println("This is a fake class.");
6+
}
7+
}

src/it/reactorProcess/pom.xml renamed to src/it/reactorProcessJar/project-verifier/pom.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1919
<modelVersion>4.0.0</modelVersion>
2020

21+
<parent>
22+
<groupId>test</groupId>
23+
<artifactId>test-parent</artifactId>
24+
<version>0.0.1</version>
25+
</parent>
26+
2127
<groupId>test</groupId>
22-
<artifactId>test-parent</artifactId>
28+
<artifactId>project-verifier</artifactId>
2329
<version>0.0.1</version>
24-
<packaging>pom</packaging>
2530

2631
<build>
2732
<plugins>
@@ -44,8 +49,11 @@
4449
</plugins>
4550
</build>
4651

47-
<modules>
48-
<module>projectA</module>
49-
<module>projectB</module>
50-
</modules>
52+
<dependencies>
53+
<dependency>
54+
<groupId>test</groupId>
55+
<artifactId>project-jar</artifactId>
56+
<version>0.0.1</version>
57+
</dependency>
58+
</dependencies>
5159
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright 2018 Wren Security
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
invoker.buildResult = failure

src/it/reactorProcessPom/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<groupId>test</groupId>
22+
<artifactId>test-parent</artifactId>
23+
<version>0.0.1</version>
24+
<packaging>pom</packaging>
25+
26+
<modules>
27+
<module>project-pom</module>
28+
<module>project-verifier</module>
29+
</modules>
30+
</project>

src/it/reactorProcess/projectA/pom.xml renamed to src/it/reactorProcessPom/project-pom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</parent>
2626

2727
<groupId>test</groupId>
28-
<artifactId>projectA</artifactId>
28+
<artifactId>project-pom</artifactId>
2929
<version>0.0.1</version>
3030
<packaging>pom</packaging>
3131
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.simplify4u.plugins;
2+
3+
class Main {
4+
public static void main(String[] args) {
5+
System.out.println("This is a fake class.");
6+
}
7+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2018 Wren Security
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>test</groupId>
23+
<artifactId>test-parent</artifactId>
24+
<version>0.0.1</version>
25+
</parent>
26+
27+
<groupId>test</groupId>
28+
<artifactId>project-verifier</artifactId>
29+
<version>0.0.1</version>
30+
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.simplify4u.plugins</groupId>
35+
<artifactId>pgpverify-maven-plugin</artifactId>
36+
<version>@project.version@</version>
37+
<configuration>
38+
<failNoSignature>true</failNoSignature>
39+
<verifyReactorDependencies>true</verifyReactorDependencies>
40+
</configuration>
41+
<executions>
42+
<execution>
43+
<goals>
44+
<goal>check</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
</plugins>
50+
</build>
51+
52+
<dependencies>
53+
<dependency>
54+
<groupId>test</groupId>
55+
<artifactId>project-pom</artifactId>
56+
<version>0.0.1</version>
57+
<type>pom</type>
58+
</dependency>
59+
</dependencies>
60+
</project>

0 commit comments

Comments
 (0)