FingerprintMojo extends TreeMojo { static LibraryFingerprint fingerprint(final URL[] ruleDeps, final URL[] libDeps, final List<String> presents, final List<String> absents, final Logger logger) throws IOException { try (final URLClassLoader classLoader = new URLClassLoader(ruleDeps, new URLClassLoader(libDeps != null ? libDeps : new URL[0], null))) { return new LibraryFingerprint(classLoader, presents, absents, logger); } }  @Override DependencyNodeVisitor getSerializingDependencyNodeVisitor(final Writer writer); @Override void execute();  }
@Test public void testJms1() throws IOException { final URL[] ruleDeps = new URL[] { getPath(new MavenDependency("io.opentracing.contrib.specialagent.rule", "jms", version)), getPath(new MavenDependency("io.opentracing.contrib", "opentracing-jms-1", "0.1.7")), getPath(new MavenDependency("io.opentracing.contrib", "opentracing-jms-common", "0.1.7")) }; final URL[] libDeps = new URL[] { getPath(new MavenDependency("javax.jms", "jms-api", "1.1-rev-1")) }; final LibraryFingerprint fingerprint = FingerprintMojo.fingerprint(ruleDeps, libDeps, null, null, logger); System.out.println(fingerprint.toString()); assertNotEquals("", fingerprint.toString()); }
@Test public void testJms2() throws IOException { final URL[] ruleDeps = new URL[] { getPath(new MavenDependency("io.opentracing.contrib.specialagent.rule", "jms", version)), getPath(new MavenDependency("io.opentracing.contrib", "opentracing-jms-2", "0.1.7")), getPath(new MavenDependency("io.opentracing.contrib", "opentracing-jms-common", "0.1.7")) }; final URL[] libDeps = new URL[] { getPath(new MavenDependency("javax.jms", "javax.jms-api", "2.0.1")) }; final LibraryFingerprint fingerprint = FingerprintMojo.fingerprint(ruleDeps, libDeps, null, null, logger); System.out.println(fingerprint.toString()); assertNotEquals("", fingerprint.toString()); }