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

Commit

Permalink
Fix handling of bundle and test-jar packaging
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Kortanul committed May 29, 2018
1 parent 7c9043e commit ee9a453
Show file tree
Hide file tree
Showing 33 changed files with 778 additions and 59 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>org.simplify4u.plugins</groupId>
<artifactId>pgpverify-maven-plugin</artifactId>
<version>1.3.0-wren1</version>
<version>1.3.0-wren2</version>
<packaging>maven-plugin</packaging>

<name>Verify PGP signatures plugin</name>
Expand Down
30 changes: 30 additions & 0 deletions src/it/reactorProcessBundle/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<modules>
<module>project-bundle</module>
<module>project-verifier</module>
</modules>
</project>
47 changes: 47 additions & 0 deletions src/it/reactorProcessBundle/project-bundle/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
</parent>

<groupId>test</groupId>
<artifactId>project-bundle</artifactId>
<version>0.0.1</version>
<packaging>bundle</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.5.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>com.demo.hello.*</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.simplify4u.plugins;

class Main {
public static void main(String[] args) {
System.out.println("This is a fake class.");
}
}
59 changes: 59 additions & 0 deletions src/it/reactorProcessBundle/project-verifier/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
</parent>

<groupId>test</groupId>
<artifactId>project-verifier</artifactId>
<version>0.0.1</version>

<build>
<plugins>
<plugin>
<groupId>org.simplify4u.plugins</groupId>
<artifactId>pgpverify-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<failNoSignature>true</failNoSignature>
<verifyReactorDependencies>true</verifyReactorDependencies>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>project-bundle</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</project>
16 changes: 16 additions & 0 deletions src/it/reactorProcessJar/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright 2018 Wren Security
#
# 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.
#
invoker.buildResult = failure
30 changes: 30 additions & 0 deletions src/it/reactorProcessJar/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<modules>
<module>project-jar</module>
<module>project-verifier</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
</parent>

<groupId>test</groupId>
<artifactId>projectB</artifactId>
<artifactId>project-jar</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>projectA</artifactId>
<version>0.0.1</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.simplify4u.plugins;

class Main {
public static void main(String[] args) {
System.out.println("This is a fake class.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
</parent>

<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<artifactId>project-verifier</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<build>
<plugins>
Expand All @@ -44,8 +49,11 @@
</plugins>
</build>

<modules>
<module>projectA</module>
<module>projectB</module>
</modules>
<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>project-jar</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</project>
16 changes: 16 additions & 0 deletions src/it/reactorProcessPom/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright 2018 Wren Security
#
# 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.
#
invoker.buildResult = failure
30 changes: 30 additions & 0 deletions src/it/reactorProcessPom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<modules>
<module>project-pom</module>
<module>project-verifier</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</parent>

<groupId>test</groupId>
<artifactId>projectA</artifactId>
<artifactId>project-pom</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.simplify4u.plugins;

class Main {
public static void main(String[] args) {
System.out.println("This is a fake class.");
}
}
60 changes: 60 additions & 0 deletions src/it/reactorProcessPom/project-verifier/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Wren Security
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1</version>
</parent>

<groupId>test</groupId>
<artifactId>project-verifier</artifactId>
<version>0.0.1</version>

<build>
<plugins>
<plugin>
<groupId>org.simplify4u.plugins</groupId>
<artifactId>pgpverify-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<failNoSignature>true</failNoSignature>
<verifyReactorDependencies>true</verifyReactorDependencies>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>project-pom</artifactId>
<version>0.0.1</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit ee9a453

Please sign in to comment.