diff --git a/pom.xml b/pom.xml index 5080098..d19f330 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ it.pagopa.maven depcheck - 1.0.4 + 1.0.7-RC maven-plugin This Maven plugin generates and verifies sha256 of project dependencies @@ -23,6 +23,8 @@ ${java.version} UTF-8 UTF-8 + 3.8.1 + 0.8.10 @@ -30,12 +32,12 @@ org.apache.maven.plugins maven-plugin-plugin - 3.8.1 + ${maven-plugin-plugin.version} org.jacoco jacoco-maven-plugin - 0.8.10 + ${jacoco-maven-plugin.version} diff --git a/src/main/java/it/pagopa/maven/depcheck/DependenciesDataMojo.java b/src/main/java/it/pagopa/maven/depcheck/DependenciesDataMojo.java index ce6da12..bb64afa 100644 --- a/src/main/java/it/pagopa/maven/depcheck/DependenciesDataMojo.java +++ b/src/main/java/it/pagopa/maven/depcheck/DependenciesDataMojo.java @@ -85,16 +85,16 @@ protected List retrieveDependencies(MavenProject specProject) { try { String sha256 = ""; if (a.getFile() == null) { - getLog().warn(String.format("SHA-256 of %s:%s:%s cannot be computed.", a.getGroupId(), a.getArtifactId(), a.getVersion())); + getLog().warn(String.format("SHA-256 of %s cannot be computed.", a.getId())); } else { sha256 = Sha256.calculate(a.getFile()); } - Dependency dependency = new Dependency(a.getArtifactId(), a.getGroupId(), a.getVersion(), sha256); + Dependency dependency = new Dependency(a.getId(), a.getArtifactId(), a.getGroupId(), a.getVersion(), sha256); getLog().info(dependency.toString()); return dependency; } catch (NoSuchAlgorithmException | IOException e) { - getLog().error(String.format("Error calculating SHA-256 %s:%s:%s.", a.getGroupId(), a.getArtifactId(), a.getVersion())); + getLog().error(String.format("Error calculating SHA-256 %s.", a.getId())); getLog().error(e); throw new RuntimeException(e); } diff --git a/src/main/java/it/pagopa/maven/depcheck/bean/Dependency.java b/src/main/java/it/pagopa/maven/depcheck/bean/Dependency.java index 7224e42..26070f4 100644 --- a/src/main/java/it/pagopa/maven/depcheck/bean/Dependency.java +++ b/src/main/java/it/pagopa/maven/depcheck/bean/Dependency.java @@ -10,6 +10,11 @@ * @author Antonio Tarricone */ public class Dependency implements Comparable { + /* + * + */ + private String id; + /* * */ @@ -37,12 +42,14 @@ public Dependency() { } /** + * @param id * @param artifactId * @param groupId * @param version * @param sha256 */ - public Dependency(String artifactId, String groupId, String version, String sha256) { + public Dependency(String id, String artifactId, String groupId, String version, String sha256) { + this.id = id; this.artifactId = artifactId; this.groupId = groupId; this.version = version; @@ -57,24 +64,20 @@ public String getSha256() { } /** - * * @return */ public String getId() { - return new StringBuilder(groupId) - .append(":") - .append(artifactId) - .append(":") - .append(version) - .toString(); + return id; } - + /** * {@inheritDoc} */ @Override public String toString() { - return new StringBuilder("Dependency [artifactId=") + return new StringBuilder("Dependency [id=") + .append(id) + .append(", artifactId=") .append(artifactId) .append(", groupId=") .append(groupId) @@ -91,13 +94,16 @@ public String toString() { */ @Override public int compareTo(Dependency o) { - int c = groupId.compareTo(o.groupId); + int c = id.compareTo(o.id); if (c == 0) { - c = artifactId.compareTo(o.artifactId); + c = groupId.compareTo(o.groupId); if (c == 0) { - c = version.compareTo(o.version); + c = artifactId.compareTo(o.artifactId); if (c == 0) { - c = sha256.compareTo(o.sha256); + c = version.compareTo(o.version); + if (c == 0) { + c = sha256.compareTo(o.sha256); + } } } } diff --git a/src/test/java/it/pagopa/maven/depcheck/DependenciesDataGeneratorMojoTest.java b/src/test/java/it/pagopa/maven/depcheck/DependenciesDataGeneratorMojoTest.java index a244fb2..ccca732 100644 --- a/src/test/java/it/pagopa/maven/depcheck/DependenciesDataGeneratorMojoTest.java +++ b/src/test/java/it/pagopa/maven/depcheck/DependenciesDataGeneratorMojoTest.java @@ -9,9 +9,7 @@ import java.io.FileReader; import java.util.Set; -import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.testing.AbstractMojoTestCase; -import org.apache.maven.plugin.testing.stubs.ArtifactStub; import org.apache.maven.project.MavenProject; import com.google.gson.GsonBuilder; @@ -29,13 +27,15 @@ public class DependenciesDataGeneratorMojoTest extends AbstractMojoTestCase { * @throws Exception */ public void testWoParentWoPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); @@ -79,25 +79,29 @@ public void testWoParentWoPluginsHashOk() throws Exception { * @throws Exception */ public void testWoParentWPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); artifact2.setVersion("version_2"); - Artifact artifact3 = new ArtifactStub(); + MyArtifactStub artifact3 = new MyArtifactStub(); + artifact3.setId("art_3"); artifact3.setArtifactId("artifact_3"); artifact3.setFile(getTestFile("src/test/resources/unit-test/artifact_3.txt")); artifact3.setGroupId("group_3"); artifact3.setVersion("version_3"); - Artifact artifact4 = new ArtifactStub(); + MyArtifactStub artifact4 = new MyArtifactStub(); + artifact4.setId("art_4"); artifact4.setArtifactId("artifact_4"); artifact4.setFile(getTestFile("src/test/resources/unit-test/artifact_4.txt")); artifact4.setGroupId("group_4"); @@ -141,37 +145,43 @@ public void testWoParentWPluginsHashOk() throws Exception { * @throws Exception */ public void testWParentWPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); artifact2.setVersion("version_2"); - Artifact artifact3 = new ArtifactStub(); + MyArtifactStub artifact3 = new MyArtifactStub(); + artifact3.setId("art_3"); artifact3.setArtifactId("artifact_3"); artifact3.setFile(getTestFile("src/test/resources/unit-test/artifact_3.txt")); artifact3.setGroupId("group_3"); artifact3.setVersion("version_3"); - Artifact artifact4 = new ArtifactStub(); + MyArtifactStub artifact4 = new MyArtifactStub(); + artifact4.setId("art_4"); artifact4.setArtifactId("artifact_4"); artifact4.setFile(getTestFile("src/test/resources/unit-test/artifact_4.txt")); artifact4.setGroupId("group_4"); artifact4.setVersion("version_4"); - Artifact artifact5 = new ArtifactStub(); + MyArtifactStub artifact5 = new MyArtifactStub(); + artifact5.setId("art_5"); artifact5.setArtifactId("artifact_5"); artifact5.setFile(getTestFile("src/test/resources/unit-test/artifact_5.txt")); artifact5.setGroupId("group_5"); artifact5.setVersion("version_5"); - Artifact artifact6 = new ArtifactStub(); + MyArtifactStub artifact6 = new MyArtifactStub(); + artifact6.setId("art_6"); artifact6.setArtifactId("artifact_6"); artifact6.setFile(getTestFile("src/test/resources/unit-test/artifact_6.txt")); artifact6.setGroupId("group_6"); diff --git a/src/test/java/it/pagopa/maven/depcheck/DependenciesDataVerifierMojoTest.java b/src/test/java/it/pagopa/maven/depcheck/DependenciesDataVerifierMojoTest.java index a66e36e..22ac5ad 100644 --- a/src/test/java/it/pagopa/maven/depcheck/DependenciesDataVerifierMojoTest.java +++ b/src/test/java/it/pagopa/maven/depcheck/DependenciesDataVerifierMojoTest.java @@ -8,11 +8,9 @@ import java.io.File; import java.util.Set; -import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; -import org.apache.maven.plugin.testing.stubs.ArtifactStub; import org.apache.maven.project.MavenProject; /** @@ -25,13 +23,15 @@ public class DependenciesDataVerifierMojoTest extends AbstractMojoTestCase { * @throws Exception */ public void testWoParentWoPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); @@ -57,25 +57,29 @@ public void testWoParentWoPluginsHashOk() throws Exception { * @throws Exception */ public void testWoParentWPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); artifact2.setVersion("version_2"); - Artifact artifact3 = new ArtifactStub(); + MyArtifactStub artifact3 = new MyArtifactStub(); + artifact3.setId("art_3"); artifact3.setArtifactId("artifact_3"); artifact3.setFile(getTestFile("src/test/resources/unit-test/artifact_3.txt")); artifact3.setGroupId("group_3"); artifact3.setVersion("version_3"); - Artifact artifact4 = new ArtifactStub(); + MyArtifactStub artifact4 = new MyArtifactStub(); + artifact4.setId("art_4"); artifact4.setArtifactId("artifact_4"); artifact4.setFile(getTestFile("src/test/resources/unit-test/artifact_4.txt")); artifact4.setGroupId("group_4"); @@ -101,37 +105,43 @@ public void testWoParentWPluginsHashOk() throws Exception { * @throws Exception */ public void testWParentWPluginsHashOk() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); artifact2.setVersion("version_2"); - Artifact artifact3 = new ArtifactStub(); + MyArtifactStub artifact3 = new MyArtifactStub(); + artifact3.setId("art_3"); artifact3.setArtifactId("artifact_3"); artifact3.setFile(getTestFile("src/test/resources/unit-test/artifact_3.txt")); artifact3.setGroupId("group_3"); artifact3.setVersion("version_3"); - Artifact artifact4 = new ArtifactStub(); + MyArtifactStub artifact4 = new MyArtifactStub(); + artifact4.setId("art_4"); artifact4.setArtifactId("artifact_4"); artifact4.setFile(getTestFile("src/test/resources/unit-test/artifact_4.txt")); artifact4.setGroupId("group_4"); artifact4.setVersion("version_4"); - Artifact artifact5 = new ArtifactStub(); + MyArtifactStub artifact5 = new MyArtifactStub(); + artifact5.setId("art_5"); artifact5.setArtifactId("artifact_5"); artifact5.setFile(getTestFile("src/test/resources/unit-test/artifact_5.txt")); artifact5.setGroupId("group_5"); artifact5.setVersion("version_5"); - Artifact artifact6 = new ArtifactStub(); + MyArtifactStub artifact6 = new MyArtifactStub(); + artifact6.setId("art_6"); artifact6.setArtifactId("artifact_6"); artifact6.setFile(getTestFile("src/test/resources/unit-test/artifact_6.txt")); artifact6.setGroupId("group_6"); @@ -163,13 +173,15 @@ public void testWParentWPluginsHashOk() throws Exception { * @throws Exception */ public void testWoParentWoPluginsMissingDependency() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); @@ -202,13 +214,15 @@ public void testWoParentWoPluginsMissingDependency() throws Exception { * @throws Exception */ public void testWoParentWoPluginsWrongHash() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); @@ -239,52 +253,55 @@ public void testWoParentWoPluginsWrongHash() throws Exception { * * @throws Exception */ -// public void testWoParentWoPluginsUnusedHash() throws Exception { -// Artifact artifact1 = new ArtifactStub(); -// artifact1.setArtifactId("artifact_1"); -// artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); -// artifact1.setGroupId("group_1"); -// artifact1.setVersion("version_1"); -// -// Artifact artifact2 = new ArtifactStub(); -// artifact2.setArtifactId("artifact_2"); -// artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); -// artifact2.setGroupId("group_2"); -// artifact2.setVersion("version_2"); -// -// MavenProject project = new MavenProject(); -// project.setName("PROJECT_STUB_WO_PARENT_WO_PLUGINS_UNUSED_HASH"); -// project.setArtifacts(Set.of(artifact1, artifact2)); -// project.setPluginArtifacts(null); -// project.setParent(null); -// -// File pom = getTestFile("src/test/resources/unit-test/pom.xml"); -// DependenciesDataVerifierMojo mojo = (DependenciesDataVerifierMojo) lookupMojo("verify", pom); -// setVariableValueToObject(mojo, "project", project); -// setVariableValueToObject(mojo, "fileName", "src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json"); -// setVariableValueToObject(mojo, "includePlugins", false); -// setVariableValueToObject(mojo, "includeParent", false); -// try { -// mojo.execute(); -// fail(); -// } catch (MojoExecutionException e) { -// } catch (Throwable e) { -// fail(); -// } -// } + // public void testWoParentWoPluginsUnusedHash() throws Exception { + // MyArtifactStub artifact1 = new MyArtifactStub(); artifact1.setId("art_1"); + // artifact1.setArtifactId("artifact_1"); + // artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); + // artifact1.setGroupId("group_1"); + // artifact1.setVersion("version_1"); + // + // MyArtifactStub artifact2 = new MyArtifactStub(); artifact2.setId("art_2"); + // artifact2.setArtifactId("artifact_2"); + // artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); + // artifact2.setGroupId("group_2"); + // artifact2.setVersion("version_2"); + // + // MavenProject project = new MavenProject(); + // project.setName("PROJECT_STUB_WO_PARENT_WO_PLUGINS_UNUSED_HASH"); + // project.setArtifacts(Set.of(artifact1, artifact2)); + // project.setPluginArtifacts(null); + // project.setParent(null); + // + // File pom = getTestFile("src/test/resources/unit-test/pom.xml"); + // DependenciesDataVerifierMojo mojo = (DependenciesDataVerifierMojo) lookupMojo("verify", pom); + // setVariableValueToObject(mojo, "project", project); + // setVariableValueToObject(mojo, "fileName", + // "src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json"); + // setVariableValueToObject(mojo, "includePlugins", false); + // setVariableValueToObject(mojo, "includeParent", false); + // try { + // mojo.execute(); + // fail(); + // } catch (MojoExecutionException e) { + // } catch (Throwable e) { + // fail(); + // } + // } /** * * @throws Exception */ public void testWoParentWoPluginsFileNotFound() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(getTestFile("src/test/resources/unit-test/artifact_2.txt")); artifact2.setGroupId("group_2"); @@ -336,13 +353,15 @@ public void testWoParentWPluginsWoDependencies() throws Exception { * @throws Exception */ public void testWoParentWoPluginsUnreachableDependency() throws Exception { - Artifact artifact1 = new ArtifactStub(); + MyArtifactStub artifact1 = new MyArtifactStub(); + artifact1.setId("art_1"); artifact1.setArtifactId("artifact_1"); artifact1.setFile(getTestFile("src/test/resources/unit-test/artifact_1.txt")); artifact1.setGroupId("group_1"); artifact1.setVersion("version_1"); - Artifact artifact2 = new ArtifactStub(); + MyArtifactStub artifact2 = new MyArtifactStub(); + artifact2.setId("art_2"); artifact2.setArtifactId("artifact_2"); artifact2.setFile(null); artifact2.setGroupId("group_2"); diff --git a/src/test/java/it/pagopa/maven/depcheck/MyArtifactStub.java b/src/test/java/it/pagopa/maven/depcheck/MyArtifactStub.java new file mode 100644 index 0000000..44df246 --- /dev/null +++ b/src/test/java/it/pagopa/maven/depcheck/MyArtifactStub.java @@ -0,0 +1,34 @@ +/* + * MyArtifactStub.java + * + * 30 mag 2023 + */ +package it.pagopa.maven.depcheck; + +import org.apache.maven.plugin.testing.stubs.ArtifactStub; + +/** + * + * @author Antonio Tarricone + */ +public class MyArtifactStub extends ArtifactStub { + /* + * + */ + private String id; + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * @param id + */ + public void setId(String id) { + this.id = id; + } +} \ No newline at end of file diff --git a/src/test/java/it/pagopa/maven/depcheck/bean/DependencyTest.java b/src/test/java/it/pagopa/maven/depcheck/bean/DependencyTest.java index 1fcf346..ecaa67a 100644 --- a/src/test/java/it/pagopa/maven/depcheck/bean/DependencyTest.java +++ b/src/test/java/it/pagopa/maven/depcheck/bean/DependencyTest.java @@ -16,29 +16,36 @@ public class DependencyTest { @Test public void test1() { - Dependency d1 = new Dependency("2", "1", "3", "4"); - Dependency d2 = new Dependency("2", "1", "3", "5"); + Dependency d1 = new Dependency("0", "2", "1", "3", "4"); + Dependency d2 = new Dependency("0", "2", "1", "3", "5"); assertTrue(d1.compareTo(d2) < 0); } @Test public void test2() { - Dependency d1 = new Dependency("2", "1", "3", "4"); - Dependency d2 = new Dependency("2", "1", "6", "5"); + Dependency d1 = new Dependency("0", "2", "1", "3", "4"); + Dependency d2 = new Dependency("0", "2", "1", "6", "5"); assertTrue(d1.compareTo(d2) < 0); } @Test public void test3() { - Dependency d1 = new Dependency("2", "1", "3", "4"); - Dependency d2 = new Dependency("7", "1", "6", "5"); + Dependency d1 = new Dependency("0", "2", "1", "3", "4"); + Dependency d2 = new Dependency("0", "7", "1", "6", "5"); assertTrue(d1.compareTo(d2) < 0); } @Test public void test4() { - Dependency d1 = new Dependency("2", "1", "3", "4"); - Dependency d2 = new Dependency("7", "8", "6", "5"); + Dependency d1 = new Dependency("0", "2", "1", "3", "4"); + Dependency d2 = new Dependency("0", "7", "8", "6", "5"); + assertTrue(d1.compareTo(d2) < 0); + } + + @Test + public void test5() { + Dependency d1 = new Dependency("0", "2", "1", "3", "4"); + Dependency d2 = new Dependency("9", "7", "8", "6", "5"); assertTrue(d1.compareTo(d2) < 0); } } \ No newline at end of file diff --git a/src/test/resources/unit-test/w-parent-w-plugins-verify-ok.json b/src/test/resources/unit-test/w-parent-w-plugins-verify-ok.json index e499d33..58090e2 100644 --- a/src/test/resources/unit-test/w-parent-w-plugins-verify-ok.json +++ b/src/test/resources/unit-test/w-parent-w-plugins-verify-ok.json @@ -1,36 +1,42 @@ { "dependencies": [ { + "id": "art_1", "artifactId": "artifact_1", "groupId": "group_1", "version": "version_1", "sha256": "A-X-Jx18XkXHRJVHThrKvsWjQwBtJ7nELSQImvuKjko=" }, { + "id": "art_2", "artifactId": "artifact_2", "groupId": "group_2", "version": "version_2", "sha256": "TYB8qTVHft4XP3n_qyd7H6AxU3ukxrhMt0tz2lnRZ1w=" }, { + "id": "art_3", "artifactId": "artifact_3", "groupId": "group_3", "version": "version_3", "sha256": "_5OCEb0meAy3k3tY_5-vacMSEAtz1HHUHtDSBB5RoZA=" }, { + "id": "art_4", "artifactId": "artifact_4", "groupId": "group_4", "version": "version_4", "sha256": "Ekxz-HgCxeqhbfB7P90rlFtBaixQl5FuFqkrXiFOp-M=" }, { + "id": "art_5", "artifactId": "artifact_5", "groupId": "group_5", "version": "version_5", "sha256": "_71naveVg8qvhtWS1JWrJM_n8WyZ7XBhfFE0HsvarXE=" }, { + "id": "art_6", "artifactId": "artifact_6", "groupId": "group_6", "version": "version_6", diff --git a/src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json b/src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json index 3ff2a7e..3d3166f 100644 --- a/src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json +++ b/src/test/resources/unit-test/wo-parent-w-plugins-verify-ok.json @@ -1,24 +1,28 @@ { "dependencies": [ { + "id": "art_1", "artifactId": "artifact_1", "groupId": "group_1", "version": "version_1", "sha256": "A-X-Jx18XkXHRJVHThrKvsWjQwBtJ7nELSQImvuKjko=" }, { + "id": "art_2", "artifactId": "artifact_2", "groupId": "group_2", "version": "version_2", "sha256": "TYB8qTVHft4XP3n_qyd7H6AxU3ukxrhMt0tz2lnRZ1w=" }, { + "id": "art_3", "artifactId": "artifact_3", "groupId": "group_3", "version": "version_3", "sha256": "_5OCEb0meAy3k3tY_5-vacMSEAtz1HHUHtDSBB5RoZA=" }, { + "id": "art_4", "artifactId": "artifact_4", "groupId": "group_4", "version": "version_4", diff --git a/src/test/resources/unit-test/wo-parent-wo-plugins-missing-dependency.json b/src/test/resources/unit-test/wo-parent-wo-plugins-missing-dependency.json index c3c9f0f..97b4a3b 100644 --- a/src/test/resources/unit-test/wo-parent-wo-plugins-missing-dependency.json +++ b/src/test/resources/unit-test/wo-parent-wo-plugins-missing-dependency.json @@ -1,6 +1,7 @@ { "dependencies": [ { + "id": "art_1", "artifactId": "artifact_1", "groupId": "group_1", "version": "version_1", diff --git a/src/test/resources/unit-test/wo-parent-wo-plugins-verify-ok.json b/src/test/resources/unit-test/wo-parent-wo-plugins-verify-ok.json index cd4d65e..ca67eca 100644 --- a/src/test/resources/unit-test/wo-parent-wo-plugins-verify-ok.json +++ b/src/test/resources/unit-test/wo-parent-wo-plugins-verify-ok.json @@ -1,12 +1,14 @@ { "dependencies": [ { + "id": "art_1", "artifactId": "artifact_1", "groupId": "group_1", "version": "version_1", "sha256": "A-X-Jx18XkXHRJVHThrKvsWjQwBtJ7nELSQImvuKjko=" }, { + "id": "art_2", "artifactId": "artifact_2", "groupId": "group_2", "version": "version_2", diff --git a/src/test/resources/unit-test/wo-parent-wo-plugins-wrong-hash.json b/src/test/resources/unit-test/wo-parent-wo-plugins-wrong-hash.json index ade0250..de07d9a 100644 --- a/src/test/resources/unit-test/wo-parent-wo-plugins-wrong-hash.json +++ b/src/test/resources/unit-test/wo-parent-wo-plugins-wrong-hash.json @@ -1,12 +1,14 @@ { "dependencies": [ { + "id": "art_1", "artifactId": "artifact_1", "groupId": "group_1", "version": "version_1", "sha256": "A-X-Jx18XkXHRJVHThrKvsWjQwBtJ7nELSQImvuKjko=" }, { + "id": "art_2", "artifactId": "artifact_2", "groupId": "group_2", "version": "version_2",