@Test(expected = MojoExecutionException.class) public void testResolutionFailure() throws Exception { when(repositorySystem.resolveDependencies(eq(repositorySystemSession), any(DependencyRequest.class))) .thenThrow(new DependencyResolutionException(new DependencyResult(new DependencyRequest(root, mock(DependencyFilter.class))), new Throwable())); classLoaderResolver.resolve(new MavenCoordinate(FOO, BAR, QUX, JAR)); }
public ClassLoader resolve(MavenCoordinate mavenCoordinate) throws MojoFailureException, MojoExecutionException { ClassLoader classLoader = classLoaders.get(mavenCoordinate); if (classLoader == null) { classLoader = doResolve(mavenCoordinate); classLoaders.put(mavenCoordinate, classLoader); } return classLoader; }
ClassLoaderResolver implements Closeable { public ClassLoader resolve(MavenCoordinate mavenCoordinate) throws MojoFailureException, MojoExecutionException { ClassLoader classLoader = classLoaders.get(mavenCoordinate); if (classLoader == null) { classLoader = doResolve(mavenCoordinate); classLoaders.put(mavenCoordinate, classLoader); } return classLoader; } }
ClassLoaderResolver implements Closeable { public ClassLoader resolve(MavenCoordinate mavenCoordinate) throws MojoFailureException, MojoExecutionException { ClassLoader classLoader = classLoaders.get(mavenCoordinate); if (classLoader == null) { classLoader = doResolve(mavenCoordinate); classLoaders.put(mavenCoordinate, classLoader); } return classLoader; } ClassLoaderResolver(Log log, RepositorySystem repositorySystem, RepositorySystemSession repositorySystemSession, List<RemoteRepository> remoteRepositories); }
ClassLoaderResolver implements Closeable { public ClassLoader resolve(MavenCoordinate mavenCoordinate) throws MojoFailureException, MojoExecutionException { ClassLoader classLoader = classLoaders.get(mavenCoordinate); if (classLoader == null) { classLoader = doResolve(mavenCoordinate); classLoaders.put(mavenCoordinate, classLoader); } return classLoader; } ClassLoaderResolver(Log log, RepositorySystem repositorySystem, RepositorySystemSession repositorySystemSession, List<RemoteRepository> remoteRepositories); ClassLoader resolve(MavenCoordinate mavenCoordinate); void close(); }
ClassLoaderResolver implements Closeable { public ClassLoader resolve(MavenCoordinate mavenCoordinate) throws MojoFailureException, MojoExecutionException { ClassLoader classLoader = classLoaders.get(mavenCoordinate); if (classLoader == null) { classLoader = doResolve(mavenCoordinate); classLoaders.put(mavenCoordinate, classLoader); } return classLoader; } ClassLoaderResolver(Log log, RepositorySystem repositorySystem, RepositorySystemSession repositorySystemSession, List<RemoteRepository> remoteRepositories); ClassLoader resolve(MavenCoordinate mavenCoordinate); void close();  }