@Test public void testRepositoryEventsSuccessfulLocal() throws ArtifactResolutionException, IOException { RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); File tmpFile = TestFileUtils.createTempFile( "tmp" ); Map<String, String> properties = new HashMap<String, String>(); properties.put( ArtifactProperties.LOCAL_PATH, tmpFile.getAbsolutePath() ); artifact = artifact.setProperties( properties ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); resolver.resolveArtifact( session, request ); List<RepositoryEvent> events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( EventType.ARTIFACT_RESOLVING, event.getType() ); assertNull( event.getException() ); assertEquals( artifact, event.getArtifact() ); event = events.get( 1 ); assertEquals( EventType.ARTIFACT_RESOLVED, event.getType() ); assertNull( event.getException() ); assertEquals( artifact, event.getArtifact().setFile( null ) ); }
public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); }
DefaultArtifactResolver implements ArtifactResolver, Service { public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); } }
DefaultArtifactResolver implements ArtifactResolver, Service { public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); } DefaultArtifactResolver(); @Inject  DefaultArtifactResolver( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                             VersionResolver versionResolver, UpdateCheckManager updateCheckManager,
                             RepositoryConnectorProvider repositoryConnectorProvider,
                             RemoteRepositoryManager remoteRepositoryManager, SyncContextFactory syncContextFactory,
                             OfflineController offlineController, LoggerFactory loggerFactory ); }
DefaultArtifactResolver implements ArtifactResolver, Service { public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); } DefaultArtifactResolver(); @Inject  DefaultArtifactResolver( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                             VersionResolver versionResolver, UpdateCheckManager updateCheckManager,
                             RepositoryConnectorProvider repositoryConnectorProvider,
                             RemoteRepositoryManager remoteRepositoryManager, SyncContextFactory syncContextFactory,
                             OfflineController offlineController, LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultArtifactResolver setLoggerFactory( LoggerFactory loggerFactory ); DefaultArtifactResolver setFileProcessor( FileProcessor fileProcessor ); DefaultArtifactResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultArtifactResolver setVersionResolver( VersionResolver versionResolver ); DefaultArtifactResolver setUpdateCheckManager( UpdateCheckManager updateCheckManager ); DefaultArtifactResolver setRepositoryConnectorProvider( RepositoryConnectorProvider repositoryConnectorProvider ); DefaultArtifactResolver setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ); DefaultArtifactResolver setSyncContextFactory( SyncContextFactory syncContextFactory ); DefaultArtifactResolver setOfflineController( OfflineController offlineController ); ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ); List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
                                                  Collection<? extends ArtifactRequest> requests ); }
DefaultArtifactResolver implements ArtifactResolver, Service { public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); } DefaultArtifactResolver(); @Inject  DefaultArtifactResolver( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher,
                             VersionResolver versionResolver, UpdateCheckManager updateCheckManager,
                             RepositoryConnectorProvider repositoryConnectorProvider,
                             RemoteRepositoryManager remoteRepositoryManager, SyncContextFactory syncContextFactory,
                             OfflineController offlineController, LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultArtifactResolver setLoggerFactory( LoggerFactory loggerFactory ); DefaultArtifactResolver setFileProcessor( FileProcessor fileProcessor ); DefaultArtifactResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ); DefaultArtifactResolver setVersionResolver( VersionResolver versionResolver ); DefaultArtifactResolver setUpdateCheckManager( UpdateCheckManager updateCheckManager ); DefaultArtifactResolver setRepositoryConnectorProvider( RepositoryConnectorProvider repositoryConnectorProvider ); DefaultArtifactResolver setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ); DefaultArtifactResolver setSyncContextFactory( SyncContextFactory syncContextFactory ); DefaultArtifactResolver setOfflineController( OfflineController offlineController ); ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ); List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
                                                  Collection<? extends ArtifactRequest> requests );  }