[java-identity-provider] branch main updated: JPAR-175 Investigate Maven Dependency Resolution Strategy

Rod Widdowson rdw at steadingsoftware.com
Tue Jul 20 15:20:28 UTC 2021


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b2b7f68b95cf875287d323e0e035be32a7359516

The following commit(s) were added to refs/heads/main by this push:
       new  b2b7f68b9 JPAR-175 Investigate Maven Dependency Resolution Strategy
b2b7f68b9 is described below

commit b2b7f68b95cf875287d323e0e035be32a7359516
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Jul 20 16:12:56 2021 +0100

    JPAR-175 Investigate Maven Dependency Resolution Strategy
    
    https://issues.shibboleth.net/jira/browse/JPAR-175
    
    The "where did this come from" code was citing our java parent pom as the parent,
    but it should have been idp-parent.
    
    This was reporting all sorts of false positive (like spring-xyz-5.3.7
    being announced as having been brought in by spring-abc-5.3.9).
---
 .../test/java/net/shibboleth/idp/dependencies/DependencyTest.java  | 7 ++++---
 .../src/test/java/net/shibboleth/idp/dependencies/ParsedPom.java   | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/idp-installer/src/test/java/net/shibboleth/idp/dependencies/DependencyTest.java b/idp-installer/src/test/java/net/shibboleth/idp/dependencies/DependencyTest.java
index db6892c11..0ab55e7fc 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/dependencies/DependencyTest.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/dependencies/DependencyTest.java
@@ -398,6 +398,7 @@ public class DependencyTest extends OpenSAMLInitBaseTestCase implements PomLoade
             }
         }
         final Path lib = Path.of("../idp-war-distribution/target/idp-war-distribution-"+ idpParent.getOurInfo().getVersion()).resolve("WEB-INF").resolve("lib");
+
         final Map<String, String> names = new HashMap<>();
         int wrongVersion = 0;
         int found = 0;
@@ -454,7 +455,7 @@ public class DependencyTest extends OpenSAMLInitBaseTestCase implements PomLoade
         Collections.sort(contributedDeps);
         int noSource = 0;
 
-        report.format("Found in but not explicitly defined as a dependency:\n\n");
+        report.format("Found in WAR but not explicitly defined as a dependency:\n\n");
 
         for (final String dependency: contributedDeps) {
             final Map<String, Set<String>> map = dependencySource.get(dependency);
@@ -479,7 +480,7 @@ public class DependencyTest extends OpenSAMLInitBaseTestCase implements PomLoade
                 }
             }
         }
-        report.format("%d Orphans artifact(s)\n", noSource);
+        report.format("%d Orphaned artifact(s)\n", noSource);
         report.format("%d Similar artifact names(s)\n", similarNames);
         report.format("%d Wrong Versions(s)\n", wrongVersion);
         report.format("Dependency Test Completed at %s\n\n ", Instant.now().toString());
@@ -584,7 +585,7 @@ public class DependencyTest extends OpenSAMLInitBaseTestCase implements PomLoade
                     + "        <artifactId>%s</artifactId>\n"
                     + "        <version>%s</version>\n"
                     + "    </parent>\n"
-                    + "\n", parentArtefact.getGroupId(), parentArtefact.getArtifactId(), parentArtefact.getVersion());
+                    + "\n", idpParent.getOurInfo().getGroupId(), idpParent.getOurInfo().getArtifactId(), idpParent.getOurInfo().getVersion());
             pom.format("    <groupId>shibboleth.net.dependency</groupId>\n"
                     + "    <version>0.0.1</version>\n"
                     + "    <name>Shibboleth Dependency</name>\n"
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/dependencies/ParsedPom.java b/idp-installer/src/test/java/net/shibboleth/idp/dependencies/ParsedPom.java
index 186cec368..f94a62397 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/dependencies/ParsedPom.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/dependencies/ParsedPom.java
@@ -266,7 +266,7 @@ public class ParsedPom extends OpenSAMLInitBaseTestCase{
      */
     private void addWithCheck(final PomArtifact artifact, final Map<String, PomArtifact> map) {
         final PomArtifact old = map.put(artifact.getMapKey(),artifact);
-        if (old != null) {
+        if (old != null && !old.equals(artifact)) {
             duplicates.add(new Pair<>(old, artifact));
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list