[java-identity-provider] branch maint-4.1 updated: JPAR-175 Investigate Maven Dependency Resolution Strategy
Rod Widdowson
rdw at steadingsoftware.com
Tue Jul 20 15:16:22 UTC 2021
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch maint-4.1
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=fc2f36dded67cbea29991f91c8c891ccd2b8e748
The following commit(s) were added to refs/heads/maint-4.1 by this push:
new fc2f36dde JPAR-175 Investigate Maven Dependency Resolution Strategy
fc2f36dde is described below
commit fc2f36dded67cbea29991f91c8c891ccd2b8e748
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).
---
.../net/shibboleth/idp/dependencies/DependencyTest.java | 14 +++++++-------
.../java/net/shibboleth/idp/dependencies/ParsedPom.java | 2 +-
2 files changed, 8 insertions(+), 8 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 123e2c901..8a6fc0a07 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
@@ -155,7 +155,7 @@ public class DependencyTest extends OpenSAMLInitBaseTestCase implements PomLoade
* @throws IOException if the file doesn't exist
* @throws MavenInvocationException if we fail to download a pom or a dependency
*/
- @Test(enabled=false) public void testDependencies() throws IOException, MavenInvocationException {
+ @Test(enabled=true) public void testDependencies() throws IOException, MavenInvocationException {
if (!idpParent.getDuplicates().isEmpty()) {
report.format("Duplicates found parsing the poms\n");
for (final Pair<PomArtifact,PomArtifact> poms : idpParent.getDuplicates()) {
@@ -168,9 +168,9 @@ 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");
- if (!Files.exists(lib)) {
- throw new SkipException("War distribution target not found");
- }
+ if (!Files.exists(lib)) {
+ throw new SkipException("War distribution target not found");
+ }
final Map<String, String> names = new HashMap<>();
int wrongVersion = 0;
int found = 0;
@@ -227,7 +227,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);
@@ -252,7 +252,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("Completed at %s\n", Instant.now().toString());
@@ -358,7 +358,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 ba0bc12f6..d9eb89fd9 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