pax_global_header00006660000000000000000000000064124554635610014525gustar00rootroot0000000000000052 comment=8092eaecbd34bd7bf18f49cb8a99bd218fb6e30e aether-1.0.2.v20150114/000077500000000000000000000000001245546356100140575ustar00rootroot00000000000000aether-1.0.2.v20150114/.gitignore000066400000000000000000000000771245546356100160530ustar00rootroot00000000000000target/ .project .classpath .settings/ .idea *.iml *.ipr *.iws aether-1.0.2.v20150114/CONTRIBUTING.md000066400000000000000000000004421245546356100163100ustar00rootroot00000000000000Contributing Patches ==================== Please be sure to read our [contribution guide](http://www.eclipse.org/aether/contribution/) first to avoid running down the wrong path. Non-conforming contributions are less likely to get accepted or might not be noticed by the committers at all. aether-1.0.2.v20150114/README.md000066400000000000000000000002201245546356100153300ustar00rootroot00000000000000Homepage ======== License ======= - [Eclipse Public License, v1.0](http://www.eclipse.org/legal/epl-v10.html) aether-1.0.2.v20150114/aether-api/000077500000000000000000000000001245546356100160765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/pom.xml000066400000000000000000000034511245546356100174160ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-api Aether API The application programming interface for the repository system. org.eclipse.aether.api junit junit test org.hamcrest hamcrest-library test org.codehaus.mojo animal-sniffer-maven-plugin org.codehaus.mojo clirr-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-api/src/000077500000000000000000000000001245546356100166655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/000077500000000000000000000000001245546356100176115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/000077500000000000000000000000001245546356100205325ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/000077500000000000000000000000001245546356100213215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/000077500000000000000000000000001245546356100227455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100242155ustar00rootroot00000000000000AbstractForwardingRepositorySystemSession.java000066400000000000000000000121501245546356100354370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.Map; import org.eclipse.aether.artifact.ArtifactTypeRegistry; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.transfer.TransferListener; /** * A special repository system session to enable decorating or proxying another session. To do so, clients have to * create a subclass and implement {@link #getSession()}. */ public abstract class AbstractForwardingRepositorySystemSession implements RepositorySystemSession { /** * Creates a new forwarding session. */ protected AbstractForwardingRepositorySystemSession() { } /** * Gets the repository system session to which this instance forwards calls. It's worth noting that this class does * not save/cache the returned reference but queries this method before each forwarding. Hence, the session * forwarded to may change over time or depending on the context (e.g. calling thread). * * @return The repository system session to forward calls to, never {@code null}. */ protected abstract RepositorySystemSession getSession(); public boolean isOffline() { return getSession().isOffline(); } public boolean isIgnoreArtifactDescriptorRepositories() { return getSession().isIgnoreArtifactDescriptorRepositories(); } public ResolutionErrorPolicy getResolutionErrorPolicy() { return getSession().getResolutionErrorPolicy(); } public ArtifactDescriptorPolicy getArtifactDescriptorPolicy() { return getSession().getArtifactDescriptorPolicy(); } public String getChecksumPolicy() { return getSession().getChecksumPolicy(); } public String getUpdatePolicy() { return getSession().getUpdatePolicy(); } public LocalRepository getLocalRepository() { return getSession().getLocalRepository(); } public LocalRepositoryManager getLocalRepositoryManager() { return getSession().getLocalRepositoryManager(); } public WorkspaceReader getWorkspaceReader() { return getSession().getWorkspaceReader(); } public RepositoryListener getRepositoryListener() { return getSession().getRepositoryListener(); } public TransferListener getTransferListener() { return getSession().getTransferListener(); } public Map getSystemProperties() { return getSession().getSystemProperties(); } public Map getUserProperties() { return getSession().getUserProperties(); } public Map getConfigProperties() { return getSession().getConfigProperties(); } public MirrorSelector getMirrorSelector() { return getSession().getMirrorSelector(); } public ProxySelector getProxySelector() { return getSession().getProxySelector(); } public AuthenticationSelector getAuthenticationSelector() { return getSession().getAuthenticationSelector(); } public ArtifactTypeRegistry getArtifactTypeRegistry() { return getSession().getArtifactTypeRegistry(); } public DependencyTraverser getDependencyTraverser() { return getSession().getDependencyTraverser(); } public DependencyManager getDependencyManager() { return getSession().getDependencyManager(); } public DependencySelector getDependencySelector() { return getSession().getDependencySelector(); } public VersionFilter getVersionFilter() { return getSession().getVersionFilter(); } public DependencyGraphTransformer getDependencyGraphTransformer() { return getSession().getDependencyGraphTransformer(); } public SessionData getData() { return getSession().getData(); } public RepositoryCache getCache() { return getSession().getCache(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java000066400000000000000000000043061245546356100324340ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * A skeleton implementation for custom repository listeners. The callback methods in this class do nothing. */ public abstract class AbstractRepositoryListener implements RepositoryListener { /** * Enables subclassing. */ protected AbstractRepositoryListener() { } public void artifactDeployed( RepositoryEvent event ) { } public void artifactDeploying( RepositoryEvent event ) { } public void artifactDescriptorInvalid( RepositoryEvent event ) { } public void artifactDescriptorMissing( RepositoryEvent event ) { } public void artifactDownloaded( RepositoryEvent event ) { } public void artifactDownloading( RepositoryEvent event ) { } public void artifactInstalled( RepositoryEvent event ) { } public void artifactInstalling( RepositoryEvent event ) { } public void artifactResolved( RepositoryEvent event ) { } public void artifactResolving( RepositoryEvent event ) { } public void metadataDeployed( RepositoryEvent event ) { } public void metadataDeploying( RepositoryEvent event ) { } public void metadataDownloaded( RepositoryEvent event ) { } public void metadataDownloading( RepositoryEvent event ) { } public void metadataInstalled( RepositoryEvent event ) { } public void metadataInstalling( RepositoryEvent event ) { } public void metadataInvalid( RepositoryEvent event ) { } public void metadataResolved( RepositoryEvent event ) { } public void metadataResolving( RepositoryEvent event ) { } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java000066400000000000000000000137451245546356100317560ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * The keys and defaults for common configuration properties. * * @see RepositorySystemSession#getConfigProperties() */ public final class ConfigurationProperties { private static final String PREFIX_AETHER = "aether."; private static final String PREFIX_CONNECTOR = PREFIX_AETHER + "connector."; /** * The prefix for properties that control the priority of pluggable extensions like transporters. For example, for * an extension with the fully qualified class name "org.eclipse.MyExtensionFactory", the configuration properties * "aether.priority.org.eclipse.MyExtensionFactory", "aether.priority.MyExtensionFactory" and * "aether.priority.MyExtension" will be consulted for the priority, in that order (obviously, the last key is only * tried if the class name ends with "Factory"). The corresponding value is a float and the special value * {@link Float#NaN} or "NaN" (case-sensitive) can be used to disable the extension. */ public static final String PREFIX_PRIORITY = PREFIX_AETHER + "priority."; /** * A flag indicating whether the priorities of pluggable extensions are implicitly given by their iteration order * such that the first extension has the highest priority. If set, an extension's built-in priority as well as any * corresponding {@code aether.priority.*} configuration properties are ignored when searching for a suitable * implementation among the available extensions. This priority mode is meant for cases where the application will * present/inject extensions in the desired search order. * * @see #DEFAULT_IMPLICIT_PRIORITIES */ public static final String IMPLICIT_PRIORITIES = PREFIX_PRIORITY + "implicit"; /** * The default extension priority mode if {@link #IMPLICIT_PRIORITIES} isn't set. */ public static final boolean DEFAULT_IMPLICIT_PRIORITIES = false; /** * A flag indicating whether interaction with the user is allowed. * * @see #DEFAULT_INTERACTIVE */ public static final String INTERACTIVE = PREFIX_AETHER + "interactive"; /** * The default interactive mode if {@link #INTERACTIVE} isn't set. */ public static final boolean DEFAULT_INTERACTIVE = false; /** * The user agent that repository connectors should report to servers. * * @see #DEFAULT_USER_AGENT */ public static final String USER_AGENT = PREFIX_CONNECTOR + "userAgent"; /** * The default user agent to use if {@link #USER_AGENT} isn't set. */ public static final String DEFAULT_USER_AGENT = "Aether"; /** * The maximum amount of time (in milliseconds) to wait for a successful connection to a remote server. Non-positive * values indicate no timeout. * * @see #DEFAULT_CONNECT_TIMEOUT */ public static final String CONNECT_TIMEOUT = PREFIX_CONNECTOR + "connectTimeout"; /** * The default connect timeout to use if {@link #CONNECT_TIMEOUT} isn't set. */ public static final int DEFAULT_CONNECT_TIMEOUT = 10 * 1000; /** * The maximum amount of time (in milliseconds) to wait for remaining data to arrive from a remote server. Note that * this timeout does not restrict the overall duration of a request, it only restricts the duration of inactivity * between consecutive data packets. Non-positive values indicate no timeout. * * @see #DEFAULT_REQUEST_TIMEOUT */ public static final String REQUEST_TIMEOUT = PREFIX_CONNECTOR + "requestTimeout"; /** * The default request timeout to use if {@link #REQUEST_TIMEOUT} isn't set. */ public static final int DEFAULT_REQUEST_TIMEOUT = 1800 * 1000; /** * The request headers to use for HTTP-based repository connectors. The headers are specified using a * {@code Map}, mapping a header name to its value. Besides this general key, clients may also * specify headers for a specific remote repository by appending the suffix {@code .} to this key when * storing the headers map. The repository-specific headers map is supposed to be complete, i.e. is not merged with * the general headers map. */ public static final String HTTP_HEADERS = PREFIX_CONNECTOR + "http.headers"; /** * The encoding/charset to use when exchanging credentials with HTTP servers. Besides this general key, clients may * also specify the encoding for a specific remote repository by appending the suffix {@code .} to this key * when storing the charset name. * * @see #DEFAULT_HTTP_CREDENTIAL_ENCODING */ public static final String HTTP_CREDENTIAL_ENCODING = PREFIX_CONNECTOR + "http.credentialEncoding"; /** * The default encoding/charset to use if {@link #HTTP_CREDENTIAL_ENCODING} isn't set. */ public static final String DEFAULT_HTTP_CREDENTIAL_ENCODING = "ISO-8859-1"; /** * A flag indicating whether checksums which are retrieved during checksum validation should be persisted in the * local filesystem next to the file they provide the checksum for. * * @see #DEFAULT_PERSISTED_CHECKSUMS */ public static final String PERSISTED_CHECKSUMS = PREFIX_CONNECTOR + "persistedChecksums"; /** * The default checksum persistence mode if {@link #PERSISTED_CHECKSUMS} isn't set. */ public static final boolean DEFAULT_PERSISTED_CHECKSUMS = true; private ConfigurationProperties() { // hide constructor } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java000066400000000000000000000025471245546356100315000ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * A simplistic repository cache backed by a thread-safe map. The simplistic nature of this cache makes it only suitable * for use with short-lived repository system sessions where pruning of cache data is not required. */ public final class DefaultRepositoryCache implements RepositoryCache { private final Map cache = new ConcurrentHashMap( 256 ); public Object get( RepositorySystemSession session, Object key ) { return cache.get( key ); } public void put( RepositorySystemSession session, Object key, Object data ) { if ( data != null ) { cache.put( key, data ); } else { cache.remove( key ); } } } DefaultRepositorySystemSession.java000066400000000000000000000711401245546356100332410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.transfer.TransferListener; /** * A simple repository system session. *

* Note: This class is not thread-safe. It is assumed that the mutators get only called during an * initialization phase and that the session itself is not changed once initialized and being used by the repository * system. It is recommended to call {@link #setReadOnly()} once the session has been fully initialized to prevent * accidental manipulation of it afterwards. */ public final class DefaultRepositorySystemSession implements RepositorySystemSession { private boolean readOnly; private boolean offline; private boolean ignoreArtifactDescriptorRepositories; private ResolutionErrorPolicy resolutionErrorPolicy; private ArtifactDescriptorPolicy artifactDescriptorPolicy; private String checksumPolicy; private String updatePolicy; private LocalRepositoryManager localRepositoryManager; private WorkspaceReader workspaceReader; private RepositoryListener repositoryListener; private TransferListener transferListener; private Map systemProperties; private Map systemPropertiesView; private Map userProperties; private Map userPropertiesView; private Map configProperties; private Map configPropertiesView; private MirrorSelector mirrorSelector; private ProxySelector proxySelector; private AuthenticationSelector authenticationSelector; private ArtifactTypeRegistry artifactTypeRegistry; private DependencyTraverser dependencyTraverser; private DependencyManager dependencyManager; private DependencySelector dependencySelector; private VersionFilter versionFilter; private DependencyGraphTransformer dependencyGraphTransformer; private SessionData data; private RepositoryCache cache; /** * Creates an uninitialized session. Note: The new session is not ready to use, as a bare minimum, * {@link #setLocalRepositoryManager(LocalRepositoryManager)} needs to be called but usually other settings also * need to be customized to achieve meaningful behavior. */ public DefaultRepositorySystemSession() { systemProperties = new HashMap(); systemPropertiesView = Collections.unmodifiableMap( systemProperties ); userProperties = new HashMap(); userPropertiesView = Collections.unmodifiableMap( userProperties ); configProperties = new HashMap(); configPropertiesView = Collections.unmodifiableMap( configProperties ); mirrorSelector = NullMirrorSelector.INSTANCE; proxySelector = NullProxySelector.INSTANCE; authenticationSelector = NullAuthenticationSelector.INSTANCE; artifactTypeRegistry = NullArtifactTypeRegistry.INSTANCE; data = new DefaultSessionData(); } /** * Creates a shallow copy of the specified session. Actually, the copy is not completely shallow, all maps holding * system/user/config properties are copied as well. In other words, invoking any mutator on the new session itself * has no effect on the original session. Other mutable objects like the session data and cache (if any) are not * copied and will be shared with the original session unless reconfigured. * * @param session The session to copy, must not be {@code null}. */ public DefaultRepositorySystemSession( RepositorySystemSession session ) { if ( session == null ) { throw new IllegalArgumentException( "repository system session not specified" ); } setOffline( session.isOffline() ); setIgnoreArtifactDescriptorRepositories( session.isIgnoreArtifactDescriptorRepositories() ); setResolutionErrorPolicy( session.getResolutionErrorPolicy() ); setArtifactDescriptorPolicy( session.getArtifactDescriptorPolicy() ); setChecksumPolicy( session.getChecksumPolicy() ); setUpdatePolicy( session.getUpdatePolicy() ); setLocalRepositoryManager( session.getLocalRepositoryManager() ); setWorkspaceReader( session.getWorkspaceReader() ); setRepositoryListener( session.getRepositoryListener() ); setTransferListener( session.getTransferListener() ); setSystemProperties( session.getSystemProperties() ); setUserProperties( session.getUserProperties() ); setConfigProperties( session.getConfigProperties() ); setMirrorSelector( session.getMirrorSelector() ); setProxySelector( session.getProxySelector() ); setAuthenticationSelector( session.getAuthenticationSelector() ); setArtifactTypeRegistry( session.getArtifactTypeRegistry() ); setDependencyTraverser( session.getDependencyTraverser() ); setDependencyManager( session.getDependencyManager() ); setDependencySelector( session.getDependencySelector() ); setVersionFilter( session.getVersionFilter() ); setDependencyGraphTransformer( session.getDependencyGraphTransformer() ); setData( session.getData() ); setCache( session.getCache() ); } public boolean isOffline() { return offline; } /** * Controls whether the repository system operates in offline mode and avoids/refuses any access to remote * repositories. * * @param offline {@code true} if the repository system is in offline mode, {@code false} otherwise. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setOffline( boolean offline ) { failIfReadOnly(); this.offline = offline; return this; } public boolean isIgnoreArtifactDescriptorRepositories() { return ignoreArtifactDescriptorRepositories; } /** * Controls whether repositories declared in artifact descriptors should be ignored during transitive dependency * collection. If enabled, only the repositories originally provided with the collect request will be considered. * * @param ignoreArtifactDescriptorRepositories {@code true} to ignore additional repositories from artifact * descriptors, {@code false} to merge those with the originally specified repositories. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setIgnoreArtifactDescriptorRepositories( boolean ignoreArtifactDescriptorRepositories ) { failIfReadOnly(); this.ignoreArtifactDescriptorRepositories = ignoreArtifactDescriptorRepositories; return this; } public ResolutionErrorPolicy getResolutionErrorPolicy() { return resolutionErrorPolicy; } /** * Sets the policy which controls whether resolutions errors from remote repositories should be cached. * * @param resolutionErrorPolicy The resolution error policy for this session, may be {@code null} if resolution * errors should generally not be cached. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setResolutionErrorPolicy( ResolutionErrorPolicy resolutionErrorPolicy ) { failIfReadOnly(); this.resolutionErrorPolicy = resolutionErrorPolicy; return this; } public ArtifactDescriptorPolicy getArtifactDescriptorPolicy() { return artifactDescriptorPolicy; } /** * Sets the policy which controls how errors related to reading artifact descriptors should be handled. * * @param artifactDescriptorPolicy The descriptor error policy for this session, may be {@code null} if descriptor * errors should generally not be tolerated. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setArtifactDescriptorPolicy( ArtifactDescriptorPolicy artifactDescriptorPolicy ) { failIfReadOnly(); this.artifactDescriptorPolicy = artifactDescriptorPolicy; return this; } public String getChecksumPolicy() { return checksumPolicy; } /** * Sets the global checksum policy. If set, the global checksum policy overrides the checksum policies of the remote * repositories being used for resolution. * * @param checksumPolicy The global checksum policy, may be {@code null}/empty to apply the per-repository policies. * @return This session for chaining, never {@code null}. * @see RepositoryPolicy#CHECKSUM_POLICY_FAIL * @see RepositoryPolicy#CHECKSUM_POLICY_IGNORE * @see RepositoryPolicy#CHECKSUM_POLICY_WARN */ public DefaultRepositorySystemSession setChecksumPolicy( String checksumPolicy ) { failIfReadOnly(); this.checksumPolicy = checksumPolicy; return this; } public String getUpdatePolicy() { return updatePolicy; } /** * Sets the global update policy. If set, the global update policy overrides the update policies of the remote * repositories being used for resolution. * * @param updatePolicy The global update policy, may be {@code null}/empty to apply the per-repository policies. * @return This session for chaining, never {@code null}. * @see RepositoryPolicy#UPDATE_POLICY_ALWAYS * @see RepositoryPolicy#UPDATE_POLICY_DAILY * @see RepositoryPolicy#UPDATE_POLICY_NEVER */ public DefaultRepositorySystemSession setUpdatePolicy( String updatePolicy ) { failIfReadOnly(); this.updatePolicy = updatePolicy; return this; } public LocalRepository getLocalRepository() { LocalRepositoryManager lrm = getLocalRepositoryManager(); return ( lrm != null ) ? lrm.getRepository() : null; } public LocalRepositoryManager getLocalRepositoryManager() { return localRepositoryManager; } /** * Sets the local repository manager used during this session. Note: Eventually, a valid session must have * a local repository manager set. * * @param localRepositoryManager The local repository manager used during this session, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setLocalRepositoryManager( LocalRepositoryManager localRepositoryManager ) { failIfReadOnly(); this.localRepositoryManager = localRepositoryManager; return this; } public WorkspaceReader getWorkspaceReader() { return workspaceReader; } /** * Sets the workspace reader used during this session. If set, the workspace reader will usually be consulted first * to resolve artifacts. * * @param workspaceReader The workspace reader for this session, may be {@code null} if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setWorkspaceReader( WorkspaceReader workspaceReader ) { failIfReadOnly(); this.workspaceReader = workspaceReader; return this; } public RepositoryListener getRepositoryListener() { return repositoryListener; } /** * Sets the listener being notified of actions in the repository system. * * @param repositoryListener The repository listener, may be {@code null} if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setRepositoryListener( RepositoryListener repositoryListener ) { failIfReadOnly(); this.repositoryListener = repositoryListener; return this; } public TransferListener getTransferListener() { return transferListener; } /** * Sets the listener being notified of uploads/downloads by the repository system. * * @param transferListener The transfer listener, may be {@code null} if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setTransferListener( TransferListener transferListener ) { failIfReadOnly(); this.transferListener = transferListener; return this; } private Map copySafe( Map table, Class valueType ) { Map map; if ( table == null || table.isEmpty() ) { map = new HashMap(); } else { map = new HashMap( (int) ( table.size() / 0.75f ) + 1 ); for ( Map.Entry entry : table.entrySet() ) { Object key = entry.getKey(); if ( key instanceof String ) { Object value = entry.getValue(); if ( valueType.isInstance( value ) ) { map.put( key.toString(), valueType.cast( value ) ); } } } } return map; } public Map getSystemProperties() { return systemPropertiesView; } /** * Sets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually * collected from the runtime environment like {@link System#getProperties()} and environment variables. *

* Note: System properties are of type {@code Map} and any key-value pair in the input map * that doesn't match this type will be silently ignored. * * @param systemProperties The system properties, may be {@code null} or empty if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setSystemProperties( Map systemProperties ) { failIfReadOnly(); this.systemProperties = copySafe( systemProperties, String.class ); systemPropertiesView = Collections.unmodifiableMap( this.systemProperties ); return this; } /** * Sets the specified system property. * * @param key The property key, must not be {@code null}. * @param value The property value, may be {@code null} to remove/unset the property. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setSystemProperty( String key, String value ) { failIfReadOnly(); if ( value != null ) { systemProperties.put( key, value ); } else { systemProperties.remove( key ); } return this; } public Map getUserProperties() { return userPropertiesView; } /** * Sets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to * system properties but are set on the discretion of the user and hence are considered of higher priority than * system properties in case of conflicts. *

* Note: User properties are of type {@code Map} and any key-value pair in the input map * that doesn't match this type will be silently ignored. * * @param userProperties The user properties, may be {@code null} or empty if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setUserProperties( Map userProperties ) { failIfReadOnly(); this.userProperties = copySafe( userProperties, String.class ); userPropertiesView = Collections.unmodifiableMap( this.userProperties ); return this; } /** * Sets the specified user property. * * @param key The property key, must not be {@code null}. * @param value The property value, may be {@code null} to remove/unset the property. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setUserProperty( String key, String value ) { failIfReadOnly(); if ( value != null ) { userProperties.put( key, value ); } else { userProperties.remove( key ); } return this; } public Map getConfigProperties() { return configPropertiesView; } /** * Sets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling, * connector-specific behavior, etc.). *

* Note: Configuration properties are of type {@code Map} and any key-value pair in the * input map that doesn't match this type will be silently ignored. * * @param configProperties The configuration properties, may be {@code null} or empty if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setConfigProperties( Map configProperties ) { failIfReadOnly(); this.configProperties = copySafe( configProperties, Object.class ); configPropertiesView = Collections.unmodifiableMap( this.configProperties ); return this; } /** * Sets the specified configuration property. * * @param key The property key, must not be {@code null}. * @param value The property value, may be {@code null} to remove/unset the property. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setConfigProperty( String key, Object value ) { failIfReadOnly(); if ( value != null ) { configProperties.put( key, value ); } else { configProperties.remove( key ); } return this; } public MirrorSelector getMirrorSelector() { return mirrorSelector; } /** * Sets the mirror selector to use for repositories discovered in artifact descriptors. Note that this selector is * not used for remote repositories which are passed as request parameters to the repository system, those * repositories are supposed to denote the effective repositories. * * @param mirrorSelector The mirror selector to use, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setMirrorSelector( MirrorSelector mirrorSelector ) { failIfReadOnly(); this.mirrorSelector = mirrorSelector; if ( this.mirrorSelector == null ) { this.mirrorSelector = NullMirrorSelector.INSTANCE; } return this; } public ProxySelector getProxySelector() { return proxySelector; } /** * Sets the proxy selector to use for repositories discovered in artifact descriptors. Note that this selector is * not used for remote repositories which are passed as request parameters to the repository system, those * repositories are supposed to have their proxy (if any) already set. * * @param proxySelector The proxy selector to use, may be {@code null}. * @return This session for chaining, never {@code null}. * @see org.eclipse.aether.repository.RemoteRepository#getProxy() */ public DefaultRepositorySystemSession setProxySelector( ProxySelector proxySelector ) { failIfReadOnly(); this.proxySelector = proxySelector; if ( this.proxySelector == null ) { this.proxySelector = NullProxySelector.INSTANCE; } return this; } public AuthenticationSelector getAuthenticationSelector() { return authenticationSelector; } /** * Sets the authentication selector to use for repositories discovered in artifact descriptors. Note that this * selector is not used for remote repositories which are passed as request parameters to the repository system, * those repositories are supposed to have their authentication (if any) already set. * * @param authenticationSelector The authentication selector to use, may be {@code null}. * @return This session for chaining, never {@code null}. * @see org.eclipse.aether.repository.RemoteRepository#getAuthentication() */ public DefaultRepositorySystemSession setAuthenticationSelector( AuthenticationSelector authenticationSelector ) { failIfReadOnly(); this.authenticationSelector = authenticationSelector; if ( this.authenticationSelector == null ) { this.authenticationSelector = NullAuthenticationSelector.INSTANCE; } return this; } public ArtifactTypeRegistry getArtifactTypeRegistry() { return artifactTypeRegistry; } /** * Sets the registry of artifact types recognized by this session. * * @param artifactTypeRegistry The artifact type registry, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setArtifactTypeRegistry( ArtifactTypeRegistry artifactTypeRegistry ) { failIfReadOnly(); this.artifactTypeRegistry = artifactTypeRegistry; if ( this.artifactTypeRegistry == null ) { this.artifactTypeRegistry = NullArtifactTypeRegistry.INSTANCE; } return this; } public DependencyTraverser getDependencyTraverser() { return dependencyTraverser; } /** * Sets the dependency traverser to use for building dependency graphs. * * @param dependencyTraverser The dependency traverser to use for building dependency graphs, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setDependencyTraverser( DependencyTraverser dependencyTraverser ) { failIfReadOnly(); this.dependencyTraverser = dependencyTraverser; return this; } public DependencyManager getDependencyManager() { return dependencyManager; } /** * Sets the dependency manager to use for building dependency graphs. * * @param dependencyManager The dependency manager to use for building dependency graphs, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setDependencyManager( DependencyManager dependencyManager ) { failIfReadOnly(); this.dependencyManager = dependencyManager; return this; } public DependencySelector getDependencySelector() { return dependencySelector; } /** * Sets the dependency selector to use for building dependency graphs. * * @param dependencySelector The dependency selector to use for building dependency graphs, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setDependencySelector( DependencySelector dependencySelector ) { failIfReadOnly(); this.dependencySelector = dependencySelector; return this; } public VersionFilter getVersionFilter() { return versionFilter; } /** * Sets the version filter to use for building dependency graphs. * * @param versionFilter The version filter to use for building dependency graphs, may be {@code null} to not filter * versions. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setVersionFilter( VersionFilter versionFilter ) { failIfReadOnly(); this.versionFilter = versionFilter; return this; } public DependencyGraphTransformer getDependencyGraphTransformer() { return dependencyGraphTransformer; } /** * Sets the dependency graph transformer to use for building dependency graphs. * * @param dependencyGraphTransformer The dependency graph transformer to use for building dependency graphs, may be * {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setDependencyGraphTransformer( DependencyGraphTransformer dependencyGraphTransformer ) { failIfReadOnly(); this.dependencyGraphTransformer = dependencyGraphTransformer; return this; } public SessionData getData() { return data; } /** * Sets the custom data associated with this session. * * @param data The session data, may be {@code null}. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setData( SessionData data ) { failIfReadOnly(); this.data = data; if ( this.data == null ) { this.data = new DefaultSessionData(); } return this; } public RepositoryCache getCache() { return cache; } /** * Sets the cache the repository system may use to save data for future reuse during the session. * * @param cache The repository cache, may be {@code null} if none. * @return This session for chaining, never {@code null}. */ public DefaultRepositorySystemSession setCache( RepositoryCache cache ) { failIfReadOnly(); this.cache = cache; return this; } /** * Marks this session as read-only such that any future attempts to call its mutators will fail with an exception. * Marking an already read-only session as read-only has no effect. The session's data and cache remain writable * though. */ public void setReadOnly() { readOnly = true; } private void failIfReadOnly() { if ( readOnly ) { throw new IllegalStateException( "repository system session is read-only" ); } } static class NullProxySelector implements ProxySelector { public static final ProxySelector INSTANCE = new NullProxySelector(); public Proxy getProxy( RemoteRepository repository ) { return repository.getProxy(); } } static class NullMirrorSelector implements MirrorSelector { public static final MirrorSelector INSTANCE = new NullMirrorSelector(); public RemoteRepository getMirror( RemoteRepository repository ) { return null; } } static class NullAuthenticationSelector implements AuthenticationSelector { public static final AuthenticationSelector INSTANCE = new NullAuthenticationSelector(); public Authentication getAuthentication( RemoteRepository repository ) { return repository.getAuthentication(); } } static final class NullArtifactTypeRegistry implements ArtifactTypeRegistry { public static final ArtifactTypeRegistry INSTANCE = new NullArtifactTypeRegistry(); public ArtifactType get( String typeId ) { return null; } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/DefaultSessionData.java000066400000000000000000000041111245546356100305770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** * A simple session data storage backed by a thread-safe map. */ public final class DefaultSessionData implements SessionData { private final ConcurrentMap data; public DefaultSessionData() { data = new ConcurrentHashMap(); } public void set( Object key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } if ( value != null ) { data.put( key, value ); } else { data.remove( key ); } } public boolean set( Object key, Object oldValue, Object newValue ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } if ( newValue != null ) { if ( oldValue == null ) { return data.putIfAbsent( key, newValue ) == null; } return data.replace( key, oldValue, newValue ); } else { if ( oldValue == null ) { return !data.containsKey( key ); } return data.remove( key, oldValue ); } } public Object get( Object key ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } return data.get( key ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositoryCache.java000066400000000000000000000047001245546356100301640ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant * for exclusive consumption by the repository system and is opaque to the cache implementation. Note: * Actual cache implementations must be thread-safe. * * @see RepositorySystemSession#getCache() */ public interface RepositoryCache { /** * Puts the specified data into the cache. It is entirely up to the cache implementation how long this data will be * kept before being purged, i.e. callers must not make any assumptions about the lifetime of cached data. *

* Warning: The cache will directly save the provided reference. If the cached data is mutable, i.e. could * be modified after being put into the cache, the caller is responsible for creating a copy of the original data * and store the copy in the cache. * * @param session The repository session during which the cache is accessed, must not be {@code null}. * @param key The key to use for lookup of the data, must not be {@code null}. * @param data The data to store in the cache, may be {@code null}. */ void put( RepositorySystemSession session, Object key, Object data ); /** * Gets the specified data from the cache. *

* Warning: The cache will directly return the saved reference. If the cached data is to be modified after * its retrieval, the caller is responsible to create a copy of the returned data and use this instead of the cache * record. * * @param session The repository session during which the cache is accessed, must not be {@code null}. * @param key The key to use for lookup of the data, must not be {@code null}. * @return The requested data or {@code null} if none was present in the cache. */ Object get( RepositorySystemSession session, Object key ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositoryEvent.java000066400000000000000000000270031245546356100302430ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.io.File; import java.util.Collections; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.ArtifactRepository; /** * An event describing an action performed by the repository system. Note that events which indicate the end of an * action like {@link EventType#ARTIFACT_RESOLVED} are generally fired in both the success and the failure case. Use * {@link #getException()} to check whether an event denotes success or failure. * * @see RepositoryListener * @see RepositoryEvent.Builder */ public final class RepositoryEvent { /** * The type of the repository event. */ public enum EventType { /** * @see RepositoryListener#artifactDescriptorInvalid(RepositoryEvent) */ ARTIFACT_DESCRIPTOR_INVALID, /** * @see RepositoryListener#artifactDescriptorMissing(RepositoryEvent) */ ARTIFACT_DESCRIPTOR_MISSING, /** * @see RepositoryListener#metadataInvalid(RepositoryEvent) */ METADATA_INVALID, /** * @see RepositoryListener#artifactResolving(RepositoryEvent) */ ARTIFACT_RESOLVING, /** * @see RepositoryListener#artifactResolved(RepositoryEvent) */ ARTIFACT_RESOLVED, /** * @see RepositoryListener#metadataResolving(RepositoryEvent) */ METADATA_RESOLVING, /** * @see RepositoryListener#metadataResolved(RepositoryEvent) */ METADATA_RESOLVED, /** * @see RepositoryListener#artifactDownloading(RepositoryEvent) */ ARTIFACT_DOWNLOADING, /** * @see RepositoryListener#artifactDownloaded(RepositoryEvent) */ ARTIFACT_DOWNLOADED, /** * @see RepositoryListener#metadataDownloading(RepositoryEvent) */ METADATA_DOWNLOADING, /** * @see RepositoryListener#metadataDownloaded(RepositoryEvent) */ METADATA_DOWNLOADED, /** * @see RepositoryListener#artifactInstalling(RepositoryEvent) */ ARTIFACT_INSTALLING, /** * @see RepositoryListener#artifactInstalled(RepositoryEvent) */ ARTIFACT_INSTALLED, /** * @see RepositoryListener#metadataInstalling(RepositoryEvent) */ METADATA_INSTALLING, /** * @see RepositoryListener#metadataInstalled(RepositoryEvent) */ METADATA_INSTALLED, /** * @see RepositoryListener#artifactDeploying(RepositoryEvent) */ ARTIFACT_DEPLOYING, /** * @see RepositoryListener#artifactDeployed(RepositoryEvent) */ ARTIFACT_DEPLOYED, /** * @see RepositoryListener#metadataDeploying(RepositoryEvent) */ METADATA_DEPLOYING, /** * @see RepositoryListener#metadataDeployed(RepositoryEvent) */ METADATA_DEPLOYED } private final EventType type; private final RepositorySystemSession session; private final Artifact artifact; private final Metadata metadata; private final ArtifactRepository repository; private final File file; private final List exceptions; private final RequestTrace trace; RepositoryEvent( Builder builder ) { type = builder.type; session = builder.session; artifact = builder.artifact; metadata = builder.metadata; repository = builder.repository; file = builder.file; exceptions = builder.exceptions; trace = builder.trace; } /** * Gets the type of the event. * * @return The type of the event, never {@code null}. */ public EventType getType() { return type; } /** * Gets the repository system session during which the event occurred. * * @return The repository system session during which the event occurred, never {@code null}. */ public RepositorySystemSession getSession() { return session; } /** * Gets the artifact involved in the event (if any). * * @return The involved artifact or {@code null} if none. */ public Artifact getArtifact() { return artifact; } /** * Gets the metadata involved in the event (if any). * * @return The involved metadata or {@code null} if none. */ public Metadata getMetadata() { return metadata; } /** * Gets the file involved in the event (if any). * * @return The involved file or {@code null} if none. */ public File getFile() { return file; } /** * Gets the repository involved in the event (if any). * * @return The involved repository or {@code null} if none. */ public ArtifactRepository getRepository() { return repository; } /** * Gets the exception that caused the event (if any). As a rule of thumb, an event accompanied by an exception * indicates a failure of the corresponding action. If multiple exceptions occurred, this method returns the first * exception. * * @return The exception or {@code null} if none. */ public Exception getException() { return exceptions.isEmpty() ? null : exceptions.get( 0 ); } /** * Gets the exceptions that caused the event (if any). As a rule of thumb, an event accompanied by exceptions * indicates a failure of the corresponding action. * * @return The exceptions, never {@code null}. */ public List getExceptions() { return exceptions; } /** * Gets the trace information about the request during which the event occurred. * * @return The trace information or {@code null} if none. */ public RequestTrace getTrace() { return trace; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( getType() ); if ( getArtifact() != null ) { buffer.append( " " ).append( getArtifact() ); } if ( getMetadata() != null ) { buffer.append( " " ).append( getMetadata() ); } if ( getFile() != null ) { buffer.append( " (" ).append( getFile() ).append( ")" ); } if ( getRepository() != null ) { buffer.append( " @ " ).append( getRepository() ); } return buffer.toString(); } /** * A builder to create events. */ public static final class Builder { EventType type; RepositorySystemSession session; Artifact artifact; Metadata metadata; ArtifactRepository repository; File file; List exceptions = Collections.emptyList(); RequestTrace trace; /** * Creates a new event builder for the specified session and event type. * * @param session The repository system session, must not be {@code null}. * @param type The type of the event, must not be {@code null}. */ public Builder( RepositorySystemSession session, EventType type ) { if ( session == null ) { throw new IllegalArgumentException( "session not specified" ); } this.session = session; if ( type == null ) { throw new IllegalArgumentException( "event type not specified" ); } this.type = type; } /** * Sets the artifact involved in the event. * * @param artifact The involved artifact, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Sets the metadata involved in the event. * * @param metadata The involved metadata, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Sets the repository involved in the event. * * @param repository The involved repository, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setRepository( ArtifactRepository repository ) { this.repository = repository; return this; } /** * Sets the file involved in the event. * * @param file The involved file, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setFile( File file ) { this.file = file; return this; } /** * Sets the exception causing the event. * * @param exception The exception causing the event, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setException( Exception exception ) { if ( exception != null ) { this.exceptions = Collections.singletonList( exception ); } else { this.exceptions = Collections.emptyList(); } return this; } /** * Sets the exceptions causing the event. * * @param exceptions The exceptions causing the event, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setExceptions( List exceptions ) { if ( exceptions != null ) { this.exceptions = exceptions; } else { this.exceptions = Collections.emptyList(); } return this; } /** * Sets the trace information about the request during which the event occurred. * * @param trace The trace information, may be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setTrace( RequestTrace trace ) { this.trace = trace; return this; } /** * Builds a new event from the current values of this builder. The state of the builder itself remains * unchanged. * * @return The event, never {@code null}. */ public RepositoryEvent build() { return new RepositoryEvent( this ); } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositoryException.java000066400000000000000000000036021245546356100311170ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * The base class for exceptions thrown by the repository system. Note: Unless otherwise noted, instances of * this class and its subclasses will not persist fields carrying extended error information during serialization. */ public class RepositoryException extends Exception { /** * Creates a new exception with the specified detail message. * * @param message The detail message, may be {@code null}. */ public RepositoryException( String message ) { super( message ); } /** * Creates a new exception with the specified detail message and cause. * * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public RepositoryException( String message, Throwable cause ) { super( message, cause ); } /** * @noreference This method is not intended to be used by clients. */ protected static String getMessage( String prefix, Throwable cause ) { String msg = ""; if ( cause != null ) { msg = cause.getMessage(); if ( msg == null || msg.length() <= 0 ) { msg = cause.getClass().getSimpleName(); } msg = prefix + msg; } return msg; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositoryListener.java000066400000000000000000000247221245546356100307540ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * A listener being notified of events from the repository system. In general, the system sends events upon termination * of an operation like {@link #artifactResolved(RepositoryEvent)} regardless whether it succeeded or failed so * listeners need to inspect the event details carefully. Also, the listener may be called from an arbitrary thread. * Note: Implementors are strongly advised to inherit from {@link AbstractRepositoryListener} instead of * directly implementing this interface. * * @see org.eclipse.aether.RepositorySystemSession#getRepositoryListener() * @see org.eclipse.aether.transfer.TransferListener * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface RepositoryListener { /** * Notifies the listener of a syntactically or semantically invalid artifact descriptor. * {@link RepositoryEvent#getArtifact()} indicates the artifact whose descriptor is invalid and * {@link RepositoryEvent#getExceptions()} carries the encountered errors. Depending on the session's * {@link org.eclipse.aether.resolution.ArtifactDescriptorPolicy}, the underlying repository operation might abort * with an exception or ignore the invalid descriptor. * * @param event The event details, must not be {@code null}. */ void artifactDescriptorInvalid( RepositoryEvent event ); /** * Notifies the listener of a missing artifact descriptor. {@link RepositoryEvent#getArtifact()} indicates the * artifact whose descriptor is missing. Depending on the session's * {@link org.eclipse.aether.resolution.ArtifactDescriptorPolicy}, the underlying repository operation might abort * with an exception or ignore the missing descriptor. * * @param event The event details, must not be {@code null}. */ void artifactDescriptorMissing( RepositoryEvent event ); /** * Notifies the listener of syntactically or semantically invalid metadata. {@link RepositoryEvent#getMetadata()} * indicates the invalid metadata and {@link RepositoryEvent#getExceptions()} carries the encountered errors. The * underlying repository operation might still succeed, depending on whether the metadata in question is actually * needed to carry out the resolution process. * * @param event The event details, must not be {@code null}. */ void metadataInvalid( RepositoryEvent event ); /** * Notifies the listener of an artifact that is about to be resolved. {@link RepositoryEvent#getArtifact()} denotes * the artifact in question. Unlike the {@link #artifactDownloading(RepositoryEvent)} event, this event is fired * regardless whether the artifact already exists locally or not. * * @param event The event details, must not be {@code null}. */ void artifactResolving( RepositoryEvent event ); /** * Notifies the listener of an artifact whose resolution has been completed, either successfully or not. * {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getExceptions()} indicates whether the resolution succeeded or failed. Unlike the * {@link #artifactDownloaded(RepositoryEvent)} event, this event is fired regardless whether the artifact already * exists locally or not. * * @param event The event details, must not be {@code null}. */ void artifactResolved( RepositoryEvent event ); /** * Notifies the listener of some metadata that is about to be resolved. {@link RepositoryEvent#getMetadata()} * denotes the metadata in question. Unlike the {@link #metadataDownloading(RepositoryEvent)} event, this event is * fired regardless whether the metadata already exists locally or not. * * @param event The event details, must not be {@code null}. */ void metadataResolving( RepositoryEvent event ); /** * Notifies the listener of some metadata whose resolution has been completed, either successfully or not. * {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getExceptions()} indicates whether the resolution succeeded or failed. Unlike the * {@link #metadataDownloaded(RepositoryEvent)} event, this event is fired regardless whether the metadata already * exists locally or not. * * @param event The event details, must not be {@code null}. */ void metadataResolved( RepositoryEvent event ); /** * Notifies the listener of an artifact that is about to be downloaded from a remote repository. * {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getRepository()} the source repository. Unlike the * {@link #artifactResolving(RepositoryEvent)} event, this event is only fired when the artifact does not already * exist locally. * * @param event The event details, must not be {@code null}. */ void artifactDownloading( RepositoryEvent event ); /** * Notifies the listener of an artifact whose download has been completed, either successfully or not. * {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getExceptions()} indicates whether the download succeeded or failed. Unlike the * {@link #artifactResolved(RepositoryEvent)} event, this event is only fired when the artifact does not already * exist locally. * * @param event The event details, must not be {@code null}. */ void artifactDownloaded( RepositoryEvent event ); /** * Notifies the listener of some metadata that is about to be downloaded from a remote repository. * {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getRepository()} the source repository. Unlike the * {@link #metadataResolving(RepositoryEvent)} event, this event is only fired when the metadata does not already * exist locally. * * @param event The event details, must not be {@code null}. */ void metadataDownloading( RepositoryEvent event ); /** * Notifies the listener of some metadata whose download has been completed, either successfully or not. * {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getExceptions()} indicates whether the download succeeded or failed. Unlike the * {@link #metadataResolved(RepositoryEvent)} event, this event is only fired when the metadata does not already * exist locally. * * @param event The event details, must not be {@code null}. */ void metadataDownloaded( RepositoryEvent event ); /** * Notifies the listener of an artifact that is about to be installed to the local repository. * {@link RepositoryEvent#getArtifact()} denotes the artifact in question. * * @param event The event details, must not be {@code null}. */ void artifactInstalling( RepositoryEvent event ); /** * Notifies the listener of an artifact whose installation to the local repository has been completed, either * successfully or not. {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getExceptions()} indicates whether the installation succeeded or failed. * * @param event The event details, must not be {@code null}. */ void artifactInstalled( RepositoryEvent event ); /** * Notifies the listener of some metadata that is about to be installed to the local repository. * {@link RepositoryEvent#getMetadata()} denotes the metadata in question. * * @param event The event details, must not be {@code null}. */ void metadataInstalling( RepositoryEvent event ); /** * Notifies the listener of some metadata whose installation to the local repository has been completed, either * successfully or not. {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getExceptions()} indicates whether the installation succeeded or failed. * * @param event The event details, must not be {@code null}. */ void metadataInstalled( RepositoryEvent event ); /** * Notifies the listener of an artifact that is about to be uploaded to a remote repository. * {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getRepository()} the destination repository. * * @param event The event details, must not be {@code null}. */ void artifactDeploying( RepositoryEvent event ); /** * Notifies the listener of an artifact whose upload to a remote repository has been completed, either successfully * or not. {@link RepositoryEvent#getArtifact()} denotes the artifact in question and * {@link RepositoryEvent#getExceptions()} indicates whether the upload succeeded or failed. * * @param event The event details, must not be {@code null}. */ void artifactDeployed( RepositoryEvent event ); /** * Notifies the listener of some metadata that is about to be uploaded to a remote repository. * {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getRepository()} the destination repository. * * @param event The event details, must not be {@code null}. */ void metadataDeploying( RepositoryEvent event ); /** * Notifies the listener of some metadata whose upload to a remote repository has been completed, either * successfully or not. {@link RepositoryEvent#getMetadata()} denotes the metadata in question and * {@link RepositoryEvent#getExceptions()} indicates whether the upload succeeded or failed. * * @param event The event details, must not be {@code null}. */ void metadataDeployed( RepositoryEvent event ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositorySystem.java000066400000000000000000000366651245546356100304640ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.Collection; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.resolution.DependencyResult; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; /** * The main entry point to the repository system and its functionality. Note that obtaining a concrete implementation of * this interface (e.g. via dependency injection, service locator, etc.) is dependent on the application and its * specific needs, please consult the online documentation for examples and directions on booting the system. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface RepositorySystem { /** * Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to * "3.8", "3.8.1", "3.8.2". Note that the returned list of versions is only dependent on the configured repositories * and their contents, the list is not processed by the {@link RepositorySystemSession#getVersionFilter() session's * version filter}. *

* The supplied request may also refer to a single concrete version rather than a version range. In this case * though, the result contains simply the (parsed) input version, regardless of the repositories and their contents. * * @param session The repository session, must not be {@code null}. * @param request The version range request, must not be {@code null}. * @return The version range result, never {@code null}. * @throws VersionRangeResolutionException If the requested range could not be parsed. Note that an empty range does * not raise an exception. * @see #newResolutionRepositories(RepositorySystemSession, List) */ VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException; /** * Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to * "1.0-20090208.132618-23". * * @param session The repository session, must not be {@code null}. * @param request The version request, must not be {@code null}. * @return The version result, never {@code null}. * @throws VersionResolutionException If the metaversion could not be resolved. * @see #newResolutionRepositories(RepositorySystemSession, List) */ VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException; /** * Gets information about an artifact like its direct dependencies and potential relocations. * * @param session The repository session, must not be {@code null}. * @param request The descriptor request, must not be {@code null}. * @return The descriptor result, never {@code null}. * @throws ArtifactDescriptorException If the artifact descriptor could not be read. * @see RepositorySystemSession#getArtifactDescriptorPolicy() * @see #newResolutionRepositories(RepositorySystemSession, List) */ ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException; /** * Collects the transitive dependencies of an artifact and builds a dependency graph. Note that this operation is * only concerned about determining the coordinates of the transitive dependencies. To also resolve the actual * artifact files, use {@link #resolveDependencies(RepositorySystemSession, DependencyRequest)}. * * @param session The repository session, must not be {@code null}. * @param request The collection request, must not be {@code null}. * @return The collection result, never {@code null}. * @throws DependencyCollectionException If the dependency tree could not be built. * @see RepositorySystemSession#getDependencyTraverser() * @see RepositorySystemSession#getDependencyManager() * @see RepositorySystemSession#getDependencySelector() * @see RepositorySystemSession#getVersionFilter() * @see RepositorySystemSession#getDependencyGraphTransformer() * @see #newResolutionRepositories(RepositorySystemSession, List) */ CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException; /** * Collects and resolves the transitive dependencies of an artifact. This operation is essentially a combination of * {@link #collectDependencies(RepositorySystemSession, CollectRequest)} and * {@link #resolveArtifacts(RepositorySystemSession, Collection)}. * * @param session The repository session, must not be {@code null}. * @param request The dependency request, must not be {@code null}. * @return The dependency result, never {@code null}. * @throws DependencyResolutionException If the dependency tree could not be built or any dependency artifact could * not be resolved. * @see #newResolutionRepositories(RepositorySystemSession, List) */ DependencyResult resolveDependencies( RepositorySystemSession session, DependencyRequest request ) throws DependencyResolutionException; /** * Resolves the path for an artifact. The artifact will be downloaded to the local repository if necessary. An * artifact that is already resolved will be skipped and is not re-resolved. In general, callers must not assume any * relationship between an artifact's resolved filename and its coordinates. Note that this method assumes that any * relocations have already been processed. * * @param session The repository session, must not be {@code null}. * @param request The resolution request, must not be {@code null}. * @return The resolution result, never {@code null}. * @throws ArtifactResolutionException If the artifact could not be resolved. * @see Artifact#getFile() * @see #newResolutionRepositories(RepositorySystemSession, List) */ ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException; /** * Resolves the paths for a collection of artifacts. Artifacts will be downloaded to the local repository if * necessary. Artifacts that are already resolved will be skipped and are not re-resolved. In general, callers must * not assume any relationship between an artifact's filename and its coordinates. Note that this method assumes * that any relocations have already been processed. * * @param session The repository session, must not be {@code null}. * @param requests The resolution requests, must not be {@code null}. * @return The resolution results (in request order), never {@code null}. * @throws ArtifactResolutionException If any artifact could not be resolved. * @see Artifact#getFile() * @see #newResolutionRepositories(RepositorySystemSession, List) */ List resolveArtifacts( RepositorySystemSession session, Collection requests ) throws ArtifactResolutionException; /** * Resolves the paths for a collection of metadata. Metadata will be downloaded to the local repository if * necessary, e.g. because it hasn't been cached yet or the cache is deemed outdated. * * @param session The repository session, must not be {@code null}. * @param requests The resolution requests, must not be {@code null}. * @return The resolution results (in request order), never {@code null}. * @see Metadata#getFile() * @see #newResolutionRepositories(RepositorySystemSession, List) */ List resolveMetadata( RepositorySystemSession session, Collection requests ); /** * Installs a collection of artifacts and their accompanying metadata to the local repository. * * @param session The repository session, must not be {@code null}. * @param request The installation request, must not be {@code null}. * @return The installation result, never {@code null}. * @throws InstallationException If any artifact/metadata from the request could not be installed. */ InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException; /** * Uploads a collection of artifacts and their accompanying metadata to a remote repository. * * @param session The repository session, must not be {@code null}. * @param request The deployment request, must not be {@code null}. * @return The deployment result, never {@code null}. * @throws DeploymentException If any artifact/metadata from the request could not be deployed. * @see #newDeploymentRepository(RepositorySystemSession, RemoteRepository) */ DeployResult deploy( RepositorySystemSession session, DeployRequest request ) throws DeploymentException; /** * Creates a new manager for the specified local repository. If the specified local repository has no type, the * default local repository type of the system will be used. Note: It is expected that this method * invocation is one of the last steps of setting up a new session, in particular any configuration properties * should have been set already. * * @param session The repository system session from which to configure the manager, must not be {@code null}. * @param localRepository The local repository to create a manager for, must not be {@code null}. * @return The local repository manager, never {@code null}. * @throws IllegalArgumentException If the specified repository type is not recognized or no base directory is * given. */ LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session, LocalRepository localRepository ); /** * Creates a new synchronization context. * * @param session The repository session during which the context will be used, must not be {@code null}. * @param shared A flag indicating whether access to the artifacts/metadata associated with the new context can be * shared among concurrent readers or whether access needs to be exclusive to the calling thread. * @return The synchronization context, never {@code null}. */ SyncContext newSyncContext( RepositorySystemSession session, boolean shared ); /** * Forms remote repositories suitable for artifact resolution by applying the session's authentication selector and * similar network configuration to the given repository prototypes. As noted for * {@link RepositorySystemSession#getAuthenticationSelector()} etc. the remote repositories passed to e.g. * {@link #resolveArtifact(RepositorySystemSession, ArtifactRequest) resolveArtifact()} are used as is and expected * to already carry any required authentication or proxy configuration. This method can be used to apply the * authentication/proxy configuration from a session to a bare repository definition to obtain the complete * repository definition for use in the resolution request. * * @param session The repository system session from which to configure the repositories, must not be {@code null}. * @param repositories The repository prototypes from which to derive the resolution repositories, must not be * {@code null} or contain {@code null} elements. * @return The resolution repositories, never {@code null}. Note that there is generally no 1:1 relationship of the * obtained repositories to the original inputs due to mirror selection potentially aggregating multiple * repositories. * @see #newDeploymentRepository(RepositorySystemSession, RemoteRepository) */ List newResolutionRepositories( RepositorySystemSession session, List repositories ); /** * Forms a remote repository suitable for artifact deployment by applying the session's authentication selector and * similar network configuration to the given repository prototype. As noted for * {@link RepositorySystemSession#getAuthenticationSelector()} etc. the remote repository passed to * {@link #deploy(RepositorySystemSession, DeployRequest) deploy()} is used as is and expected to already carry any * required authentication or proxy configuration. This method can be used to apply the authentication/proxy * configuration from a session to a bare repository definition to obtain the complete repository definition for use * in the deploy request. * * @param session The repository system session from which to configure the repository, must not be {@code null}. * @param repository The repository prototype from which to derive the deployment repository, must not be * {@code null}. * @return The deployment repository, never {@code null}. * @see #newResolutionRepositories(RepositorySystemSession, List) */ RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java000066400000000000000000000250331245546356100320130ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.util.Map; import org.eclipse.aether.artifact.ArtifactTypeRegistry; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.transfer.TransferListener; /** * Defines settings and components that control the repository system. Once initialized, the session object itself is * supposed to be immutable and hence can safely be shared across an entire application and any concurrent threads * reading it. Components that wish to tweak some aspects of an existing session should use the copy constructor of * {@link DefaultRepositorySystemSession} and its mutators to derive a custom session. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface RepositorySystemSession { /** * Indicates whether the repository system operates in offline mode and avoids/refuses any access to remote * repositories. * * @return {@code true} if the repository system is in offline mode, {@code false} otherwise. */ boolean isOffline(); /** * Indicates whether repositories declared in artifact descriptors should be ignored during transitive dependency * collection. If enabled, only the repositories originally provided with the collect request will be considered. * * @return {@code true} if additional repositories from artifact descriptors are ignored, {@code false} to merge * those with the originally specified repositories. */ boolean isIgnoreArtifactDescriptorRepositories(); /** * Gets the policy which controls whether resolutions errors from remote repositories should be cached. * * @return The resolution error policy for this session or {@code null} if resolution errors should generally not be * cached. */ ResolutionErrorPolicy getResolutionErrorPolicy(); /** * Gets the policy which controls how errors related to reading artifact descriptors should be handled. * * @return The descriptor error policy for this session or {@code null} if descriptor errors should generally not be * tolerated. */ ArtifactDescriptorPolicy getArtifactDescriptorPolicy(); /** * Gets the global checksum policy. If set, the global checksum policy overrides the checksum policies of the remote * repositories being used for resolution. * * @return The global checksum policy or {@code null}/empty if not set and the per-repository policies apply. * @see RepositoryPolicy#CHECKSUM_POLICY_FAIL * @see RepositoryPolicy#CHECKSUM_POLICY_IGNORE * @see RepositoryPolicy#CHECKSUM_POLICY_WARN */ String getChecksumPolicy(); /** * Gets the global update policy. If set, the global update policy overrides the update policies of the remote * repositories being used for resolution. * * @return The global update policy or {@code null}/empty if not set and the per-repository policies apply. * @see RepositoryPolicy#UPDATE_POLICY_ALWAYS * @see RepositoryPolicy#UPDATE_POLICY_DAILY * @see RepositoryPolicy#UPDATE_POLICY_NEVER */ String getUpdatePolicy(); /** * Gets the local repository used during this session. This is a convenience method for * {@link LocalRepositoryManager#getRepository()}. * * @return The local repository being during this session, never {@code null}. */ LocalRepository getLocalRepository(); /** * Gets the local repository manager used during this session. * * @return The local repository manager used during this session, never {@code null}. */ LocalRepositoryManager getLocalRepositoryManager(); /** * Gets the workspace reader used during this session. If set, the workspace reader will usually be consulted first * to resolve artifacts. * * @return The workspace reader for this session or {@code null} if none. */ WorkspaceReader getWorkspaceReader(); /** * Gets the listener being notified of actions in the repository system. * * @return The repository listener or {@code null} if none. */ RepositoryListener getRepositoryListener(); /** * Gets the listener being notified of uploads/downloads by the repository system. * * @return The transfer listener or {@code null} if none. */ TransferListener getTransferListener(); /** * Gets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually * collected from the runtime environment like {@link System#getProperties()} and environment variables. * * @return The (read-only) system properties, never {@code null}. */ Map getSystemProperties(); /** * Gets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to * system properties but are set on the discretion of the user and hence are considered of higher priority than * system properties. * * @return The (read-only) user properties, never {@code null}. */ Map getUserProperties(); /** * Gets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling, * connector-specific behavior, etc.) * * @return The (read-only) configuration properties, never {@code null}. * @see ConfigurationProperties */ Map getConfigProperties(); /** * Gets the mirror selector to use for repositories discovered in artifact descriptors. Note that this selector is * not used for remote repositories which are passed as request parameters to the repository system, those * repositories are supposed to denote the effective repositories. * * @return The mirror selector to use, never {@code null}. * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List) */ MirrorSelector getMirrorSelector(); /** * Gets the proxy selector to use for repositories discovered in artifact descriptors. Note that this selector is * not used for remote repositories which are passed as request parameters to the repository system, those * repositories are supposed to have their proxy (if any) already set. * * @return The proxy selector to use, never {@code null}. * @see org.eclipse.aether.repository.RemoteRepository#getProxy() * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List) */ ProxySelector getProxySelector(); /** * Gets the authentication selector to use for repositories discovered in artifact descriptors. Note that this * selector is not used for remote repositories which are passed as request parameters to the repository system, * those repositories are supposed to have their authentication (if any) already set. * * @return The authentication selector to use, never {@code null}. * @see org.eclipse.aether.repository.RemoteRepository#getAuthentication() * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List) */ AuthenticationSelector getAuthenticationSelector(); /** * Gets the registry of artifact types recognized by this session, for instance when processing artifact * descriptors. * * @return The artifact type registry, never {@code null}. */ ArtifactTypeRegistry getArtifactTypeRegistry(); /** * Gets the dependency traverser to use for building dependency graphs. * * @return The dependency traverser to use for building dependency graphs or {@code null} if dependencies are * unconditionally traversed. */ DependencyTraverser getDependencyTraverser(); /** * Gets the dependency manager to use for building dependency graphs. * * @return The dependency manager to use for building dependency graphs or {@code null} if dependency management is * not performed. */ DependencyManager getDependencyManager(); /** * Gets the dependency selector to use for building dependency graphs. * * @return The dependency selector to use for building dependency graphs or {@code null} if dependencies are * unconditionally included. */ DependencySelector getDependencySelector(); /** * Gets the version filter to use for building dependency graphs. * * @return The version filter to use for building dependency graphs or {@code null} if versions aren't filtered. */ VersionFilter getVersionFilter(); /** * Gets the dependency graph transformer to use for building dependency graphs. * * @return The dependency graph transformer to use for building dependency graphs or {@code null} if none. */ DependencyGraphTransformer getDependencyGraphTransformer(); /** * Gets the custom data associated with this session. * * @return The session data, never {@code null}. */ SessionData getData(); /** * Gets the cache the repository system may use to save data for future reuse during the session. * * @return The repository cache or {@code null} if none. */ RepositoryCache getCache(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/RequestTrace.java000066400000000000000000000071211245546356100274700ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * A trace of nested requests that are performed by the repository system. This trace information can be used to * correlate repository events with higher level operations in the application code that eventually caused the events. A * single trace can carry an arbitrary object as data which is meant to describe a request/operation that is currently * executed. For call hierarchies within the repository system itself, this data will usually be the {@code *Request} * object that is currently processed. When invoking methods on the repository system, client code may provide a request * trace that has been prepopulated with whatever data is useful for the application to indicate its state for later * evaluation when processing the repository events. * * @see RepositoryEvent#getTrace() */ public class RequestTrace { private final RequestTrace parent; private final Object data; /** * Creates a child of the specified request trace. This method is basically a convenience that will invoke * {@link RequestTrace#newChild(Object) parent.newChild()} when the specified parent trace is not {@code null} or * otherwise instantiante a new root trace. * * @param parent The parent request trace, may be {@code null}. * @param data The data to associate with the child trace, may be {@code null}. * @return The child trace, never {@code null}. */ public static RequestTrace newChild( RequestTrace parent, Object data ) { if ( parent == null ) { return new RequestTrace( data ); } return parent.newChild( data ); } /** * Creates a new root trace with the specified data. * * @param data The data to associate with the trace, may be {@code null}. */ public RequestTrace( Object data ) { this( null, data ); } /** * Creates a new trace with the specified data and parent * * @param parent The parent trace, may be {@code null} for a root trace. * @param data The data to associate with the trace, may be {@code null}. */ protected RequestTrace( RequestTrace parent, Object data ) { this.parent = parent; this.data = data; } /** * Gets the data associated with this trace. * * @return The data associated with this trace or {@code null} if none. */ public final Object getData() { return data; } /** * Gets the parent of this trace. * * @return The parent of this trace or {@code null} if this is the root of the trace stack. */ public final RequestTrace getParent() { return parent; } /** * Creates a new child of this trace. * * @param data The data to associate with the child, may be {@code null}. * @return The child trace, never {@code null}. */ public RequestTrace newChild( Object data ) { return new RequestTrace( this, data ); } @Override public String toString() { return String.valueOf( getData() ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/SessionData.java000066400000000000000000000052271245546356100273030ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; /** * A container for data that is specific to a repository system session. Both components within the repository system * and clients of the system may use this storage to associate arbitrary data with a session. *

* Unlike a cache, this session data is not subject to purging. For this same reason, session data should also not be * abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion. *

* Note: Actual implementations must be thread-safe. * * @see RepositorySystemSession#getData() * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface SessionData { /** * Associates the specified session data with the given key. * * @param key The key under which to store the session data, must not be {@code null}. * @param value The data to associate with the key, may be {@code null} to remove the mapping. */ void set( Object key, Object value ); /** * Associates the specified session data with the given key if the key is currently mapped to the given value. This * method provides an atomic compare-and-update of some key's value. * * @param key The key under which to store the session data, must not be {@code null}. * @param oldValue The expected data currently associated with the key, may be {@code null}. * @param newValue The data to associate with the key, may be {@code null} to remove the mapping. * @return {@code true} if the key mapping was successfully updated from the old value to the new value, * {@code false} if the current key mapping didn't match the expected value and was not updated. */ boolean set( Object key, Object oldValue, Object newValue ); /** * Gets the session data associated with the specified key. * * @param key The key for which to retrieve the session data, must not be {@code null}. * @return The session data associated with the key or {@code null} if none. */ Object get( Object key ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/SyncContext.java000066400000000000000000000057641245546356100273550ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.io.Closeable; import java.util.Collection; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * A synchronization context used to coordinate concurrent access to artifacts or metadatas. The typical usage of a * synchronization context looks like this: * *

 * SyncContext syncContext = repositorySystem.newSyncContext( ... );
 * try {
 *     syncContext.acquire( artifacts, metadatas );
 *     // work with the artifacts and metadatas
 * } finally {
 *     syncContext.close();
 * }
 * 
* * Within one thread, synchronization contexts may be nested which can naturally happen in a hierarchy of method calls. * The nested synchronization contexts may also acquire overlapping sets of artifacts/metadatas as long as the following * conditions are met. If the outer-most context holding a particular resource is exclusive, that resource can be * reacquired in any nested context. If however the outer-most context is shared, the resource may only be reacquired by * nested contexts if these are also shared. *

* A synchronization context is meant to be utilized by only one thread and as such is not thread-safe. *

* Note that the level of actual synchronization is subject to the implementation and might range from OS-wide to none. * * @see RepositorySystem#newSyncContext(RepositorySystemSession, boolean) */ public interface SyncContext extends Closeable { /** * Acquires synchronized access to the specified artifacts and metadatas. The invocation will potentially block * until all requested resources can be acquired by the calling thread. Acquiring resources that are already * acquired by this synchronization context has no effect. Please also see the class-level documentation for * information regarding reentrancy. The method may be invoked multiple times on a synchronization context until all * desired resources have been acquired. * * @param artifacts The artifacts to acquire, may be {@code null} or empty if none. * @param metadatas The metadatas to acquire, may be {@code null} or empty if none. */ void acquire( Collection artifacts, Collection metadatas ); /** * Releases all previously acquired artifacts/metadatas. If no resources have been acquired before or if this * synchronization context has already been closed, this method does nothing. */ void close(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/000077500000000000000000000000001245546356100260125ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java000066400000000000000000000154641245546356100321100ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A skeleton class for artifacts. */ public abstract class AbstractArtifact implements Artifact { private static final String SNAPSHOT = "SNAPSHOT"; private static final Pattern SNAPSHOT_TIMESTAMP = Pattern.compile( "^(.*-)?([0-9]{8}\\.[0-9]{6}-[0-9]+)$" ); public boolean isSnapshot() { return isSnapshot( getVersion() ); } private static boolean isSnapshot( String version ) { return version.endsWith( SNAPSHOT ) || SNAPSHOT_TIMESTAMP.matcher( version ).matches(); } public String getBaseVersion() { return toBaseVersion( getVersion() ); } private static String toBaseVersion( String version ) { String baseVersion; if ( version == null ) { baseVersion = version; } else if ( version.startsWith( "[" ) || version.startsWith( "(" ) ) { baseVersion = version; } else { Matcher m = SNAPSHOT_TIMESTAMP.matcher( version ); if ( m.matches() ) { if ( m.group( 1 ) != null ) { baseVersion = m.group( 1 ) + SNAPSHOT; } else { baseVersion = SNAPSHOT; } } else { baseVersion = version; } } return baseVersion; } /** * Creates a new artifact with the specified coordinates, properties and file. * * @param version The version of the artifact, may be {@code null}. * @param properties The properties of the artifact, may be {@code null} if none. The method may assume immutability * of the supplied map, i.e. need not copy it. * @param file The resolved file of the artifact, may be {@code null}. * @return The new artifact instance, never {@code null}. */ private Artifact newInstance( String version, Map properties, File file ) { return new DefaultArtifact( getGroupId(), getArtifactId(), getClassifier(), getExtension(), version, file, properties ); } public Artifact setVersion( String version ) { String current = getVersion(); if ( current.equals( version ) || ( version == null && current.length() <= 0 ) ) { return this; } return newInstance( version, getProperties(), getFile() ); } public Artifact setFile( File file ) { File current = getFile(); if ( ( current == null ) ? file == null : current.equals( file ) ) { return this; } return newInstance( getVersion(), getProperties(), file ); } public Artifact setProperties( Map properties ) { Map current = getProperties(); if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) ) { return this; } return newInstance( getVersion(), copyProperties( properties ), getFile() ); } public String getProperty( String key, String defaultValue ) { String value = getProperties().get( key ); return ( value != null ) ? value : defaultValue; } /** * Copies the specified artifact properties. This utility method should be used when creating new artifact instances * with caller-supplied properties. * * @param properties The properties to copy, may be {@code null}. * @return The copied and read-only properties, never {@code null}. */ protected static Map copyProperties( Map properties ) { if ( properties != null && !properties.isEmpty() ) { return Collections.unmodifiableMap( new HashMap( properties ) ); } else { return Collections.emptyMap(); } } @Override public String toString() { StringBuilder buffer = new StringBuilder( 128 ); buffer.append( getGroupId() ); buffer.append( ':' ).append( getArtifactId() ); buffer.append( ':' ).append( getExtension() ); if ( getClassifier().length() > 0 ) { buffer.append( ':' ).append( getClassifier() ); } buffer.append( ':' ).append( getVersion() ); return buffer.toString(); } /** * Compares this artifact with the specified object. * * @param obj The object to compare this artifact against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Artifact} with equal coordinates, * properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Artifact ) ) { return false; } Artifact that = (Artifact) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getExtension().equals( that.getExtension() ) && getClassifier().equals( that.getClassifier() ) && eq( getFile(), that.getFile() ) && getProperties().equals( that.getProperties() ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } /** * Returns a hash code for this artifact. * * @return A hash code for the artifact. */ @Override public int hashCode() { int hash = 17; hash = hash * 31 + getGroupId().hashCode(); hash = hash * 31 + getArtifactId().hashCode(); hash = hash * 31 + getExtension().hashCode(); hash = hash * 31 + getClassifier().hashCode(); hash = hash * 31 + getVersion().hashCode(); hash = hash * 31 + hash( getFile() ); return hash; } private static int hash( Object obj ) { return ( obj != null ) ? obj.hashCode() : 0; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/Artifact.java000066400000000000000000000116261245546356100304200ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import java.io.File; import java.util.Map; /** * A specific artifact. In a nutshell, an artifact has identifying coordinates and optionally a file that denotes its * data. Note: Artifact instances are supposed to be immutable, e.g. any exposed mutator method returns a new * artifact instance and leaves the original instance unchanged. Note: Implementors are strongly advised to * inherit from {@link AbstractArtifact} instead of directly implementing this interface. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface Artifact { /** * Gets the group identifier of this artifact, for example "org.apache.maven". * * @return The group identifier, never {@code null}. */ String getGroupId(); /** * Gets the artifact identifier of this artifact, for example "maven-model". * * @return The artifact identifier, never {@code null}. */ String getArtifactId(); /** * Gets the version of this artifact, for example "1.0-20100529-1213". Note that in case of meta versions like * "1.0-SNAPSHOT", the artifact's version depends on the state of the artifact. Artifacts that have been resolved or * deployed will usually have the meta version expanded. * * @return The version, never {@code null}. */ String getVersion(); /** * Sets the version of the artifact. * * @param version The version of this artifact, may be {@code null} or empty. * @return The new artifact, never {@code null}. */ Artifact setVersion( String version ); /** * Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to the {@link #getVersion()}, the * base version will always refer to the unresolved meta version. * * @return The base version, never {@code null}. */ String getBaseVersion(); /** * Determines whether this artifact uses a snapshot version. * * @return {@code true} if the artifact is a snapshot, {@code false} otherwise. */ boolean isSnapshot(); /** * Gets the classifier of this artifact, for example "sources". * * @return The classifier or an empty string if none, never {@code null}. */ String getClassifier(); /** * Gets the (file) extension of this artifact, for example "jar" or "tar.gz". * * @return The file extension (without leading period), never {@code null}. */ String getExtension(); /** * Gets the file of this artifact. Note that only resolved artifacts have a file associated with them. In general, * callers must not assume any relationship between an artifact's filename and its coordinates. * * @return The file or {@code null} if the artifact isn't resolved. */ File getFile(); /** * Sets the file of the artifact. * * @param file The file of the artifact, may be {@code null} * @return The new artifact, never {@code null}. */ Artifact setFile( File file ); /** * Gets the specified property. * * @param key The name of the property, must not be {@code null}. * @param defaultValue The default value to return in case the property is not set, may be {@code null}. * @return The requested property value or {@code null} if the property is not set and no default value was * provided. * @see ArtifactProperties */ String getProperty( String key, String defaultValue ); /** * Gets the properties of this artifact. Clients may use these properties to associate non-persistent values with an * artifact that help later processing when the artifact gets passed around within the application. * * @return The (read-only) properties, never {@code null}. * @see ArtifactProperties */ Map getProperties(); /** * Sets the properties for the artifact. Note that these properties exist merely in memory and are not persisted * when the artifact gets installed/deployed to a repository. * * @param properties The properties for the artifact, may be {@code null}. * @return The new artifact, never {@code null}. * @see ArtifactProperties */ Artifact setProperties( Map properties ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java000066400000000000000000000046511245546356100324750ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; /** * The keys for common properties of artifacts. * * @see Artifact#getProperties() */ public final class ArtifactProperties { /** * A high-level characterization of the artifact, e.g. "maven-plugin" or "test-jar". * * @see ArtifactType#getId() */ public static final String TYPE = "type"; /** * The programming language this artifact is relevant for, e.g. "java" or "none". */ public static final String LANGUAGE = "language"; /** * The (expected) path to the artifact on the local filesystem. An artifact which has this property set is assumed * to be not present in any regular repository and likewise has no artifact descriptor. Artifact resolution will * verify the path and resolve the artifact if the path actually denotes an existing file. If the path isn't valid, * resolution will fail and no attempts to search local/remote repositories are made. */ public static final String LOCAL_PATH = "localPath"; /** * A boolean flag indicating whether the artifact presents some kind of bundle that physically includes its * dependencies, e.g. a fat WAR. */ public static final String INCLUDES_DEPENDENCIES = "includesDependencies"; /** * A boolean flag indicating whether the artifact is meant to be used for the compile/runtime/test build path of a * consumer project. */ public static final String CONSTITUTES_BUILD_PATH = "constitutesBuildPath"; /** * The URL to a web page from which the artifact can be manually downloaded. This URL is not contacted by the * repository system but serves as a pointer for the end user to assist in getting artifacts that are not published * in a proper repository. */ public static final String DOWNLOAD_URL = "downloadUrl"; private ArtifactProperties() { // hide constructor } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java000066400000000000000000000041351245546356100312570ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import java.util.Map; /** * An artifact type describing artifact characteristics/properties that are common for certain artifacts. Artifact types * are a means to simplify the description of an artifact by referring to an artifact type instead of specifying the * various properties individually. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @see ArtifactTypeRegistry * @see DefaultArtifact#DefaultArtifact(String, String, String, String, String, ArtifactType) */ public interface ArtifactType { /** * Gets the identifier of this type, e.g. "maven-plugin" or "test-jar". * * @return The identifier of this type, never {@code null}. * @see ArtifactProperties#TYPE */ String getId(); /** * Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact). * * @return The usual file extension, never {@code null}. */ String getExtension(); /** * Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact). * * @return The usual classifier or an empty string if none, never {@code null}. */ String getClassifier(); /** * Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact). * * @return The (read-only) properties, never {@code null}. * @see ArtifactProperties */ Map getProperties(); } ArtifactTypeRegistry.java000066400000000000000000000020111245546356100327200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; /** * A registry of known artifact types. * * @see org.eclipse.aether.RepositorySystemSession#getArtifactTypeRegistry() */ public interface ArtifactTypeRegistry { /** * Gets the artifact type with the specified identifier. * * @param typeId The identifier of the type, must not be {@code null}. * @return The artifact type or {@code null} if no type with the requested identifier exists. */ ArtifactType get( String typeId ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java000066400000000000000000000255561245546356100317340ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A simple artifact. Note: Instances of this class are immutable and the exposed mutators return new objects * rather than changing the current instance. */ public final class DefaultArtifact extends AbstractArtifact { private final String groupId; private final String artifactId; private final String version; private final String classifier; private final String extension; private final File file; private final Map properties; /** * Creates a new artifact with the specified coordinates. If not specified in the artifact coordinates, the * artifact's extension defaults to {@code jar} and classifier to an empty string. * * @param coords The artifact coordinates in the format * {@code :[:[:]]:}, must not be {@code null}. */ public DefaultArtifact( String coords ) { this( coords, Collections. emptyMap() ); } /** * Creates a new artifact with the specified coordinates and properties. If not specified in the artifact * coordinates, the artifact's extension defaults to {@code jar} and classifier to an empty string. * * @param coords The artifact coordinates in the format * {@code :[:[:]]:}, must not be {@code null}. * @param properties The artifact properties, may be {@code null}. */ public DefaultArtifact( String coords, Map properties ) { Pattern p = Pattern.compile( "([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)" ); Matcher m = p.matcher( coords ); if ( !m.matches() ) { throw new IllegalArgumentException( "Bad artifact coordinates " + coords + ", expected format is :[:[:]]:" ); } groupId = m.group( 1 ); artifactId = m.group( 2 ); extension = get( m.group( 4 ), "jar" ); classifier = get( m.group( 6 ), "" ); version = m.group( 7 ); file = null; this.properties = copyProperties( properties ); } private static String get( String value, String defaultValue ) { return ( value == null || value.length() <= 0 ) ? defaultValue : value; } /** * Creates a new artifact with the specified coordinates and no classifier. Passing {@code null} for any of the * coordinates is equivalent to specifying an empty string. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String extension, String version ) { this( groupId, artifactId, "", extension, version ); } /** * Creates a new artifact with the specified coordinates. Passing {@code null} for any of the coordinates is * equivalent to specifying an empty string. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version ) { this( groupId, artifactId, classifier, extension, version, null, (File) null ); } /** * Creates a new artifact with the specified coordinates. Passing {@code null} for any of the coordinates is * equivalent to specifying an empty string. The optional artifact type provided to this constructor will be used to * determine the artifact's classifier and file extension if the corresponding arguments for this constructor are * {@code null}. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. * @param type The artifact type from which to query classifier, file extension and properties, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, ArtifactType type ) { this( groupId, artifactId, classifier, extension, version, null, type ); } /** * Creates a new artifact with the specified coordinates and properties. Passing {@code null} for any of the * coordinates is equivalent to specifying an empty string. The optional artifact type provided to this constructor * will be used to determine the artifact's classifier and file extension if the corresponding arguments for this * constructor are {@code null}. If the artifact type specifies properties, those will get merged with the * properties passed directly into the constructor, with the latter properties taking precedence. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. * @param properties The properties of the artifact, may be {@code null} if none. * @param type The artifact type from which to query classifier, file extension and properties, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, Map properties, ArtifactType type ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); if ( classifier != null || type == null ) { this.classifier = emptify( classifier ); } else { this.classifier = emptify( type.getClassifier() ); } if ( extension != null || type == null ) { this.extension = emptify( extension ); } else { this.extension = emptify( type.getExtension() ); } this.version = emptify( version ); this.file = null; this.properties = merge( properties, ( type != null ) ? type.getProperties() : null ); } private static Map merge( Map dominant, Map recessive ) { Map properties; if ( ( dominant == null || dominant.isEmpty() ) && ( recessive == null || recessive.isEmpty() ) ) { properties = Collections.emptyMap(); } else { properties = new HashMap(); if ( recessive != null ) { properties.putAll( recessive ); } if ( dominant != null ) { properties.putAll( dominant ); } properties = Collections.unmodifiableMap( properties ); } return properties; } /** * Creates a new artifact with the specified coordinates, properties and file. Passing {@code null} for any of the * coordinates is equivalent to specifying an empty string. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. * @param properties The properties of the artifact, may be {@code null} if none. * @param file The resolved file of the artifact, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, Map properties, File file ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.classifier = emptify( classifier ); this.extension = emptify( extension ); this.version = emptify( version ); this.file = file; this.properties = copyProperties( properties ); } DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, File file, Map properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.classifier = emptify( classifier ); this.extension = emptify( extension ); this.version = emptify( version ); this.file = file; this.properties = properties; } private static String emptify( String str ) { return ( str == null ) ? "" : str; } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getVersion() { return version; } public String getClassifier() { return classifier; } public String getExtension() { return extension; } public File getFile() { return file; } public Map getProperties() { return properties; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java000066400000000000000000000131061245546356100325620ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * A simple artifact type. */ public final class DefaultArtifactType implements ArtifactType { private final String id; private final String extension; private final String classifier; private final Map properties; /** * Creates a new artifact type with the specified identifier. This constructor assumes the usual file extension * equals the given type id and that the usual classifier is empty. Additionally, the properties * {@link ArtifactProperties#LANGUAGE}, {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} and * {@link ArtifactProperties#INCLUDES_DEPENDENCIES} will be set to {@code "none"}, {@code true} and {@code false}, * respectively. * * @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE} * property, must not be {@code null} or empty. */ public DefaultArtifactType( String id ) { this( id, id, "", "none", false, false ); } /** * Creates a new artifact type with the specified properties. Additionally, the properties * {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} and {@link ArtifactProperties#INCLUDES_DEPENDENCIES} will be * set to {@code true} and {@code false}, respectively. * * @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE} * property, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param language The value for the {@link ArtifactProperties#LANGUAGE} property, may be {@code null}. */ public DefaultArtifactType( String id, String extension, String classifier, String language ) { this( id, extension, classifier, language, true, false ); } /** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE} * property, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param language The value for the {@link ArtifactProperties#LANGUAGE} property, may be {@code null}. * @param constitutesBuildPath The value for the {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} property. * @param includesDependencies The value for the {@link ArtifactProperties#INCLUDES_DEPENDENCIES} property. */ public DefaultArtifactType( String id, String extension, String classifier, String language, boolean constitutesBuildPath, boolean includesDependencies ) { if ( id == null || id.length() < 0 ) { throw new IllegalArgumentException( "no type id specified" ); } this.id = id; this.extension = emptify( extension ); this.classifier = emptify( classifier ); Map props = new HashMap(); props.put( ArtifactProperties.TYPE, id ); props.put( ArtifactProperties.LANGUAGE, ( language != null && language.length() > 0 ) ? language : "none" ); props.put( ArtifactProperties.INCLUDES_DEPENDENCIES, Boolean.toString( includesDependencies ) ); props.put( ArtifactProperties.CONSTITUTES_BUILD_PATH, Boolean.toString( constitutesBuildPath ) ); properties = Collections.unmodifiableMap( props ); } /** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param properties The properties for artifacts of this type, may be {@code null}. */ public DefaultArtifactType( String id, String extension, String classifier, Map properties ) { if ( id == null || id.length() < 0 ) { throw new IllegalArgumentException( "no type id specified" ); } this.id = id; this.extension = emptify( extension ); this.classifier = emptify( classifier ); this.properties = AbstractArtifact.copyProperties( properties ); } private static String emptify( String str ) { return ( str == null ) ? "" : str; } public String getId() { return id; } public String getExtension() { return extension; } public String getClassifier() { return classifier; } public Map getProperties() { return properties; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/artifact/package-info.java000066400000000000000000000012251245546356100312010ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The definition of an artifact, that is the primary entity managed by the repository system. */ package org.eclipse.aether.artifact; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/000077500000000000000000000000001245546356100263505ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java000066400000000000000000000264661245546356100321670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.RemoteRepository; /** * A request to collect the transitive dependencies and to build a dependency graph from them. There are three ways to * create a dependency graph. First, only the root dependency can be given. Second, a root dependency and direct * dependencies can be specified in which case the specified direct dependencies are merged with the direct dependencies * retrieved from the artifact descriptor of the root dependency. And last, only direct dependencies can be specified in * which case the root node of the resulting graph has no associated dependency. * * @see RepositorySystem#collectDependencies(RepositorySystemSession, CollectRequest) */ public final class CollectRequest { private Artifact rootArtifact; private Dependency root; private List dependencies = Collections.emptyList(); private List managedDependencies = Collections.emptyList(); private List repositories = Collections.emptyList(); private String context = ""; private RequestTrace trace; /** * Creates an uninitialized request. */ public CollectRequest() { // enables default constructor } /** * Creates a request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List repositories ) { setRoot( root ); setRepositories( repositories ); } /** * Creates a new request with the specified properties. * * @param root The root dependency whose transitive dependencies should be collected, may be {@code null}. * @param dependencies The direct dependencies to merge with the direct dependencies from the root dependency's * artifact descriptor. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( Dependency root, List dependencies, List repositories ) { setRoot( root ); setDependencies( dependencies ); setRepositories( repositories ); } /** * Creates a new request with the specified properties. * * @param dependencies The direct dependencies of some imaginary root, may be {@code null}. * @param managedDependencies The dependency management information to apply to the transitive dependencies, may be * {@code null}. * @param repositories The repositories to use for the collection, may be {@code null}. */ public CollectRequest( List dependencies, List managedDependencies, List repositories ) { setDependencies( dependencies ); setManagedDependencies( managedDependencies ); setRepositories( repositories ); } /** * Gets the root artifact for the dependency graph. * * @return The root artifact for the dependency graph or {@code null} if none. */ public Artifact getRootArtifact() { return rootArtifact; } /** * Sets the root artifact for the dependency graph. This must not be confused with {@link #setRoot(Dependency)}: The * root dependency, like any other specified dependency, will be subject to dependency * collection/resolution, i.e. should have an artifact descriptor and a corresponding artifact file. The root * artifact on the other hand is only used as a label for the root node of the graph in case no root * dependency was specified. As such, the configured root artifact is ignored if {@link #getRoot()} does not return * {@code null}. * * @param rootArtifact The root artifact for the dependency graph, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setRootArtifact( Artifact rootArtifact ) { this.rootArtifact = rootArtifact; return this; } /** * Gets the root dependency of the graph. * * @return The root dependency of the graph or {@code null} if none. */ public Dependency getRoot() { return root; } /** * Sets the root dependency of the graph. * * @param root The root dependency of the graph, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setRoot( Dependency root ) { this.root = root; return this; } /** * Gets the direct dependencies. * * @return The direct dependencies, never {@code null}. */ public List getDependencies() { return dependencies; } /** * Sets the direct dependencies. If both a root dependency and direct dependencies are given in the request, the * direct dependencies from the request will be merged with the direct dependencies from the root dependency's * artifact descriptor, giving higher priority to the dependencies from the request. * * @param dependencies The direct dependencies, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setDependencies( List dependencies ) { if ( dependencies == null ) { this.dependencies = Collections.emptyList(); } else { this.dependencies = dependencies; } return this; } /** * Adds the specified direct dependency. * * @param dependency The dependency to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest addDependency( Dependency dependency ) { if ( dependency != null ) { if ( this.dependencies.isEmpty() ) { this.dependencies = new ArrayList(); } this.dependencies.add( dependency ); } return this; } /** * Gets the dependency management to apply to transitive dependencies. * * @return The dependency management to apply to transitive dependencies, never {@code null}. */ public List getManagedDependencies() { return managedDependencies; } /** * Sets the dependency management to apply to transitive dependencies. To clarify, this management does not apply to * the direct dependencies of the root node. * * @param managedDependencies The dependency management, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setManagedDependencies( List managedDependencies ) { if ( managedDependencies == null ) { this.managedDependencies = Collections.emptyList(); } else { this.managedDependencies = managedDependencies; } return this; } /** * Adds the specified managed dependency. * * @param managedDependency The managed dependency to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest addManagedDependency( Dependency managedDependency ) { if ( managedDependency != null ) { if ( this.managedDependencies.isEmpty() ) { this.managedDependencies = new ArrayList(); } this.managedDependencies.add( managedDependency ); } return this; } /** * Gets the repositories to use for the collection. * * @return The repositories to use for the collection, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the repositories to use for the collection. * * @param repositories The repositories to use for the collection, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified repository for collection. * * @param repository The repository to collect dependency information from, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( this.repositories.isEmpty() ) { this.repositories = new ArrayList(); } this.repositories.add( repository ); } return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public CollectRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getRoot() + " -> " + getDependencies() + " < " + getRepositories(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/CollectResult.java000066400000000000000000000100241245546356100317740ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.graph.DependencyCycle; import org.eclipse.aether.graph.DependencyNode; /** * The result of a dependency collection request. * * @see RepositorySystem#collectDependencies(RepositorySystemSession, CollectRequest) */ public final class CollectResult { private final CollectRequest request; private List exceptions; private List cycles; private DependencyNode root; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public CollectResult( CollectRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "dependency collection request has not been specified" ); } this.request = request; exceptions = Collections.emptyList(); cycles = Collections.emptyList(); } /** * Gets the collection request that was made. * * @return The collection request, never {@code null}. */ public CollectRequest getRequest() { return request; } /** * Gets the exceptions that occurred while building the dependency graph. * * @return The exceptions that occurred, never {@code null}. */ public List getExceptions() { return exceptions; } /** * Records the specified exception while building the dependency graph. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public CollectResult addException( Exception exception ) { if ( exception != null ) { if ( exceptions.isEmpty() ) { exceptions = new ArrayList(); } exceptions.add( exception ); } return this; } /** * Gets the dependency cycles that were encountered while building the dependency graph. * * @return The dependency cycles in the (raw) graph, never {@code null}. */ public List getCycles() { return cycles; } /** * Records the specified dependency cycle. * * @param cycle The dependency cycle to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public CollectResult addCycle( DependencyCycle cycle ) { if ( cycle != null ) { if ( cycles.isEmpty() ) { cycles = new ArrayList(); } cycles.add( cycle ); } return this; } /** * Gets the root node of the dependency graph. * * @return The root node of the dependency graph or {@code null} if none. */ public DependencyNode getRoot() { return root; } /** * Sets the root node of the dependency graph. * * @param root The root node of the dependency graph, may be {@code null}. * @return This result for chaining, never {@code null}. */ public CollectResult setRoot( DependencyNode root ) { this.root = root; return this; } @Override public String toString() { return String.valueOf( getRoot() ); } } DependencyCollectionContext.java000066400000000000000000000052601245546356100345760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; /** * A context used during dependency collection to update the dependency manager, selector and traverser. * * @see DependencyManager#deriveChildManager(DependencyCollectionContext) * @see DependencyTraverser#deriveChildTraverser(DependencyCollectionContext) * @see DependencySelector#deriveChildSelector(DependencyCollectionContext) * @see VersionFilter#deriveChildFilter(DependencyCollectionContext) * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface DependencyCollectionContext { /** * Gets the repository system session during which the dependency collection happens. * * @return The repository system session, never {@code null}. */ RepositorySystemSession getSession(); /** * Gets the artifact whose children are to be processed next during dependency collection. For all nodes but the * root, this is simply shorthand for {@code getDependency().getArtifact()}. In case of the root node however, * {@link #getDependency()} might be {@code null} while the node still has an artifact which serves as its label and * is not to be resolved. * * @return The artifact whose children are going to be processed or {@code null} in case of the root node without * dependency and label. */ Artifact getArtifact(); /** * Gets the dependency whose children are to be processed next during dependency collection. * * @return The dependency whose children are going to be processed or {@code null} in case of the root node without * dependency. */ Dependency getDependency(); /** * Gets the dependency management information that was contributed by the artifact descriptor of the current * dependency. * * @return The dependency management information, never {@code null}. */ List getManagedDependencies(); } DependencyCollectionException.java000066400000000000000000000065031245546356100351110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.RepositoryException; /** * Thrown in case of bad artifact descriptors, version ranges or other issues encountered during calculation of the * dependency graph. */ public class DependencyCollectionException extends RepositoryException { private final transient CollectResult result; /** * Creates a new exception with the specified result. * * @param result The collection result at the point the exception occurred, may be {@code null}. */ public DependencyCollectionException( CollectResult result ) { super( "Failed to collect dependencies for " + getSource( result ), getCause( result ) ); this.result = result; } /** * Creates a new exception with the specified result and detail message. * * @param result The collection result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public DependencyCollectionException( CollectResult result, String message ) { super( message, getCause( result ) ); this.result = result; } /** * Creates a new exception with the specified result, detail message and cause. * * @param result The collection result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public DependencyCollectionException( CollectResult result, String message, Throwable cause ) { super( message, cause ); this.result = result; } /** * Gets the collection result at the point the exception occurred. Despite being incomplete, callers might want to * use this result to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The collection result or {@code null} if unknown. */ public CollectResult getResult() { return result; } private static String getSource( CollectResult result ) { if ( result == null ) { return ""; } CollectRequest request = result.getRequest(); if ( request.getRoot() != null ) { return request.getRoot().toString(); } if ( request.getRootArtifact() != null ) { return request.getRootArtifact().toString(); } return request.getDependencies().toString(); } private static Throwable getCause( CollectResult result ) { Throwable cause = null; if ( result != null && !result.getExceptions().isEmpty() ) { cause = result.getExceptions().get( 0 ); } return cause; } } DependencyGraphTransformationContext.java000066400000000000000000000034141245546356100364720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.RepositorySystemSession; /** * A context used during dependency collection to exchange information within a chain of dependency graph transformers. * * @see DependencyGraphTransformer * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface DependencyGraphTransformationContext { /** * Gets the repository system session during which the graph transformation happens. * * @return The repository system session, never {@code null}. */ RepositorySystemSession getSession(); /** * Gets a keyed value from the context. * * @param key The key used to query the value, must not be {@code null}. * @return The queried value or {@code null} if none. */ Object get( Object key ); /** * Puts a keyed value into the context. * * @param key The key used to store the value, must not be {@code null}. * @param value The value to store, may be {@code null} to remove the mapping. * @return The previous value associated with the key or {@code null} if none. */ Object put( Object key, Object value ); } DependencyGraphTransformer.java000066400000000000000000000035261245546356100344250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.graph.DependencyNode; /** * Transforms a given dependency graph. *

* Note: Implementations must be stateless. *

* Warning: Dependency graphs may generally contain cycles. As such a graph transformer that cannot assume for * sure that cycles have already been eliminated must gracefully handle cyclic graphs, e.g. guard against infinite * recursion. * * @see org.eclipse.aether.RepositorySystemSession#getDependencyGraphTransformer() */ public interface DependencyGraphTransformer { /** * Transforms the dependency graph denoted by the specified root node. The transformer may directly change the * provided input graph or create a new graph, the former is recommended for performance reasons. * * @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. * @param context The graph transformation context, must not be {@code null}. * @return The result graph of the transformation, never {@code null}. * @throws RepositoryException If the transformation failed. */ DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException; } DependencyManagement.java000066400000000000000000000130031245546356100332040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.Collection; import java.util.Map; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; /** * The management updates to apply to a dependency. * * @see DependencyManager#manageDependency(Dependency) */ public final class DependencyManagement { private String version; private String scope; private Boolean optional; private Collection exclusions; private Map properties; /** * Creates an empty management update. */ public DependencyManagement() { // enables default constructor } /** * Gets the new version to apply to the dependency. * * @return The new version or {@code null} if the version is not managed and the existing dependency version should * remain unchanged. */ public String getVersion() { return version; } /** * Sets the new version to apply to the dependency. * * @param version The new version, may be {@code null} if the version is not managed. * @return This management update for chaining, never {@code null}. */ public DependencyManagement setVersion( String version ) { this.version = version; return this; } /** * Gets the new scope to apply to the dependency. * * @return The new scope or {@code null} if the scope is not managed and the existing dependency scope should remain * unchanged. */ public String getScope() { return scope; } /** * Sets the new scope to apply to the dependency. * * @param scope The new scope, may be {@code null} if the scope is not managed. * @return This management update for chaining, never {@code null}. */ public DependencyManagement setScope( String scope ) { this.scope = scope; return this; } /** * Gets the new optional flag to apply to the dependency. * * @return The new optional flag or {@code null} if the flag is not managed and the existing optional flag of the * dependency should remain unchanged. */ public Boolean getOptional() { return optional; } /** * Sets the new optional flag to apply to the dependency. * * @param optional The optional flag, may be {@code null} if the flag is not managed. * @return This management update for chaining, never {@code null}. */ public DependencyManagement setOptional( Boolean optional ) { this.optional = optional; return this; } /** * Gets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged * with information from dependency management or overridden by it. * * @return The new exclusions or {@code null} if the exclusions are not managed and the existing dependency * exclusions should remain unchanged. */ public Collection getExclusions() { return exclusions; } /** * Sets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged * with information from dependency management or overridden by it. * * @param exclusions The new exclusions, may be {@code null} if the exclusions are not managed. * @return This management update for chaining, never {@code null}. */ public DependencyManagement setExclusions( Collection exclusions ) { this.exclusions = exclusions; return this; } /** * Gets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, * i.e. the dependency manager controls whether any existing properties get merged with the information from * dependency management or overridden by it. * * @return The new artifact properties or {@code null} if the properties are not managed and the existing properties * should remain unchanged. */ public Map getProperties() { return properties; } /** * Sets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, * i.e. the dependency manager controls whether any existing properties get merged with the information from * dependency management or overridden by it. * * @param properties The new artifact properties, may be {@code null} if the properties are not managed. * @return This management update for chaining, never {@code null}. */ public DependencyManagement setProperties( Map properties ) { this.properties = properties; return this; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java000066400000000000000000000042131245546356100325640ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.graph.Dependency; /** * Applies dependency management to the dependencies of a dependency node. *

* Note: Implementations must be stateless. *

* Warning: This hook is called from a hot spot and therefore implementations should pay attention to * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencyManager() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, * CollectRequest) */ public interface DependencyManager { /** * Applies dependency management to the specified dependency. * * @param dependency The dependency to manage, must not be {@code null}. * @return The management update to apply to the dependency or {@code null} if the dependency is not managed at all. */ DependencyManagement manageDependency( Dependency dependency ); /** * Derives a dependency manager for the specified collection context. When calculating the child manager, * implementors are strongly advised to simply return the current instance if nothing changed to help save memory. * * @param context The dependency collection context, must not be {@code null}. * @return The dependency manager for the dependencies of the target node or {@code null} if dependency management * should no longer be applied. */ DependencyManager deriveChildManager( DependencyCollectionContext context ); } DependencySelector.java000066400000000000000000000042461245546356100327210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.graph.Dependency; /** * Decides what dependencies to include in the dependency graph. *

* Note: Implementations must be stateless. *

* Warning: This hook is called from a hot spot and therefore implementations should pay attention to * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencySelector() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, * CollectRequest) */ public interface DependencySelector { /** * Decides whether the specified dependency should be included in the dependency graph. * * @param dependency The dependency to check, must not be {@code null}. * @return {@code false} if the dependency should be excluded from the children of the current node, {@code true} * otherwise. */ boolean selectDependency( Dependency dependency ); /** * Derives a dependency selector for the specified collection context. When calculating the child selector, * implementors are strongly advised to simply return the current instance if nothing changed to help save memory. * * @param context The dependency collection context, must not be {@code null}. * @return The dependency selector for the target node or {@code null} if dependencies should be unconditionally * included in the sub graph. */ DependencySelector deriveChildSelector( DependencyCollectionContext context ); } DependencyTraverser.java000066400000000000000000000045101245546356100331100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import org.eclipse.aether.graph.Dependency; /** * Decides whether the dependencies of a dependency node should be traversed as well. *

* Note: Implementations must be stateless. *

* Warning: This hook is called from a hot spot and therefore implementations should pay attention to * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencyTraverser() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, * CollectRequest) */ public interface DependencyTraverser { /** * Decides whether the dependencies of the specified dependency should be traversed. * * @param dependency The dependency to check, must not be {@code null}. * @return {@code true} if the dependency graph builder should recurse into the specified dependency and process its * dependencies, {@code false} otherwise. */ boolean traverseDependency( Dependency dependency ); /** * Derives a dependency traverser that will be used to decide whether the transitive dependencies of the dependency * given in the collection context shall be traversed. When calculating the child traverser, implementors are * strongly advised to simply return the current instance if nothing changed to help save memory. * * @param context The dependency collection context, must not be {@code null}. * @return The dependency traverser for the target node or {@code null} if dependencies should be unconditionally * traversed in the sub graph. */ DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); } UnsolvableVersionConflictException.java000066400000000000000000000104071245546356100361570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.version.VersionConstraint; /** * Thrown in case of an unsolvable conflict between different version constraints for a dependency. */ public class UnsolvableVersionConflictException extends RepositoryException { private final transient Collection versions; private final transient Collection> paths; /** * Creates a new exception with the specified paths to conflicting nodes in the dependency graph. * * @param paths The paths to the dependency nodes that participate in the version conflict, may be {@code null}. */ public UnsolvableVersionConflictException( Collection> paths ) { super( "Could not resolve version conflict among " + toPaths( paths ) ); if ( paths == null ) { this.paths = Collections.emptyList(); this.versions = Collections.emptyList(); } else { this.paths = paths; this.versions = new LinkedHashSet(); for ( List path : paths ) { VersionConstraint constraint = path.get( path.size() - 1 ).getVersionConstraint(); if ( constraint != null && constraint.getRange() != null ) { versions.add( constraint.toString() ); } } } } private static String toPaths( Collection> paths ) { String result = ""; if ( paths != null ) { Collection strings = new LinkedHashSet(); for ( List path : paths ) { strings.add( toPath( path ) ); } result = strings.toString(); } return result; } private static String toPath( List path ) { StringBuilder buffer = new StringBuilder( 256 ); for ( Iterator it = path.iterator(); it.hasNext(); ) { DependencyNode node = it.next(); if ( node.getDependency() == null ) { continue; } Artifact artifact = node.getDependency().getArtifact(); buffer.append( artifact.getGroupId() ); buffer.append( ':' ).append( artifact.getArtifactId() ); buffer.append( ':' ).append( artifact.getExtension() ); if ( artifact.getClassifier().length() > 0 ) { buffer.append( ':' ).append( artifact.getClassifier() ); } buffer.append( ':' ).append( node.getVersionConstraint() ); if ( it.hasNext() ) { buffer.append( " -> " ); } } return buffer.toString(); } /** * Gets the paths leading to the conflicting dependencies. * * @return The (read-only) paths leading to the conflicting dependencies, never {@code null}. */ public Collection> getPaths() { return paths; } /** * Gets the conflicting version constraints of the dependency. * * @return The (read-only) conflicting version constraints, never {@code null}. */ public Collection getVersions() { return versions; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java000066400000000000000000000124451245546356100320140ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.collection; import java.util.Iterator; import java.util.List; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * Decides which versions matching a version range should actually be considered for the dependency graph. The version * filter is not invoked for dependencies that do not declare a version range but a single version. *

* Note: Implementations must be stateless. *

* Warning: This hook is called from a hot spot and therefore implementations should pay attention to * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getVersionFilter() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, * CollectRequest) */ public interface VersionFilter { /** * A context used during version filtering to hold relevant data. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ interface VersionFilterContext extends Iterable { /** * Gets the repository system session during which the version filtering happens. * * @return The repository system session, never {@code null}. */ RepositorySystemSession getSession(); /** * Gets the dependency whose version range is being filtered. * * @return The dependency, never {@code null}. */ Dependency getDependency(); /** * Gets the total number of available versions. This count reflects any removals made during version filtering. * * @return The total number of available versions. */ int getCount(); /** * Gets an iterator over the available versions of the dependency. The iterator returns versions in ascending * order. Use {@link Iterator#remove()} to exclude a version from further consideration in the dependency graph. * * @return The iterator of available versions, never {@code null}. */ Iterator iterator(); /** * Gets the version constraint that was parsed from the dependency's version string. * * @return The parsed version constraint, never {@code null}. */ VersionConstraint getVersionConstraint(); /** * Gets the repository from which the specified version was resolved. * * @param version The version whose source repository should be retrieved, must not be {@code null}. * @return The repository from which the version was resolved or {@code null} if unknown. */ ArtifactRepository getRepository( Version version ); /** * Gets the remote repositories from which the versions were resolved. * * @return The (read-only) list of repositories, never {@code null}. */ List getRepositories(); } /** * Filters the available versions for a given dependency. Implementations will usually call * {@link VersionFilterContext#iterator() context.iterator()} to inspect the available versions and use * {@link java.util.Iterator#remove()} to delete unacceptable versions. If no versions remain after all filtering * has been performed, the dependency collection process will automatically fail, i.e. implementations need not * handle this situation on their own. * * @param context The version filter context, must not be {@code null}. * @throws RepositoryException If the filtering could not be performed. */ void filterVersions( VersionFilterContext context ) throws RepositoryException; /** * Derives a version filter for the specified collection context. The derived filter will be used to handle version * ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are * strongly advised to simply return the current instance if nothing changed to help save memory. * * @param context The dependency collection context, must not be {@code null}. * @return The version filter for the target node or {@code null} if versions should not be filtered any more. */ VersionFilter deriveChildFilter( DependencyCollectionContext context ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/collection/package-info.java000066400000000000000000000012701245546356100315370ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The types and extension points for collecting the transitive dependencies of an artifact and building a dependency * graph. */ package org.eclipse.aether.collection; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/deployment/000077500000000000000000000000001245546356100263755ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java000066400000000000000000000122321245546356100320450ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.deployment; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; /** * A request to deploy artifacts and their accompanying metadata into the a remote repository. * * @see RepositorySystem#deploy(RepositorySystemSession, DeployRequest) */ public final class DeployRequest { private Collection artifacts = Collections.emptyList(); private Collection metadata = Collections.emptyList(); private RemoteRepository repository; private RequestTrace trace; /** * Creates an uninitialized request. */ public DeployRequest() { } /** * Gets the artifact to deploy. * * @return The artifacts to deploy, never {@code null}. */ public Collection getArtifacts() { return artifacts; } /** * Sets the artifacts to deploy. * * @param artifacts The artifacts to deploy, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest setArtifacts( Collection artifacts ) { if ( artifacts == null ) { this.artifacts = Collections.emptyList(); } else { this.artifacts = artifacts; } return this; } /** * Adds the specified artifacts for deployment. * * @param artifact The artifact to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest addArtifact( Artifact artifact ) { if ( artifact != null ) { if ( artifacts.isEmpty() ) { artifacts = new ArrayList(); } artifacts.add( artifact ); } return this; } /** * Gets the metadata to deploy. * * @return The metadata to deploy, never {@code null}. */ public Collection getMetadata() { return metadata; } /** * Sets the metadata to deploy. * * @param metadata The metadata to deploy, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest setMetadata( Collection metadata ) { if ( metadata == null ) { this.metadata = Collections.emptyList(); } else { this.metadata = metadata; } return this; } /** * Adds the specified metadata for deployment. * * @param metadata The metadata to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest addMetadata( Metadata metadata ) { if ( metadata != null ) { if ( this.metadata.isEmpty() ) { this.metadata = new ArrayList(); } this.metadata.add( metadata ); } return this; } /** * Gets the repository to deploy to. * * @return The repository to deploy to or {@code null} if not set. */ public RemoteRepository getRepository() { return repository; } /** * Sets the repository to deploy to. * * @param repository The repository to deploy to, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest setRepository( RemoteRepository repository ) { this.repository = repository; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DeployRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifacts() + ", " + getMetadata() + " > " + getRepository(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java000066400000000000000000000107101245546356100316720ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.deployment; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * The result of deploying artifacts and their accompanying metadata into the a remote repository. * * @see RepositorySystem#deploy(RepositorySystemSession, DeployRequest) */ public final class DeployResult { private final DeployRequest request; private Collection artifacts; private Collection metadata; /** * Creates a new result for the specified request. * * @param request The deployment request, must not be {@code null}. */ public DeployResult( DeployRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "deploy request has not been specified" ); } this.request = request; artifacts = Collections.emptyList(); metadata = Collections.emptyList(); } /** * Gets the deploy request that was made. * * @return The deploy request, never {@code null}. */ public DeployRequest getRequest() { return request; } /** * Gets the artifacts that got deployed. * * @return The deployed artifacts, never {@code null}. */ public Collection getArtifacts() { return artifacts; } /** * Sets the artifacts that got deployed. * * @param artifacts The deployed artifacts, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DeployResult setArtifacts( Collection artifacts ) { if ( artifacts == null ) { this.artifacts = Collections.emptyList(); } else { this.artifacts = artifacts; } return this; } /** * Adds the specified artifacts to the result. * * @param artifact The deployed artifact to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DeployResult addArtifact( Artifact artifact ) { if ( artifact != null ) { if ( artifacts.isEmpty() ) { artifacts = new ArrayList(); } artifacts.add( artifact ); } return this; } /** * Gets the metadata that got deployed. Note that due to automatically generated metadata, there might have been * more metadata deployed than originally specified in the deploy request. * * @return The deployed metadata, never {@code null}. */ public Collection getMetadata() { return metadata; } /** * Sets the metadata that got deployed. * * @param metadata The deployed metadata, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DeployResult setMetadata( Collection metadata ) { if ( metadata == null ) { this.metadata = Collections.emptyList(); } else { this.metadata = metadata; } return this; } /** * Adds the specified metadata to this result. * * @param metadata The deployed metadata to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DeployResult addMetadata( Metadata metadata ) { if ( metadata != null ) { if ( this.metadata.isEmpty() ) { this.metadata = new ArrayList(); } this.metadata.add( metadata ); } return this; } @Override public String toString() { return getArtifacts() + ", " + getMetadata(); } } DeploymentException.java000066400000000000000000000025121245546356100331600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/deployment/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.deployment; import org.eclipse.aether.RepositoryException; /** * Thrown in case of a deployment error like authentication failure. */ public class DeploymentException extends RepositoryException { /** * Creates a new exception with the specified detail message. * * @param message The detail message, may be {@code null}. */ public DeploymentException( String message ) { super( message ); } /** * Creates a new exception with the specified detail message and cause. * * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public DeploymentException( String message, Throwable cause ) { super( message, cause ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/deployment/package-info.java000066400000000000000000000012041245546356100315610ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The types supporting the publishing of artifacts to a remote repository. */ package org.eclipse.aether.deployment; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/000077500000000000000000000000001245546356100253165ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java000066400000000000000000000230541245546356100323560ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * A node within a dependency graph. */ public final class DefaultDependencyNode implements DependencyNode { private List children; private Dependency dependency; private Artifact artifact; private List relocations; private Collection aliases; private VersionConstraint versionConstraint; private Version version; private byte managedBits; private List repositories; private String context; private Map data; /** * Creates a new node with the specified dependency. * * @param dependency The dependency associated with this node, may be {@code null} for a root node. */ public DefaultDependencyNode( Dependency dependency ) { this.dependency = dependency; artifact = ( dependency != null ) ? dependency.getArtifact() : null; children = new ArrayList( 0 ); aliases = relocations = Collections.emptyList(); repositories = Collections.emptyList(); context = ""; data = Collections.emptyMap(); } /** * Creates a new root node with the specified artifact as its label. Note that the new node has no dependency, i.e. * {@link #getDependency()} will return {@code null}. Put differently, the specified artifact will not be subject to * dependency collection/resolution. * * @param artifact The artifact to use as label for this node, may be {@code null}. */ public DefaultDependencyNode( Artifact artifact ) { this.artifact = artifact; children = new ArrayList( 0 ); aliases = relocations = Collections.emptyList(); repositories = Collections.emptyList(); context = ""; data = Collections.emptyMap(); } /** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList( 0 ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setManagedBits( node.getManagedBits() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); Map data = node.getData(); setData( data.isEmpty() ? null : new HashMap( data ) ); } public List getChildren() { return children; } public void setChildren( List children ) { if ( children == null ) { this.children = new ArrayList( 0 ); } else { this.children = children; } } public Dependency getDependency() { return dependency; } public Artifact getArtifact() { return artifact; } public void setArtifact( Artifact artifact ) { if ( dependency == null ) { throw new UnsupportedOperationException( "node does not have a dependency" ); } dependency = dependency.setArtifact( artifact ); this.artifact = dependency.getArtifact(); } public List getRelocations() { return relocations; } /** * Sets the sequence of relocations that was followed to resolve this dependency's artifact. * * @param relocations The sequence of relocations, may be {@code null}. */ public void setRelocations( List relocations ) { if ( relocations == null || relocations.isEmpty() ) { this.relocations = Collections.emptyList(); } else { this.relocations = relocations; } } public Collection getAliases() { return aliases; } /** * Sets the known aliases for this dependency's artifact. * * @param aliases The known aliases, may be {@code null}. */ public void setAliases( Collection aliases ) { if ( aliases == null || aliases.isEmpty() ) { this.aliases = Collections.emptyList(); } else { this.aliases = aliases; } } public VersionConstraint getVersionConstraint() { return versionConstraint; } /** * Sets the version constraint that was parsed from the dependency's version declaration. * * @param versionConstraint The version constraint for this node, may be {@code null}. */ public void setVersionConstraint( VersionConstraint versionConstraint ) { this.versionConstraint = versionConstraint; } public Version getVersion() { return version; } /** * Sets the version that was selected for the dependency's target artifact. * * @param version The parsed version, may be {@code null}. */ public void setVersion( Version version ) { this.version = version; } public void setScope( String scope ) { if ( dependency == null ) { throw new UnsupportedOperationException( "node does not have a dependency" ); } dependency = dependency.setScope( scope ); } public void setOptional( Boolean optional ) { if ( dependency == null ) { throw new UnsupportedOperationException( "node does not have a dependency" ); } dependency = dependency.setOptional( optional ); } public int getManagedBits() { return managedBits; } /** * Sets a bit field indicating which attributes of this node were subject to dependency management. * * @param managedBits The bit field indicating the managed attributes or {@code 0} if dependency management wasn't * applied. */ public void setManagedBits( int managedBits ) { this.managedBits = (byte) ( managedBits & 0x1F ); } public List getRepositories() { return repositories; } /** * Sets the remote repositories from which this node's artifact shall be resolved. * * @param repositories The remote repositories to use for artifact resolution, may be {@code null}. */ public void setRepositories( List repositories ) { if ( repositories == null || repositories.isEmpty() ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } } public String getRequestContext() { return context; } public void setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; } public Map getData() { return data; } public void setData( Map data ) { if ( data == null ) { this.data = Collections.emptyMap(); } else { this.data = data; } } public void setData( Object key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } if ( value == null ) { if ( !data.isEmpty() ) { data.remove( key ); if ( data.isEmpty() ) { data = Collections.emptyMap(); } } } else { if ( data.isEmpty() ) { data = new HashMap( 1, 2 ); // nodes can be numerous so let's be space conservative } data.put( key, value ); } } public boolean accept( DependencyVisitor visitor ) { if ( visitor.visitEnter( this ) ) { for ( DependencyNode child : children ) { if ( !child.accept( visitor ) ) { break; } } } return visitor.visitLeave( this ); } @Override public String toString() { Dependency dep = getDependency(); if ( dep == null ) { return String.valueOf( getArtifact() ); } return dep.toString(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/Dependency.java000066400000000000000000000233301245546356100302400ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import java.util.AbstractSet; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.NoSuchElementException; import java.util.Set; import org.eclipse.aether.artifact.Artifact; /** * A dependency to some artifact. Note: Instances of this class are immutable and the exposed mutators return * new objects rather than changing the current instance. */ public final class Dependency { private final Artifact artifact; private final String scope; private final Boolean optional; private final Set exclusions; /** * Creates a mandatory dependency on the specified artifact with the given scope. * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. */ public Dependency( Artifact artifact, String scope ) { this( artifact, scope, false ); } /** * Creates a dependency on the specified artifact with the given scope. * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. * @param optional A flag whether the dependency is optional or mandatory, may be {@code null}. */ public Dependency( Artifact artifact, String scope, Boolean optional ) { this( artifact, scope, optional, null ); } /** * Creates a dependency on the specified artifact with the given scope and exclusions. * * @param artifact The artifact being depended on, must not be {@code null}. * @param scope The scope of the dependency, may be {@code null}. * @param optional A flag whether the dependency is optional or mandatory, may be {@code null}. * @param exclusions The exclusions that apply to transitive dependencies, may be {@code null} if none. */ public Dependency( Artifact artifact, String scope, Boolean optional, Collection exclusions ) { this( artifact, scope, Exclusions.copy( exclusions ), optional ); } private Dependency( Artifact artifact, String scope, Set exclusions, Boolean optional ) { // NOTE: This constructor assumes immutability of the provided exclusion collection, for internal use only if ( artifact == null ) { throw new IllegalArgumentException( "no artifact specified for dependency" ); } this.artifact = artifact; this.scope = ( scope != null ) ? scope : ""; this.optional = optional; this.exclusions = exclusions; } /** * Gets the artifact being depended on. * * @return The artifact, never {@code null}. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact being depended on. * * @param artifact The artifact, must not be {@code null}. * @return The new dependency, never {@code null}. */ public Dependency setArtifact( Artifact artifact ) { if ( this.artifact.equals( artifact ) ) { return this; } return new Dependency( artifact, scope, exclusions, optional ); } /** * Gets the scope of the dependency. The scope defines in which context this dependency is relevant. * * @return The scope or an empty string if not set, never {@code null}. */ public String getScope() { return scope; } /** * Sets the scope of the dependency, e.g. "compile". * * @param scope The scope of the dependency, may be {@code null}. * @return The new dependency, never {@code null}. */ public Dependency setScope( String scope ) { if ( this.scope.equals( scope ) || ( scope == null && this.scope.length() <= 0 ) ) { return this; } return new Dependency( artifact, scope, exclusions, optional ); } /** * Indicates whether this dependency is optional or not. Optional dependencies can be ignored in some contexts. * * @return {@code true} if the dependency is (definitively) optional, {@code false} otherwise. */ public boolean isOptional() { return Boolean.TRUE.equals( optional ); } /** * Gets the optional flag for the dependency. Note: Most clients will usually call {@link #isOptional()} to * determine the optional flag, this method is for advanced use cases where three-valued logic is required. * * @return The optional flag or {@code null} if unspecified. */ public Boolean getOptional() { return optional; } /** * Sets the optional flag for the dependency. * * @param optional {@code true} if the dependency is optional, {@code false} if the dependency is mandatory, may be * {@code null} if unspecified. * @return The new dependency, never {@code null}. */ public Dependency setOptional( Boolean optional ) { if ( eq( this.optional, optional ) ) { return this; } return new Dependency( artifact, scope, exclusions, optional ); } /** * Gets the exclusions for this dependency. Exclusions can be used to remove transitive dependencies during * resolution. * * @return The (read-only) exclusions, never {@code null}. */ public Collection getExclusions() { return exclusions; } /** * Sets the exclusions for the dependency. * * @param exclusions The exclusions, may be {@code null}. * @return The new dependency, never {@code null}. */ public Dependency setExclusions( Collection exclusions ) { if ( hasEquivalentExclusions( exclusions ) ) { return this; } return new Dependency( artifact, scope, optional, exclusions ); } private boolean hasEquivalentExclusions( Collection exclusions ) { if ( exclusions == null || exclusions.isEmpty() ) { return this.exclusions.isEmpty(); } if ( exclusions instanceof Set ) { return this.exclusions.equals( exclusions ); } return exclusions.size() >= this.exclusions.size() && this.exclusions.containsAll( exclusions ) && exclusions.containsAll( this.exclusions ); } @Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Dependency that = (Dependency) obj; return artifact.equals( that.artifact ) && scope.equals( that.scope ) && eq( optional, that.optional ) && exclusions.equals( that.exclusions ); } private static boolean eq( T o1, T o2 ) { return ( o1 != null ) ? o1.equals( o2 ) : o2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + artifact.hashCode(); hash = hash * 31 + scope.hashCode(); hash = hash * 31 + ( optional != null ? optional.hashCode() : 0 ); hash = hash * 31 + exclusions.size(); return hash; } private static class Exclusions extends AbstractSet { private final Exclusion[] exclusions; public static Set copy( Collection exclusions ) { if ( exclusions == null || exclusions.isEmpty() ) { return Collections.emptySet(); } return new Exclusions( exclusions ); } private Exclusions( Collection exclusions ) { if ( exclusions.size() > 1 && !( exclusions instanceof Set ) ) { exclusions = new LinkedHashSet( exclusions ); } this.exclusions = exclusions.toArray( new Exclusion[exclusions.size()] ); } @Override public Iterator iterator() { return new Iterator() { private int cursor = 0; public boolean hasNext() { return cursor < exclusions.length; } public Exclusion next() { try { Exclusion exclusion = exclusions[cursor]; cursor++; return exclusion; } catch ( IndexOutOfBoundsException e ) { throw new NoSuchElementException(); } } public void remove() { throw new UnsupportedOperationException(); } }; } @Override public int size() { return exclusions.length; } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java000066400000000000000000000035041245546356100312210ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import java.util.List; /** * A cycle within a dependency graph, that is a sequence of dependencies d_1, d_2, ..., d_n where d_1 and d_n have the * same versionless coordinates. In more practical terms, a cycle occurs when a project directly or indirectly depends * on its own output artifact. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface DependencyCycle { /** * Gets the dependencies that lead to the first dependency on the cycle, starting from the root of the dependency * graph. * * @return The (read-only) sequence of dependencies that precedes the cycle in the graph, potentially empty but * never {@code null}. */ List getPrecedingDependencies(); /** * Gets the dependencies that actually form the cycle. For example, a -> b -> c -> a, i.e. the last * dependency in this sequence duplicates the first element and closes the cycle. Hence the length of the cycle is * the size of the returned sequence minus 1. * * @return The (read-only) sequence of dependencies that forms the cycle, never {@code null}. */ List getCyclicDependencies(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java000066400000000000000000000026771245546356100314210ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import java.util.List; /** * A filter to include/exclude dependency nodes during other operations. */ public interface DependencyFilter { /** * Indicates whether the specified dependency node shall be included or excluded. * * @param node The dependency node to filter, must not be {@code null}. * @param parents The (read-only) chain of parent nodes that leads to the node to be filtered, must not be * {@code null}. Iterating this (possibly empty) list walks up the dependency graph towards the root * node, i.e. the immediate parent node (if any) is the first node in the list. The size of the list also * denotes the zero-based depth of the filtered node. * @return {@code true} to include the dependency node, {@code false} to exclude it. */ boolean accept( DependencyNode node, List parents ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java000066400000000000000000000206611245546356100310520ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import java.util.Collection; import java.util.List; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * A node within a dependency graph. To conserve memory, dependency graphs may reuse a given node instance multiple * times to represent reoccurring dependencies. As such clients traversing a dependency graph should be prepared to * discover multiple paths leading to the same node instance unless the input graph is known to be a duplicate-free * tree. Note: Unless otherwise noted, implementation classes are not thread-safe and dependency nodes should * not be mutated by concurrent threads. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface DependencyNode { /** * A bit flag indicating the dependency version was subject to dependency management * * @see #getManagedBits() */ int MANAGED_VERSION = 0x01; /** * A bit flag indicating the dependency scope was subject to dependency management * * @see #getManagedBits() */ int MANAGED_SCOPE = 0x02; /** * A bit flag indicating the optional flag was subject to dependency management * * @see #getManagedBits() */ int MANAGED_OPTIONAL = 0x04; /** * A bit flag indicating the artifact properties were subject to dependency management * * @see #getManagedBits() */ int MANAGED_PROPERTIES = 0x08; /** * A bit flag indicating the exclusions were subject to dependency management * * @see #getManagedBits() */ int MANAGED_EXCLUSIONS = 0x10; /** * Gets the child nodes of this node. To conserve memory, dependency nodes with equal dependencies may share the * same child list instance. Hence clients mutating the child list need to be aware that these changes might affect * more than this node. Where this is not desired, the child list should be copied before mutation if the client * cannot be sure whether it might be shared with other nodes in the graph. * * @return The child nodes of this node, never {@code null}. */ List getChildren(); /** * Sets the child nodes of this node. * * @param children The child nodes, may be {@code null} */ void setChildren( List children ); /** * Gets the dependency associated with this node. Note: For dependency graphs that have been constructed * without a root dependency, this method will yield {@code null} when invoked on the graph's root node. The root * node of such graphs may however still have a label as returned by {@link #getArtifact()}. * * @return The dependency or {@code null} if none. */ Dependency getDependency(); /** * Gets the artifact associated with this node. If this node is associated with a dependency, this is equivalent to * {@code getDependency().getArtifact()}. Otherwise the artifact merely provides a label for this node in which case * the artifact must not be subjected to dependency collection/resolution. * * @return The associated artifact or {@code null} if none. */ Artifact getArtifact(); /** * Updates the artifact of the dependency after resolution. The new artifact must have the same coordinates as the * original artifact. This method may only be invoked if this node actually has a dependency, i.e. if * {@link #getDependency()} is not null. * * @param artifact The artifact satisfying the dependency, must not be {@code null}. */ void setArtifact( Artifact artifact ); /** * Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency. * * @return The (read-only) sequence of relocations, never {@code null}. */ List getRelocations(); /** * Gets the known aliases for this dependency's artifact. An alias can be used to mark a patched rebuild of some * other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as * a conflict. * * @return The (read-only) set of known aliases, never {@code null}. */ Collection getAliases(); /** * Gets the version constraint that was parsed from the dependency's version declaration. * * @return The version constraint for this node or {@code null}. */ VersionConstraint getVersionConstraint(); /** * Gets the version that was selected for the dependency's target artifact. * * @return The parsed version or {@code null}. */ Version getVersion(); /** * Sets the scope of the dependency. This method may only be invoked if this node actually has a dependency, i.e. if * {@link #getDependency()} is not null. * * @param scope The scope, may be {@code null}. */ void setScope( String scope ); /** * Sets the optional flag of the dependency. This method may only be invoked if this node actually has a dependency, * i.e. if {@link #getDependency()} is not null. * * @param optional The optional flag, may be {@code null}. */ void setOptional( Boolean optional ); /** * Gets a bit field indicating which attributes of this node were subject to dependency management. * * @return A bit field containing any of the bits {@link #MANAGED_VERSION}, {@link #MANAGED_SCOPE}, * {@link #MANAGED_OPTIONAL}, {@link #MANAGED_PROPERTIES} and {@link #MANAGED_EXCLUSIONS} if the * corresponding attribute was set via dependency management. */ int getManagedBits(); /** * Gets the remote repositories from which this node's artifact shall be resolved. * * @return The (read-only) list of remote repositories to use for artifact resolution, never {@code null}. */ List getRepositories(); /** * Gets the request context in which this dependency node was created. * * @return The request context, never {@code null}. */ String getRequestContext(); /** * Sets the request context in which this dependency node was created. * * @param context The context, may be {@code null}. */ void setRequestContext( String context ); /** * Gets the custom data associated with this dependency node. Clients of the repository system can use this data to * annotate dependency nodes with domain-specific information. Note that the returned map is read-only and * {@link #setData(Object, Object)} needs to be used to update the custom data. * * @return The (read-only) key-value mappings, never {@code null}. */ Map getData(); /** * Sets the custom data associated with this dependency node. * * @param data The new custom data, may be {@code null}. */ void setData( Map data ); /** * Associates the specified dependency node data with the given key. Note: This method must not be called * while {@link #getData()} is being iterated. * * @param key The key under which to store the data, must not be {@code null}. * @param value The data to associate with the key, may be {@code null} to remove the mapping. */ void setData( Object key, Object value ); /** * Traverses this node and potentially its children using the specified visitor. * * @param visitor The visitor to call back, must not be {@code null}. * @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings. */ boolean accept( DependencyVisitor visitor ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java000066400000000000000000000027551245546356100316300ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; /** * A visitor for nodes of the dependency graph. * * @see DependencyNode#accept(DependencyVisitor) */ public interface DependencyVisitor { /** * Notifies the visitor of a node visit before its children have been processed. * * @param node The dependency node being visited, must not be {@code null}. * @return {@code true} to visit child nodes of the specified node as well, {@code false} to skip children. */ boolean visitEnter( DependencyNode node ); /** * Notifies the visitor of a node visit after its children have been processed. Note that this method is always * invoked regardless whether any children have actually been visited. * * @param node The dependency node being visited, must not be {@code null}. * @return {@code true} to visit siblings nodes of the specified node as well, {@code false} to skip siblings. */ boolean visitLeave( DependencyNode node ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/Exclusion.java000066400000000000000000000067471245546356100301500ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; /** * An exclusion of one or more transitive dependencies. Note: Instances of this class are immutable and the * exposed mutators return new objects rather than changing the current instance. * * @see Dependency#getExclusions() */ public final class Exclusion { private final String groupId; private final String artifactId; private final String classifier; private final String extension; /** * Creates an exclusion for artifacts with the specified coordinates. * * @param groupId The group identifier, may be {@code null}. * @param artifactId The artifact identifier, may be {@code null}. * @param classifier The classifier, may be {@code null}. * @param extension The file extension, may be {@code null}. */ public Exclusion( String groupId, String artifactId, String classifier, String extension ) { this.groupId = ( groupId != null ) ? groupId : ""; this.artifactId = ( artifactId != null ) ? artifactId : ""; this.classifier = ( classifier != null ) ? classifier : ""; this.extension = ( extension != null ) ? extension : ""; } /** * Gets the group identifier for artifacts to exclude. * * @return The group identifier, never {@code null}. */ public String getGroupId() { return groupId; } /** * Gets the artifact identifier for artifacts to exclude. * * @return The artifact identifier, never {@code null}. */ public String getArtifactId() { return artifactId; } /** * Gets the classifier for artifacts to exclude. * * @return The classifier, never {@code null}. */ public String getClassifier() { return classifier; } /** * Gets the file extension for artifacts to exclude. * * @return The file extension of artifacts to exclude, never {@code null}. */ public String getExtension() { return extension; } @Override public String toString() { return getGroupId() + ':' + getArtifactId() + ':' + getExtension() + ( getClassifier().length() > 0 ? ':' + getClassifier() : "" ); } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Exclusion that = (Exclusion) obj; return artifactId.equals( that.artifactId ) && groupId.equals( that.groupId ) && extension.equals( that.extension ) && classifier.equals( that.classifier ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + artifactId.hashCode(); hash = hash * 31 + groupId.hashCode(); hash = hash * 31 + classifier.hashCode(); hash = hash * 31 + extension.hashCode(); return hash; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/graph/package-info.java000066400000000000000000000012071245546356100305050ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The representation of a dependency graph by means of connected dependency nodes. */ package org.eclipse.aether.graph; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/installation/000077500000000000000000000000001245546356100267165ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java000066400000000000000000000107531245546356100325460ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.installation; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * A request to install artifacts and their accompanying metadata into the local repository. * * @see RepositorySystem#install(RepositorySystemSession, InstallRequest) */ public final class InstallRequest { private Collection artifacts = Collections.emptyList(); private Collection metadata = Collections.emptyList(); private RequestTrace trace; /** * Creates an uninitialized request. */ public InstallRequest() { } /** * Gets the artifact to install. * * @return The artifacts to install, never {@code null}. */ public Collection getArtifacts() { return artifacts; } /** * Sets the artifacts to install. * * @param artifacts The artifacts to install, may be {@code null}. * @return This request for chaining, never {@code null}. */ public InstallRequest setArtifacts( Collection artifacts ) { if ( artifacts == null ) { this.artifacts = Collections.emptyList(); } else { this.artifacts = artifacts; } return this; } /** * Adds the specified artifacts for installation. * * @param artifact The artifact to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public InstallRequest addArtifact( Artifact artifact ) { if ( artifact != null ) { if ( artifacts.isEmpty() ) { artifacts = new ArrayList(); } artifacts.add( artifact ); } return this; } /** * Gets the metadata to install. * * @return The metadata to install, never {@code null}. */ public Collection getMetadata() { return metadata; } /** * Sets the metadata to install. * * @param metadata The metadata to install. * @return This request for chaining, never {@code null}. */ public InstallRequest setMetadata( Collection metadata ) { if ( metadata == null ) { this.metadata = Collections.emptyList(); } else { this.metadata = metadata; } return this; } /** * Adds the specified metadata for installation. * * @param metadata The metadata to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public InstallRequest addMetadata( Metadata metadata ) { if ( metadata != null ) { if ( this.metadata.isEmpty() ) { this.metadata = new ArrayList(); } this.metadata.add( metadata ); } return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public InstallRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifacts() + ", " + getMetadata(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/installation/InstallResult.java000066400000000000000000000107471245546356100323770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.installation; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * The result of installing artifacts and their accompanying metadata into the a remote repository. * * @see RepositorySystem#install(RepositorySystemSession, InstallRequest) */ public final class InstallResult { private final InstallRequest request; private Collection artifacts; private Collection metadata; /** * Creates a new result for the specified request. * * @param request The installation request, must not be {@code null}. */ public InstallResult( InstallRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "install request has not been specified" ); } this.request = request; artifacts = Collections.emptyList(); metadata = Collections.emptyList(); } /** * Gets the install request that was made. * * @return The install request, never {@code null}. */ public InstallRequest getRequest() { return request; } /** * Gets the artifacts that got installed. * * @return The installed artifacts, never {@code null}. */ public Collection getArtifacts() { return artifacts; } /** * Sets the artifacts that got installed. * * @param artifacts The installed artifacts, may be {@code null}. * @return This result for chaining, never {@code null}. */ public InstallResult setArtifacts( Collection artifacts ) { if ( artifacts == null ) { this.artifacts = Collections.emptyList(); } else { this.artifacts = artifacts; } return this; } /** * Adds the specified artifacts to the result. * * @param artifact The installed artifact to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public InstallResult addArtifact( Artifact artifact ) { if ( artifact != null ) { if ( artifacts.isEmpty() ) { artifacts = new ArrayList(); } artifacts.add( artifact ); } return this; } /** * Gets the metadata that got installed. Note that due to automatically generated metadata, there might have been * more metadata installed than originally specified in the install request. * * @return The installed metadata, never {@code null}. */ public Collection getMetadata() { return metadata; } /** * Sets the metadata that got installed. * * @param metadata The installed metadata, may be {@code null}. * @return This result for chaining, never {@code null}. */ public InstallResult setMetadata( Collection metadata ) { if ( metadata == null ) { this.metadata = Collections.emptyList(); } else { this.metadata = metadata; } return this; } /** * Adds the specified metadata to this result. * * @param metadata The installed metadata to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public InstallResult addMetadata( Metadata metadata ) { if ( metadata != null ) { if ( this.metadata.isEmpty() ) { this.metadata = new ArrayList(); } this.metadata.add( metadata ); } return this; } @Override public String toString() { return getArtifacts() + ", " + getMetadata(); } } InstallationException.java000066400000000000000000000025121245546356100340220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/installation/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.installation; import org.eclipse.aether.RepositoryException; /** * Thrown in case of an installation error like an IO error. */ public class InstallationException extends RepositoryException { /** * Creates a new exception with the specified detail message. * * @param message The detail message, may be {@code null}. */ public InstallationException( String message ) { super( message ); } /** * Creates a new exception with the specified detail message and cause. * * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public InstallationException( String message, Throwable cause ) { super( message, cause ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/installation/package-info.java000066400000000000000000000012051245546356100321030ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The types supporting the publishing of artifacts to a local repository. */ package org.eclipse.aether.installation; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/000077500000000000000000000000001245546356100257755ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java000066400000000000000000000112241245546356100320440ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.metadata; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * A skeleton class for metadata. */ public abstract class AbstractMetadata implements Metadata { private Metadata newInstance( Map properties, File file ) { return new DefaultMetadata( getGroupId(), getArtifactId(), getVersion(), getType(), getNature(), file, properties ); } public Metadata setFile( File file ) { File current = getFile(); if ( ( current == null ) ? file == null : current.equals( file ) ) { return this; } return newInstance( getProperties(), file ); } public Metadata setProperties( Map properties ) { Map current = getProperties(); if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) ) { return this; } return newInstance( copyProperties( properties ), getFile() ); } public String getProperty( String key, String defaultValue ) { String value = getProperties().get( key ); return ( value != null ) ? value : defaultValue; } /** * Copies the specified metadata properties. This utility method should be used when creating new metadata instances * with caller-supplied properties. * * @param properties The properties to copy, may be {@code null}. * @return The copied and read-only properties, never {@code null}. */ protected static Map copyProperties( Map properties ) { if ( properties != null && !properties.isEmpty() ) { return Collections.unmodifiableMap( new HashMap( properties ) ); } else { return Collections.emptyMap(); } } @Override public String toString() { StringBuilder buffer = new StringBuilder( 128 ); if ( getGroupId().length() > 0 ) { buffer.append( getGroupId() ); } if ( getArtifactId().length() > 0 ) { buffer.append( ':' ).append( getArtifactId() ); } if ( getVersion().length() > 0 ) { buffer.append( ':' ).append( getVersion() ); } buffer.append( '/' ).append( getType() ); return buffer.toString(); } /** * Compares this metadata with the specified object. * * @param obj The object to compare this metadata against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates, * type, nature, properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Metadata ) ) { return false; } Metadata that = (Metadata) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getType().equals( that.getType() ) && getNature().equals( that.getNature() ) && eq( getFile(), that.getFile() ) && eq( getProperties(), that.getProperties() ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } /** * Returns a hash code for this metadata. * * @return A hash code for the metadata. */ @Override public int hashCode() { int hash = 17; hash = hash * 31 + getGroupId().hashCode(); hash = hash * 31 + getArtifactId().hashCode(); hash = hash * 31 + getType().hashCode(); hash = hash * 31 + getNature().hashCode(); hash = hash * 31 + getVersion().hashCode(); hash = hash * 31 + hash( getFile() ); return hash; } private static int hash( Object obj ) { return ( obj != null ) ? obj.hashCode() : 0; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java000066400000000000000000000153131245546356100316700ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.metadata; import java.io.File; import java.util.Map; /** * A basic metadata instance. Note: Instances of this class are immutable and the exposed mutators return new * objects rather than changing the current instance. */ public final class DefaultMetadata extends AbstractMetadata { private final String groupId; private final String artifactId; private final String version; private final String type; private final Nature nature; private final File file; private final Map properties; /** * Creates a new metadata for the repository root with the specific type and nature. * * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. */ public DefaultMetadata( String type, Nature nature ) { this( "", "", "", type, nature, null, (File) null ); } /** * Creates a new metadata for the groupId level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. */ public DefaultMetadata( String groupId, String type, Nature nature ) { this( groupId, "", "", type, nature, null, (File) null ); } /** * Creates a new metadata for the groupId:artifactId level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String type, Nature nature ) { this( groupId, artifactId, "", type, nature, null, (File) null ); } /** * Creates a new metadata for the groupId:artifactId:version level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param version The version to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature ) { this( groupId, artifactId, version, type, nature, null, (File) null ); } /** * Creates a new metadata for the groupId:artifactId:version level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param version The version to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. * @param file The resolved file of the metadata, may be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file ) { this( groupId, artifactId, version, type, nature, null, file ); } /** * Creates a new metadata for the groupId:artifactId:version level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param version The version to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. * @param properties The properties of the metadata, may be {@code null} if none. * @param file The resolved file of the metadata, may be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, Map properties, File file ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); if ( nature == null ) { throw new IllegalArgumentException( "metadata nature was not specified" ); } this.nature = nature; this.file = file; this.properties = copyProperties( properties ); } DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file, Map properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); this.nature = nature; this.file = file; this.properties = properties; } private static String emptify( String str ) { return ( str == null ) ? "" : str; } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getVersion() { return version; } public String getType() { return type; } public Nature getNature() { return nature; } public File getFile() { return file; } public Map getProperties() { return properties; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java000066400000000000000000000030321245546356100321620ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.metadata; import java.io.File; import org.eclipse.aether.RepositoryException; /** * A piece of metadata that needs to be merged with any current metadata before installation/deployment. */ public interface MergeableMetadata extends Metadata { /** * Merges this metadata into the current metadata (if any). Note that this method will be invoked regardless whether * metadata currently exists or not. * * @param current The path to the current metadata file, may not exist but must not be {@code null}. * @param result The path to the result file where the merged metadata should be stored, must not be {@code null}. * @throws RepositoryException If the metadata could not be merged. */ void merge( File current, File result ) throws RepositoryException; /** * Indicates whether this metadata has been merged. * * @return {@code true} if the metadata has been merged, {@code false} otherwise. */ boolean isMerged(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/Metadata.java000066400000000000000000000102151245546356100303570ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.metadata; import java.io.File; import java.util.Map; /** * A piece of repository metadata, e.g. an index of available versions. In contrast to an artifact, which usually exists * in only one repository, metadata usually exists in multiple repositories and each repository contains a different * copy of the metadata. Note: Metadata instances are supposed to be immutable, e.g. any exposed mutator method * returns a new metadata instance and leaves the original instance unchanged. Implementors are strongly advised to obey * this contract. Note: Implementors are strongly advised to inherit from {@link AbstractMetadata} instead of * directly implementing this interface. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface Metadata { /** * The nature of the metadata. */ enum Nature { /** * The metadata refers to release artifacts only. */ RELEASE, /** * The metadata refers to snapshot artifacts only. */ SNAPSHOT, /** * The metadata refers to either release or snapshot artifacts. */ RELEASE_OR_SNAPSHOT } /** * Gets the group identifier of this metadata. * * @return The group identifier or an empty string if the metadata applies to the entire repository, never * {@code null}. */ String getGroupId(); /** * Gets the artifact identifier of this metadata. * * @return The artifact identifier or an empty string if the metadata applies to the groupId level only, never * {@code null}. */ String getArtifactId(); /** * Gets the version of this metadata. * * @return The version or an empty string if the metadata applies to the groupId:artifactId level only, never * {@code null}. */ String getVersion(); /** * Gets the type of the metadata, e.g. "maven-metadata.xml". * * @return The type of the metadata, never {@code null}. */ String getType(); /** * Gets the nature of this metadata. The nature indicates to what artifact versions the metadata refers. * * @return The nature, never {@code null}. */ Nature getNature(); /** * Gets the file of this metadata. Note that only resolved metadata has a file associated with it. * * @return The file or {@code null} if none. */ File getFile(); /** * Sets the file of the metadata. * * @param file The file of the metadata, may be {@code null} * @return The new metadata, never {@code null}. */ Metadata setFile( File file ); /** * Gets the specified property. * * @param key The name of the property, must not be {@code null}. * @param defaultValue The default value to return in case the property is not set, may be {@code null}. * @return The requested property value or {@code null} if the property is not set and no default value was * provided. */ String getProperty( String key, String defaultValue ); /** * Gets the properties of this metadata. * * @return The (read-only) properties, never {@code null}. */ Map getProperties(); /** * Sets the properties for the metadata. * * @param properties The properties for the metadata, may be {@code null}. * @return The new metadata, never {@code null}. */ Metadata setProperties( Map properties ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/metadata/package-info.java000066400000000000000000000012471245546356100311700ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The definition of metadata, that is an auxiliary entity managed by the repository system to locate artifacts. */ package org.eclipse.aether.metadata; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/package-info.java000066400000000000000000000012121245546356100274000ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The primary API of the {@link org.eclipse.aether.RepositorySystem} and its functionality. */ package org.eclipse.aether; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/000077500000000000000000000000001245546356100264345ustar00rootroot00000000000000ArtifactRepository.java000066400000000000000000000022071245546356100330560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * A repository hosting artifacts. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface ArtifactRepository { /** * Gets the type of the repository, for example "default". * * @return The (case-sensitive) type of the repository, never {@code null}. */ String getContentType(); /** * Gets the identifier of this repository. * * @return The (case-sensitive) identifier, never {@code null}. */ String getId(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/Authentication.java000066400000000000000000000043061245546356100322610ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.Map; /** * The authentication to use for accessing a protected resource. This acts basically as an extensible callback mechanism * from which network operations can request authentication data like username and password when needed. */ public interface Authentication { /** * Fills the given authentication context with the data from this authentication callback. To do so, implementors * have to call {@link AuthenticationContext#put(String, Object)}.
*
* The {@code key} parameter supplied to this method acts merely as a hint for interactive callbacks that want to * prompt the user for only that authentication data which is required. Implementations are free to ignore this * parameter and put all the data they have into the authentication context at once. * * @param context The authentication context to populate, must not be {@code null}. * @param key The key denoting a specific piece of authentication data that is being requested for a network * operation, may be {@code null}. * @param data Any (read-only) extra data in form of key value pairs that might be useful when getting the * authentication data, may be {@code null}. */ void fill( AuthenticationContext context, String key, Map data ); /** * Updates the given digest with data from this authentication callback. To do so, implementors have to call the * {@code update()} methods in {@link AuthenticationDigest}. * * @param digest The digest to update, must not be {@code null}. */ void digest( AuthenticationDigest digest ); } AuthenticationContext.java000066400000000000000000000337571245546356100335630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.Closeable; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.RepositorySystemSession; /** * A glorified map of key value pairs holding (cleartext) authentication data. Authentication contexts are used * internally when network operations need to access secured repositories or proxies. Each authentication context * manages the credentials required to access a single host. Unlike {@link Authentication} callbacks which exist for a * potentially long time like the duration of a repository system session, an authentication context has a supposedly * short lifetime and should be {@link #close() closed} as soon as the corresponding network operation has finished: * *

 * AuthenticationContext context = AuthenticationContext.forRepository( session, repository );
 * try {
 *     // get credentials
 *     char[] password = context.get( AuthenticationContext.PASSWORD, char[].class );
 *     // perform network operation using retrieved credentials
 *     ...
 * } finally {
 *     // erase confidential authentication data from heap memory
 *     AuthenticationContext.close( context );
 * }
 * 
* * The same authentication data can often be presented using different data types, e.g. a password can be presented * using a character array or (less securely) using a string. For ease of use, an authentication context treats the * following groups of data types as equivalent and converts values automatically during retrieval: *
    *
  • {@code String}, {@code char[]}
  • *
  • {@code String}, {@code File}
  • *
* An authentication context is thread-safe. */ public final class AuthenticationContext implements Closeable { /** * The key used to store the username. The corresponding authentication data should be of type {@link String}. */ public static final String USERNAME = "username"; /** * The key used to store the password. The corresponding authentication data should be of type {@code char[]} or * {@link String}. */ public static final String PASSWORD = "password"; /** * The key used to store the NTLM domain. The corresponding authentication data should be of type {@link String}. */ public static final String NTLM_DOMAIN = "ntlm.domain"; /** * The key used to store the NTML workstation. The corresponding authentication data should be of type * {@link String}. */ public static final String NTLM_WORKSTATION = "ntlm.workstation"; /** * The key used to store the pathname to a private key file. The corresponding authentication data should be of type * {@link String} or {@link File}. */ public static final String PRIVATE_KEY_PATH = "privateKey.path"; /** * The key used to store the passphrase protecting the private key. The corresponding authentication data should be * of type {@code char[]} or {@link String}. */ public static final String PRIVATE_KEY_PASSPHRASE = "privateKey.passphrase"; /** * The key used to store the acceptance policy for unknown host keys. The corresponding authentication data should * be of type {@link Boolean}. When querying this authentication data, the extra data should provide * {@link #HOST_KEY_REMOTE} and {@link #HOST_KEY_LOCAL}, e.g. to enable a well-founded decision of the user during * an interactive prompt. */ public static final String HOST_KEY_ACCEPTANCE = "hostKey.acceptance"; /** * The key used to store the fingerprint of the public key advertised by remote host. Note that this key is used to * query the extra data passed to {@link #get(String, Map, Class)} when getting {@link #HOST_KEY_ACCEPTANCE}, not * the authentication data in a context. */ public static final String HOST_KEY_REMOTE = "hostKey.remote"; /** * The key used to store the fingerprint of the public key expected from remote host as recorded in a known hosts * database. Note that this key is used to query the extra data passed to {@link #get(String, Map, Class)} when * getting {@link #HOST_KEY_ACCEPTANCE}, not the authentication data in a context. */ public static final String HOST_KEY_LOCAL = "hostKey.local"; /** * The key used to store the SSL context. The corresponding authentication data should be of type * {@link javax.net.ssl.SSLContext}. */ public static final String SSL_CONTEXT = "ssl.context"; /** * The key used to store the SSL hostname verifier. The corresponding authentication data should be of type * {@link javax.net.ssl.HostnameVerifier}. */ public static final String SSL_HOSTNAME_VERIFIER = "ssl.hostnameVerifier"; private final RepositorySystemSession session; private final RemoteRepository repository; private final Proxy proxy; private final Authentication auth; private final Map authData; private boolean fillingAuthData; /** * Gets an authentication context for the specified repository. * * @param session The repository system session during which the repository is accessed, must not be {@code null}. * @param repository The repository for which to create an authentication context, must not be {@code null}. * @return An authentication context for the repository or {@code null} if no authentication is configured for it. */ public static AuthenticationContext forRepository( RepositorySystemSession session, RemoteRepository repository ) { return newInstance( session, repository, null, repository.getAuthentication() ); } /** * Gets an authentication context for the proxy of the specified repository. * * @param session The repository system session during which the repository is accessed, must not be {@code null}. * @param repository The repository for whose proxy to create an authentication context, must not be {@code null}. * @return An authentication context for the proxy or {@code null} if no proxy is set or no authentication is * configured for it. */ public static AuthenticationContext forProxy( RepositorySystemSession session, RemoteRepository repository ) { Proxy proxy = repository.getProxy(); return newInstance( session, repository, proxy, ( proxy != null ) ? proxy.getAuthentication() : null ); } private static AuthenticationContext newInstance( RepositorySystemSession session, RemoteRepository repository, Proxy proxy, Authentication auth ) { if ( auth == null ) { return null; } return new AuthenticationContext( session, repository, proxy, auth ); } private AuthenticationContext( RepositorySystemSession session, RemoteRepository repository, Proxy proxy, Authentication auth ) { if ( session == null ) { throw new IllegalArgumentException( "repository system session missing" ); } this.session = session; this.repository = repository; this.proxy = proxy; this.auth = auth; authData = new HashMap(); } /** * Gets the repository system session during which the authentication happens. * * @return The repository system session, never {@code null}. */ public RepositorySystemSession getSession() { return session; } /** * Gets the repository requiring authentication. If {@link #getProxy()} is not {@code null}, the data gathered by * this authentication context does not apply to the repository's host but rather the proxy. * * @return The repository to be contacted, never {@code null}. */ public RemoteRepository getRepository() { return repository; } /** * Gets the proxy (if any) to be authenticated with. * * @return The proxy or {@code null} if authenticating directly with the repository's host. */ public Proxy getProxy() { return proxy; } /** * Gets the authentication data for the specified key. * * @param key The key whose authentication data should be retrieved, must not be {@code null}. * @return The requested authentication data or {@code null} if none. */ public String get( String key ) { return get( key, null, String.class ); } /** * Gets the authentication data for the specified key. * * @param The data type of the authentication data. * @param key The key whose authentication data should be retrieved, must not be {@code null}. * @param type The expected type of the authentication data, must not be {@code null}. * @return The requested authentication data or {@code null} if none or if the data doesn't match the expected type. */ public T get( String key, Class type ) { return get( key, null, type ); } /** * Gets the authentication data for the specified key. * * @param The data type of the authentication data. * @param key The key whose authentication data should be retrieved, must not be {@code null}. * @param data Any (read-only) extra data in form of key value pairs that might be useful when getting the * authentication data, may be {@code null}. * @param type The expected type of the authentication data, must not be {@code null}. * @return The requested authentication data or {@code null} if none or if the data doesn't match the expected type. */ public T get( String key, Map data, Class type ) { if ( key == null ) { throw new IllegalArgumentException( "authentication data key missing" ); } Object value; synchronized ( authData ) { value = authData.get( key ); if ( value == null && !authData.containsKey( key ) && !fillingAuthData ) { if ( auth != null ) { try { fillingAuthData = true; auth.fill( this, key, data ); } finally { fillingAuthData = false; } value = authData.get( key ); } if ( value == null ) { authData.put( key, value ); } } } return convert( value, type ); } private T convert( Object value, Class type ) { if ( !type.isInstance( value ) ) { if ( String.class.equals( type ) ) { if ( value instanceof File ) { value = ( (File) value ).getPath(); } else if ( value instanceof char[] ) { value = new String( (char[]) value ); } } else if ( File.class.equals( type ) ) { if ( value instanceof String ) { value = new File( (String) value ); } } else if ( char[].class.equals( type ) ) { if ( value instanceof String ) { value = ( (String) value ).toCharArray(); } } } if ( type.isInstance( value ) ) { return type.cast( value ); } return null; } /** * Puts the specified authentication data into this context. This method should only be called from implementors of * {@link Authentication#fill(AuthenticationContext, String, Map)}. Passed in character arrays are not cloned and * become owned by this context, i.e. get erased when the context gets closed. * * @param key The key to associate the authentication data with, must not be {@code null}. * @param value The (cleartext) authentication data to store, may be {@code null}. */ public void put( String key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "authentication data key missing" ); } synchronized ( authData ) { Object oldValue = authData.put( key, value ); if ( oldValue instanceof char[] ) { Arrays.fill( (char[]) oldValue, '\0' ); } } } /** * Closes this authentication context and erases sensitive authentication data from heap memory. Closing an already * closed context has no effect. */ public void close() { synchronized ( authData ) { for ( Object value : authData.values() ) { if ( value instanceof char[] ) { Arrays.fill( (char[]) value, '\0' ); } } authData.clear(); } } /** * Closes the specified authentication context. This is a convenience method doing a {@code null} check before * calling {@link #close()} on the given context. * * @param context The authentication context to close, may be {@code null}. */ public static void close( AuthenticationContext context ) { if ( context != null ) { context.close(); } } } AuthenticationDigest.java000066400000000000000000000151501245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import org.eclipse.aether.RepositorySystemSession; /** * A helper to calculate a fingerprint/digest for the authentication data of a repository/proxy. Such a fingerprint can * be used to detect changes in the authentication data across JVM restarts without exposing sensitive information. */ public final class AuthenticationDigest { private final MessageDigest digest; private final RepositorySystemSession session; private final RemoteRepository repository; private final Proxy proxy; /** * Gets the fingerprint for the authentication of the specified repository. * * @param session The repository system session during which the fingerprint is requested, must not be {@code null}. * @param repository The repository whose authentication is to be fingerprinted, must not be {@code null}. * @return The fingerprint of the repository authentication or an empty string if no authentication is configured, * never {@code null}. */ public static String forRepository( RepositorySystemSession session, RemoteRepository repository ) { String digest = ""; Authentication auth = repository.getAuthentication(); if ( auth != null ) { AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, null ); auth.digest( authDigest ); digest = authDigest.digest(); } return digest; } /** * Gets the fingerprint for the authentication of the specified repository's proxy. * * @param session The repository system session during which the fingerprint is requested, must not be {@code null}. * @param repository The repository whose proxy authentication is to be fingerprinted, must not be {@code null}. * @return The fingerprint of the proxy authentication or an empty string if no proxy is present or if no proxy * authentication is configured, never {@code null}. */ public static String forProxy( RepositorySystemSession session, RemoteRepository repository ) { String digest = ""; Proxy proxy = repository.getProxy(); if ( proxy != null ) { Authentication auth = proxy.getAuthentication(); if ( auth != null ) { AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, proxy ); auth.digest( authDigest ); digest = authDigest.digest(); } } return digest; } private AuthenticationDigest( RepositorySystemSession session, RemoteRepository repository, Proxy proxy ) { this.session = session; this.repository = repository; this.proxy = proxy; digest = newDigest(); } private static MessageDigest newDigest() { try { return MessageDigest.getInstance( "SHA-1" ); } catch ( NoSuchAlgorithmException e ) { try { return MessageDigest.getInstance( "MD5" ); } catch ( NoSuchAlgorithmException ne ) { throw new IllegalStateException( ne ); } } } /** * Gets the repository system session during which the authentication fingerprint is calculated. * * @return The repository system session, never {@code null}. */ public RepositorySystemSession getSession() { return session; } /** * Gets the repository requiring authentication. If {@link #getProxy()} is not {@code null}, the data gathered by * this authentication digest does not apply to the repository's host but rather the proxy. * * @return The repository to be contacted, never {@code null}. */ public RemoteRepository getRepository() { return repository; } /** * Gets the proxy (if any) to be authenticated with. * * @return The proxy or {@code null} if authenticating directly with the repository's host. */ public Proxy getProxy() { return proxy; } /** * Updates the digest with the specified strings. * * @param strings The strings to update the digest with, may be {@code null} or contain {@code null} elements. */ public void update( String... strings ) { if ( strings != null ) { for ( String string : strings ) { if ( string != null ) { try { digest.update( string.getBytes( "UTF-8" ) ); } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException( e ); } } } } } /** * Updates the digest with the specified characters. * * @param chars The characters to update the digest with, may be {@code null}. */ public void update( char... chars ) { if ( chars != null ) { for ( char c : chars ) { digest.update( (byte) ( c >> 8 ) ); digest.update( (byte) ( c & 0xFF ) ); } } } /** * Updates the digest with the specified bytes. * * @param bytes The bytes to update the digest with, may be {@code null}. */ public void update( byte... bytes ) { if ( bytes != null ) { digest.update( bytes ); } } private String digest() { byte[] bytes = digest.digest(); StringBuilder buffer = new StringBuilder( bytes.length * 2 ); for ( byte aByte : bytes ) { int b = aByte & 0xFF; if ( b < 0x10 ) { buffer.append( '0' ); } buffer.append( Integer.toHexString( b ) ); } return buffer.toString(); } } AuthenticationSelector.java000066400000000000000000000021021245546356100336730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * Selects authentication for a given remote repository. * * @see org.eclipse.aether.RepositorySystemSession#getAuthenticationSelector() */ public interface AuthenticationSelector { /** * Selects authentication for the specified remote repository. * * @param repository The repository for which to select authentication, must not be {@code null}. * @return The selected authentication or {@code null} if none. */ Authentication getAuthentication( RemoteRepository repository ); } LocalArtifactRegistration.java000066400000000000000000000102531245546356100343240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; /** * A request to register an artifact within the local repository. Certain local repository implementations can refuse to * serve physically present artifacts if those haven't been previously registered to them. * * @see LocalRepositoryManager#add(RepositorySystemSession, LocalArtifactRegistration) */ public final class LocalArtifactRegistration { private Artifact artifact; private RemoteRepository repository; private Collection contexts = Collections.emptyList(); /** * Creates an uninitialized registration. */ public LocalArtifactRegistration() { // enables default constructor } /** * Creates a registration request for the specified (locally installed) artifact. * * @param artifact The artifact to register, may be {@code null}. */ public LocalArtifactRegistration( Artifact artifact ) { setArtifact( artifact ); } /** * Creates a registration request for the specified artifact. * * @param artifact The artifact to register, may be {@code null}. * @param repository The remote repository from which the artifact was resolved or {@code null} if the artifact was * locally installed. * @param contexts The resolution contexts, may be {@code null}. */ public LocalArtifactRegistration( Artifact artifact, RemoteRepository repository, Collection contexts ) { setArtifact( artifact ); setRepository( repository ); setContexts( contexts ); } /** * Gets the artifact to register. * * @return The artifact or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact to register. * * @param artifact The artifact, may be {@code null}. * @return This request for chaining, never {@code null}. */ public LocalArtifactRegistration setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the remote repository from which the artifact was resolved. * * @return The remote repository or {@code null} if the artifact was locally installed. */ public RemoteRepository getRepository() { return repository; } /** * Sets the remote repository from which the artifact was resolved. * * @param repository The remote repository or {@code null} if the artifact was locally installed. * @return This request for chaining, never {@code null}. */ public LocalArtifactRegistration setRepository( RemoteRepository repository ) { this.repository = repository; return this; } /** * Gets the resolution contexts in which the artifact is available. * * @return The resolution contexts in which the artifact is available, never {@code null}. */ public Collection getContexts() { return contexts; } /** * Sets the resolution contexts in which the artifact is available. * * @param contexts The resolution contexts, may be {@code null}. * @return This request for chaining, never {@code null}. */ public LocalArtifactRegistration setContexts( Collection contexts ) { if ( contexts != null ) { this.contexts = contexts; } else { this.contexts = Collections.emptyList(); } return this; } } LocalArtifactRequest.java000066400000000000000000000074661245546356100333160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; /** * A query to the local repository for the existence of an artifact. * * @see LocalRepositoryManager#find(RepositorySystemSession, LocalArtifactRequest) */ public final class LocalArtifactRequest { private Artifact artifact; private String context = ""; private List repositories = Collections.emptyList(); /** * Creates an uninitialized query. */ public LocalArtifactRequest() { // enables default constructor } /** * Creates a query with the specified properties. * * @param artifact The artifact to query for, may be {@code null}. * @param repositories The remote repositories that should be considered as potential sources for the artifact, may * be {@code null} or empty to only consider locally installed artifacts. * @param context The resolution context for the artifact, may be {@code null}. */ public LocalArtifactRequest( Artifact artifact, List repositories, String context ) { setArtifact( artifact ); setRepositories( repositories ); setContext( context ); } /** * Gets the artifact to query for. * * @return The artifact or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact to query for. * * @param artifact The artifact, may be {@code null}. * @return This query for chaining, never {@code null}. */ public LocalArtifactRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the resolution context. * * @return The resolution context, never {@code null}. */ public String getContext() { return context; } /** * Sets the resolution context. * * @param context The resolution context, may be {@code null}. * @return This query for chaining, never {@code null}. */ public LocalArtifactRequest setContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the remote repositories to consider as sources of the artifact. * * @return The remote repositories, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the remote repositories to consider as sources of the artifact. * * @param repositories The remote repositories, may be {@code null} or empty to only consider locally installed * artifacts. * @return This query for chaining, never {@code null}. */ public LocalArtifactRequest setRepositories( List repositories ) { if ( repositories != null ) { this.repositories = repositories; } else { this.repositories = Collections.emptyList(); } return this; } @Override public String toString() { return getArtifact() + " @ " + getRepositories(); } } LocalArtifactResult.java000066400000000000000000000107561245546356100331400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.File; import org.eclipse.aether.RepositorySystemSession; /** * A result from the local repository about the existence of an artifact. * * @see LocalRepositoryManager#find(RepositorySystemSession, LocalArtifactRequest) */ public final class LocalArtifactResult { private final LocalArtifactRequest request; private File file; private boolean available; private RemoteRepository repository; /** * Creates a new result for the specified request. * * @param request The local artifact request, must not be {@code null}. */ public LocalArtifactResult( LocalArtifactRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "local artifact request has not been specified" ); } this.request = request; } /** * Gets the request corresponding to this result. * * @return The corresponding request, never {@code null}. */ public LocalArtifactRequest getRequest() { return request; } /** * Gets the file to the requested artifact. Note that this file must not be used unless {@link #isAvailable()} * returns {@code true}. An artifact file can be found but considered unavailable if the artifact was cached from a * remote repository that is not part of the list of remote repositories used for the query. * * @return The file to the requested artifact or {@code null} if the artifact does not exist locally. */ public File getFile() { return file; } /** * Sets the file to requested artifact. * * @param file The artifact file, may be {@code null}. * @return This result for chaining, never {@code null}. */ public LocalArtifactResult setFile( File file ) { this.file = file; return this; } /** * Indicates whether the requested artifact is available for use. As a minimum, the file needs to be physically * existent in the local repository to be available. Additionally, a local repository manager can consider the list * of supplied remote repositories to determine whether the artifact is logically available and mark an artifact * unavailable (despite its physical existence) if it is not known to be hosted by any of the provided repositories. * * @return {@code true} if the artifact is available, {@code false} otherwise. * @see LocalArtifactRequest#getRepositories() */ public boolean isAvailable() { return available; } /** * Sets whether the artifact is available. * * @param available {@code true} if the artifact is available, {@code false} otherwise. * @return This result for chaining, never {@code null}. */ public LocalArtifactResult setAvailable( boolean available ) { this.available = available; return this; } /** * Gets the (first) remote repository from which the artifact was cached (if any). * * @return The remote repository from which the artifact was originally retrieved or {@code null} if unknown or if * the artifact has been locally installed. * @see LocalArtifactRequest#getRepositories() */ public RemoteRepository getRepository() { return repository; } /** * Sets the (first) remote repository from which the artifact was cached. * * @param repository The remote repository from which the artifact was originally retrieved, may be {@code null} if * unknown or if the artifact has been locally installed. * @return This result for chaining, never {@code null}. */ public LocalArtifactResult setRepository( RemoteRepository repository ) { this.repository = repository; return this; } @Override public String toString() { return getFile() + " (" + ( isAvailable() ? "available" : "unavailable" ) + ")"; } } LocalMetadataRegistration.java000066400000000000000000000101221245546356100343020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; /** * A request to register metadata within the local repository. * * @see LocalRepositoryManager#add(RepositorySystemSession, LocalMetadataRegistration) */ public final class LocalMetadataRegistration { private Metadata metadata; private RemoteRepository repository; private Collection contexts = Collections.emptyList(); /** * Creates an uninitialized registration. */ public LocalMetadataRegistration() { // enables default constructor } /** * Creates a registration request for the specified metadata accompanying a locally installed artifact. * * @param metadata The metadata to register, may be {@code null}. */ public LocalMetadataRegistration( Metadata metadata ) { setMetadata( metadata ); } /** * Creates a registration request for the specified metadata. * * @param metadata The metadata to register, may be {@code null}. * @param repository The remote repository from which the metadata was resolved or {@code null} if the metadata * accompanies a locally installed artifact. * @param contexts The resolution contexts, may be {@code null}. */ public LocalMetadataRegistration( Metadata metadata, RemoteRepository repository, Collection contexts ) { setMetadata( metadata ); setRepository( repository ); setContexts( contexts ); } /** * Gets the metadata to register. * * @return The metadata or {@code null} if not set. */ public Metadata getMetadata() { return metadata; } /** * Sets the metadata to register. * * @param metadata The metadata, may be {@code null}. * @return This request for chaining, never {@code null}. */ public LocalMetadataRegistration setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Gets the remote repository from which the metadata was resolved. * * @return The remote repository or {@code null} if the metadata was locally installed. */ public RemoteRepository getRepository() { return repository; } /** * Sets the remote repository from which the metadata was resolved. * * @param repository The remote repository or {@code null} if the metadata accompanies a locally installed artifact. * @return This request for chaining, never {@code null}. */ public LocalMetadataRegistration setRepository( RemoteRepository repository ) { this.repository = repository; return this; } /** * Gets the resolution contexts in which the metadata is available. * * @return The resolution contexts in which the metadata is available, never {@code null}. */ public Collection getContexts() { return contexts; } /** * Sets the resolution contexts in which the metadata is available. * * @param contexts The resolution contexts, may be {@code null}. * @return This request for chaining, never {@code null}. */ public LocalMetadataRegistration setContexts( Collection contexts ) { if ( contexts != null ) { this.contexts = contexts; } else { this.contexts = Collections.emptyList(); } return this; } } LocalMetadataRequest.java000066400000000000000000000066221245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; /** * A query to the local repository for the existence of metadata. * * @see LocalRepositoryManager#find(RepositorySystemSession, LocalMetadataRequest) */ public final class LocalMetadataRequest { private Metadata metadata; private String context = ""; private RemoteRepository repository = null; /** * Creates an uninitialized query. */ public LocalMetadataRequest() { // enables default constructor } /** * Creates a query with the specified properties. * * @param metadata The metadata to query for, may be {@code null}. * @param repository The source remote repository for the metadata, may be {@code null} for local metadata. * @param context The resolution context for the metadata, may be {@code null}. */ public LocalMetadataRequest( Metadata metadata, RemoteRepository repository, String context ) { setMetadata( metadata ); setRepository( repository ); setContext( context ); } /** * Gets the metadata to query for. * * @return The metadata or {@code null} if not set. */ public Metadata getMetadata() { return metadata; } /** * Sets the metadata to query for. * * @param metadata The metadata, may be {@code null}. * @return This query for chaining, never {@code null}. */ public LocalMetadataRequest setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Gets the resolution context. * * @return The resolution context, never {@code null}. */ public String getContext() { return context; } /** * Sets the resolution context. * * @param context The resolution context, may be {@code null}. * @return This query for chaining, never {@code null}. */ public LocalMetadataRequest setContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the remote repository to use as source of the metadata. * * @return The remote repositories, may be {@code null} for local metadata. */ public RemoteRepository getRepository() { return repository; } /** * Sets the remote repository to use as sources of the metadata. * * @param repository The remote repository, may be {@code null}. * @return This query for chaining, may be {@code null} for local metadata. */ public LocalMetadataRequest setRepository( RemoteRepository repository ) { this.repository = repository; return this; } @Override public String toString() { return getMetadata() + " @ " + getRepository(); } } LocalMetadataResult.java000066400000000000000000000054741245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.File; import org.eclipse.aether.RepositorySystemSession; /** * A result from the local repository about the existence of metadata. * * @see LocalRepositoryManager#find(RepositorySystemSession, LocalMetadataRequest) */ public final class LocalMetadataResult { private final LocalMetadataRequest request; private File file; private boolean stale; /** * Creates a new result for the specified request. * * @param request The local metadata request, must not be {@code null}. */ public LocalMetadataResult( LocalMetadataRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "local metadata request has not been specified" ); } this.request = request; } /** * Gets the request corresponding to this result. * * @return The corresponding request, never {@code null}. */ public LocalMetadataRequest getRequest() { return request; } /** * Gets the file to the requested metadata if the metadata is available in the local repository. * * @return The file to the requested metadata or {@code null}. */ public File getFile() { return file; } /** * Sets the file to requested metadata. * * @param file The metadata file, may be {@code null}. * @return This result for chaining, never {@code null}. */ public LocalMetadataResult setFile( File file ) { this.file = file; return this; } /** * This value indicates whether the metadata is stale and should be updated. * * @return {@code true} if the metadata is stale and should be updated, {@code false} otherwise. */ public boolean isStale() { return stale; } /** * Sets whether the metadata is stale. * * @param stale {@code true} if the metadata is stale and should be updated, {@code false} otherwise. * @return This result for chaining, never {@code null}. */ public LocalMetadataResult setStale( boolean stale ) { this.stale = stale; return this; } @Override public String toString() { return request.toString() + "(" + getFile() + ")"; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java000066400000000000000000000064031245546356100324340ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.File; /** * A repository on the local file system used to cache contents of remote repositories and to store locally installed * artifacts. Note that this class merely describes such a repository, actual access to the contained artifacts is * handled by a {@link LocalRepositoryManager} which is usually determined from the {@link #getContentType() type} of * the repository. */ public final class LocalRepository implements ArtifactRepository { private final File basedir; private final String type; /** * Creates a new local repository with the specified base directory and unknown type. * * @param basedir The base directory of the repository, may be {@code null}. */ public LocalRepository( String basedir ) { this( ( basedir != null ) ? new File( basedir ) : null, "" ); } /** * Creates a new local repository with the specified base directory and unknown type. * * @param basedir The base directory of the repository, may be {@code null}. */ public LocalRepository( File basedir ) { this( basedir, "" ); } /** * Creates a new local repository with the specified properties. * * @param basedir The base directory of the repository, may be {@code null}. * @param type The type of the repository, may be {@code null}. */ public LocalRepository( File basedir, String type ) { this.basedir = basedir; this.type = ( type != null ) ? type : ""; } public String getContentType() { return type; } public String getId() { return "local"; } /** * Gets the base directory of the repository. * * @return The base directory or {@code null} if none. */ public File getBasedir() { return basedir; } @Override public String toString() { return getBasedir() + " (" + getContentType() + ")"; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } LocalRepository that = (LocalRepository) obj; return eq( basedir, that.basedir ) && eq( type, that.type ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( basedir ); hash = hash * 31 + hash( type ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } } LocalRepositoryManager.java000066400000000000000000000143001245546356100336430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * Manages access to a local repository. * * @see RepositorySystemSession#getLocalRepositoryManager() * @see org.eclipse.aether.RepositorySystem#newLocalRepositoryManager(RepositorySystemSession, LocalRepository) */ public interface LocalRepositoryManager { /** * Gets the description of the local repository being managed. * * @return The description of the local repository, never {@code null}. */ LocalRepository getRepository(); /** * Gets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at * the returned location, the path merely indicates where the artifact would eventually be stored. The path uses the * forward slash as directory separator regardless of the underlying file system. * * @param artifact The artifact for which to determine the path, must not be {@code null}. * @return The path, relative to the local repository's base directory. */ String getPathForLocalArtifact( Artifact artifact ); /** * Gets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually * exist yet at the returned location, the path merely indicates where the artifact would eventually be stored. The * path uses the forward slash as directory separator regardless of the underlying file system. * * @param artifact The artifact for which to determine the path, must not be {@code null}. * @param repository The source repository of the artifact, must not be {@code null}. * @param context The resolution context in which the artifact is being requested, may be {@code null}. * @return The path, relative to the local repository's base directory. */ String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ); /** * Gets the relative path for locally installed metadata. Note that the metadata need not actually exist yet at the * returned location, the path merely indicates where the metadata would eventually be stored. The path uses the * forward slash as directory separator regardless of the underlying file system. * * @param metadata The metadata for which to determine the path, must not be {@code null}. * @return The path, relative to the local repository's base directory. */ String getPathForLocalMetadata( Metadata metadata ); /** * Gets the relative path for metadata cached from a remote repository. Note that the metadata need not actually * exist yet at the returned location, the path merely indicates where the metadata would eventually be stored. The * path uses the forward slash as directory separator regardless of the underlying file system. * * @param metadata The metadata for which to determine the path, must not be {@code null}. * @param repository The source repository of the metadata, must not be {@code null}. * @param context The resolution context in which the metadata is being requested, may be {@code null}. * @return The path, relative to the local repository's base directory. */ String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ); /** * Queries for the existence of an artifact in the local repository. The request could be satisfied by a locally * installed artifact or a previously downloaded artifact. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param request The artifact request, must not be {@code null}. * @return The result of the request, never {@code null}. */ LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ); /** * Registers an installed or resolved artifact with the local repository. Note that artifact registration is merely * concerned about updating the local repository's internal state, not about actually installing the artifact or its * accompanying metadata. * * @param session The repository system session during which the registration is made, must not be {@code null}. * @param request The registration request, must not be {@code null}. */ void add( RepositorySystemSession session, LocalArtifactRegistration request ); /** * Queries for the existence of metadata in the local repository. The request could be satisfied by locally * installed or previously downloaded metadata. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param request The metadata request, must not be {@code null}. * @return The result of the request, never {@code null}. */ LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ); /** * Registers installed or resolved metadata with the local repository. Note that metadata registration is merely * concerned about updating the local repository's internal state, not about actually installing the metadata. * However, this method MUST be called after the actual install to give the repository manager the opportunity to * inspect the added metadata. * * @param session The repository system session during which the registration is made, must not be {@code null}. * @param request The registration request, must not be {@code null}. */ void add( RepositorySystemSession session, LocalMetadataRegistration request ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java000066400000000000000000000020741245546356100322550ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * Selects a mirror for a given remote repository. * * @see org.eclipse.aether.RepositorySystemSession#getMirrorSelector() */ public interface MirrorSelector { /** * Selects a mirror for the specified repository. * * @param repository The repository to select a mirror for, must not be {@code null}. * @return The selected mirror or {@code null} if none. * @see RemoteRepository#getMirroredRepositories() */ RemoteRepository getMirror( RemoteRepository repository ); } NoLocalRepositoryManagerException.java000066400000000000000000000062351245546356100360270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import org.eclipse.aether.RepositoryException; /** * Thrown in case of an unsupported local repository type. */ public class NoLocalRepositoryManagerException extends RepositoryException { private final transient LocalRepository repository; /** * Creates a new exception with the specified repository. * * @param repository The local repository for which no support is available, may be {@code null}. */ public NoLocalRepositoryManagerException( LocalRepository repository ) { this( repository, toMessage( repository ) ); } /** * Creates a new exception with the specified repository and detail message. * * @param repository The local repository for which no support is available, may be {@code null}. * @param message The detail message, may be {@code null}. */ public NoLocalRepositoryManagerException( LocalRepository repository, String message ) { super( message ); this.repository = repository; } /** * Creates a new exception with the specified repository and cause. * * @param repository The local repository for which no support is available, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoLocalRepositoryManagerException( LocalRepository repository, Throwable cause ) { this( repository, toMessage( repository ), cause ); } /** * Creates a new exception with the specified repository, detail message and cause. * * @param repository The local repository for which no support is available, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoLocalRepositoryManagerException( LocalRepository repository, String message, Throwable cause ) { super( message, cause ); this.repository = repository; } private static String toMessage( LocalRepository repository ) { if ( repository != null ) { return "No manager available for local repository (" + repository.getBasedir().getAbsolutePath() + ") of type " + repository.getContentType(); } else { return "No manager available for local repository"; } } /** * Gets the local repository whose content type is not supported. * * @return The unsupported local repository or {@code null} if unknown. */ public LocalRepository getRepository() { return repository; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/Proxy.java000066400000000000000000000072571245546356100304330ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * A proxy to use for connections to a repository. */ public final class Proxy { /** * Type denoting a proxy for HTTP transfers. */ public static final String TYPE_HTTP = "http"; /** * Type denoting a proxy for HTTPS transfers. */ public static final String TYPE_HTTPS = "https"; private final String type; private final String host; private final int port; private final Authentication auth; /** * Creates a new proxy with the specified properties and no authentication. * * @param type The type of the proxy, e.g. "http", may be {@code null}. * @param host The host of the proxy, may be {@code null}. * @param port The port of the proxy. */ public Proxy( String type, String host, int port ) { this( type, host, port, null ); } /** * Creates a new proxy with the specified properties. * * @param type The type of the proxy, e.g. "http", may be {@code null}. * @param host The host of the proxy, may be {@code null}. * @param port The port of the proxy. * @param auth The authentication to use for the proxy connection, may be {@code null}. */ public Proxy( String type, String host, int port, Authentication auth ) { this.type = ( type != null ) ? type : ""; this.host = ( host != null ) ? host : ""; this.port = port; this.auth = auth; } /** * Gets the type of this proxy. * * @return The type of this proxy, never {@code null}. */ public String getType() { return type; } /** * Gets the host for this proxy. * * @return The host for this proxy, never {@code null}. */ public String getHost() { return host; } /** * Gets the port number for this proxy. * * @return The port number for this proxy. */ public int getPort() { return port; } /** * Gets the authentication to use for the proxy connection. * * @return The authentication to use or {@code null} if none. */ public Authentication getAuthentication() { return auth; } @Override public String toString() { return getHost() + ':' + getPort(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Proxy that = (Proxy) obj; return eq( type, that.type ) && eq( host, that.host ) && port == that.port && eq( auth, that.auth ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( host ); hash = hash * 31 + hash( type ); hash = hash * 31 + port; hash = hash * 31 + hash( auth ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java000066400000000000000000000020001245546356100321110ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * Selects a proxy for a given remote repository. * * @see org.eclipse.aether.RepositorySystemSession#getProxySelector() */ public interface ProxySelector { /** * Selects a proxy for the specified remote repository. * * @param repository The repository for which to select a proxy, must not be {@code null}. * @return The selected proxy or {@code null} if none. */ Proxy getProxy( RemoteRepository repository ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java000066400000000000000000000446031245546356100326410ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A repository on a remote server. */ public final class RemoteRepository implements ArtifactRepository { private static final Pattern URL_PATTERN = Pattern.compile( "([^:/]+(:[^:/]{2,}+(?=://))?):(//([^@/]*@)?([^/:]+))?.*" ); private final String id; private final String type; private final String url; private final String host; private final String protocol; private final RepositoryPolicy releasePolicy; private final RepositoryPolicy snapshotPolicy; private final Proxy proxy; private final Authentication authentication; private final List mirroredRepositories; private final boolean repositoryManager; RemoteRepository( Builder builder ) { if ( builder.prototype != null ) { id = ( builder.delta & Builder.ID ) != 0 ? builder.id : builder.prototype.id; type = ( builder.delta & Builder.TYPE ) != 0 ? builder.type : builder.prototype.type; url = ( builder.delta & Builder.URL ) != 0 ? builder.url : builder.prototype.url; releasePolicy = ( builder.delta & Builder.RELEASES ) != 0 ? builder.releasePolicy : builder.prototype.releasePolicy; snapshotPolicy = ( builder.delta & Builder.SNAPSHOTS ) != 0 ? builder.snapshotPolicy : builder.prototype.snapshotPolicy; proxy = ( builder.delta & Builder.PROXY ) != 0 ? builder.proxy : builder.prototype.proxy; authentication = ( builder.delta & Builder.AUTH ) != 0 ? builder.authentication : builder.prototype.authentication; repositoryManager = ( builder.delta & Builder.REPOMAN ) != 0 ? builder.repositoryManager : builder.prototype.repositoryManager; mirroredRepositories = ( builder.delta & Builder.MIRRORED ) != 0 ? copy( builder.mirroredRepositories ) : builder.prototype.mirroredRepositories; } else { id = builder.id; type = builder.type; url = builder.url; releasePolicy = builder.releasePolicy; snapshotPolicy = builder.snapshotPolicy; proxy = builder.proxy; authentication = builder.authentication; repositoryManager = builder.repositoryManager; mirroredRepositories = copy( builder.mirroredRepositories ); } Matcher m = URL_PATTERN.matcher( url ); if ( m.matches() ) { protocol = m.group( 1 ); String host = m.group( 5 ); this.host = ( host != null ) ? host : ""; } else { protocol = host = ""; } } private static List copy( List repos ) { if ( repos == null || repos.isEmpty() ) { return Collections.emptyList(); } return Collections.unmodifiableList( Arrays.asList( repos.toArray( new RemoteRepository[repos.size()] ) ) ); } public String getId() { return id; } public String getContentType() { return type; } /** * Gets the (base) URL of this repository. * * @return The (base) URL of this repository, never {@code null}. */ public String getUrl() { return url; } /** * Gets the protocol part from the repository's URL, for example {@code file} or {@code http}. As suggested by RFC * 2396, section 3.1 "Scheme Component", the protocol name should be treated case-insensitively. * * @return The protocol or an empty string if none, never {@code null}. */ public String getProtocol() { return protocol; } /** * Gets the host part from the repository's URL. * * @return The host or an empty string if none, never {@code null}. */ public String getHost() { return host; } /** * Gets the policy to apply for snapshot/release artifacts. * * @param snapshot {@code true} to retrieve the snapshot policy, {@code false} to retrieve the release policy. * @return The requested repository policy, never {@code null}. */ public RepositoryPolicy getPolicy( boolean snapshot ) { return snapshot ? snapshotPolicy : releasePolicy; } /** * Gets the proxy that has been selected for this repository. * * @return The selected proxy or {@code null} if none. */ public Proxy getProxy() { return proxy; } /** * Gets the authentication that has been selected for this repository. * * @return The selected authentication or {@code null} if none. */ public Authentication getAuthentication() { return authentication; } /** * Gets the repositories that this repository serves as a mirror for. * * @return The (read-only) repositories being mirrored by this repository, never {@code null}. */ public List getMirroredRepositories() { return mirroredRepositories; } /** * Indicates whether this repository refers to a repository manager or not. * * @return {@code true} if this repository is a repository manager, {@code false} otherwise. */ public boolean isRepositoryManager() { return repositoryManager; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( getId() ); buffer.append( " (" ).append( getUrl() ); buffer.append( ", " ).append( getContentType() ); boolean r = getPolicy( false ).isEnabled(), s = getPolicy( true ).isEnabled(); if ( r && s ) { buffer.append( ", releases+snapshots" ); } else if ( r ) { buffer.append( ", releases" ); } else if ( s ) { buffer.append( ", snapshots" ); } else { buffer.append( ", disabled" ); } if ( isRepositoryManager() ) { buffer.append( ", managed" ); } buffer.append( ")" ); return buffer.toString(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } RemoteRepository that = (RemoteRepository) obj; return eq( url, that.url ) && eq( type, that.type ) && eq( id, that.id ) && eq( releasePolicy, that.releasePolicy ) && eq( snapshotPolicy, that.snapshotPolicy ) && eq( proxy, that.proxy ) && eq( authentication, that.authentication ) && eq( mirroredRepositories, that.mirroredRepositories ) && repositoryManager == that.repositoryManager; } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( url ); hash = hash * 31 + hash( type ); hash = hash * 31 + hash( id ); hash = hash * 31 + hash( releasePolicy ); hash = hash * 31 + hash( snapshotPolicy ); hash = hash * 31 + hash( proxy ); hash = hash * 31 + hash( authentication ); hash = hash * 31 + hash( mirroredRepositories ); hash = hash * 31 + ( repositoryManager ? 1 : 0 ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } /** * A builder to create remote repositories. */ public static final class Builder { private static final RepositoryPolicy DEFAULT_POLICY = new RepositoryPolicy(); static final int ID = 0x0001, TYPE = 0x0002, URL = 0x0004, RELEASES = 0x0008, SNAPSHOTS = 0x0010, PROXY = 0x0020, AUTH = 0x0040, MIRRORED = 0x0080, REPOMAN = 0x0100; int delta; RemoteRepository prototype; String id; String type; String url; RepositoryPolicy releasePolicy = DEFAULT_POLICY; RepositoryPolicy snapshotPolicy = DEFAULT_POLICY; Proxy proxy; Authentication authentication; List mirroredRepositories; boolean repositoryManager; /** * Creates a new repository builder. * * @param id The identifier of the repository, may be {@code null}. * @param type The type of the repository, may be {@code null}. * @param url The (base) URL of the repository, may be {@code null}. */ public Builder( String id, String type, String url ) { this.id = ( id != null ) ? id : ""; this.type = ( type != null ) ? type : ""; this.url = ( url != null ) ? url : ""; } /** * Creates a new repository builder which uses the specified remote repository as a prototype for the new one. * All properties which have not been set on the builder will be copied from the prototype when building the * repository. * * @param prototype The remote repository to use as prototype, must not be {@code null}. */ public Builder( RemoteRepository prototype ) { if ( prototype == null ) { throw new IllegalArgumentException( "repository prototype missing" ); } this.prototype = prototype; } /** * Builds a new remote repository from the current values of this builder. The state of the builder itself * remains unchanged. * * @return The remote repository, never {@code null}. */ public RemoteRepository build() { if ( prototype != null && delta == 0 ) { return prototype; } return new RemoteRepository( this ); } private void delta( int flag, T builder, T prototype ) { boolean equal = ( builder != null ) ? builder.equals( prototype ) : prototype == null; if ( equal ) { delta &= ~flag; } else { delta |= flag; } } /** * Sets the identifier of the repository. * * @param id The identifier of the repository, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setId( String id ) { this.id = ( id != null ) ? id : ""; if ( prototype != null ) { delta( ID, this.id, prototype.getId() ); } return this; } /** * Sets the type of the repository, e.g. "default". * * @param type The type of the repository, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setContentType( String type ) { this.type = ( type != null ) ? type : ""; if ( prototype != null ) { delta( TYPE, this.type, prototype.getContentType() ); } return this; } /** * Sets the (base) URL of the repository. * * @param url The URL of the repository, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setUrl( String url ) { this.url = ( url != null ) ? url : ""; if ( prototype != null ) { delta( URL, this.url, prototype.getUrl() ); } return this; } /** * Sets the policy to apply for snapshot and release artifacts. * * @param policy The repository policy to set, may be {@code null} to use a default policy. * @return This builder for chaining, never {@code null}. */ public Builder setPolicy( RepositoryPolicy policy ) { this.releasePolicy = this.snapshotPolicy = ( policy != null ) ? policy : DEFAULT_POLICY; if ( prototype != null ) { delta( RELEASES, this.releasePolicy, prototype.getPolicy( false ) ); delta( SNAPSHOTS, this.snapshotPolicy, prototype.getPolicy( true ) ); } return this; } /** * Sets the policy to apply for release artifacts. * * @param releasePolicy The repository policy to set, may be {@code null} to use a default policy. * @return This builder for chaining, never {@code null}. */ public Builder setReleasePolicy( RepositoryPolicy releasePolicy ) { this.releasePolicy = ( releasePolicy != null ) ? releasePolicy : DEFAULT_POLICY; if ( prototype != null ) { delta( RELEASES, this.releasePolicy, prototype.getPolicy( false ) ); } return this; } /** * Sets the policy to apply for snapshot artifacts. * * @param snapshotPolicy The repository policy to set, may be {@code null} to use a default policy. * @return This builder for chaining, never {@code null}. */ public Builder setSnapshotPolicy( RepositoryPolicy snapshotPolicy ) { this.snapshotPolicy = ( snapshotPolicy != null ) ? snapshotPolicy : DEFAULT_POLICY; if ( prototype != null ) { delta( SNAPSHOTS, this.snapshotPolicy, prototype.getPolicy( true ) ); } return this; } /** * Sets the proxy to use in order to access the repository. * * @param proxy The proxy to use, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setProxy( Proxy proxy ) { this.proxy = proxy; if ( prototype != null ) { delta( PROXY, this.proxy, prototype.getProxy() ); } return this; } /** * Sets the authentication to use in order to access the repository. * * @param authentication The authentication to use, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setAuthentication( Authentication authentication ) { this.authentication = authentication; if ( prototype != null ) { delta( AUTH, this.authentication, prototype.getAuthentication() ); } return this; } /** * Sets the repositories being mirrored by the repository. * * @param mirroredRepositories The repositories being mirrored by the repository, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setMirroredRepositories( List mirroredRepositories ) { if ( this.mirroredRepositories == null ) { this.mirroredRepositories = new ArrayList(); } else { this.mirroredRepositories.clear(); } if ( mirroredRepositories != null ) { this.mirroredRepositories.addAll( mirroredRepositories ); } if ( prototype != null ) { delta( MIRRORED, this.mirroredRepositories, prototype.getMirroredRepositories() ); } return this; } /** * Adds the specified repository to the list of repositories being mirrored by the repository. If this builder * was {@link #RemoteRepository.Builder(RemoteRepository) constructed from a prototype}, the given repository * will be added to the list of mirrored repositories from the prototype. * * @param mirroredRepository The repository being mirrored by the repository, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder addMirroredRepository( RemoteRepository mirroredRepository ) { if ( mirroredRepository != null ) { if ( this.mirroredRepositories == null ) { this.mirroredRepositories = new ArrayList(); if ( prototype != null ) { mirroredRepositories.addAll( prototype.getMirroredRepositories() ); } } mirroredRepositories.add( mirroredRepository ); if ( prototype != null ) { delta |= MIRRORED; } } return this; } /** * Marks the repository as a repository manager or not. * * @param repositoryManager {@code true} if the repository points at a repository manager, {@code false} if the * repository is just serving static contents. * @return This builder for chaining, never {@code null}. */ public Builder setRepositoryManager( boolean repositoryManager ) { this.repositoryManager = repositoryManager; if ( prototype != null ) { delta( REPOMAN, this.repositoryManager, prototype.isRepositoryManager() ); } return this; } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java000066400000000000000000000104651245546356100326440ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; /** * A policy controlling access to a repository. */ public final class RepositoryPolicy { /** * Never update locally cached data. */ public static final String UPDATE_POLICY_NEVER = "never"; /** * Always update locally cached data. */ public static final String UPDATE_POLICY_ALWAYS = "always"; /** * Update locally cached data once a day. */ public static final String UPDATE_POLICY_DAILY = "daily"; /** * Update locally cached data every X minutes as given by "interval:X". */ public static final String UPDATE_POLICY_INTERVAL = "interval"; /** * Verify checksums and fail the resolution if they do not match. */ public static final String CHECKSUM_POLICY_FAIL = "fail"; /** * Verify checksums and warn if they do not match. */ public static final String CHECKSUM_POLICY_WARN = "warn"; /** * Do not verify checksums. */ public static final String CHECKSUM_POLICY_IGNORE = "ignore"; private final boolean enabled; private final String updatePolicy; private final String checksumPolicy; /** * Creates a new policy with checksum warnings and daily update checks. */ public RepositoryPolicy() { this( true, UPDATE_POLICY_DAILY, CHECKSUM_POLICY_WARN ); } /** * Creates a new policy with the specified settings. * * @param enabled A flag whether the associated repository should be accessed or not. * @param updatePolicy The update interval after which locally cached data from the repository is considered stale * and should be refetched, may be {@code null}. * @param checksumPolicy The way checksum verification should be handled, may be {@code null}. */ public RepositoryPolicy( boolean enabled, String updatePolicy, String checksumPolicy ) { this.enabled = enabled; this.updatePolicy = ( updatePolicy != null ) ? updatePolicy : ""; this.checksumPolicy = ( checksumPolicy != null ) ? checksumPolicy : ""; } /** * Indicates whether the associated repository should be contacted or not. * * @return {@code true} if the repository should be contacted, {@code false} otherwise. */ public boolean isEnabled() { return enabled; } /** * Gets the update policy for locally cached data from the repository. * * @return The update policy, never {@code null}. */ public String getUpdatePolicy() { return updatePolicy; } /** * Gets the policy for checksum validation. * * @return The checksum policy, never {@code null}. */ public String getChecksumPolicy() { return checksumPolicy; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "enabled=" ).append( isEnabled() ); buffer.append( ", checksums=" ).append( getChecksumPolicy() ); buffer.append( ", updates=" ).append( getUpdatePolicy() ); return buffer.toString(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } RepositoryPolicy that = (RepositoryPolicy) obj; return enabled == that.enabled && updatePolicy.equals( that.updatePolicy ) && checksumPolicy.equals( that.checksumPolicy ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + ( enabled ? 1 : 0 ); hash = hash * 31 + updatePolicy.hashCode(); hash = hash * 31 + checksumPolicy.hashCode(); return hash; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java000066400000000000000000000032051245546356100323600ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.io.File; import java.util.List; import org.eclipse.aether.artifact.Artifact; /** * Manages a repository backed by the IDE workspace, a build session or a similar ad-hoc collection of artifacts. * * @see org.eclipse.aether.RepositorySystemSession#getWorkspaceReader() */ public interface WorkspaceReader { /** * Gets a description of the workspace repository. * * @return The repository description, never {@code null}. */ WorkspaceRepository getRepository(); /** * Locates the specified artifact. * * @param artifact The artifact to locate, must not be {@code null}. * @return The path to the artifact or {@code null} if the artifact is not available. */ File findArtifact( Artifact artifact ); /** * Determines all available versions of the specified artifact. * * @param artifact The artifact whose versions should be listed, must not be {@code null}. * @return The available versions of the artifact, must not be {@code null}. */ List findVersions( Artifact artifact ); } WorkspaceRepository.java000066400000000000000000000066421245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import java.util.UUID; /** * A repository backed by an IDE workspace, the output of a build session or similar ad-hoc collection of artifacts. As * far as the repository system is concerned, a workspace repository is read-only, i.e. can only be used for artifact * resolution but not installation/deployment. Note that this class merely describes such a repository, actual access to * the contained artifacts is handled by a {@link WorkspaceReader}. */ public final class WorkspaceRepository implements ArtifactRepository { private final String type; private final Object key; /** * Creates a new workspace repository of type {@code "workspace"} and a random key. */ public WorkspaceRepository() { this( "workspace" ); } /** * Creates a new workspace repository with the specified type and a random key. * * @param type The type of the repository, may be {@code null}. */ public WorkspaceRepository( String type ) { this( type, null ); } /** * Creates a new workspace repository with the specified type and key. The key is used to distinguish one workspace * from another and should be sensitive to the artifacts that are (potentially) available in the workspace. * * @param type The type of the repository, may be {@code null}. * @param key The (comparison) key for the repository, may be {@code null} to generate a unique random key. */ public WorkspaceRepository( String type, Object key ) { this.type = ( type != null ) ? type : ""; this.key = ( key != null ) ? key : UUID.randomUUID().toString().replace( "-", "" ); } public String getContentType() { return type; } public String getId() { return "workspace"; } /** * Gets the key of this workspace repository. The key is used to distinguish one workspace from another and should * be sensitive to the artifacts that are (potentially) available in the workspace. * * @return The (comparison) key for this workspace repository, never {@code null}. */ public Object getKey() { return key; } @Override public String toString() { return "(" + getContentType() + ")"; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } WorkspaceRepository that = (WorkspaceRepository) obj; return getContentType().equals( that.getContentType() ) && getKey().equals( that.getKey() ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + getKey().hashCode(); hash = hash * 31 + getContentType().hashCode(); return hash; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/repository/package-info.java000066400000000000000000000012001245546356100316140ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The definition of various kinds of repositories that host artifacts. */ package org.eclipse.aether.repository; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/000077500000000000000000000000001245546356100264205ustar00rootroot00000000000000ArtifactDescriptorException.java000066400000000000000000000056161245546356100346670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositoryException; /** * Thrown in case of an unreadable or unresolvable artifact descriptor. */ public class ArtifactDescriptorException extends RepositoryException { private final transient ArtifactDescriptorResult result; /** * Creates a new exception with the specified result. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result ) { super( "Failed to read artifact descriptor" + ( result != null ? " for " + result.getRequest().getArtifact() : "" ), getCause( result ) ); this.result = result; } /** * Creates a new exception with the specified result and detail message. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result, String message ) { super( message, getCause( result ) ); this.result = result; } /** * Creates a new exception with the specified result, detail message and cause. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result, String message, Throwable cause ) { super( message, cause ); this.result = result; } /** * Gets the descriptor result at the point the exception occurred. Despite being incomplete, callers might want to * use this result to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The descriptor result or {@code null} if unknown. */ public ArtifactDescriptorResult getResult() { return result; } private static Throwable getCause( ArtifactDescriptorResult result ) { Throwable cause = null; if ( result != null && !result.getExceptions().isEmpty() ) { cause = result.getExceptions().get( 0 ); } return cause; } } ArtifactDescriptorPolicy.java000066400000000000000000000034551245546356100341670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositorySystemSession; /** * Controls the handling of errors related to reading an artifact descriptor. * * @see RepositorySystemSession#getArtifactDescriptorPolicy() */ public interface ArtifactDescriptorPolicy { /** * Bit mask indicating that errors while reading the artifact descriptor should not be tolerated. */ int STRICT = 0x00; /** * Bit flag indicating that missing artifact descriptors should be silently ignored. */ int IGNORE_MISSING = 0x01; /** * Bit flag indicating that existent but invalid artifact descriptors should be silently ignored. */ int IGNORE_INVALID = 0x02; /** * Bit mask indicating that all errors should be silently ignored. */ int IGNORE_ERRORS = IGNORE_MISSING | IGNORE_INVALID; /** * Gets the error policy for an artifact's descriptor. * * @param session The repository session during which the policy is determined, must not be {@code null}. * @param request The policy request holding further details, must not be {@code null}. * @return The bit mask describing the desired error policy. */ int getPolicy( RepositorySystemSession session, ArtifactDescriptorPolicyRequest request ); } ArtifactDescriptorPolicyRequest.java000066400000000000000000000053611245546356100355360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.artifact.Artifact; /** * A query for the error policy for a given artifact's descriptor. * * @see ArtifactDescriptorPolicy */ public final class ArtifactDescriptorPolicyRequest { private Artifact artifact; private String context = ""; /** * Creates an uninitialized request. */ public ArtifactDescriptorPolicyRequest() { // enables default constructor } /** * Creates a request for the specified artifact. * * @param artifact The artifact for whose descriptor to determine the error policy, may be {@code null}. * @param context The context in which this request is made, may be {@code null}. */ public ArtifactDescriptorPolicyRequest( Artifact artifact, String context ) { setArtifact( artifact ); setRequestContext( context ); } /** * Gets the artifact for whose descriptor to determine the error policy. * * @return The artifact for whose descriptor to determine the error policy or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact for whose descriptor to determine the error policy. * * @param artifact The artifact for whose descriptor to determine the error policy, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorPolicyRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorPolicyRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } @Override public String toString() { return String.valueOf( getArtifact() ); } } ArtifactDescriptorRequest.java000066400000000000000000000124141245546356100343530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; /** * A request to read an artifact descriptor. * * @see RepositorySystem#readArtifactDescriptor(RepositorySystemSession, ArtifactDescriptorRequest) */ public final class ArtifactDescriptorRequest { private Artifact artifact; private List repositories = Collections.emptyList(); private String context = ""; private RequestTrace trace; /** * Creates an uninitialized request. */ public ArtifactDescriptorRequest() { // enables default constructor } /** * Creates a request with the specified properties. * * @param artifact The artifact whose descriptor should be read, may be {@code null}. * @param repositories The repositories to resolve the descriptor from, may be {@code null}. * @param context The context in which this request is made, may be {@code null}. */ public ArtifactDescriptorRequest( Artifact artifact, List repositories, String context ) { setArtifact( artifact ); setRepositories( repositories ); setRequestContext( context ); } /** * Gets the artifact whose descriptor shall be read. * * @return The artifact or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact whose descriptor shall be read. Eventually, a valid request must have an artifact set. * * @param artifact The artifact, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the repositories to resolve the descriptor from. * * @return The repositories, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the repositories to resolve the descriptor from. * * @param repositories The repositories, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorRequest setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified repository for the resolution of the artifact descriptor. * * @param repository The repository to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorRequest addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( this.repositories.isEmpty() ) { this.repositories = new ArrayList(); } this.repositories.add( repository ); } return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactDescriptorRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifact() + " < " + getRepositories(); } } ArtifactDescriptorResult.java000066400000000000000000000322661245546356100342100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; /** * The result from reading an artifact descriptor. * * @see RepositorySystem#readArtifactDescriptor(RepositorySystemSession, ArtifactDescriptorRequest) */ public final class ArtifactDescriptorResult { private final ArtifactDescriptorRequest request; private List exceptions; private List relocations; private Collection aliases; private Artifact artifact; private ArtifactRepository repository; private List dependencies; private List managedDependencies; private List repositories; private Map properties; /** * Creates a new result for the specified request. * * @param request The descriptor request, must not be {@code null}. */ public ArtifactDescriptorResult( ArtifactDescriptorRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "artifact descriptor request has not been specified" ); } this.request = request; artifact = request.getArtifact(); exceptions = Collections.emptyList(); relocations = Collections.emptyList(); aliases = Collections.emptyList(); dependencies = managedDependencies = Collections.emptyList(); repositories = Collections.emptyList(); properties = Collections.emptyMap(); } /** * Gets the descriptor request that was made. * * @return The descriptor request, never {@code null}. */ public ArtifactDescriptorRequest getRequest() { return request; } /** * Gets the exceptions that occurred while reading the artifact descriptor. * * @return The exceptions that occurred, never {@code null}. */ public List getExceptions() { return exceptions; } /** * Sets the exceptions that occurred while reading the artifact descriptor. * * @param exceptions The exceptions that occurred, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setExceptions( List exceptions ) { if ( exceptions == null ) { this.exceptions = Collections.emptyList(); } else { this.exceptions = exceptions; } return this; } /** * Records the specified exception while reading the artifact descriptor. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addException( Exception exception ) { if ( exception != null ) { if ( exceptions.isEmpty() ) { exceptions = new ArrayList(); } exceptions.add( exception ); } return this; } /** * Gets the relocations that were processed to read the artifact descriptor. The returned list denotes the hops that * lead to the final artifact coordinates as given by {@link #getArtifact()}. * * @return The relocations that were processed, never {@code null}. */ public List getRelocations() { return relocations; } /** * Sets the relocations that were processed to read the artifact descriptor. * * @param relocations The relocations that were processed, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setRelocations( List relocations ) { if ( relocations == null ) { this.relocations = Collections.emptyList(); } else { this.relocations = relocations; } return this; } /** * Records the specified relocation hop while locating the artifact descriptor. * * @param artifact The artifact that got relocated, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addRelocation( Artifact artifact ) { if ( artifact != null ) { if ( relocations.isEmpty() ) { relocations = new ArrayList(); } relocations.add( artifact ); } return this; } /** * Gets the known aliases for this artifact. An alias denotes a different artifact with (almost) the same contents * and can be used to mark a patched rebuild of some other artifact as such, thereby allowing conflict resolution to * consider the patched and the original artifact as a conflict. * * @return The aliases of the artifact, never {@code null}. */ public Collection getAliases() { return aliases; } /** * Sets the aliases of the artifact. * * @param aliases The aliases of the artifact, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setAliases( Collection aliases ) { if ( aliases == null ) { this.aliases = Collections.emptyList(); } else { this.aliases = aliases; } return this; } /** * Records the specified alias. * * @param alias The alias for the artifact, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addAlias( Artifact alias ) { if ( alias != null ) { if ( aliases.isEmpty() ) { aliases = new ArrayList(); } aliases.add( alias ); } return this; } /** * Gets the artifact whose descriptor was read. This can be a different artifact than originally requested in case * relocations were encountered. * * @return The artifact after following any relocations, never {@code null}. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact whose descriptor was read. * * @param artifact The artifact whose descriptor was read, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the repository from which the descriptor was eventually resolved. * * @return The repository from which the descriptor was resolved or {@code null} if unknown. */ public ArtifactRepository getRepository() { return repository; } /** * Sets the repository from which the descriptor was resolved. * * @param repository The repository from which the descriptor was resolved, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setRepository( ArtifactRepository repository ) { this.repository = repository; return this; } /** * Gets the list of direct dependencies of the artifact. * * @return The list of direct dependencies, never {@code null} */ public List getDependencies() { return dependencies; } /** * Sets the list of direct dependencies of the artifact. * * @param dependencies The list of direct dependencies, may be {@code null} * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setDependencies( List dependencies ) { if ( dependencies == null ) { this.dependencies = Collections.emptyList(); } else { this.dependencies = dependencies; } return this; } /** * Adds the specified direct dependency. * * @param dependency The direct dependency to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addDependency( Dependency dependency ) { if ( dependency != null ) { if ( dependencies.isEmpty() ) { dependencies = new ArrayList(); } dependencies.add( dependency ); } return this; } /** * Gets the dependency management information. * * @return The dependency management information. */ public List getManagedDependencies() { return managedDependencies; } /** * Sets the dependency management information. * * @param dependencies The dependency management information, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setManagedDependencies( List dependencies ) { if ( dependencies == null ) { this.managedDependencies = Collections.emptyList(); } else { this.managedDependencies = dependencies; } return this; } /** * Adds the specified managed dependency. * * @param dependency The managed dependency to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addManagedDependency( Dependency dependency ) { if ( dependency != null ) { if ( managedDependencies.isEmpty() ) { managedDependencies = new ArrayList(); } managedDependencies.add( dependency ); } return this; } /** * Gets the remote repositories listed in the artifact descriptor. * * @return The remote repositories listed in the artifact descriptor, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the remote repositories listed in the artifact descriptor. * * @param repositories The remote repositories listed in the artifact descriptor, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified remote repository. * * @param repository The remote repository to add, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( repositories.isEmpty() ) { repositories = new ArrayList(); } repositories.add( repository ); } return this; } /** * Gets any additional information about the artifact in form of key-value pairs. Note: Regardless of their * actual type, all property values must be treated as being read-only. * * @return The additional information about the artifact, never {@code null}. */ public Map getProperties() { return properties; } /** * Sets any additional information about the artifact in form of key-value pairs. * * @param properties The additional information about the artifact, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactDescriptorResult setProperties( Map properties ) { if ( properties == null ) { this.properties = Collections.emptyMap(); } else { this.properties = properties; } return this; } @Override public String toString() { return getArtifact() + " -> " + getDependencies(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java000066400000000000000000000142541245546356100323770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.repository.RemoteRepository; /** * A request to resolve an artifact. * * @see RepositorySystem#resolveArtifacts(RepositorySystemSession, java.util.Collection) * @see Artifact#getFile() */ public final class ArtifactRequest { private Artifact artifact; private DependencyNode node; private List repositories = Collections.emptyList(); private String context = ""; private RequestTrace trace; /** * Creates an uninitialized request. */ public ArtifactRequest() { // enables default constructor } /** * Creates a request with the specified properties. * * @param artifact The artifact to resolve, may be {@code null}. * @param repositories The repositories to resolve the artifact from, may be {@code null}. * @param context The context in which this request is made, may be {@code null}. */ public ArtifactRequest( Artifact artifact, List repositories, String context ) { setArtifact( artifact ); setRepositories( repositories ); setRequestContext( context ); } /** * Creates a request from the specified dependency node. * * @param node The dependency node to resolve, may be {@code null}. */ public ArtifactRequest( DependencyNode node ) { setDependencyNode( node ); setRepositories( node.getRepositories() ); setRequestContext( node.getRequestContext() ); } /** * Gets the artifact to resolve. * * @return The artifact to resolve or {@code null}. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact to resolve. * * @param artifact The artifact to resolve, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the dependency node (if any) for which to resolve the artifact. * * @return The dependency node to resolve or {@code null} if unknown. */ public DependencyNode getDependencyNode() { return node; } /** * Sets the dependency node to resolve. * * @param node The dependency node to resolve, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest setDependencyNode( DependencyNode node ) { this.node = node; if ( node != null ) { setArtifact( node.getDependency().getArtifact() ); } return this; } /** * Gets the repositories to resolve the artifact from. * * @return The repositories, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the repositories to resolve the artifact from. * * @param repositories The repositories, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified repository for the resolution. * * @param repository The repository to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( this.repositories.isEmpty() ) { this.repositories = new ArrayList(); } this.repositories.add( repository ); } return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ArtifactRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifact() + " < " + getRepositories(); } } ArtifactResolutionException.java000066400000000000000000000125621245546356100347120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.RepositoryOfflineException; /** * Thrown in case of a unresolvable artifacts. */ public class ArtifactResolutionException extends RepositoryException { private final transient List results; /** * Creates a new exception with the specified results. * * @param results The resolution results at the point the exception occurred, may be {@code null}. */ public ArtifactResolutionException( List results ) { super( getMessage( results ), getCause( results ) ); this.results = ( results != null ) ? results : Collections. emptyList(); } /** * Creates a new exception with the specified results and detail message. * * @param results The resolution results at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactResolutionException( List results, String message ) { super( message, getCause( results ) ); this.results = ( results != null ) ? results : Collections. emptyList(); } /** * Creates a new exception with the specified results, detail message and cause. * * @param results The resolution results at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactResolutionException( List results, String message, Throwable cause ) { super( message, cause ); this.results = ( results != null ) ? results : Collections. emptyList(); } /** * Gets the resolution results at the point the exception occurred. Despite being incomplete, callers might want to * use these results to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The resolution results or {@code null} if unknown. */ public List getResults() { return results; } /** * Gets the first result from {@link #getResults()}. This is a convenience method for cases where callers know only * a single result/request is involved. * * @return The (first) resolution result or {@code null} if none. */ public ArtifactResult getResult() { return ( results != null && !results.isEmpty() ) ? results.get( 0 ) : null; } private static String getMessage( List results ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "The following artifacts could not be resolved: " ); int unresolved = 0; String sep = ""; for ( ArtifactResult result : results ) { if ( !result.isResolved() ) { unresolved++; buffer.append( sep ); buffer.append( result.getRequest().getArtifact() ); sep = ", "; } } Throwable cause = getCause( results ); if ( cause != null ) { if ( unresolved == 1 ) { buffer.setLength( 0 ); buffer.append( cause.getMessage() ); } else { buffer.append( ": " ).append( cause.getMessage() ); } } return buffer.toString(); } private static Throwable getCause( List results ) { for ( ArtifactResult result : results ) { if ( !result.isResolved() ) { Throwable notFound = null, offline = null; for ( Throwable t : result.getExceptions() ) { if ( t instanceof ArtifactNotFoundException ) { if ( notFound == null ) { notFound = t; } if ( offline == null && t.getCause() instanceof RepositoryOfflineException ) { offline = t; } } else { return t; } } if ( offline != null ) { return offline; } if ( notFound != null ) { return notFound; } } } return null; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java000066400000000000000000000127561245546356100322320ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.transfer.ArtifactNotFoundException; /** * The result of an artifact resolution request. * * @see RepositorySystem#resolveArtifacts(RepositorySystemSession, java.util.Collection) * @see Artifact#getFile() */ public final class ArtifactResult { private final ArtifactRequest request; private List exceptions; private Artifact artifact; private ArtifactRepository repository; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public ArtifactResult( ArtifactRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "resolution request has not been specified" ); } this.request = request; exceptions = Collections.emptyList(); } /** * Gets the resolution request that was made. * * @return The resolution request, never {@code null}. */ public ArtifactRequest getRequest() { return request; } /** * Gets the resolved artifact (if any). Use {@link #getExceptions()} to query the errors that occurred while trying * to resolve the artifact. * * @return The resolved artifact or {@code null} if the resolution failed. */ public Artifact getArtifact() { return artifact; } /** * Sets the resolved artifact. * * @param artifact The resolved artifact, may be {@code null} if the resolution failed. * @return This result for chaining, never {@code null}. */ public ArtifactResult setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the exceptions that occurred while resolving the artifact. Note that this list can be non-empty even if the * artifact was successfully resolved, e.g. when one of the contacted remote repositories didn't contain the * artifact but a later repository eventually contained it. * * @return The exceptions that occurred, never {@code null}. * @see #isResolved() */ public List getExceptions() { return exceptions; } /** * Records the specified exception while resolving the artifact. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactResult addException( Exception exception ) { if ( exception != null ) { if ( exceptions.isEmpty() ) { exceptions = new ArrayList(); } exceptions.add( exception ); } return this; } /** * Gets the repository from which the artifact was eventually resolved. Note that successive resolutions of the same * artifact might yield different results if the employed local repository does not track the origin of an artifact. * * @return The repository from which the artifact was resolved or {@code null} if unknown. */ public ArtifactRepository getRepository() { return repository; } /** * Sets the repository from which the artifact was resolved. * * @param repository The repository from which the artifact was resolved, may be {@code null}. * @return This result for chaining, never {@code null}. */ public ArtifactResult setRepository( ArtifactRepository repository ) { this.repository = repository; return this; } /** * Indicates whether the requested artifact was resolved. Note that the artifact might have been successfully * resolved despite {@link #getExceptions()} indicating transfer errors while trying to fetch the artifact from some * of the specified remote repositories. * * @return {@code true} if the artifact was resolved, {@code false} otherwise. * @see Artifact#getFile() */ public boolean isResolved() { return getArtifact() != null && getArtifact().getFile() != null; } /** * Indicates whether the requested artifact is not present in any of the specified repositories. * * @return {@code true} if the artifact is not present in any repository, {@code false} otherwise. */ public boolean isMissing() { for ( Exception e : getExceptions() ) { if ( !( e instanceof ArtifactNotFoundException ) ) { return false; } } return !isResolved(); } @Override public String toString() { return getArtifact() + " < " + getRepository(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java000066400000000000000000000143161245546356100327170ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A request to resolve transitive dependencies. This request can either be supplied with a {@link CollectRequest} to * calculate the transitive dependencies or with an already resolved dependency graph. * * @see RepositorySystem#resolveDependencies(RepositorySystemSession, DependencyRequest) * @see Artifact#getFile() */ public final class DependencyRequest { private DependencyNode root; private CollectRequest collectRequest; private DependencyFilter filter; private RequestTrace trace; /** * Creates an uninitialized request. Note that either {@link #setRoot(DependencyNode)} or * {@link #setCollectRequest(CollectRequest)} must eventually be called to create a valid request. */ public DependencyRequest() { // enables default constructor } /** * Creates a request for the specified dependency graph and with the given resolution filter. * * @param node The root node of the dependency graph whose artifacts should be resolved, may be {@code null}. * @param filter The resolution filter to use, may be {@code null}. */ public DependencyRequest( DependencyNode node, DependencyFilter filter ) { setRoot( node ); setFilter( filter ); } /** * Creates a request for the specified collect request and with the given resolution filter. * * @param request The collect request used to calculate the dependency graph whose artifacts should be resolved, may * be {@code null}. * @param filter The resolution filter to use, may be {@code null}. */ public DependencyRequest( CollectRequest request, DependencyFilter filter ) { setCollectRequest( request ); setFilter( filter ); } /** * Gets the root node of the dependency graph whose artifacts should be resolved. * * @return The root node of the dependency graph or {@code null} if none. */ public DependencyNode getRoot() { return root; } /** * Sets the root node of the dependency graph whose artifacts should be resolved. When this request is processed, * the nodes of the given dependency graph will be updated to refer to the resolved artifacts. Eventually, either * {@link #setRoot(DependencyNode)} or {@link #setCollectRequest(CollectRequest)} must be called to create a valid * request. * * @param root The root node of the dependency graph, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DependencyRequest setRoot( DependencyNode root ) { this.root = root; return this; } /** * Gets the collect request used to calculate the dependency graph whose artifacts should be resolved. * * @return The collect request or {@code null} if none. */ public CollectRequest getCollectRequest() { return collectRequest; } /** * Sets the collect request used to calculate the dependency graph whose artifacts should be resolved. Eventually, * either {@link #setRoot(DependencyNode)} or {@link #setCollectRequest(CollectRequest)} must be called to create a * valid request. If this request is supplied with a dependency node via {@link #setRoot(DependencyNode)}, the * collect request is ignored. * * @param collectRequest The collect request, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DependencyRequest setCollectRequest( CollectRequest collectRequest ) { this.collectRequest = collectRequest; return this; } /** * Gets the resolution filter used to select which artifacts of the dependency graph should be resolved. * * @return The resolution filter or {@code null} to resolve all artifacts of the dependency graph. */ public DependencyFilter getFilter() { return filter; } /** * Sets the resolution filter used to select which artifacts of the dependency graph should be resolved. For * example, use this filter to restrict resolution to dependencies of a certain scope. * * @param filter The resolution filter, may be {@code null} to resolve all artifacts of the dependency graph. * @return This request for chaining, never {@code null}. */ public DependencyRequest setFilter( DependencyFilter filter ) { this.filter = filter; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public DependencyRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { if ( root != null ) { return String.valueOf( root ); } return String.valueOf( collectRequest ); } } DependencyResolutionException.java000066400000000000000000000047161245546356100352350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositoryException; /** * Thrown in case of a unresolvable dependencies. */ public class DependencyResolutionException extends RepositoryException { private final transient DependencyResult result; /** * Creates a new exception with the specified result and cause. * * @param result The dependency result at the point the exception occurred, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public DependencyResolutionException( DependencyResult result, Throwable cause ) { super( getMessage( cause ), cause ); this.result = result; } /** * Creates a new exception with the specified result, detail message and cause. * * @param result The dependency result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public DependencyResolutionException( DependencyResult result, String message, Throwable cause ) { super( message, cause ); this.result = result; } private static String getMessage( Throwable cause ) { String msg = null; if ( cause != null ) { msg = cause.getMessage(); } if ( msg == null || msg.length() <= 0 ) { msg = "Could not resolve transitive dependencies"; } return msg; } /** * Gets the dependency result at the point the exception occurred. Despite being incomplete, callers might want to * use this result to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The dependency result or {@code null} if unknown. */ public DependencyResult getResult() { return result; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java000066400000000000000000000131261245546356100325430ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.graph.DependencyCycle; import org.eclipse.aether.graph.DependencyNode; /** * The result of a dependency resolution request. * * @see RepositorySystem#resolveDependencies(RepositorySystemSession, DependencyRequest) */ public final class DependencyResult { private final DependencyRequest request; private DependencyNode root; private List cycles; private List collectExceptions; private List artifactResults; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public DependencyResult( DependencyRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "dependency request has not been specified" ); } this.request = request; root = request.getRoot(); cycles = Collections.emptyList(); collectExceptions = Collections.emptyList(); artifactResults = Collections.emptyList(); } /** * Gets the resolution request that was made. * * @return The resolution request, never {@code null}. */ public DependencyRequest getRequest() { return request; } /** * Gets the root node of the resolved dependency graph. Note that this dependency graph might be * incomplete/unfinished in case of {@link #getCollectExceptions()} indicating errors during its calculation. * * @return The root node of the resolved dependency graph or {@code null} if none. */ public DependencyNode getRoot() { return root; } /** * Sets the root node of the resolved dependency graph. * * @param root The root node of the resolved dependency graph, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DependencyResult setRoot( DependencyNode root ) { this.root = root; return this; } /** * Gets the dependency cycles that were encountered while building the dependency graph. Note that dependency cycles * will only be reported here if the underlying request was created from a * {@link org.eclipse.aether.collection.CollectRequest CollectRequest}. If the underlying {@link DependencyRequest} * was created from an existing dependency graph, information about cycles will not be available in this result. * * @return The dependency cycles in the (raw) graph, never {@code null}. */ public List getCycles() { return cycles; } /** * Records the specified dependency cycles while building the dependency graph. * * @param cycles The dependency cycles to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DependencyResult setCycles( List cycles ) { if ( cycles == null ) { this.cycles = Collections.emptyList(); } else { this.cycles = cycles; } return this; } /** * Gets the exceptions that occurred while building the dependency graph. * * @return The exceptions that occurred, never {@code null}. */ public List getCollectExceptions() { return collectExceptions; } /** * Records the specified exceptions while building the dependency graph. * * @param exceptions The exceptions to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DependencyResult setCollectExceptions( List exceptions ) { if ( exceptions == null ) { this.collectExceptions = Collections.emptyList(); } else { this.collectExceptions = exceptions; } return this; } /** * Gets the resolution results for the dependency artifacts that matched {@link DependencyRequest#getFilter()}. * * @return The resolution results for the dependency artifacts, never {@code null}. */ public List getArtifactResults() { return artifactResults; } /** * Sets the resolution results for the artifacts that matched {@link DependencyRequest#getFilter()}. * * @param results The resolution results for the artifacts, may be {@code null}. * @return This result for chaining, never {@code null}. */ public DependencyResult setArtifactResults( List results ) { if ( results == null ) { this.artifactResults = Collections.emptyList(); } else { this.artifactResults = results; } return this; } @Override public String toString() { return String.valueOf( artifactResults ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java000066400000000000000000000165021245546356100323600ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; /** * A request to resolve metadata from either a remote repository or the local repository. * * @see RepositorySystem#resolveMetadata(RepositorySystemSession, java.util.Collection) * @see Metadata#getFile() */ public final class MetadataRequest { private Metadata metadata; private RemoteRepository repository; private String context = ""; private boolean deleteLocalCopyIfMissing; private boolean favorLocalRepository; private RequestTrace trace; /** * Creates an uninitialized request. */ public MetadataRequest() { // enables default constructor } /** * Creates a request to resolve the specified metadata from the local repository. * * @param metadata The metadata to resolve, may be {@code null}. */ public MetadataRequest( Metadata metadata ) { setMetadata( metadata ); } /** * Creates a request with the specified properties. * * @param metadata The metadata to resolve, may be {@code null}. * @param repository The repository to resolve the metadata from, may be {@code null} to resolve from the local * repository. * @param context The context in which this request is made, may be {@code null}. */ public MetadataRequest( Metadata metadata, RemoteRepository repository, String context ) { setMetadata( metadata ); setRepository( repository ); setRequestContext( context ); } /** * Gets the metadata to resolve. * * @return The metadata or {@code null} if not set. */ public Metadata getMetadata() { return metadata; } /** * Sets the metadata to resolve. * * @param metadata The metadata, may be {@code null}. * @return This request for chaining, never {@code null}. */ public MetadataRequest setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Gets the repository from which the metadata should be resolved. * * @return The repository or {@code null} to resolve from the local repository. */ public RemoteRepository getRepository() { return repository; } /** * Sets the repository from which the metadata should be resolved. * * @param repository The repository, may be {@code null} to resolve from the local repository. * @return This request for chaining, never {@code null}. */ public MetadataRequest setRepository( RemoteRepository repository ) { this.repository = repository; return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public MetadataRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Indicates whether the locally cached copy of the metadata should be removed if the corresponding file does not * exist (any more) in the remote repository. * * @return {@code true} if locally cached metadata should be deleted if no corresponding remote file exists, * {@code false} to keep the local copy. */ public boolean isDeleteLocalCopyIfMissing() { return deleteLocalCopyIfMissing; } /** * Controls whether the locally cached copy of the metadata should be removed if the corresponding file does not * exist (any more) in the remote repository. * * @param deleteLocalCopyIfMissing {@code true} if locally cached metadata should be deleted if no corresponding * remote file exists, {@code false} to keep the local copy. * @return This request for chaining, never {@code null}. */ public MetadataRequest setDeleteLocalCopyIfMissing( boolean deleteLocalCopyIfMissing ) { this.deleteLocalCopyIfMissing = deleteLocalCopyIfMissing; return this; } /** * Indicates whether the metadata resolution should be suppressed if the corresponding metadata of the local * repository is up-to-date according to the update policy of the remote repository. In this case, the metadata * resolution will even be suppressed if no local copy of the remote metadata exists yet. * * @return {@code true} to suppress resolution of remote metadata if the corresponding metadata of the local * repository is up-to-date, {@code false} to resolve the remote metadata normally according to the update * policy. */ public boolean isFavorLocalRepository() { return favorLocalRepository; } /** * Controls resolution of remote metadata when already corresponding metadata of the local repository exists. In * cases where the local repository's metadata is sufficient and going to be preferred, resolution of the remote * metadata can be suppressed to avoid unnecessary network access. * * @param favorLocalRepository {@code true} to suppress resolution of remote metadata if the corresponding metadata * of the local repository is up-to-date, {@code false} to resolve the remote metadata normally according * to the update policy. * @return This request for chaining, never {@code null}. */ public MetadataRequest setFavorLocalRepository( boolean favorLocalRepository ) { this.favorLocalRepository = favorLocalRepository; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public MetadataRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getMetadata() + " < " + getRepository(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java000066400000000000000000000115161245546356100322060ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.transfer.MetadataNotFoundException; /** * The result of a metadata resolution request. * * @see RepositorySystem#resolveMetadata(RepositorySystemSession, java.util.Collection) */ public final class MetadataResult { private final MetadataRequest request; private Exception exception; private boolean updated; private Metadata metadata; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public MetadataResult( MetadataRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "metadata request has not been specified" ); } this.request = request; } /** * Gets the resolution request that was made. * * @return The resolution request, never {@code null}. */ public MetadataRequest getRequest() { return request; } /** * Gets the resolved metadata (if any). * * @return The resolved metadata or {@code null} if the resolution failed. */ public Metadata getMetadata() { return metadata; } /** * Sets the resolved metadata. * * @param metadata The resolved metadata, may be {@code null} if the resolution failed. * @return This result for chaining, never {@code null}. */ public MetadataResult setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Records the specified exception while resolving the metadata. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public MetadataResult setException( Exception exception ) { this.exception = exception; return this; } /** * Gets the exception that occurred while resolving the metadata. * * @return The exception that occurred or {@code null} if none. */ public Exception getException() { return exception; } /** * Sets the updated flag for the metadata. * * @param updated {@code true} if the metadata was actually fetched from the remote repository during the * resolution, {@code false} if the metadata was resolved from a locally cached copy. * @return This result for chaining, never {@code null}. */ public MetadataResult setUpdated( boolean updated ) { this.updated = updated; return this; } /** * Indicates whether the metadata was actually fetched from the remote repository or resolved from the local cache. * If metadata has been locally cached during a previous resolution request and this local copy is still up-to-date * according to the remote repository's update policy, no remote access is made. * * @return {@code true} if the metadata was actually fetched from the remote repository during the resolution, * {@code false} if the metadata was resolved from a locally cached copy. */ public boolean isUpdated() { return updated; } /** * Indicates whether the requested metadata was resolved. Note that the metadata might have been successfully * resolved (from the local cache) despite {@link #getException()} indicating a transfer error while trying to * refetch the metadata from the remote repository. * * @return {@code true} if the metadata was resolved, {@code false} otherwise. * @see Metadata#getFile() */ public boolean isResolved() { return getMetadata() != null && getMetadata().getFile() != null; } /** * Indicates whether the requested metadata is not present in the remote repository. * * @return {@code true} if the metadata is not present in the remote repository, {@code false} otherwise. */ public boolean isMissing() { return getException() instanceof MetadataNotFoundException; } @Override public String toString() { return getMetadata() + ( isUpdated() ? " (updated)" : " (cached)" ); } } ResolutionErrorPolicy.java000066400000000000000000000066441245546356100335530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * Controls the caching of resolution errors for artifacts/metadata from remote repositories. If caching is enabled for * a given resource, a marker will be set (usually somewhere in the local repository) to suppress repeated resolution * attempts for the broken resource, thereby avoiding expensive but useless network IO. The error marker is considered * stale once the repository's update policy has expired at which point a future resolution attempt will be allowed. * Error caching considers the current network settings such that fixes to the configuration like authentication or * proxy automatically trigger revalidation with the remote side regardless of the time elapsed since the previous * resolution error. * * @see RepositorySystemSession#getResolutionErrorPolicy() */ public interface ResolutionErrorPolicy { /** * Bit mask indicating that resolution errors should not be cached in the local repository. This forces the system * to always query the remote repository for locally missing artifacts/metadata. */ int CACHE_DISABLED = 0x00; /** * Bit flag indicating whether missing artifacts/metadata should be cached in the local repository. If caching is * enabled, resolution will not be reattempted until the update policy for the affected resource has expired. */ int CACHE_NOT_FOUND = 0x01; /** * Bit flag indicating whether connectivity/transfer errors (e.g. unreachable host, bad authentication) should be * cached in the local repository. If caching is enabled, resolution will not be reattempted until the update policy * for the affected resource has expired. */ int CACHE_TRANSFER_ERROR = 0x02; /** * Bit mask indicating that all resolution errors should be cached in the local repository. */ int CACHE_ALL = CACHE_NOT_FOUND | CACHE_TRANSFER_ERROR; /** * Gets the error policy for an artifact. * * @param session The repository session during which the policy is determined, must not be {@code null}. * @param request The policy request holding further details, must not be {@code null}. * @return The bit mask describing the desired error policy. */ int getArtifactPolicy( RepositorySystemSession session, ResolutionErrorPolicyRequest request ); /** * Gets the error policy for some metadata. * * @param session The repository session during which the policy is determined, must not be {@code null}. * @param request The policy request holding further details, must not be {@code null}. * @return The bit mask describing the desired error policy. */ int getMetadataPolicy( RepositorySystemSession session, ResolutionErrorPolicyRequest request ); } ResolutionErrorPolicyRequest.java000066400000000000000000000057241245546356100351220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.repository.RemoteRepository; /** * A query for the resolution error policy for a given artifact/metadata. * * @param The type of the affected repository item (artifact or metadata). * @see ResolutionErrorPolicy */ public final class ResolutionErrorPolicyRequest { private T item; private RemoteRepository repository; /** * Creates an uninitialized request. */ public ResolutionErrorPolicyRequest() { // enables default constructor } /** * Creates a request for the specified artifact/metadata and remote repository. * * @param item The artifact/metadata for which to determine the error policy, may be {@code null}. * @param repository The repository from which the resolution is attempted, may be {@code null}. */ public ResolutionErrorPolicyRequest( T item, RemoteRepository repository ) { setItem( item ); setRepository( repository ); } /** * Gets the artifact/metadata for which to determine the error policy. * * @return The artifact/metadata for which to determine the error policy or {@code null} if not set. */ public T getItem() { return item; } /** * Sets the artifact/metadata for which to determine the error policy. * * @param item The artifact/metadata for which to determine the error policy, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ResolutionErrorPolicyRequest setItem( T item ) { this.item = item; return this; } /** * Gets the remote repository from which the resolution of the artifact/metadata is attempted. * * @return The involved remote repository or {@code null} if not set. */ public RemoteRepository getRepository() { return repository; } /** * Sets the remote repository from which the resolution of the artifact/metadata is attempted. * * @param repository The repository from which the resolution is attempted, may be {@code null}. * @return This request for chaining, never {@code null}. */ public ResolutionErrorPolicyRequest setRepository( RemoteRepository repository ) { this.repository = repository; return this; } @Override public String toString() { return getItem() + " < " + getRepository(); } } VersionRangeRequest.java000066400000000000000000000122251245546356100331610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; /** * A request to resolve a version range. * * @see RepositorySystem#resolveVersionRange(RepositorySystemSession, VersionRangeRequest) */ public final class VersionRangeRequest { private Artifact artifact; private List repositories = Collections.emptyList(); private String context = ""; private RequestTrace trace; /** * Creates an uninitialized request. */ public VersionRangeRequest() { // enables default constructor } /** * Creates a request with the specified properties. * * @param artifact The artifact whose version range should be resolved, may be {@code null}. * @param repositories The repositories to resolve the version from, may be {@code null}. * @param context The context in which this request is made, may be {@code null}. */ public VersionRangeRequest( Artifact artifact, List repositories, String context ) { setArtifact( artifact ); setRepositories( repositories ); setRequestContext( context ); } /** * Gets the artifact whose version range shall be resolved. * * @return The artifact or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact whose version range shall be resolved. * * @param artifact The artifact, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRangeRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the repositories to resolve the version range from. * * @return The repositories, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the repositories to resolve the version range from. * * @param repositories The repositories, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRangeRequest setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified repository for the resolution. * * @param repository The repository to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRangeRequest addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( this.repositories.isEmpty() ) { this.repositories = new ArrayList(); } this.repositories.add( repository ); } return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRangeRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRangeRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifact() + " < " + getRepositories(); } } VersionRangeResolutionException.java000066400000000000000000000064561245546356100355640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositoryException; /** * Thrown in case of an unparseable or unresolvable version range. */ public class VersionRangeResolutionException extends RepositoryException { private final transient VersionRangeResult result; /** * Creates a new exception with the specified result. * * @param result The version range result at the point the exception occurred, may be {@code null}. */ public VersionRangeResolutionException( VersionRangeResult result ) { super( getMessage( result ), getCause( result ) ); this.result = result; } private static String getMessage( VersionRangeResult result ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Failed to resolve version range" ); if ( result != null ) { buffer.append( " for " ).append( result.getRequest().getArtifact() ); if ( !result.getExceptions().isEmpty() ) { buffer.append( ": " ).append( result.getExceptions().iterator().next().getMessage() ); } } return buffer.toString(); } private static Throwable getCause( VersionRangeResult result ) { Throwable cause = null; if ( result != null && !result.getExceptions().isEmpty() ) { cause = result.getExceptions().get( 0 ); } return cause; } /** * Creates a new exception with the specified result and detail message. * * @param result The version range result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public VersionRangeResolutionException( VersionRangeResult result, String message ) { super( message ); this.result = result; } /** * Creates a new exception with the specified result, detail message and cause. * * @param result The version range result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public VersionRangeResolutionException( VersionRangeResult result, String message, Throwable cause ) { super( message, cause ); this.result = result; } /** * Gets the version range result at the point the exception occurred. Despite being incomplete, callers might want * to use this result to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The version range result or {@code null} if unknown. */ public VersionRangeResult getResult() { return result; } } VersionRangeResult.java000066400000000000000000000153401245546356100330100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * The result of a version range resolution request. * * @see RepositorySystem#resolveVersionRange(RepositorySystemSession, VersionRangeRequest) */ public final class VersionRangeResult { private final VersionRangeRequest request; private List exceptions; private List versions; private Map repositories; private VersionConstraint versionConstraint; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public VersionRangeResult( VersionRangeRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "version range request has not been specified" ); } this.request = request; exceptions = Collections.emptyList(); versions = Collections.emptyList(); repositories = Collections.emptyMap(); } /** * Gets the resolution request that was made. * * @return The resolution request, never {@code null}. */ public VersionRangeRequest getRequest() { return request; } /** * Gets the exceptions that occurred while resolving the version range. * * @return The exceptions that occurred, never {@code null}. */ public List getExceptions() { return exceptions; } /** * Records the specified exception while resolving the version range. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionRangeResult addException( Exception exception ) { if ( exception != null ) { if ( exceptions.isEmpty() ) { exceptions = new ArrayList(); } exceptions.add( exception ); } return this; } /** * Gets the versions (in ascending order) that matched the requested range. * * @return The matching versions (if any), never {@code null}. */ public List getVersions() { return versions; } /** * Adds the specified version to the result. Note that versions must be added in ascending order. * * @param version The version to add, must not be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionRangeResult addVersion( Version version ) { if ( versions.isEmpty() ) { versions = new ArrayList(); } versions.add( version ); return this; } /** * Sets the versions (in ascending order) matching the requested range. * * @param versions The matching versions, may be empty or {@code null} if none. * @return This result for chaining, never {@code null}. */ public VersionRangeResult setVersions( List versions ) { if ( versions == null ) { this.versions = Collections.emptyList(); } else { this.versions = versions; } return this; } /** * Gets the lowest version matching the requested range. * * @return The lowest matching version or {@code null} if no versions matched the requested range. */ public Version getLowestVersion() { if ( versions.isEmpty() ) { return null; } return versions.get( 0 ); } /** * Gets the highest version matching the requested range. * * @return The highest matching version or {@code null} if no versions matched the requested range. */ public Version getHighestVersion() { if ( versions.isEmpty() ) { return null; } return versions.get( versions.size() - 1 ); } /** * Gets the repository from which the specified version was resolved. * * @param version The version whose source repository should be retrieved, must not be {@code null}. * @return The repository from which the version was resolved or {@code null} if unknown. */ public ArtifactRepository getRepository( Version version ) { return repositories.get( version ); } /** * Records the repository from which the specified version was resolved * * @param version The version whose source repository is to be recorded, must not be {@code null}. * @param repository The repository from which the version was resolved, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionRangeResult setRepository( Version version, ArtifactRepository repository ) { if ( repository != null ) { if ( repositories.isEmpty() ) { repositories = new HashMap(); } repositories.put( version, repository ); } return this; } /** * Gets the version constraint that was parsed from the artifact's version string. * * @return The parsed version constraint or {@code null}. */ public VersionConstraint getVersionConstraint() { return versionConstraint; } /** * Sets the version constraint that was parsed from the artifact's version string. * * @param versionConstraint The parsed version constraint, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionRangeResult setVersionConstraint( VersionConstraint versionConstraint ) { this.versionConstraint = versionConstraint; return this; } @Override public String toString() { return String.valueOf( repositories ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java000066400000000000000000000121301245546356100322560ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; /** * A request to resolve a metaversion. * * @see RepositorySystem#resolveVersion(RepositorySystemSession, VersionRequest) */ public final class VersionRequest { private Artifact artifact; private List repositories = Collections.emptyList(); private String context = ""; private RequestTrace trace; /** * Creates an uninitialized request. */ public VersionRequest() { // enables default constructor } /** * Creates a request with the specified properties. * * @param artifact The artifact whose (meta-)version should be resolved, may be {@code null}. * @param repositories The repositories to resolve the version from, may be {@code null}. * @param context The context in which this request is made, may be {@code null}. */ public VersionRequest( Artifact artifact, List repositories, String context ) { setArtifact( artifact ); setRepositories( repositories ); setRequestContext( context ); } /** * Gets the artifact whose (meta-)version shall be resolved. * * @return The artifact or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact whose (meta-)version shall be resolved. * * @param artifact The artifact, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRequest setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the repositories to resolve the version from. * * @return The repositories, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the repositories to resolve the version from. * * @param repositories The repositories, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRequest setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } /** * Adds the specified repository for the resolution. * * @param repository The repository to add, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRequest addRepository( RemoteRepository repository ) { if ( repository != null ) { if ( this.repositories.isEmpty() ) { this.repositories = new ArrayList(); } this.repositories.add( repository ); } return this; } /** * Gets the context in which this request is made. * * @return The context, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context in which this request is made. * * @param context The context, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRequest setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the trace information that describes the higher level request/operation in which this request is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this request is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This request for chaining, never {@code null}. */ public VersionRequest setTrace( RequestTrace trace ) { this.trace = trace; return this; } @Override public String toString() { return getArtifact() + " < " + getRepositories(); } } VersionResolutionException.java000066400000000000000000000063261245546356100346030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import org.eclipse.aether.RepositoryException; /** * Thrown in case of an unresolvable metaversion. */ public class VersionResolutionException extends RepositoryException { private final transient VersionResult result; /** * Creates a new exception with the specified result. * * @param result The version result at the point the exception occurred, may be {@code null}. */ public VersionResolutionException( VersionResult result ) { super( getMessage( result ), getCause( result ) ); this.result = result; } private static String getMessage( VersionResult result ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Failed to resolve version" ); if ( result != null ) { buffer.append( " for " ).append( result.getRequest().getArtifact() ); if ( !result.getExceptions().isEmpty() ) { buffer.append( ": " ).append( result.getExceptions().iterator().next().getMessage() ); } } return buffer.toString(); } private static Throwable getCause( VersionResult result ) { Throwable cause = null; if ( result != null && !result.getExceptions().isEmpty() ) { cause = result.getExceptions().get( 0 ); } return cause; } /** * Creates a new exception with the specified result and detail message. * * @param result The version result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public VersionResolutionException( VersionResult result, String message ) { super( message, getCause( result ) ); this.result = result; } /** * Creates a new exception with the specified result, detail message and cause. * * @param result The version result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public VersionResolutionException( VersionResult result, String message, Throwable cause ) { super( message, cause ); this.result = result; } /** * Gets the version result at the point the exception occurred. Despite being incomplete, callers might want to use * this result to fail gracefully and continue their operation with whatever interim data has been gathered. * * @return The version result or {@code null} if unknown. */ public VersionResult getResult() { return result; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java000066400000000000000000000074111245546356100321120ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.resolution; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.ArtifactRepository; /** * The result of a version resolution request. * * @see RepositorySystem#resolveVersion(RepositorySystemSession, VersionRequest) */ public final class VersionResult { private final VersionRequest request; private List exceptions; private String version; private ArtifactRepository repository; /** * Creates a new result for the specified request. * * @param request The resolution request, must not be {@code null}. */ public VersionResult( VersionRequest request ) { if ( request == null ) { throw new IllegalArgumentException( "version request has not been specified" ); } this.request = request; exceptions = Collections.emptyList(); } /** * Gets the resolution request that was made. * * @return The resolution request, never {@code null}. */ public VersionRequest getRequest() { return request; } /** * Gets the exceptions that occurred while resolving the version. * * @return The exceptions that occurred, never {@code null}. */ public List getExceptions() { return exceptions; } /** * Records the specified exception while resolving the version. * * @param exception The exception to record, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionResult addException( Exception exception ) { if ( exception != null ) { if ( exceptions.isEmpty() ) { exceptions = new ArrayList(); } exceptions.add( exception ); } return this; } /** * Gets the resolved version. * * @return The resolved version or {@code null} if the resolution failed. */ public String getVersion() { return version; } /** * Sets the resolved version. * * @param version The resolved version, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionResult setVersion( String version ) { this.version = version; return this; } /** * Gets the repository from which the version was eventually resolved. * * @return The repository from which the version was resolved or {@code null} if unknown. */ public ArtifactRepository getRepository() { return repository; } /** * Sets the repository from which the version was resolved. * * @param repository The repository from which the version was resolved, may be {@code null}. * @return This result for chaining, never {@code null}. */ public VersionResult setRepository( ArtifactRepository repository ) { this.repository = repository; return this; } @Override public String toString() { return getVersion() + " @ " + getRepository(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/resolution/package-info.java000066400000000000000000000012141245546356100316050ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The types supporting the resolution of artifacts and metadata from repositories. */ package org.eclipse.aether.resolution; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/000077500000000000000000000000001245546356100260415ustar00rootroot00000000000000AbstractTransferListener.java000066400000000000000000000026451245546356100336120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; /** * A skeleton implementation for custom transfer listeners. The callback methods in this class do nothing. */ public abstract class AbstractTransferListener implements TransferListener { /** * Enables subclassing. */ protected AbstractTransferListener() { } public void transferInitiated( TransferEvent event ) throws TransferCancelledException { } public void transferStarted( TransferEvent event ) throws TransferCancelledException { } public void transferProgressed( TransferEvent event ) throws TransferCancelledException { } public void transferCorrupted( TransferEvent event ) throws TransferCancelledException { } public void transferSucceeded( TransferEvent event ) { } public void transferFailed( TransferEvent event ) { } } ArtifactNotFoundException.java000066400000000000000000000075331245546356100337260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown when an artifact was not found in a particular repository. */ public class ArtifactNotFoundException extends ArtifactTransferException { /** * Creates a new exception with the specified artifact and repository. * * @param artifact The missing artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. */ public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository ) { super( artifact, repository, getMessage( artifact, repository ) ); } private static String getMessage( Artifact artifact, RemoteRepository repository ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Could not find artifact " ).append( artifact ); buffer.append( getString( " in ", repository ) ); if ( artifact != null ) { String localPath = artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ); if ( localPath != null && repository == null ) { buffer.append( " at specified path " ).append( localPath ); } String downloadUrl = artifact.getProperty( ArtifactProperties.DOWNLOAD_URL, null ); if ( downloadUrl != null ) { buffer.append( ", try downloading from " ).append( downloadUrl ); } } return buffer.toString(); } /** * Creates a new exception with the specified artifact, repository and detail message. * * @param artifact The missing artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository, String message ) { super( artifact, repository, message ); } /** * Creates a new exception with the specified artifact, repository and detail message. * * @param artifact The missing artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param fromCache {@code true} if the exception was played back from the error cache, {@code false} if the * exception actually just occurred. */ public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository, String message, boolean fromCache ) { super( artifact, repository, message, fromCache ); } /** * Creates a new exception with the specified artifact, repository, detail message and cause. * * @param artifact The missing artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository, String message, Throwable cause ) { super( artifact, repository, message, cause ); } } ArtifactTransferException.java000066400000000000000000000111361245546356100337500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown when an artifact could not be uploaded/downloaded to/from a particular remote repository. */ public class ArtifactTransferException extends RepositoryException { private final transient Artifact artifact; private final transient RemoteRepository repository; private final boolean fromCache; static String getString( String prefix, RemoteRepository repository ) { if ( repository == null ) { return ""; } else { return prefix + repository.getId() + " (" + repository.getUrl() + ")"; } } /** * Creates a new exception with the specified artifact, repository and detail message. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, String message ) { this( artifact, repository, message, false ); } /** * Creates a new exception with the specified artifact, repository and detail message. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param fromCache {@code true} if the exception was played back from the error cache, {@code false} if the * exception actually just occurred. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, String message, boolean fromCache ) { super( message ); this.artifact = artifact; this.repository = repository; this.fromCache = fromCache; } /** * Creates a new exception with the specified artifact, repository and cause. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, Throwable cause ) { this( artifact, repository, "Could not transfer artifact " + artifact + getString( " from/to ", repository ) + getMessage( ": ", cause ), cause ); } /** * Creates a new exception with the specified artifact, repository, detail message and cause. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, String message, Throwable cause ) { super( message, cause ); this.artifact = artifact; this.repository = repository; this.fromCache = false; } /** * Gets the artifact that could not be transferred. * * @return The troublesome artifact or {@code null} if unknown. */ public Artifact getArtifact() { return artifact; } /** * Gets the remote repository involved in the transfer. * * @return The involved remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } /** * Indicates whether this exception actually just occurred or was played back from the error cache. * * @return {@code true} if the exception was played back from the error cache, {@code false} if the exception * actually occurred just now. */ public boolean isFromCache() { return fromCache; } } ChecksumFailureException.java000066400000000000000000000100041245546356100335510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; /** * Thrown in case of a checksum failure during an artifact/metadata download. */ public class ChecksumFailureException extends RepositoryException { private final String expected; private final String actual; private final boolean retryWorthy; /** * Creates a new exception with the specified expected and actual checksum. The resulting exception is * {@link #isRetryWorthy() retry-worthy}. * * @param expected The expected checksum as declared by the hosting repository, may be {@code null}. * @param actual The actual checksum as computed from the local bytes, may be {@code null}. */ public ChecksumFailureException( String expected, String actual ) { super( "Checksum validation failed, expected " + expected + " but is " + actual ); this.expected = expected; this.actual = actual; retryWorthy = true; } /** * Creates a new exception with the specified detail message. The resulting exception is not * {@link #isRetryWorthy() retry-worthy}. * * @param message The detail message, may be {@code null}. */ public ChecksumFailureException( String message ) { this( false, message, null ); } /** * Creates a new exception with the specified cause. The resulting exception is not {@link #isRetryWorthy() * retry-worthy}. * * @param cause The exception that caused this one, may be {@code null}. */ public ChecksumFailureException( Throwable cause ) { this( "Checksum validation failed" + getMessage( ": ", cause ), cause ); } /** * Creates a new exception with the specified detail message and cause. The resulting exception is not * {@link #isRetryWorthy() retry-worthy}. * * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ChecksumFailureException( String message, Throwable cause ) { this( false, message, cause ); } /** * Creates a new exception with the specified retry flag, detail message and cause. * * @param retryWorthy {@code true} if the exception is retry-worthy, {@code false} otherwise. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ChecksumFailureException( boolean retryWorthy, String message, Throwable cause ) { super( message, cause ); expected = actual = ""; this.retryWorthy = retryWorthy; } /** * Gets the expected checksum for the downloaded artifact/metadata. * * @return The expected checksum as declared by the hosting repository or {@code null} if unknown. */ public String getExpected() { return expected; } /** * Gets the actual checksum for the downloaded artifact/metadata. * * @return The actual checksum as computed from the local bytes or {@code null} if unknown. */ public String getActual() { return actual; } /** * Indicates whether the corresponding download is retry-worthy. * * @return {@code true} if retrying the download might solve the checksum failure, {@code false} if the checksum * failure is non-recoverable. */ public boolean isRetryWorthy() { return retryWorthy; } } MetadataNotFoundException.java000066400000000000000000000073731245546356100337130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown when metadata was not found in a particular repository. */ public class MetadataNotFoundException extends MetadataTransferException { /** * Creates a new exception with the specified metadata and local repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved local repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, LocalRepository repository ) { super( metadata, null, "Could not find metadata " + metadata + getString( " in ", repository ) ); } private static String getString( String prefix, LocalRepository repository ) { if ( repository == null ) { return ""; } else { return prefix + repository.getId() + " (" + repository.getBasedir() + ")"; } } /** * Creates a new exception with the specified metadata and repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository ) { super( metadata, repository, "Could not find metadata " + metadata + getString( " in ", repository ) ); } /** * Creates a new exception with the specified metadata, repository and detail message. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository, String message ) { super( metadata, repository, message ); } /** * Creates a new exception with the specified metadata, repository and detail message. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param fromCache {@code true} if the exception was played back from the error cache, {@code false} if the * exception actually just occurred. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository, String message, boolean fromCache ) { super( metadata, repository, message, fromCache ); } /** * Creates a new exception with the specified metadata, repository, detail message and cause. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository, String message, Throwable cause ) { super( metadata, repository, message, cause ); } } MetadataTransferException.java000066400000000000000000000111331245546356100337300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown when metadata could not be uploaded/downloaded to/from a particular remote repository. */ public class MetadataTransferException extends RepositoryException { private final transient Metadata metadata; private final transient RemoteRepository repository; private final boolean fromCache; static String getString( String prefix, RemoteRepository repository ) { if ( repository == null ) { return ""; } else { return prefix + repository.getId() + " (" + repository.getUrl() + ")"; } } /** * Creates a new exception with the specified metadata, repository and detail message. * * @param metadata The untransferable metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. */ public MetadataTransferException( Metadata metadata, RemoteRepository repository, String message ) { this( metadata, repository, message, false ); } /** * Creates a new exception with the specified metadata, repository and detail message. * * @param metadata The untransferable metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param fromCache {@code true} if the exception was played back from the error cache, {@code false} if the * exception actually just occurred. */ public MetadataTransferException( Metadata metadata, RemoteRepository repository, String message, boolean fromCache ) { super( message ); this.metadata = metadata; this.repository = repository; this.fromCache = fromCache; } /** * Creates a new exception with the specified metadata, repository and cause. * * @param metadata The untransferable metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public MetadataTransferException( Metadata metadata, RemoteRepository repository, Throwable cause ) { this( metadata, repository, "Could not transfer metadata " + metadata + getString( " from/to ", repository ) + getMessage( ": ", cause ), cause ); } /** * Creates a new exception with the specified metadata, repository, detail message and cause. * * @param metadata The untransferable metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public MetadataTransferException( Metadata metadata, RemoteRepository repository, String message, Throwable cause ) { super( message, cause ); this.metadata = metadata; this.repository = repository; this.fromCache = false; } /** * Gets the metadata that could not be transferred. * * @return The troublesome metadata or {@code null} if unknown. */ public Metadata getMetadata() { return metadata; } /** * Gets the remote repository involved in the transfer. * * @return The involved remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } /** * Indicates whether this exception actually just occurred or was played back from the error cache. * * @return {@code true} if the exception was played back from the error cache, {@code false} if the exception * actually occurred just now. */ public boolean isFromCache() { return fromCache; } } NoRepositoryConnectorException.java000066400000000000000000000063421245546356100350400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown in case of an unsupported remote repository type. */ public class NoRepositoryConnectorException extends RepositoryException { private final transient RemoteRepository repository; /** * Creates a new exception with the specified repository. * * @param repository The remote repository whose content type is not supported, may be {@code null}. */ public NoRepositoryConnectorException( RemoteRepository repository ) { this( repository, toMessage( repository ) ); } /** * Creates a new exception with the specified repository and detail message. * * @param repository The remote repository whose content type is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. */ public NoRepositoryConnectorException( RemoteRepository repository, String message ) { super( message ); this.repository = repository; } /** * Creates a new exception with the specified repository and cause. * * @param repository The remote repository whose content type is not supported, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoRepositoryConnectorException( RemoteRepository repository, Throwable cause ) { this( repository, toMessage( repository ), cause ); } /** * Creates a new exception with the specified repository, detail message and cause. * * @param repository The remote repository whose content type is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoRepositoryConnectorException( RemoteRepository repository, String message, Throwable cause ) { super( message, cause ); this.repository = repository; } private static String toMessage( RemoteRepository repository ) { if ( repository != null ) { return "No connector available to access repository " + repository.getId() + " (" + repository.getUrl() + ") of type " + repository.getContentType(); } else { return "No connector available to access repository"; } } /** * Gets the remote repository whose content type is not supported. * * @return The unsupported remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } } NoRepositoryLayoutException.java000066400000000000000000000061031245546356100343560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown in case of an unsupported repository layout. */ public class NoRepositoryLayoutException extends RepositoryException { private final transient RemoteRepository repository; /** * Creates a new exception with the specified repository. * * @param repository The remote repository whose layout is not supported, may be {@code null}. */ public NoRepositoryLayoutException( RemoteRepository repository ) { this( repository, toMessage( repository ) ); } /** * Creates a new exception with the specified repository and detail message. * * @param repository The remote repository whose layout is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. */ public NoRepositoryLayoutException( RemoteRepository repository, String message ) { super( message ); this.repository = repository; } /** * Creates a new exception with the specified repository and cause. * * @param repository The remote repository whose layout is not supported, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoRepositoryLayoutException( RemoteRepository repository, Throwable cause ) { this( repository, toMessage( repository ), cause ); } /** * Creates a new exception with the specified repository, detail message and cause. * * @param repository The remote repository whose layout is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoRepositoryLayoutException( RemoteRepository repository, String message, Throwable cause ) { super( message, cause ); this.repository = repository; } private static String toMessage( RemoteRepository repository ) { if ( repository != null ) { return "Unsupported repository layout " + repository.getContentType(); } else { return "Unsupported repository layout"; } } /** * Gets the remote repository whose layout is not supported. * * @return The unsupported remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } } NoTransporterException.java000066400000000000000000000061361245546356100333320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown in case of an unsupported transport protocol. */ public class NoTransporterException extends RepositoryException { private final transient RemoteRepository repository; /** * Creates a new exception with the specified repository. * * @param repository The remote repository whose transport layout is not supported, may be {@code null}. */ public NoTransporterException( RemoteRepository repository ) { this( repository, toMessage( repository ) ); } /** * Creates a new exception with the specified repository and detail message. * * @param repository The remote repository whose transport layout is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. */ public NoTransporterException( RemoteRepository repository, String message ) { super( message ); this.repository = repository; } /** * Creates a new exception with the specified repository and cause. * * @param repository The remote repository whose transport layout is not supported, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoTransporterException( RemoteRepository repository, Throwable cause ) { this( repository, toMessage( repository ), cause ); } /** * Creates a new exception with the specified repository, detail message and cause. * * @param repository The remote repository whose transport layout is not supported, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public NoTransporterException( RemoteRepository repository, String message, Throwable cause ) { super( message, cause ); this.repository = repository; } private static String toMessage( RemoteRepository repository ) { if ( repository != null ) { return "Unsupported transport protocol " + repository.getProtocol(); } else { return "Unsupported transport protocol"; } } /** * Gets the remote repository whose transport protocol is not supported. * * @return The unsupported remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } } RepositoryOfflineException.java000066400000000000000000000043521245546356100341720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; /** * Thrown when a transfer could not be performed because a remote repository is not accessible in offline mode. */ public class RepositoryOfflineException extends RepositoryException { private final transient RemoteRepository repository; private static String getMessage( RemoteRepository repository ) { if ( repository == null ) { return "Cannot access remote repositories in offline mode"; } else { return "Cannot access " + repository.getId() + " (" + repository.getUrl() + ") in offline mode"; } } /** * Creates a new exception with the specified repository. * * @param repository The inaccessible remote repository, may be {@code null}. */ public RepositoryOfflineException( RemoteRepository repository ) { super( getMessage( repository ) ); this.repository = repository; } /** * Creates a new exception with the specified repository and detail message. * * @param repository The inaccessible remote repository, may be {@code null}. * @param message The detail message, may be {@code null}. */ public RepositoryOfflineException( RemoteRepository repository, String message ) { super( message ); this.repository = repository; } /** * Gets the remote repository that could not be accessed due to offline mode. * * @return The inaccessible remote repository or {@code null} if unknown. */ public RemoteRepository getRepository() { return repository; } } TransferCancelledException.java000066400000000000000000000030311245546356100340600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import org.eclipse.aether.RepositoryException; /** * Thrown in case an upload/download was cancelled (e.g. due to user request). */ public class TransferCancelledException extends RepositoryException { /** * Creates a new exception with a stock detail message. */ public TransferCancelledException() { super( "The operation was cancelled." ); } /** * Creates a new exception with the specified detail message. * * @param message The detail message, may be {@code null}. */ public TransferCancelledException( String message ) { super( message ); } /** * Creates a new exception with the specified detail message and cause. * * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public TransferCancelledException( String message, Throwable cause ) { super( message, cause ); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java000066400000000000000000000324561245546356100315040ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import java.nio.ByteBuffer; import org.eclipse.aether.RepositorySystemSession; /** * An event fired to a transfer listener during an artifact/metadata transfer. * * @see TransferListener * @see TransferEvent.Builder */ public final class TransferEvent { /** * The type of the event. */ public enum EventType { /** * @see TransferListener#transferInitiated(TransferEvent) */ INITIATED, /** * @see TransferListener#transferStarted(TransferEvent) */ STARTED, /** * @see TransferListener#transferProgressed(TransferEvent) */ PROGRESSED, /** * @see TransferListener#transferCorrupted(TransferEvent) */ CORRUPTED, /** * @see TransferListener#transferSucceeded(TransferEvent) */ SUCCEEDED, /** * @see TransferListener#transferFailed(TransferEvent) */ FAILED } /** * The type of the request/transfer being performed. */ public enum RequestType { /** * Download artifact/metadata. */ GET, /** * Check artifact/metadata existence only. */ GET_EXISTENCE, /** * Upload artifact/metadata. */ PUT, } private final EventType type; private final RequestType requestType; private final RepositorySystemSession session; private final TransferResource resource; private final ByteBuffer dataBuffer; private final long transferredBytes; private final Exception exception; TransferEvent( Builder builder ) { type = builder.type; requestType = builder.requestType; session = builder.session; resource = builder.resource; dataBuffer = builder.dataBuffer; transferredBytes = builder.transferredBytes; exception = builder.exception; } /** * Gets the type of the event. * * @return The type of the event, never {@code null}. */ public EventType getType() { return type; } /** * Gets the type of the request/transfer. * * @return The type of the request/transfer, never {@code null}. */ public RequestType getRequestType() { return requestType; } /** * Gets the repository system session during which the event occurred. * * @return The repository system session during which the event occurred, never {@code null}. */ public RepositorySystemSession getSession() { return session; } /** * Gets the resource that is being transferred. * * @return The resource being transferred, never {@code null}. */ public TransferResource getResource() { return resource; } /** * Gets the total number of bytes that have been transferred since the download/upload of the resource was started. * If a download has been resumed, the returned count includes the bytes that were already downloaded during the * previous attempt. In other words, the ratio of transferred bytes to the content length of the resource indicates * the percentage of transfer completion. * * @return The total number of bytes that have been transferred since the transfer started, never negative. * @see #getDataLength() * @see TransferResource#getResumeOffset() */ public long getTransferredBytes() { return transferredBytes; } /** * Gets the byte buffer holding the transferred bytes since the last event. A listener must assume this buffer to be * owned by the event source and must not change any byte in this buffer. Also, the buffer is only valid for the * duration of the event callback, i.e. the next event might reuse the same buffer (with updated contents). * Therefore, if the actual event processing is deferred, the byte buffer would have to be cloned to create an * immutable snapshot of its contents. * * @return The (read-only) byte buffer or {@code null} if not applicable to the event, i.e. if the event type is not * {@link EventType#PROGRESSED}. */ public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; } /** * Gets the number of bytes that have been transferred since the last event. * * @return The number of bytes that have been transferred since the last event, possibly zero but never negative. * @see #getTransferredBytes() */ public int getDataLength() { return ( dataBuffer != null ) ? dataBuffer.remaining() : 0; } /** * Gets the error that occurred during the transfer. * * @return The error that occurred or {@code null} if none. */ public Exception getException() { return exception; } @Override public String toString() { return getRequestType() + " " + getType() + " " + getResource(); } /** * A builder to create transfer events. */ public static final class Builder { EventType type; RequestType requestType; RepositorySystemSession session; TransferResource resource; ByteBuffer dataBuffer; long transferredBytes; Exception exception; /** * Creates a new transfer event builder for the specified session and the given resource. * * @param session The repository system session, must not be {@code null}. * @param resource The resource being transferred, must not be {@code null}. */ public Builder( RepositorySystemSession session, TransferResource resource ) { if ( session == null ) { throw new IllegalArgumentException( "session not specified" ); } if ( resource == null ) { throw new IllegalArgumentException( "transfer resource not specified" ); } this.session = session; this.resource = resource; type = EventType.INITIATED; requestType = RequestType.GET; } private Builder( Builder prototype ) { session = prototype.session; resource = prototype.resource; type = prototype.type; requestType = prototype.requestType; dataBuffer = prototype.dataBuffer; transferredBytes = prototype.transferredBytes; exception = prototype.exception; } /** * Creates a new transfer event builder from the current values of this builder. The state of this builder * remains unchanged. * * @return The new event builder, never {@code null}. */ public Builder copy() { return new Builder( this ); } /** * Sets the type of the event and resets event-specific fields. In more detail, the data buffer and the * exception fields are set to {@code null}. Furthermore, the total number of transferred bytes is set to * {@code 0} if the event type is {@link EventType#STARTED}. * * @param type The type of the event, must not be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder resetType( EventType type ) { if ( type == null ) { throw new IllegalArgumentException( "event type not specified" ); } this.type = type; dataBuffer = null; exception = null; switch ( type ) { case INITIATED: case STARTED: transferredBytes = 0; default: } return this; } /** * Sets the type of the event. When re-using the same builder to generate a sequence of events for one transfer, * {@link #resetType(TransferEvent.EventType)} might be more handy. * * @param type The type of the event, must not be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setType( EventType type ) { if ( type == null ) { throw new IllegalArgumentException( "event type not specified" ); } this.type = type; return this; } /** * Sets the type of the request/transfer. * * @param requestType The request/transfer type, must not be {@code null}. * @return This event builder for chaining, never {@code null}. */ public Builder setRequestType( RequestType requestType ) { if ( requestType == null ) { throw new IllegalArgumentException( "request type not specified" ); } this.requestType = requestType; return this; } /** * Sets the total number of bytes that have been transferred so far during the download/upload of the resource. * If a download is being resumed, the count must include the bytes that were already downloaded in the previous * attempt and from which the current transfer started. In this case, the event type {@link EventType#STARTED} * should indicate from what byte the download resumes. * * @param transferredBytes The total number of bytes that have been transferred so far during the * download/upload of the resource, must not be negative. * @return This event builder for chaining, never {@code null}. * @see TransferResource#setResumeOffset(long) */ public Builder setTransferredBytes( long transferredBytes ) { if ( transferredBytes < 0 ) { throw new IllegalArgumentException( "number of transferred bytes cannot be negative" ); } this.transferredBytes = transferredBytes; return this; } /** * Increments the total number of bytes that have been transferred so far during the download/upload. * * @param transferredBytes The number of bytes that have been transferred since the last event, must not be * negative. * @return This event builder for chaining, never {@code null}. */ public Builder addTransferredBytes( long transferredBytes ) { if ( transferredBytes < 0 ) { throw new IllegalArgumentException( "number of transferred bytes cannot be negative" ); } this.transferredBytes += transferredBytes; return this; } /** * Sets the byte buffer holding the transferred bytes since the last event. * * @param buffer The byte buffer holding the transferred bytes since the last event, may be {@code null} if not * applicable to the event. * @param offset The starting point of valid bytes in the array. * @param length The number of valid bytes, must not be negative. * @return This event builder for chaining, never {@code null}. */ public Builder setDataBuffer( byte[] buffer, int offset, int length ) { return setDataBuffer( ( buffer != null ) ? ByteBuffer.wrap( buffer, offset, length ) : null ); } /** * Sets the byte buffer holding the transferred bytes since the last event. * * @param dataBuffer The byte buffer holding the transferred bytes since the last event, may be {@code null} if * not applicable to the event. * @return This event builder for chaining, never {@code null}. */ public Builder setDataBuffer( ByteBuffer dataBuffer ) { this.dataBuffer = dataBuffer; return this; } /** * Sets the error that occurred during the transfer. * * @param exception The error that occurred during the transfer, may be {@code null} if none. * @return This event builder for chaining, never {@code null}. */ public Builder setException( Exception exception ) { this.exception = exception; return this; } /** * Builds a new transfer event from the current values of this builder. The state of the builder itself remains * unchanged. * * @return The transfer event, never {@code null}. */ public TransferEvent build() { return new TransferEvent( this ); } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java000066400000000000000000000102641245546356100322010ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; /** * A listener being notified of artifact/metadata transfers from/to remote repositories. The listener may be called from * an arbitrary thread. Reusing common regular expression syntax, the sequence of events is roughly as follows: * *
 * INITIATED ( STARTED PROGRESSED* CORRUPTED? )* ( SUCCEEDED | FAILED )
 * 
* * Note: Implementors are strongly advised to inherit from {@link AbstractTransferListener} instead of directly * implementing this interface. * * @see org.eclipse.aether.RepositorySystemSession#getTransferListener() * @see org.eclipse.aether.RepositoryListener * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface TransferListener { /** * Notifies the listener about the initiation of a transfer. This event gets fired before any actual network access * to the remote repository and usually indicates some thread is now about to perform the transfer. For a given * transfer request, this event is the first one being fired and it must be emitted exactly once. * * @param event The event details, must not be {@code null}. * @throws TransferCancelledException If the transfer should be aborted. */ void transferInitiated( TransferEvent event ) throws TransferCancelledException; /** * Notifies the listener about the start of a data transfer. This event indicates a successful connection to the * remote repository. In case of a download, the requested remote resource exists and its size is given by * {@link TransferResource#getContentLength()} if possible. This event may be fired multiple times for given * transfer request if said transfer needs to be repeated (e.g. in response to an authentication challenge). * * @param event The event details, must not be {@code null}. * @throws TransferCancelledException If the transfer should be aborted. */ void transferStarted( TransferEvent event ) throws TransferCancelledException; /** * Notifies the listener about some progress in the data transfer. This event may even be fired if actually zero * bytes have been transferred since the last event, for instance to enable cancellation. * * @param event The event details, must not be {@code null}. * @throws TransferCancelledException If the transfer should be aborted. */ void transferProgressed( TransferEvent event ) throws TransferCancelledException; /** * Notifies the listener that a checksum validation failed. {@link TransferEvent#getException()} will be of type * {@link ChecksumFailureException} and can be used to query further details about the expected/actual checksums. * * @param event The event details, must not be {@code null}. * @throws TransferCancelledException If the transfer should be aborted. */ void transferCorrupted( TransferEvent event ) throws TransferCancelledException; /** * Notifies the listener about the successful completion of a transfer. This event must be fired exactly once for a * given transfer request unless said request failed. * * @param event The event details, must not be {@code null}. */ void transferSucceeded( TransferEvent event ); /** * Notifies the listener about the unsuccessful termination of a transfer. {@link TransferEvent#getException()} will * provide further information about the failure. * * @param event The event details, must not be {@code null}. */ void transferFailed( TransferEvent event ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java000066400000000000000000000136741245546356100322130ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import java.io.File; import org.eclipse.aether.RequestTrace; /** * Describes a resource being uploaded or downloaded by the repository system. */ public final class TransferResource { private final String repositoryUrl; private final String resourceName; private final File file; private final long startTime; private final RequestTrace trace; private long contentLength = -1; private long resumeOffset; /** * Creates a new transfer resource with the specified properties. * * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a * trailing slash will automatically be added if missing. * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash * (if any) will be automatically removed. * @param file The source/target file involved in the transfer, may be {@code null}. * @param trace The trace information, may be {@code null}. */ public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) { if ( repositoryUrl == null || repositoryUrl.length() <= 0 ) { this.repositoryUrl = ""; } else if ( repositoryUrl.endsWith( "/" ) ) { this.repositoryUrl = repositoryUrl; } else { this.repositoryUrl = repositoryUrl + '/'; } if ( resourceName == null || resourceName.length() <= 0 ) { this.resourceName = ""; } else if ( resourceName.startsWith( "/" ) ) { this.resourceName = resourceName.substring( 1 ); } else { this.resourceName = resourceName; } this.file = file; this.trace = trace; startTime = System.currentTimeMillis(); } /** * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be * terminated by a trailing slash. * * @return The base URL of the repository or an empty string if unknown, never {@code null}. */ public String getRepositoryUrl() { return repositoryUrl; } /** * The path of the resource relative to the repository's base URL, e.g. "org/apache/maven/maven/3.0/maven-3.0.pom". * * @return The path of the resource, never {@code null}. */ public String getResourceName() { return resourceName; } /** * Gets the local file being uploaded or downloaded. When the repository system merely checks for the existence of a * remote resource, no local file will be involved in the transfer. * * @return The source/target file involved in the transfer or {@code null} if none. */ public File getFile() { return file; } /** * The size of the resource in bytes. Note that the size of a resource during downloads might be unknown to the * client which is usually the case when transfers employ compression like gzip. In general, the content length is * not known until the transfer has {@link TransferListener#transferStarted(TransferEvent) started}. * * @return The size of the resource in bytes or a negative value if unknown. */ public long getContentLength() { return contentLength; } /** * Sets the size of the resource in bytes. * * @param contentLength The size of the resource in bytes or a negative value if unknown. * @return This resource for chaining, never {@code null}. */ public TransferResource setContentLength( long contentLength ) { this.contentLength = contentLength; return this; } /** * Gets the byte offset within the resource from which the download starts. A positive offset indicates a previous * download attempt is being resumed, {@code 0} means the transfer starts at the first byte. * * @return The zero-based index of the first byte being transferred, never negative. */ public long getResumeOffset() { return resumeOffset; } /** * Sets the byte offset within the resource at which the download starts. * * @param resumeOffset The zero-based index of the first byte being transferred, must not be negative. * @return This resource for chaining, never {@code null}. */ public TransferResource setResumeOffset( long resumeOffset ) { if ( resumeOffset < 0 ) { throw new IllegalArgumentException( "resume offset cannot be negative" ); } this.resumeOffset = resumeOffset; return this; } /** * Gets the timestamp when the transfer of this resource was started. * * @return The timestamp when the transfer of this resource was started. */ public long getTransferStartTime() { return startTime; } /** * Gets the trace information that describes the higher level request/operation during which this resource is * transferred. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } @Override public String toString() { return getRepositoryUrl() + getResourceName() + " <> " + getFile(); } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/transfer/package-info.java000066400000000000000000000012751245546356100312350ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * A listener and various exception types dealing with the transfer of a resource between the local system and a remote * repository. */ package org.eclipse.aether.transfer; aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/000077500000000000000000000000001245546356100257025ustar00rootroot00000000000000InvalidVersionSpecificationException.java000066400000000000000000000045641245546356100360130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.version; import org.eclipse.aether.RepositoryException; /** * Thrown when a version or version range could not be parsed. */ public class InvalidVersionSpecificationException extends RepositoryException { private final String version; /** * Creates a new exception with the specified version and detail message. * * @param version The invalid version specification, may be {@code null}. * @param message The detail message, may be {@code null}. */ public InvalidVersionSpecificationException( String version, String message ) { super( message ); this.version = version; } /** * Creates a new exception with the specified version and cause. * * @param version The invalid version specification, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public InvalidVersionSpecificationException( String version, Throwable cause ) { super( "Could not parse version specification " + version + getMessage( ": ", cause ), cause ); this.version = version; } /** * Creates a new exception with the specified version, detail message and cause. * * @param version The invalid version specification, may be {@code null}. * @param message The detail message, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public InvalidVersionSpecificationException( String version, String message, Throwable cause ) { super( message, cause ); this.version = version; } /** * Gets the version or version range that could not be parsed. * * @return The invalid version specification or {@code null} if unknown. */ public String getVersion() { return version; } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/Version.java000066400000000000000000000015231245546356100301730ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.version; /** * A parsed artifact version. */ public interface Version extends Comparable { /** * Gets the original string representation of the version. * * @return The string representation of the version, never {@code null}. */ String toString(); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java000066400000000000000000000034621245546356100322440ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.version; /** * A constraint on versions for a dependency. A constraint can either consist of a version range (e.g. "[1, ]") or a * single version (e.g. "1.1"). In the first case, the constraint expresses a hard requirement on a version matching the * range. In the second case, the constraint expresses a soft requirement on a specific version (i.e. a recommendation). */ public interface VersionConstraint { /** * Gets the version range of this constraint. * * @return The version range or {@code null} if none. */ VersionRange getRange(); /** * Gets the version recommended by this constraint. * * @return The recommended version or {@code null} if none. */ Version getVersion(); /** * Determines whether the specified version satisfies this constraint. In more detail, a version satisfies this * constraint if it matches its version range or if this constraint has no version range and the specified version * equals the version recommended by the constraint. * * @param version The version to test, must not be {@code null}. * @return {@code true} if the specified version satisfies this constraint, {@code false} otherwise. */ boolean containsVersion( Version version ); } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/VersionRange.java000066400000000000000000000071741245546356100311600ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.version; /** * A range of versions. */ public interface VersionRange { /** * Determines whether the specified version is contained within this range. * * @param version The version to test, must not be {@code null}. * @return {@code true} if this range contains the specified version, {@code false} otherwise. */ boolean containsVersion( Version version ); /** * Gets a lower bound (if any) for this range. If existent, this range does not contain any version smaller than its * lower bound. Note that complex version ranges might exclude some versions even within their bounds. * * @return A lower bound for this range or {@code null} is there is none. */ Bound getLowerBound(); /** * Gets an upper bound (if any) for this range. If existent, this range does not contain any version greater than * its upper bound. Note that complex version ranges might exclude some versions even within their bounds. * * @return An upper bound for this range or {@code null} is there is none. */ Bound getUpperBound(); /** * A bound of a version range. */ static final class Bound { private final Version version; private final boolean inclusive; /** * Creates a new bound with the specified properties. * * @param version The bounding version, must not be {@code null}. * @param inclusive A flag whether the specified version is included in the range or not. */ public Bound( Version version, boolean inclusive ) { if ( version == null ) { throw new IllegalArgumentException( "version missing" ); } this.version = version; this.inclusive = inclusive; } /** * Gets the bounding version. * * @return The bounding version, never {@code null}. */ public Version getVersion() { return version; } /** * Indicates whether the bounding version is included in the range or not. * * @return {@code true} if the bounding version is included in the range, {@code false} if not. */ public boolean isInclusive() { return inclusive; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Bound that = (Bound) obj; return inclusive == that.inclusive && version.equals( that.version ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + version.hashCode(); hash = hash * 31 + ( inclusive ? 1 : 0 ); return hash; } @Override public String toString() { return String.valueOf( version ); } } } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/VersionScheme.java000066400000000000000000000041551245546356100313240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.version; /** * A version scheme that handles interpretation of version strings to facilitate their comparison. */ public interface VersionScheme { /** * Parses the specified version string, for example "1.0". * * @param version The version string to parse, must not be {@code null}. * @return The parsed version, never {@code null}. * @throws InvalidVersionSpecificationException If the string violates the syntax rules of this scheme. */ Version parseVersion( String version ) throws InvalidVersionSpecificationException; /** * Parses the specified version range specification, for example "[1.0,2.0)". * * @param range The range specification to parse, must not be {@code null}. * @return The parsed version range, never {@code null}. * @throws InvalidVersionSpecificationException If the range specification violates the syntax rules of this scheme. */ VersionRange parseVersionRange( String range ) throws InvalidVersionSpecificationException; /** * Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0),(2.0,)". * * @param constraint The constraint specification to parse, must not be {@code null}. * @return The parsed version constraint, never {@code null}. * @throws InvalidVersionSpecificationException If the constraint specification violates the syntax rules of this * scheme. */ VersionConstraint parseVersionConstraint( final String constraint ) throws InvalidVersionSpecificationException; } aether-1.0.2.v20150114/aether-api/src/main/java/org/eclipse/aether/version/package-info.java000066400000000000000000000011771245546356100310770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The definition of a version scheme for parsing and comparing versions. */ package org.eclipse.aether.version; aether-1.0.2.v20150114/aether-api/src/main/resources/000077500000000000000000000000001245546356100216235ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/main/resources/about.html000066400000000000000000000026401245546356100236250ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-api/src/test/000077500000000000000000000000001245546356100176445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/000077500000000000000000000000001245546356100205655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/000077500000000000000000000000001245546356100213545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/000077500000000000000000000000001245546356100230005ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100242505ustar00rootroot00000000000000AbstractForwardingRepositorySystemSessionTest.java000066400000000000000000000022351245546356100363350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.junit.Test; public class AbstractForwardingRepositorySystemSessionTest { @Test public void testAllMethodsImplemented() throws Exception { for ( Method method : RepositorySystemSession.class.getMethods() ) { Method m = AbstractForwardingRepositorySystemSession.class.getDeclaredMethod( method.getName(), method.getParameterTypes() ); assertNotNull( method.toString(), m ); } } } AbstractRepositoryListenerTest.java000066400000000000000000000022521245546356100332460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.eclipse.aether.AbstractRepositoryListener; import org.eclipse.aether.RepositoryListener; import org.junit.Test; /** */ public class AbstractRepositoryListenerTest { @Test public void testAllEventTypesHandled() throws Exception { for ( Method method : RepositoryListener.class.getMethods() ) { assertNotNull( AbstractRepositoryListener.class.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); } } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/DefaultRepositoryCacheTest.java000066400000000000000000000055541245546356100323740ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; public class DefaultRepositoryCacheTest { private DefaultRepositoryCache cache = new DefaultRepositoryCache(); private RepositorySystemSession session = new DefaultRepositorySystemSession(); private Object get( Object key ) { return cache.get( session, key ); } private void put( Object key, Object value ) { cache.put( session, key, value ); } @Test( expected = RuntimeException.class ) public void testGet_NullKey() { get( null ); } @Test( expected = RuntimeException.class ) public void testPut_NullKey() { put( null, "data" ); } @Test public void testGetPut() { Object key = "key"; assertNull( get( key ) ); put( key, "value" ); assertEquals( "value", get( key ) ); put( key, "changed" ); assertEquals( "changed", get( key ) ); put( key, null ); assertNull( get( key ) ); } @Test( timeout = 10000 ) public void testConcurrency() throws Exception { final AtomicReference error = new AtomicReference(); Thread threads[] = new Thread[20]; for ( int i = 0; i < threads.length; i++ ) { threads[i] = new Thread() { @Override public void run() { for ( int i = 0; i < 100; i++ ) { String key = UUID.randomUUID().toString(); try { put( key, Boolean.TRUE ); assertEquals( Boolean.TRUE, get( key ) ); } catch ( Throwable t ) { error.compareAndSet( null, t ); t.printStackTrace(); } } } }; } for ( Thread thread : threads ) { thread.start(); } for ( Thread thread : threads ) { thread.join(); } assertNull( String.valueOf( error.get() ), error.get() ); } } DefaultRepositorySystemSessionTest.java000066400000000000000000000100001245546356100341200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Test; /** */ public class DefaultRepositorySystemSessionTest { @Test public void testDefaultProxySelectorUsesExistingProxy() { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); RemoteRepository repo = new RemoteRepository.Builder( "id", "default", "void" ).build(); assertSame( null, session.getProxySelector().getProxy( repo ) ); Proxy proxy = new Proxy( "http", "localhost", 8080, null ); repo = new RemoteRepository.Builder( repo ).setProxy( proxy ).build(); assertSame( proxy, session.getProxySelector().getProxy( repo ) ); } @Test public void testDefaultAuthenticationSelectorUsesExistingAuth() { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); RemoteRepository repo = new RemoteRepository.Builder( "id", "default", "void" ).build(); assertSame( null, session.getAuthenticationSelector().getAuthentication( repo ) ); Authentication auth = new Authentication() { public void fill( AuthenticationContext context, String key, Map data ) { } public void digest( AuthenticationDigest digest ) { } }; repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build(); assertSame( auth, session.getAuthenticationSelector().getAuthentication( repo ) ); } @Test public void testCopyConstructorCopiesPropertiesDeep() { DefaultRepositorySystemSession session1 = new DefaultRepositorySystemSession(); session1.setUserProperties( System.getProperties() ); session1.setSystemProperties( System.getProperties() ); session1.setConfigProperties( System.getProperties() ); DefaultRepositorySystemSession session2 = new DefaultRepositorySystemSession( session1 ); session2.setUserProperty( "key", "test" ); session2.setSystemProperty( "key", "test" ); session2.setConfigProperty( "key", "test" ); assertEquals( null, session1.getUserProperties().get( "key" ) ); assertEquals( null, session1.getSystemProperties().get( "key" ) ); assertEquals( null, session1.getConfigProperties().get( "key" ) ); } @Test public void testReadOnlyProperties() { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); try { session.getUserProperties().put( "key", "test" ); fail( "user properties are modifiable" ); } catch ( UnsupportedOperationException e ) { // expected } try { session.getSystemProperties().put( "key", "test" ); fail( "system properties are modifiable" ); } catch ( UnsupportedOperationException e ) { // expected } try { session.getConfigProperties().put( "key", "test" ); fail( "config properties are modifiable" ); } catch ( UnsupportedOperationException e ) { // expected } } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/DefaultSessionDataTest.java000066400000000000000000000073311245546356100315010ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; public class DefaultSessionDataTest { private DefaultSessionData data = new DefaultSessionData(); private Object get( Object key ) { return data.get( key ); } private void set( Object key, Object value ) { data.set( key, value ); } private boolean set( Object key, Object oldValue, Object newValue ) { return data.set( key, oldValue, newValue ); } @Test( expected = RuntimeException.class ) public void testGet_NullKey() { get( null ); } @Test( expected = RuntimeException.class ) public void testSet_NullKey() { set( null, "data" ); } @Test public void testGetSet() { Object key = "key"; assertNull( get( key ) ); set( key, "value" ); assertEquals( "value", get( key ) ); set( key, "changed" ); assertEquals( "changed", get( key ) ); set( key, null ); assertNull( get( key ) ); } @Test public void testGetSafeSet() { Object key = "key"; assertNull( get( key ) ); assertFalse( set( key, "wrong", "value" ) ); assertNull( get( key ) ); assertTrue( set( key, null, "value" ) ); assertEquals( "value", get( key ) ); assertTrue( set( key, "value", "value" ) ); assertEquals( "value", get( key ) ); assertFalse( set( key, "wrong", "changed" ) ); assertEquals( "value", get( key ) ); assertTrue( set( key, "value", "changed" ) ); assertEquals( "changed", get( key ) ); assertFalse( set( key, "wrong", null ) ); assertEquals( "changed", get( key ) ); assertTrue( set( key, "changed", null ) ); assertNull( get( key ) ); assertTrue( set( key, null, null ) ); assertNull( get( key ) ); } @Test( timeout = 10000 ) public void testConcurrency() throws Exception { final AtomicReference error = new AtomicReference(); Thread threads[] = new Thread[20]; for ( int i = 0; i < threads.length; i++ ) { threads[i] = new Thread() { @Override public void run() { for ( int i = 0; i < 100; i++ ) { String key = UUID.randomUUID().toString(); try { set( key, Boolean.TRUE ); assertEquals( Boolean.TRUE, get( key ) ); } catch ( Throwable t ) { error.compareAndSet( null, t ); t.printStackTrace(); } } } }; } for ( Thread thread : threads ) { thread.start(); } for ( Thread thread : threads ) { thread.join(); } assertNull( String.valueOf( error.get() ), error.get() ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java000066400000000000000000000203361245546356100320150ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Arrays; import java.util.Collections; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.UnsolvableVersionConflictException; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.resolution.DependencyResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.NoRepositoryConnectorException; import org.eclipse.aether.transfer.NoRepositoryLayoutException; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.junit.Test; public class RepositoryExceptionTest { private void assertSerializable( RepositoryException e ) { try { ObjectOutputStream oos = new ObjectOutputStream( new ByteArrayOutputStream() ); oos.writeObject( e ); oos.close(); } catch ( IOException ioe ) { throw new IllegalStateException( ioe ); } } private RequestTrace newTrace() { return new RequestTrace( "test" ); } private Artifact newArtifact() { return new DefaultArtifact( "gid", "aid", "ext", "1" ); } private Metadata newMetadata() { return new DefaultMetadata( "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); } private RemoteRepository newRepo() { Proxy proxy = new Proxy( Proxy.TYPE_HTTP, "localhost", 8080, null ); return new RemoteRepository.Builder( "id", "test", "http://localhost" ).setProxy( proxy ).build(); } @Test public void testArtifactDescriptorException_Serializable() { ArtifactDescriptorRequest request = new ArtifactDescriptorRequest(); request.setArtifact( newArtifact() ).addRepository( newRepo() ).setTrace( newTrace() ); ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); assertSerializable( new ArtifactDescriptorException( result ) ); } @Test public void testArtifactResolutionException_Serializable() { ArtifactRequest request = new ArtifactRequest(); request.setArtifact( newArtifact() ).addRepository( newRepo() ).setTrace( newTrace() ); ArtifactResult result = new ArtifactResult( request ); assertSerializable( new ArtifactResolutionException( Arrays.asList( result ) ) ); } @Test public void testArtifactTransferException_Serializable() { assertSerializable( new ArtifactTransferException( newArtifact(), newRepo(), "error" ) ); } @Test public void testArtifactNotFoundException_Serializable() { assertSerializable( new ArtifactNotFoundException( newArtifact(), newRepo(), "error" ) ); } @Test public void testDependencyCollectionException_Serializable() { CollectRequest request = new CollectRequest(); request.addDependency( new Dependency( newArtifact(), "compile" ) ); request.addRepository( newRepo() ); request.setTrace( newTrace() ); CollectResult result = new CollectResult( request ); assertSerializable( new DependencyCollectionException( result ) ); } @Test public void testDependencyResolutionException_Serializable() { CollectRequest request = new CollectRequest(); request.addDependency( new Dependency( newArtifact(), "compile" ) ); request.addRepository( newRepo() ); request.setTrace( newTrace() ); DependencyRequest req = new DependencyRequest(); req.setTrace( newTrace() ); req.setCollectRequest( request ); DependencyResult result = new DependencyResult( req ); assertSerializable( new DependencyResolutionException( result, null ) ); } @Test public void testMetadataTransferException_Serializable() { assertSerializable( new MetadataTransferException( newMetadata(), newRepo(), "error" ) ); } @Test public void testMetadataNotFoundException_Serializable() { assertSerializable( new MetadataNotFoundException( newMetadata(), newRepo(), "error" ) ); } @Test public void testNoLocalRepositoryManagerException_Serializable() { assertSerializable( new NoLocalRepositoryManagerException( new LocalRepository( "/tmp" ) ) ); } @Test public void testNoRepositoryConnectorException_Serializable() { assertSerializable( new NoRepositoryConnectorException( newRepo() ) ); } @Test public void testNoRepositoryLayoutException_Serializable() { assertSerializable( new NoRepositoryLayoutException( newRepo() ) ); } @Test public void testNoTransporterException_Serializable() { assertSerializable( new NoTransporterException( newRepo() ) ); } @Test public void testRepositoryOfflineException_Serializable() { assertSerializable( new RepositoryOfflineException( newRepo() ) ); } @Test public void testUnsolvableVersionConflictException_Serializable() { DependencyNode node = new DefaultDependencyNode( new Dependency( newArtifact(), "test" ) ); assertSerializable( new UnsolvableVersionConflictException( Collections.singleton( Arrays.asList( node ) ) ) ); } @Test public void testVersionResolutionException_Serializable() { VersionRequest request = new VersionRequest(); request.setArtifact( newArtifact() ).addRepository( newRepo() ).setTrace( newTrace() ); VersionResult result = new VersionResult( request ); assertSerializable( new VersionResolutionException( result ) ); } @Test public void testVersionRangeResolutionException_Serializable() { VersionRangeRequest request = new VersionRangeRequest(); request.setArtifact( newArtifact() ).addRepository( newRepo() ).setTrace( newTrace() ); VersionRangeResult result = new VersionRangeResult( request ); assertSerializable( new VersionRangeResolutionException( result ) ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/RequestTraceTest.java000066400000000000000000000027601245546356100303670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether; import static org.junit.Assert.*; import org.junit.Test; /** */ public class RequestTraceTest { @Test public void testConstructor() { RequestTrace trace = new RequestTrace( null ); assertSame( null, trace.getData() ); trace = new RequestTrace( this ); assertSame( this, trace.getData() ); } @Test public void testParentChaining() { RequestTrace trace1 = new RequestTrace( null ); RequestTrace trace2 = trace1.newChild( this ); assertSame( null, trace1.getParent() ); assertSame( null, trace1.getData() ); assertSame( trace1, trace2.getParent() ); assertSame( this, trace2.getData() ); } @Test public void testNewChildRequestTrace() { RequestTrace trace = RequestTrace.newChild( null, this ); assertNotNull( trace ); assertSame( null, trace.getParent() ); assertSame( this, trace.getData() ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/artifact/000077500000000000000000000000001245546356100260455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java000066400000000000000000000173321245546356100326200ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.artifact; import static org.junit.Assert.*; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.DefaultArtifact; import org.junit.Test; /** */ public class DefaultArtifactTest { @Test public void testDefaultArtifactString() { Artifact a; a = new DefaultArtifact( "gid:aid:ver" ); assertEquals( "gid", a.getGroupId() ); assertEquals( "aid", a.getArtifactId() ); assertEquals( "ver", a.getVersion() ); assertEquals( "ver", a.getBaseVersion() ); assertEquals( "jar", a.getExtension() ); assertEquals( "", a.getClassifier() ); a = new DefaultArtifact( "gid:aid:ext:ver" ); assertEquals( "gid", a.getGroupId() ); assertEquals( "aid", a.getArtifactId() ); assertEquals( "ver", a.getVersion() ); assertEquals( "ver", a.getBaseVersion() ); assertEquals( "ext", a.getExtension() ); assertEquals( "", a.getClassifier() ); a = new DefaultArtifact( "org.gid:foo-bar:jar:1.1-20101116.150650-3" ); assertEquals( "org.gid", a.getGroupId() ); assertEquals( "foo-bar", a.getArtifactId() ); assertEquals( "1.1-20101116.150650-3", a.getVersion() ); assertEquals( "1.1-SNAPSHOT", a.getBaseVersion() ); assertEquals( "jar", a.getExtension() ); assertEquals( "", a.getClassifier() ); a = new DefaultArtifact( "gid:aid:ext:cls:ver" ); assertEquals( "gid", a.getGroupId() ); assertEquals( "aid", a.getArtifactId() ); assertEquals( "ver", a.getVersion() ); assertEquals( "ver", a.getBaseVersion() ); assertEquals( "ext", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); a = new DefaultArtifact( "gid:aid::cls:ver" ); assertEquals( "gid", a.getGroupId() ); assertEquals( "aid", a.getArtifactId() ); assertEquals( "ver", a.getVersion() ); assertEquals( "ver", a.getBaseVersion() ); assertEquals( "jar", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); a = new DefaultArtifact( new DefaultArtifact( "gid:aid:ext:cls:ver" ).toString() ); assertEquals( "gid", a.getGroupId() ); assertEquals( "aid", a.getArtifactId() ); assertEquals( "ver", a.getVersion() ); assertEquals( "ver", a.getBaseVersion() ); assertEquals( "ext", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); } @Test( expected = IllegalArgumentException.class ) public void testDefaultArtifactBadString() { new DefaultArtifact( "gid:aid" ); } @Test public void testImmutability() { Artifact a = new DefaultArtifact( "gid:aid:ext:cls:ver" ); assertNotSame( a, a.setFile( new File( "file" ) ) ); assertNotSame( a, a.setVersion( "otherVersion" ) ); assertNotSame( a, a.setProperties( Collections.singletonMap( "key", "value" ) ) ); } @Test public void testArtifactType() { DefaultArtifactType type = new DefaultArtifactType( "typeId", "typeExt", "typeCls", "typeLang", true, true ); Artifact a = new DefaultArtifact( "gid", "aid", null, null, null, null, type ); assertEquals( "typeExt", a.getExtension() ); assertEquals( "typeCls", a.getClassifier() ); assertEquals( "typeLang", a.getProperties().get( ArtifactProperties.LANGUAGE ) ); assertEquals( "typeId", a.getProperties().get( ArtifactProperties.TYPE ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.INCLUDES_DEPENDENCIES ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.CONSTITUTES_BUILD_PATH ) ); a = new DefaultArtifact( "gid", "aid", "cls", "ext", "ver", null, type ); assertEquals( "ext", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); assertEquals( "typeLang", a.getProperties().get( ArtifactProperties.LANGUAGE ) ); assertEquals( "typeId", a.getProperties().get( ArtifactProperties.TYPE ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.INCLUDES_DEPENDENCIES ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.CONSTITUTES_BUILD_PATH ) ); Map props = new HashMap(); props.put( "someNonStandardProperty", "someNonStandardProperty" ); a = new DefaultArtifact( "gid", "aid", "cls", "ext", "ver", props, type ); assertEquals( "ext", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); assertEquals( "typeLang", a.getProperties().get( ArtifactProperties.LANGUAGE ) ); assertEquals( "typeId", a.getProperties().get( ArtifactProperties.TYPE ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.INCLUDES_DEPENDENCIES ) ); assertEquals( "true", a.getProperties().get( ArtifactProperties.CONSTITUTES_BUILD_PATH ) ); assertEquals( "someNonStandardProperty", a.getProperties().get( "someNonStandardProperty" ) ); props = new HashMap(); props.put( "someNonStandardProperty", "someNonStandardProperty" ); props.put( ArtifactProperties.CONSTITUTES_BUILD_PATH, "rubbish" ); props.put( ArtifactProperties.INCLUDES_DEPENDENCIES, "rubbish" ); a = new DefaultArtifact( "gid", "aid", "cls", "ext", "ver", props, type ); assertEquals( "ext", a.getExtension() ); assertEquals( "cls", a.getClassifier() ); assertEquals( "typeLang", a.getProperties().get( ArtifactProperties.LANGUAGE ) ); assertEquals( "typeId", a.getProperties().get( ArtifactProperties.TYPE ) ); assertEquals( "rubbish", a.getProperties().get( ArtifactProperties.INCLUDES_DEPENDENCIES ) ); assertEquals( "rubbish", a.getProperties().get( ArtifactProperties.CONSTITUTES_BUILD_PATH ) ); assertEquals( "someNonStandardProperty", a.getProperties().get( "someNonStandardProperty" ) ); } @Test public void testPropertiesCopied() { Map props = new HashMap(); props.put( "key", "value1" ); Artifact a = new DefaultArtifact( "gid:aid:1", props ); assertEquals( "value1", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value1", a.getProperty( "key", null ) ); props.put( "key", "value2" ); a = a.setProperties( props ); assertEquals( "value2", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value2", a.getProperty( "key", null ) ); } @Test public void testIsSnapshot() { Artifact a = new DefaultArtifact( "gid:aid:ext:cls:1.0" ); assertFalse( a.getVersion(), a.isSnapshot() ); a = new DefaultArtifact( "gid:aid:ext:cls:1.0-SNAPSHOT" ); assertTrue( a.getVersion(), a.isSnapshot() ); a = new DefaultArtifact( "gid:aid:ext:cls:1.0-20101116.150650-3" ); assertTrue( a.getVersion(), a.isSnapshot() ); a = new DefaultArtifact( "gid:aid:ext:cls:1.0-20101116x150650-3" ); assertFalse( a.getVersion(), a.isSnapshot() ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/graph/000077500000000000000000000000001245546356100253515ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java000066400000000000000000000042311245546356100311320ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.graph; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collections; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.junit.Test; /** */ public class DependencyTest { @Test public void testSetScope() { Dependency d1 = new Dependency( new DefaultArtifact( "gid:aid:ver" ), "compile" ); Dependency d2 = d1.setScope( null ); assertNotSame( d2, d1 ); assertEquals( "", d2.getScope() ); Dependency d3 = d1.setScope( "test" ); assertNotSame( d3, d1 ); assertEquals( "test", d3.getScope() ); } @Test public void testSetExclusions() { Dependency d1 = new Dependency( new DefaultArtifact( "gid:aid:ver" ), "compile", false, Collections.singleton( new Exclusion( "g", "a", "c", "e" ) ) ); Dependency d2 = d1.setExclusions( null ); assertNotSame( d2, d1 ); assertEquals( 0, d2.getExclusions().size() ); assertSame( d2, d2.setExclusions( null ) ); assertSame( d2, d2.setExclusions( Collections. emptyList() ) ); assertSame( d2, d2.setExclusions( Collections. emptySet() ) ); assertSame( d1, d1.setExclusions( Arrays.asList( new Exclusion( "g", "a", "c", "e" ) ) ) ); Dependency d3 = d1.setExclusions( Arrays.asList( new Exclusion( "g", "a", "c", "e" ), new Exclusion( "g", "a", "c", "f" ) ) ); assertNotSame( d3, d1 ); assertEquals( 2, d3.getExclusions().size() ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/repository/000077500000000000000000000000001245546356100264675ustar00rootroot00000000000000AuthenticationContextTest.java000066400000000000000000000133141245546356100344410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import static org.junit.Assert.*; import java.io.File; import java.util.Map; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.junit.Test; public class AuthenticationContextTest { private RepositorySystemSession newSession() { return new DefaultRepositorySystemSession(); } private RemoteRepository newRepo( Authentication auth, Proxy proxy ) { return new RemoteRepository.Builder( "test", "default", "http://localhost" ) // .setAuthentication( auth ).setProxy( proxy ).build(); } private Proxy newProxy( Authentication auth ) { return new Proxy( Proxy.TYPE_HTTP, "localhost", 8080, auth ); } private Authentication newAuth() { return new Authentication() { public void fill( AuthenticationContext context, String key, Map data ) { assertNotNull( context ); assertNotNull( context.getSession() ); assertNotNull( context.getRepository() ); assertNull( "fill() should only be called once", context.get( "key" ) ); context.put( "key", "value" ); } public void digest( AuthenticationDigest digest ) { fail( "AuthenticationContext should not call digest()" ); } }; } @Test public void testForRepository() { RepositorySystemSession session = newSession(); RemoteRepository repo = newRepo( newAuth(), newProxy( newAuth() ) ); AuthenticationContext context = AuthenticationContext.forRepository( session, repo ); assertNotNull( context ); assertSame( session, context.getSession() ); assertSame( repo, context.getRepository() ); assertNull( context.getProxy() ); assertEquals( "value", context.get( "key" ) ); assertEquals( "value", context.get( "key" ) ); } @Test public void testForRepository_NoAuth() { RepositorySystemSession session = newSession(); RemoteRepository repo = newRepo( null, newProxy( newAuth() ) ); AuthenticationContext context = AuthenticationContext.forRepository( session, repo ); assertNull( context ); } @Test public void testForProxy() { RepositorySystemSession session = newSession(); Proxy proxy = newProxy( newAuth() ); RemoteRepository repo = newRepo( newAuth(), proxy ); AuthenticationContext context = AuthenticationContext.forProxy( session, repo ); assertNotNull( context ); assertSame( session, context.getSession() ); assertSame( repo, context.getRepository() ); assertSame( proxy, context.getProxy() ); assertEquals( "value", context.get( "key" ) ); assertEquals( "value", context.get( "key" ) ); } @Test public void testForProxy_NoProxy() { RepositorySystemSession session = newSession(); Proxy proxy = null; RemoteRepository repo = newRepo( newAuth(), proxy ); AuthenticationContext context = AuthenticationContext.forProxy( session, repo ); assertNull( context ); } @Test public void testForProxy_NoProxyAuth() { RepositorySystemSession session = newSession(); Proxy proxy = newProxy( null ); RemoteRepository repo = newRepo( newAuth(), proxy ); AuthenticationContext context = AuthenticationContext.forProxy( session, repo ); assertNull( context ); } @Test public void testGet_StringVsChars() { AuthenticationContext context = AuthenticationContext.forRepository( newSession(), newRepo( newAuth(), null ) ); context.put( "key", new char[] { 'v', 'a', 'l', '1' } ); assertEquals( "val1", context.get( "key" ) ); context.put( "key", "val2" ); assertArrayEquals( new char[] { 'v', 'a', 'l', '2' }, context.get( "key", char[].class ) ); } @Test public void testGet_StringVsFile() { AuthenticationContext context = AuthenticationContext.forRepository( newSession(), newRepo( newAuth(), null ) ); context.put( "key", "val1" ); assertEquals( new File( "val1" ), context.get( "key", File.class ) ); context.put( "key", new File( "val2" ) ); assertEquals( "val2", context.get( "key" ) ); } @Test public void testPut_EraseCharArrays() { AuthenticationContext context = AuthenticationContext.forRepository( newSession(), newRepo( newAuth(), null ) ); char[] secret = { 'v', 'a', 'l', 'u', 'e' }; context.put( "key", secret ); context.put( "key", secret.clone() ); assertArrayEquals( new char[] { 0, 0, 0, 0, 0 }, secret ); } @Test public void testClose_EraseCharArrays() { AuthenticationContext.close( null ); AuthenticationContext context = AuthenticationContext.forRepository( newSession(), newRepo( newAuth(), null ) ); char[] secret = { 'v', 'a', 'l', 'u', 'e' }; context.put( "key", secret ); AuthenticationContext.close( context ); assertArrayEquals( new char[] { 0, 0, 0, 0, 0 }, secret ); } } AuthenticationDigestTest.java000066400000000000000000000110151245546356100342300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import static org.junit.Assert.*; import java.util.Map; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.junit.Test; public class AuthenticationDigestTest { private RepositorySystemSession newSession() { return new DefaultRepositorySystemSession(); } private RemoteRepository newRepo( Authentication auth, Proxy proxy ) { return new RemoteRepository.Builder( "test", "default", "http://localhost" ) // .setAuthentication( auth ).setProxy( proxy ).build(); } private Proxy newProxy( Authentication auth ) { return new Proxy( Proxy.TYPE_HTTP, "localhost", 8080, auth ); } @Test public void testForRepository() { final RepositorySystemSession session = newSession(); final RemoteRepository[] repos = { null }; Authentication auth = new Authentication() { public void fill( AuthenticationContext context, String key, Map data ) { fail( "AuthenticationDigest should not call fill()" ); } public void digest( AuthenticationDigest digest ) { assertNotNull( digest ); assertSame( session, digest.getSession() ); assertNotNull( digest.getRepository() ); assertNull( digest.getProxy() ); assertNull( "digest() should only be called once", repos[0] ); repos[0] = digest.getRepository(); digest.update( (byte[]) null ); digest.update( (char[]) null ); digest.update( (String[]) null ); digest.update( null, null ); } }; RemoteRepository repo = newRepo( auth, newProxy( null ) ); String digest = AuthenticationDigest.forRepository( session, repo ); assertSame( repo, repos[0] ); assertNotNull( digest ); assertTrue( digest.length() > 0 ); } @Test public void testForRepository_NoAuth() { RemoteRepository repo = newRepo( null, null ); String digest = AuthenticationDigest.forRepository( newSession(), repo ); assertEquals( "", digest ); } @Test public void testForProxy() { final RepositorySystemSession session = newSession(); final Proxy[] proxies = { null }; Authentication auth = new Authentication() { public void fill( AuthenticationContext context, String key, Map data ) { fail( "AuthenticationDigest should not call fill()" ); } public void digest( AuthenticationDigest digest ) { assertNotNull( digest ); assertSame( session, digest.getSession() ); assertNotNull( digest.getRepository() ); assertNotNull( digest.getProxy() ); assertNull( "digest() should only be called once", proxies[0] ); proxies[0] = digest.getProxy(); digest.update( (byte[]) null ); digest.update( (char[]) null ); digest.update( (String[]) null ); digest.update( null, null ); } }; Proxy proxy = newProxy( auth ); String digest = AuthenticationDigest.forProxy( session, newRepo( null, proxy ) ); assertSame( proxy, proxies[0] ); assertNotNull( digest ); assertTrue( digest.length() > 0 ); } @Test public void testForProxy_NoProxy() { RemoteRepository repo = newRepo( null, null ); String digest = AuthenticationDigest.forProxy( newSession(), repo ); assertEquals( "", digest ); } @Test public void testForProxy_NoProxyAuth() { RemoteRepository repo = newRepo( null, newProxy( null ) ); String digest = AuthenticationDigest.forProxy( newSession(), repo ); assertEquals( "", digest ); } } RemoteRepositoryBuilderTest.java000066400000000000000000000141261245546356100347610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import org.eclipse.aether.repository.RemoteRepository.Builder; import org.junit.Before; import org.junit.Test; public class RemoteRepositoryBuilderTest { private RemoteRepository prototype; @Before public void init() { prototype = new Builder( "id", "type", "file:void" ).build(); } @Test public void testReusePrototype() { Builder builder = new Builder( prototype ); assertSame( prototype, builder.build() ); } @Test( expected = IllegalArgumentException.class ) public void testPrototypeMandatory() { new Builder( null ); } @Test public void testSetId() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setId( prototype.getId() ).build(); assertSame( prototype, repo ); repo = builder.setId( "new-id" ).build(); assertEquals( "new-id", repo.getId() ); } @Test public void testSetContentType() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setContentType( prototype.getContentType() ).build(); assertSame( prototype, repo ); repo = builder.setContentType( "new-type" ).build(); assertEquals( "new-type", repo.getContentType() ); } @Test public void testSetUrl() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setUrl( prototype.getUrl() ).build(); assertSame( prototype, repo ); repo = builder.setUrl( "file:new" ).build(); assertEquals( "file:new", repo.getUrl() ); } @Test public void testSetPolicy() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setPolicy( prototype.getPolicy( false ) ).build(); assertSame( prototype, repo ); RepositoryPolicy policy = new RepositoryPolicy( true, "never", "fail" ); repo = builder.setPolicy( policy ).build(); assertEquals( policy, repo.getPolicy( true ) ); assertEquals( policy, repo.getPolicy( false ) ); } @Test public void testSetReleasePolicy() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setReleasePolicy( prototype.getPolicy( false ) ).build(); assertSame( prototype, repo ); RepositoryPolicy policy = new RepositoryPolicy( true, "never", "fail" ); repo = builder.setReleasePolicy( policy ).build(); assertEquals( policy, repo.getPolicy( false ) ); assertEquals( prototype.getPolicy( true ), repo.getPolicy( true ) ); } @Test public void testSetSnapshotPolicy() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setSnapshotPolicy( prototype.getPolicy( true ) ).build(); assertSame( prototype, repo ); RepositoryPolicy policy = new RepositoryPolicy( true, "never", "fail" ); repo = builder.setSnapshotPolicy( policy ).build(); assertEquals( policy, repo.getPolicy( true ) ); assertEquals( prototype.getPolicy( false ), repo.getPolicy( false ) ); } @Test public void testSetProxy() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setProxy( prototype.getProxy() ).build(); assertSame( prototype, repo ); Proxy proxy = new Proxy( "http", "localhost", 8080 ); repo = builder.setProxy( proxy ).build(); assertEquals( proxy, repo.getProxy() ); } @Test public void testSetAuthentication() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setAuthentication( prototype.getAuthentication() ).build(); assertSame( prototype, repo ); Authentication auth = new Authentication() { public void fill( AuthenticationContext context, String key, Map data ) { } public void digest( AuthenticationDigest digest ) { } }; repo = builder.setAuthentication( auth ).build(); assertEquals( auth, repo.getAuthentication() ); } @Test public void testSetMirroredRepositories() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setMirroredRepositories( prototype.getMirroredRepositories() ).build(); assertSame( prototype, repo ); List mirrored = new ArrayList( Arrays.asList( repo ) ); repo = builder.setMirroredRepositories( mirrored ).build(); assertEquals( mirrored, repo.getMirroredRepositories() ); } @Test public void testAddMirroredRepository() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.addMirroredRepository( null ).build(); assertSame( prototype, repo ); repo = builder.addMirroredRepository( prototype ).build(); assertEquals( Arrays.asList( prototype ), repo.getMirroredRepositories() ); } @Test public void testSetRepositoryManager() { Builder builder = new Builder( prototype ); RemoteRepository repo = builder.setRepositoryManager( prototype.isRepositoryManager() ).build(); assertSame( prototype, repo ); repo = builder.setRepositoryManager( !prototype.isRepositoryManager() ).build(); assertEquals( !prototype.isRepositoryManager(), repo.isRepositoryManager() ); } } RemoteRepositoryTest.java000066400000000000000000000060441245546356100334520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/repository/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.repository; import static org.junit.Assert.*; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Test; /** */ public class RemoteRepositoryTest { @Test public void testGetProtocol() { RemoteRepository.Builder builder = new RemoteRepository.Builder( "id", "type", "" ); RemoteRepository repo = builder.build(); assertEquals( "", repo.getProtocol() ); repo = builder.setUrl( "http://localhost" ).build(); assertEquals( "http", repo.getProtocol() ); repo = builder.setUrl( "HTTP://localhost" ).build(); assertEquals( "HTTP", repo.getProtocol() ); repo = builder.setUrl( "dav+http://www.sonatype.org/" ).build(); assertEquals( "dav+http", repo.getProtocol() ); repo = builder.setUrl( "dav:http://www.sonatype.org/" ).build(); assertEquals( "dav:http", repo.getProtocol() ); repo = builder.setUrl( "file:/path" ).build(); assertEquals( "file", repo.getProtocol() ); repo = builder.setUrl( "file:path" ).build(); assertEquals( "file", repo.getProtocol() ); repo = builder.setUrl( "file:C:\\dir" ).build(); assertEquals( "file", repo.getProtocol() ); repo = builder.setUrl( "file:C:/dir" ).build(); assertEquals( "file", repo.getProtocol() ); } @Test public void testGetHost() { RemoteRepository.Builder builder = new RemoteRepository.Builder( "id", "type", "" ); RemoteRepository repo = builder.build(); assertEquals( "", repo.getHost() ); repo = builder.setUrl( "http://localhost" ).build(); assertEquals( "localhost", repo.getHost() ); repo = builder.setUrl( "http://localhost/" ).build(); assertEquals( "localhost", repo.getHost() ); repo = builder.setUrl( "http://localhost:1234/" ).build(); assertEquals( "localhost", repo.getHost() ); repo = builder.setUrl( "http://127.0.0.1" ).build(); assertEquals( "127.0.0.1", repo.getHost() ); repo = builder.setUrl( "http://127.0.0.1/" ).build(); assertEquals( "127.0.0.1", repo.getHost() ); repo = builder.setUrl( "http://user@localhost/path" ).build(); assertEquals( "localhost", repo.getHost() ); repo = builder.setUrl( "http://user:pass@localhost/path" ).build(); assertEquals( "localhost", repo.getHost() ); repo = builder.setUrl( "http://user:pass@localhost:1234/path" ).build(); assertEquals( "localhost", repo.getHost() ); } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/transfer/000077500000000000000000000000001245546356100260745ustar00rootroot00000000000000AbstractTransferListenerTest.java000066400000000000000000000022711245546356100345000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/transfer/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.eclipse.aether.transfer.AbstractTransferListener; import org.eclipse.aether.transfer.TransferListener; import org.junit.Test; /** */ public class AbstractTransferListenerTest { @Test public void testAllEventTypesHandled() throws Exception { for ( Method method : TransferListener.class.getMethods() ) { assertNotNull( AbstractTransferListener.class.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); } } } aether-1.0.2.v20150114/aether-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java000066400000000000000000000050221245546356100323640ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transfer; import static org.junit.Assert.*; import java.nio.ByteBuffer; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferResource; import org.junit.Test; /** */ public class TransferEventTest { private static TransferResource res = new TransferResource( "file://nil", "void", null, null ); private static RepositorySystemSession session = new DefaultRepositorySystemSession(); @Test public void testByteArrayConversion() { byte[] buffer = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int length = buffer.length - 2; int offset = 1; TransferEvent event = new TransferEvent.Builder( session, res ).setDataBuffer( buffer, offset, length ).build(); ByteBuffer bb = event.getDataBuffer(); byte[] dst = new byte[bb.remaining()]; bb.get( dst ); byte[] expected = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; assertArrayEquals( expected, dst ); } @Test public void testRepeatableReadingOfDataBuffer() { byte[] data = { 0, 1, 2, 3, 4, 5, 6, 7 }; ByteBuffer buffer = ByteBuffer.wrap( data ); TransferEvent event = new TransferEvent.Builder( session, res ).setDataBuffer( buffer ).build(); assertEquals( 8, event.getDataLength() ); ByteBuffer eventBuffer = event.getDataBuffer(); assertNotNull( eventBuffer ); assertEquals( 8, eventBuffer.remaining() ); byte[] eventData = new byte[8]; eventBuffer.get( eventData ); assertArrayEquals( data, eventData ); assertEquals( 0, eventBuffer.remaining() ); assertEquals( 8, event.getDataLength() ); eventBuffer = event.getDataBuffer(); assertNotNull( eventBuffer ); assertEquals( 8, eventBuffer.remaining() ); eventBuffer.get( eventData ); assertArrayEquals( data, eventData ); } } aether-1.0.2.v20150114/aether-connector-basic/000077500000000000000000000000001245546356100203765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/pom.xml000066400000000000000000000053141245546356100217160ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-connector-basic Aether Connector Basic A repository connector implementation for repositories using URI-based layouts. org.eclipse.aether.connector.basic org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util javax.inject javax.inject provided true org.sonatype.sisu sisu-guice no_aop test junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.codehaus.mojo animal-sniffer-maven-plugin org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-connector-basic/src/000077500000000000000000000000001245546356100211655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/000077500000000000000000000000001245546356100221115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/000077500000000000000000000000001245546356100230325ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/000077500000000000000000000000001245546356100236215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/000077500000000000000000000000001245546356100252455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100265155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/000077500000000000000000000000001245546356100305075ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/000077500000000000000000000000001245546356100315705ustar00rootroot00000000000000ArtifactTransportListener.java000066400000000000000000000035031245546356100375350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.ArtifactTransfer; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.TransferEvent; final class ArtifactTransportListener extends TransferTransportListener { private final RemoteRepository repository; public ArtifactTransportListener( ArtifactTransfer transfer, RemoteRepository repository, TransferEvent.Builder eventBuilder ) { super( transfer, eventBuilder ); this.repository = repository; } @Override public void transferFailed( Exception exception, int classification ) { ArtifactTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new ArtifactNotFoundException( getTransfer().getArtifact(), repository ); } else { e = new ArtifactTransferException( getTransfer().getArtifact(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); } } BasicRepositoryConnector.java000066400000000000000000000505041245546356100373540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import java.io.File; import java.io.IOException; import java.net.URI; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.ArtifactUpload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.spi.connector.MetadataUpload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.NoRepositoryConnectorException; import org.eclipse.aether.transfer.NoRepositoryLayoutException; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferResource; import org.eclipse.aether.util.ChecksumUtils; import org.eclipse.aether.util.ConfigUtils; import org.eclipse.aether.util.concurrency.RunnableErrorForwarder; import org.eclipse.aether.util.concurrency.WorkerThreadFactory; /** */ final class BasicRepositoryConnector implements RepositoryConnector { private static final String CONFIG_PROP_THREADS = "aether.connector.basic.threads"; private static final String CONFIG_PROP_RESUME = "aether.connector.resumeDownloads"; private static final String CONFIG_PROP_RESUME_THRESHOLD = "aether.connector.resumeThreshold"; private static final String CONFIG_PROP_SMART_CHECKSUMS = "aether.connector.smartChecksums"; private final Logger logger; private final FileProcessor fileProcessor; private final RemoteRepository repository; private final RepositorySystemSession session; private final Transporter transporter; private final RepositoryLayout layout; private final ChecksumPolicyProvider checksumPolicyProvider; private final PartialFile.Factory partialFileFactory; private final int maxThreads; private final boolean smartChecksums; private final boolean persistedChecksums; private Executor executor; private boolean closed; public BasicRepositoryConnector( RepositorySystemSession session, RemoteRepository repository, TransporterProvider transporterProvider, RepositoryLayoutProvider layoutProvider, ChecksumPolicyProvider checksumPolicyProvider, FileProcessor fileProcessor, Logger logger ) throws NoRepositoryConnectorException { try { layout = layoutProvider.newRepositoryLayout( session, repository ); } catch ( NoRepositoryLayoutException e ) { throw new NoRepositoryConnectorException( repository, e.getMessage(), e ); } try { transporter = transporterProvider.newTransporter( session, repository ); } catch ( NoTransporterException e ) { throw new NoRepositoryConnectorException( repository, e.getMessage(), e ); } this.checksumPolicyProvider = checksumPolicyProvider; this.session = session; this.repository = repository; this.fileProcessor = fileProcessor; this.logger = logger; maxThreads = ConfigUtils.getInteger( session, 5, CONFIG_PROP_THREADS, "maven.artifact.threads" ); smartChecksums = ConfigUtils.getBoolean( session, true, CONFIG_PROP_SMART_CHECKSUMS ); persistedChecksums = ConfigUtils.getBoolean( session, ConfigurationProperties.DEFAULT_PERSISTED_CHECKSUMS, ConfigurationProperties.PERSISTED_CHECKSUMS ); boolean resumeDownloads = ConfigUtils.getBoolean( session, true, CONFIG_PROP_RESUME + '.' + repository.getId(), CONFIG_PROP_RESUME ); long resumeThreshold = ConfigUtils.getLong( session, 64 * 1024, CONFIG_PROP_RESUME_THRESHOLD + '.' + repository.getId(), CONFIG_PROP_RESUME_THRESHOLD ); int requestTimeout = ConfigUtils.getInteger( session, ConfigurationProperties.DEFAULT_REQUEST_TIMEOUT, ConfigurationProperties.REQUEST_TIMEOUT + '.' + repository.getId(), ConfigurationProperties.REQUEST_TIMEOUT ); partialFileFactory = new PartialFile.Factory( resumeDownloads, resumeThreshold, requestTimeout, logger ); } private Executor getExecutor( Collection artifacts, Collection metadatas ) { if ( maxThreads <= 1 ) { return DirectExecutor.INSTANCE; } int tasks = safe( artifacts ).size() + safe( metadatas ).size(); if ( tasks <= 1 ) { return DirectExecutor.INSTANCE; } if ( executor == null ) { executor = new ThreadPoolExecutor( maxThreads, maxThreads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue(), new WorkerThreadFactory( getClass().getSimpleName() + '-' + repository.getHost() + '-' ) ); } return executor; } @Override protected void finalize() throws Throwable { try { close(); } finally { super.finalize(); } } public void close() { if ( !closed ) { closed = true; if ( executor instanceof ExecutorService ) { ( (ExecutorService) executor ).shutdown(); } transporter.close(); } } public void get( Collection artifactDownloads, Collection metadataDownloads ) { if ( closed ) { throw new IllegalStateException( "connector closed" ); } Executor executor = getExecutor( artifactDownloads, metadataDownloads ); RunnableErrorForwarder errorForwarder = new RunnableErrorForwarder(); for ( MetadataDownload transfer : safe( metadataDownloads ) ) { URI location = layout.getLocation( transfer.getMetadata(), false ); TransferResource resource = newTransferResource( location, transfer.getFile(), transfer.getTrace() ); TransferEvent.Builder builder = newEventBuilder( resource, false, false ); MetadataTransportListener listener = new MetadataTransportListener( transfer, repository, builder ); ChecksumPolicy checksumPolicy = newChecksumPolicy( transfer.getChecksumPolicy(), resource ); List checksums = null; if ( checksumPolicy != null ) { checksums = layout.getChecksums( transfer.getMetadata(), false, location ); } Runnable task = new GetTaskRunner( location, transfer.getFile(), checksumPolicy, checksums, listener ); executor.execute( errorForwarder.wrap( task ) ); } for ( ArtifactDownload transfer : safe( artifactDownloads ) ) { URI location = layout.getLocation( transfer.getArtifact(), false ); TransferResource resource = newTransferResource( location, transfer.getFile(), transfer.getTrace() ); TransferEvent.Builder builder = newEventBuilder( resource, false, transfer.isExistenceCheck() ); ArtifactTransportListener listener = new ArtifactTransportListener( transfer, repository, builder ); Runnable task; if ( transfer.isExistenceCheck() ) { task = new PeekTaskRunner( location, listener ); } else { ChecksumPolicy checksumPolicy = newChecksumPolicy( transfer.getChecksumPolicy(), resource ); List checksums = null; if ( checksumPolicy != null ) { checksums = layout.getChecksums( transfer.getArtifact(), false, location ); } task = new GetTaskRunner( location, transfer.getFile(), checksumPolicy, checksums, listener ); } executor.execute( errorForwarder.wrap( task ) ); } errorForwarder.await(); } public void put( Collection artifactUploads, Collection metadataUploads ) { if ( closed ) { throw new IllegalStateException( "connector closed" ); } for ( ArtifactUpload transfer : safe( artifactUploads ) ) { URI location = layout.getLocation( transfer.getArtifact(), true ); TransferResource resource = newTransferResource( location, transfer.getFile(), transfer.getTrace() ); TransferEvent.Builder builder = newEventBuilder( resource, true, false ); ArtifactTransportListener listener = new ArtifactTransportListener( transfer, repository, builder ); List checksums = layout.getChecksums( transfer.getArtifact(), true, location ); Runnable task = new PutTaskRunner( location, transfer.getFile(), checksums, listener ); task.run(); } for ( MetadataUpload transfer : safe( metadataUploads ) ) { URI location = layout.getLocation( transfer.getMetadata(), true ); TransferResource resource = newTransferResource( location, transfer.getFile(), transfer.getTrace() ); TransferEvent.Builder builder = newEventBuilder( resource, true, false ); MetadataTransportListener listener = new MetadataTransportListener( transfer, repository, builder ); List checksums = layout.getChecksums( transfer.getMetadata(), true, location ); Runnable task = new PutTaskRunner( location, transfer.getFile(), checksums, listener ); task.run(); } } private static Collection safe( Collection items ) { return ( items != null ) ? items : Collections. emptyList(); } private TransferResource newTransferResource( URI path, File file, RequestTrace trace ) { return new TransferResource( repository.getUrl(), path.toString(), file, trace ); } private TransferEvent.Builder newEventBuilder( TransferResource resource, boolean upload, boolean peek ) { TransferEvent.Builder builder = new TransferEvent.Builder( session, resource ); if ( upload ) { builder.setRequestType( TransferEvent.RequestType.PUT ); } else if ( !peek ) { builder.setRequestType( TransferEvent.RequestType.GET ); } else { builder.setRequestType( TransferEvent.RequestType.GET_EXISTENCE ); } return builder; } private ChecksumPolicy newChecksumPolicy( String policy, TransferResource resource ) { return checksumPolicyProvider.newChecksumPolicy( session, repository, resource, policy ); } @Override public String toString() { return String.valueOf( repository ); } abstract class TaskRunner implements Runnable { protected final URI path; protected final TransferTransportListener listener; public TaskRunner( URI path, TransferTransportListener listener ) { this.path = path; this.listener = listener; } public void run() { try { listener.transferInitiated(); runTask(); listener.transferSucceeded(); } catch ( Exception e ) { listener.transferFailed( e, transporter.classify( e ) ); } } protected abstract void runTask() throws Exception; } class PeekTaskRunner extends TaskRunner { public PeekTaskRunner( URI path, TransferTransportListener listener ) { super( path, listener ); } protected void runTask() throws Exception { transporter.peek( new PeekTask( path ) ); } } class GetTaskRunner extends TaskRunner implements PartialFile.RemoteAccessChecker, ChecksumValidator.ChecksumFetcher { private final File file; private final ChecksumValidator checksumValidator; public GetTaskRunner( URI path, File file, ChecksumPolicy checksumPolicy, List checksums, TransferTransportListener listener ) { super( path, listener ); this.file = file; checksumValidator = new ChecksumValidator( logger, file, fileProcessor, this, checksumPolicy, safe( checksums ) ); } public void checkRemoteAccess() throws Exception { transporter.peek( new PeekTask( path ) ); } public boolean fetchChecksum( URI remote, File local ) throws Exception { try { transporter.get( new GetTask( remote ).setDataFile( local ) ); } catch ( Exception e ) { if ( transporter.classify( e ) == Transporter.ERROR_NOT_FOUND ) { return false; } throw e; } return true; } protected void runTask() throws Exception { if ( file == null ) { throw new IllegalArgumentException( "destination file has not been specified" ); } fileProcessor.mkdirs( file.getParentFile() ); PartialFile partFile = partialFileFactory.newInstance( file, this ); if ( partFile == null ) { logger.debug( "Concurrent download of " + file + " just finished, skipping download" ); return; } try { File tmp = partFile.getFile(); listener.setChecksumCalculator( checksumValidator.newChecksumCalculator( tmp ) ); for ( int firstTrial = 0, lastTrial = 1, trial = firstTrial;; trial++ ) { boolean resume = partFile.isResume() && trial <= firstTrial; GetTask task = new GetTask( path ).setDataFile( tmp, resume ).setListener( listener ); transporter.get( task ); try { checksumValidator.validate( listener.getChecksums(), smartChecksums ? task.getChecksums() : null ); break; } catch ( ChecksumFailureException e ) { boolean retry = trial < lastTrial && e.isRetryWorthy(); if ( !retry && !checksumValidator.handle( e ) ) { throw e; } listener.transferCorrupted( e ); if ( retry ) { checksumValidator.retry(); } else { break; } } } fileProcessor.move( tmp, file ); if ( persistedChecksums ) { checksumValidator.commit(); } } finally { partFile.close(); checksumValidator.close(); } } } class PutTaskRunner extends TaskRunner { private final File file; private final Collection checksums; public PutTaskRunner( URI path, File file, List checksums, TransferTransportListener listener ) { super( path, listener ); this.file = file; this.checksums = safe( checksums ); } protected void runTask() throws Exception { if ( file == null ) { throw new IllegalArgumentException( "source file has not been specified" ); } transporter.put( new PutTask( path ).setDataFile( file ).setListener( listener ) ); uploadChecksums( file, path ); } private void uploadChecksums( File file, URI location ) { if ( checksums.isEmpty() ) { return; } try { Set algos = new HashSet(); for ( RepositoryLayout.Checksum checksum : checksums ) { algos.add( checksum.getAlgorithm() ); } Map sumsByAlgo = ChecksumUtils.calc( file, algos ); for ( RepositoryLayout.Checksum checksum : checksums ) { uploadChecksum( checksum.getLocation(), sumsByAlgo.get( checksum.getAlgorithm() ) ); } } catch ( IOException e ) { String msg = "Failed to upload checksums for " + file + ": " + e.getMessage(); if ( logger.isDebugEnabled() ) { logger.warn( msg, e ); } else { logger.warn( msg ); } } } private void uploadChecksum( URI location, Object checksum ) { try { if ( checksum instanceof Exception ) { throw (Exception) checksum; } transporter.put( new PutTask( location ).setDataString( (String) checksum ) ); } catch ( Exception e ) { String msg = "Failed to upload checksum " + location + ": " + e.getMessage(); if ( logger.isDebugEnabled() ) { logger.warn( msg, e ); } else { logger.warn( msg ); } } } } private static class DirectExecutor implements Executor { static final Executor INSTANCE = new DirectExecutor(); public void execute( Runnable command ) { command.run(); } } } BasicRepositoryConnectorFactory.java000066400000000000000000000157611245546356100407120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoRepositoryConnectorException; /** * A repository connector factory that employs pluggable * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory transporters} and * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory repository layouts} for the transfers. */ @Named( "basic" ) public final class BasicRepositoryConnectorFactory implements RepositoryConnectorFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private TransporterProvider transporterProvider; private RepositoryLayoutProvider layoutProvider; private ChecksumPolicyProvider checksumPolicyProvider; private FileProcessor fileProcessor; private float priority; /** * Creates an (uninitialized) instance of this connector factory. Note: In case of manual instantiation by * clients, the new factory needs to be configured via its various mutators before first use or runtime errors will * occur. */ public BasicRepositoryConnectorFactory() { // enables default constructor } @Inject BasicRepositoryConnectorFactory( TransporterProvider transporterProvider, RepositoryLayoutProvider layoutProvider, ChecksumPolicyProvider checksumPolicyProvider, FileProcessor fileProcessor, LoggerFactory loggerFactory ) { setTransporterProvider( transporterProvider ); setRepositoryLayoutProvider( layoutProvider ); setChecksumPolicyProvider( checksumPolicyProvider ); setFileProcessor( fileProcessor ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setTransporterProvider( locator.getService( TransporterProvider.class ) ); setRepositoryLayoutProvider( locator.getService( RepositoryLayoutProvider.class ) ); setChecksumPolicyProvider( locator.getService( ChecksumPolicyProvider.class ) ); setFileProcessor( locator.getService( FileProcessor.class ) ); } /** * Sets the logger factory to use for this component. * * @param loggerFactory The logger factory to use, may be {@code null} to disable logging. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, BasicRepositoryConnector.class ); return this; } /** * Sets the transporter provider to use for this component. * * @param transporterProvider The transporter provider to use, must not be {@code null}. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setTransporterProvider( TransporterProvider transporterProvider ) { if ( transporterProvider == null ) { throw new IllegalArgumentException( "transporter provider has not been specified" ); } this.transporterProvider = transporterProvider; return this; } /** * Sets the repository layout provider to use for this component. * * @param layoutProvider The repository layout provider to use, must not be {@code null}. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setRepositoryLayoutProvider( RepositoryLayoutProvider layoutProvider ) { if ( layoutProvider == null ) { throw new IllegalArgumentException( "repository layout provider has not been specified" ); } this.layoutProvider = layoutProvider; return this; } /** * Sets the checksum policy provider to use for this component. * * @param checksumPolicyProvider The checksum policy provider to use, must not be {@code null}. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setChecksumPolicyProvider( ChecksumPolicyProvider checksumPolicyProvider ) { if ( checksumPolicyProvider == null ) { throw new IllegalArgumentException( "checksum policy provider has not been specified" ); } this.checksumPolicyProvider = checksumPolicyProvider; return this; } /** * Sets the file processor to use for this component. * * @param fileProcessor The file processor to use, must not be {@code null}. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setFileProcessor( FileProcessor fileProcessor ) { if ( fileProcessor == null ) { throw new IllegalArgumentException( "file processor has not been specified" ); } this.fileProcessor = fileProcessor; return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public BasicRepositoryConnectorFactory setPriority( float priority ) { this.priority = priority; return this; } public RepositoryConnector newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryConnectorException { return new BasicRepositoryConnector( session, repository, transporterProvider, layoutProvider, checksumPolicyProvider, fileProcessor, logger ); } } ChecksumCalculator.java000066400000000000000000000125531245546356100361360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.util.ChecksumUtils; /** * Calculates checksums for a downloaded file. */ final class ChecksumCalculator { static class Checksum { final String algorithm; final MessageDigest digest; Exception error; public Checksum( String algorithm ) { this.algorithm = algorithm; MessageDigest digest = null; try { digest = MessageDigest.getInstance( algorithm ); } catch ( NoSuchAlgorithmException e ) { error = e; } this.digest = digest; } public void update( ByteBuffer buffer ) { if ( digest != null ) { digest.update( buffer ); } } public void reset() { if ( digest != null ) { digest.reset(); error = null; } } public void error( Exception error ) { if ( digest != null ) { this.error = error; } } public Object get() { if ( error != null ) { return error; } return ChecksumUtils.toHexString( digest.digest() ); } } private final List checksums; private final File targetFile; public static ChecksumCalculator newInstance( File targetFile, Collection checksums ) { if ( checksums == null || checksums.isEmpty() ) { return null; } return new ChecksumCalculator( targetFile, checksums ); } private ChecksumCalculator( File targetFile, Collection checksums ) { this.checksums = new ArrayList(); Set algos = new HashSet(); for ( RepositoryLayout.Checksum checksum : checksums ) { String algo = checksum.getAlgorithm(); if ( algos.add( algo ) ) { this.checksums.add( new Checksum( algo ) ); } } this.targetFile = targetFile; } public void init( long dataOffset ) { for ( Checksum checksum : checksums ) { checksum.reset(); } if ( dataOffset <= 0 ) { return; } try { FileInputStream fis = new FileInputStream( targetFile ); try { long total = 0; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); for ( byte[] array = buffer.array(); total < dataOffset; ) { int read = fis.read( array ); if ( read < 0 ) { if ( total < dataOffset ) { throw new IOException( targetFile + " contains only " + total + " bytes, cannot resume download from offset " + dataOffset ); } break; } total += read; if ( total > dataOffset ) { read -= total - dataOffset; } buffer.rewind(); buffer.limit( read ); update( buffer ); } } finally { try { fis.close(); } catch ( IOException e ) { // irrelevant } } } catch ( IOException e ) { for ( Checksum checksum : checksums ) { checksum.error( e ); } } } public void update( ByteBuffer data ) { for ( Checksum checksum : checksums ) { data.mark(); checksum.update( data ); data.reset(); } } public Map get() { Map results = new HashMap(); for ( Checksum checksum : checksums ) { results.put( checksum.algorithm, checksum.get() ); } return results; } } ChecksumValidator.java000066400000000000000000000177011245546356100357720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import java.io.File; import java.io.IOException; import java.net.URI; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.UUID; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.connector.layout.RepositoryLayout.Checksum; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.util.ChecksumUtils; /** * Performs checksum validation for a downloaded file. */ final class ChecksumValidator { interface ChecksumFetcher { boolean fetchChecksum( URI remote, File local ) throws Exception; } private final Logger logger; private final File dataFile; private final Collection tempFiles; private final FileProcessor fileProcessor; private final ChecksumFetcher checksumFetcher; private final ChecksumPolicy checksumPolicy; private final Collection checksums; private final Map checksumFiles; public ChecksumValidator( Logger logger, File dataFile, FileProcessor fileProcessor, ChecksumFetcher checksumFetcher, ChecksumPolicy checksumPolicy, Collection checksums ) { this.logger = logger; this.dataFile = dataFile; this.tempFiles = new HashSet(); this.fileProcessor = fileProcessor; this.checksumFetcher = checksumFetcher; this.checksumPolicy = checksumPolicy; this.checksums = checksums; checksumFiles = new HashMap(); } public ChecksumCalculator newChecksumCalculator( File targetFile ) { if ( checksumPolicy != null ) { return ChecksumCalculator.newInstance( targetFile, checksums ); } return null; } public void validate( Map actualChecksums, Map inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); } private boolean validateInlinedChecksums( Map actualChecksums, Map inlinedChecksums ) throws ChecksumFailureException { for ( Map.Entry entry : inlinedChecksums.entrySet() ) { String algo = entry.getKey(); Object calculated = actualChecksums.get( algo ); if ( !( calculated instanceof String ) ) { continue; } String actual = String.valueOf( calculated ); String expected = entry.getValue().toString(); checksumFiles.put( getChecksumFile( algo ), expected ); if ( !isEqualChecksum( expected, actual ) ) { checksumPolicy.onChecksumMismatch( algo, ChecksumPolicy.KIND_UNOFFICIAL, new ChecksumFailureException( expected, actual ) ); } else if ( checksumPolicy.onChecksumMatch( algo, ChecksumPolicy.KIND_UNOFFICIAL ) ) { return true; } } return false; } private boolean validateExternalChecksums( Map actualChecksums ) throws ChecksumFailureException { for ( Checksum checksum : checksums ) { String algo = checksum.getAlgorithm(); Object calculated = actualChecksums.get( algo ); if ( calculated instanceof Exception ) { checksumPolicy.onChecksumError( algo, 0, new ChecksumFailureException( (Exception) calculated ) ); continue; } try { File checksumFile = getChecksumFile( checksum.getAlgorithm() ); File tmp = createTempFile( checksumFile ); try { if ( !checksumFetcher.fetchChecksum( checksum.getLocation(), tmp ) ) { continue; } } catch ( Exception e ) { checksumPolicy.onChecksumError( algo, 0, new ChecksumFailureException( e ) ); continue; } String actual = String.valueOf( calculated ); String expected = ChecksumUtils.read( tmp ); checksumFiles.put( checksumFile, tmp ); if ( !isEqualChecksum( expected, actual ) ) { checksumPolicy.onChecksumMismatch( algo, 0, new ChecksumFailureException( expected, actual ) ); } else if ( checksumPolicy.onChecksumMatch( algo, 0 ) ) { return true; } } catch ( IOException e ) { checksumPolicy.onChecksumError( algo, 0, new ChecksumFailureException( e ) ); } } return false; } private static boolean isEqualChecksum( String expected, String actual ) { return expected.equalsIgnoreCase( actual ); } private File getChecksumFile( String algorithm ) { String ext = algorithm.replace( "-", "" ).toLowerCase( Locale.ENGLISH ); return new File( dataFile.getPath() + '.' + ext ); } private File createTempFile( File path ) throws IOException { File file = File.createTempFile( path.getName() + "-" + UUID.randomUUID().toString().replace( "-", "" ).substring( 0, 8 ), ".tmp", path.getParentFile() ); tempFiles.add( file ); return file; } private void clearTempFiles() { for ( File file : tempFiles ) { if ( !file.delete() && file.exists() ) { logger.debug( "Could not delete temorary file " + file ); } } tempFiles.clear(); } public void retry() { checksumPolicy.onTransferRetry(); checksumFiles.clear(); clearTempFiles(); } public boolean handle( ChecksumFailureException exception ) { return checksumPolicy.onTransferChecksumFailure( exception ); } public void commit() { for ( Map.Entry entry : checksumFiles.entrySet() ) { File checksumFile = entry.getKey(); Object tmp = entry.getValue(); try { if ( tmp instanceof File ) { fileProcessor.move( (File) tmp, checksumFile ); tempFiles.remove( tmp ); } else { fileProcessor.write( checksumFile, String.valueOf( tmp ) ); } } catch ( IOException e ) { logger.debug( "Failed to write checksum file " + checksumFile + ": " + e.getMessage(), e ); } } checksumFiles.clear(); } public void close() { clearTempFiles(); } } MetadataTransportListener.java000066400000000000000000000035031245546356100375200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.MetadataTransfer; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.TransferEvent; final class MetadataTransportListener extends TransferTransportListener { private final RemoteRepository repository; public MetadataTransportListener( MetadataTransfer transfer, RemoteRepository repository, TransferEvent.Builder eventBuilder ) { super( transfer, eventBuilder ); this.repository = repository; } @Override public void transferFailed( Exception exception, int classification ) { MetadataTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new MetadataNotFoundException( getTransfer().getMetadata(), repository ); } else { e = new MetadataTransferException( getTransfer().getMetadata(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); } } PartialFile.java000066400000000000000000000214771245546356100345630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; import java.util.UUID; import org.eclipse.aether.spi.log.Logger; /** * A partially downloaded file with optional support for resume. If resume is enabled, a well-known location is used for * the partial file in combination with a lock file to prevent concurrent requests from corrupting it (and wasting * network bandwith). Otherwise, a (non-locked) unique temporary file is used. */ final class PartialFile implements Closeable { static final String EXT_PART = ".part"; static final String EXT_LOCK = ".lock"; interface RemoteAccessChecker { void checkRemoteAccess() throws Exception; } static class LockFile { private final File lockFile; private final FileLock lock; private final boolean concurrent; public LockFile( File partFile, int requestTimeout, RemoteAccessChecker checker, Logger logger ) throws Exception { lockFile = new File( partFile.getPath() + EXT_LOCK ); boolean[] concurrent = { false }; lock = lock( lockFile, partFile, requestTimeout, checker, logger, concurrent ); this.concurrent = concurrent[0]; } private static FileLock lock( File lockFile, File partFile, int requestTimeout, RemoteAccessChecker checker, Logger logger, boolean[] concurrent ) throws Exception { boolean interrupted = false; try { for ( long lastLength = -1, lastTime = 0;; ) { FileLock lock = tryLock( lockFile ); if ( lock != null ) { return lock; } long currentLength = partFile.length(); long currentTime = System.currentTimeMillis(); if ( currentLength != lastLength ) { if ( lastLength < 0 ) { concurrent[0] = true; /* * NOTE: We're going with the optimistic assumption that the other thread is downloading the * file from an equivalent repository. As a bare minimum, ensure the repository we are given * at least knows about the file and is accessible to us. */ checker.checkRemoteAccess(); logger.debug( "Concurrent download of " + partFile + " in progress, awaiting completion" ); } lastLength = currentLength; lastTime = currentTime; } else if ( requestTimeout > 0 && currentTime - lastTime > Math.max( requestTimeout, 3 * 1000 ) ) { throw new IOException( "Timeout while waiting for concurrent download of " + partFile + " to progress" ); } try { Thread.sleep( 100 ); } catch ( InterruptedException e ) { interrupted = true; } } } finally { if ( interrupted ) { Thread.currentThread().interrupt(); } } } private static FileLock tryLock( File lockFile ) throws IOException { RandomAccessFile raf = new RandomAccessFile( lockFile, "rw" ); try { FileLock lock = raf.getChannel().tryLock( 0, 1, false ); if ( lock == null ) { close( raf ); } return lock; } catch ( OverlappingFileLockException e ) { close( raf ); return null; } catch ( RuntimeException e ) { close( raf ); lockFile.delete(); throw e; } catch ( IOException e ) { close( raf ); lockFile.delete(); throw e; } } private static void close( Closeable file ) { try { file.close(); } catch ( IOException e ) { // irrelevant } } public boolean isConcurrent() { return concurrent; } public void close() { close( lock.channel() ); lockFile.delete(); } @Override public String toString() { return lockFile + " - " + lock.isValid(); } } static class Factory { private final boolean resume; private final long resumeThreshold; private final int requestTimeout; private final Logger logger; public Factory( boolean resume, long resumeThreshold, int requestTimeout, Logger logger ) { this.resume = resume; this.resumeThreshold = resumeThreshold; this.requestTimeout = requestTimeout; this.logger = logger; } public PartialFile newInstance( File dstFile, RemoteAccessChecker checker ) throws Exception { if ( resume ) { File partFile = new File( dstFile.getPath() + EXT_PART ); long reqTimestamp = System.currentTimeMillis(); LockFile lockFile = new LockFile( partFile, requestTimeout, checker, logger ); if ( lockFile.isConcurrent() && dstFile.lastModified() >= reqTimestamp - 100 ) { lockFile.close(); return null; } try { if ( !partFile.createNewFile() && !partFile.isFile() ) { throw new IOException( partFile.exists() ? "Path exists but is not a file" : "Unknown error" ); } return new PartialFile( partFile, lockFile, resumeThreshold, logger ); } catch ( IOException e ) { lockFile.close(); logger.debug( "Cannot create resumable file " + partFile.getAbsolutePath() + ": " + e ); // fall through and try non-resumable/temporary file location } } File tempFile = File.createTempFile( dstFile.getName() + '-' + UUID.randomUUID().toString().replace( "-", "" ), ".tmp", dstFile.getParentFile() ); return new PartialFile( tempFile, logger ); } } private final File partFile; private final LockFile lockFile; private final long threshold; private final Logger logger; private PartialFile( File partFile, Logger logger ) { this( partFile, null, 0, logger ); } private PartialFile( File partFile, LockFile lockFile, long threshold, Logger logger ) { this.partFile = partFile; this.lockFile = lockFile; this.threshold = threshold; this.logger = logger; } public File getFile() { return partFile; } public boolean isResume() { return lockFile != null && partFile.length() >= threshold; } public void close() { if ( partFile.exists() && !isResume() ) { if ( !partFile.delete() && partFile.exists() ) { logger.debug( "Could not delete temorary file " + partFile ); } } if ( lockFile != null ) { lockFile.close(); } } @Override public String toString() { return String.valueOf( getFile() ); } } TransferTransportListener.java000066400000000000000000000077311245546356100375730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import java.nio.ByteBuffer; import java.util.Collections; import java.util.Map; import org.eclipse.aether.spi.connector.Transfer; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferEvent.EventType; import org.eclipse.aether.transfer.TransferListener; class TransferTransportListener extends TransportListener { private final T transfer; private final TransferListener listener; private final TransferEvent.Builder eventBuilder; private ChecksumCalculator checksumCalculator; protected TransferTransportListener( T transfer, TransferEvent.Builder eventBuilder ) { this.transfer = transfer; this.listener = transfer.getListener(); this.eventBuilder = eventBuilder; } protected T getTransfer() { return transfer; } public void transferInitiated() throws TransferCancelledException { if ( listener != null ) { eventBuilder.resetType( EventType.INITIATED ); listener.transferInitiated( eventBuilder.build() ); } } @Override public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { if ( checksumCalculator != null ) { checksumCalculator.init( dataOffset ); } if ( listener != null ) { eventBuilder.resetType( EventType.STARTED ).setTransferredBytes( dataOffset ); TransferEvent event = eventBuilder.build(); event.getResource().setContentLength( dataLength ).setResumeOffset( dataOffset ); listener.transferStarted( event ); } } @Override public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { if ( checksumCalculator != null ) { checksumCalculator.update( data ); } if ( listener != null ) { eventBuilder.resetType( EventType.PROGRESSED ).addTransferredBytes( data.remaining() ).setDataBuffer( data ); listener.transferProgressed( eventBuilder.build() ); } } public void transferCorrupted( Exception exception ) throws TransferCancelledException { if ( listener != null ) { eventBuilder.resetType( EventType.CORRUPTED ).setException( exception ); listener.transferCorrupted( eventBuilder.build() ); } } public void transferFailed( Exception exception, int classification ) { if ( listener != null ) { eventBuilder.resetType( EventType.FAILED ).setException( exception ); listener.transferFailed( eventBuilder.build() ); } } public void transferSucceeded() { if ( listener != null ) { eventBuilder.resetType( EventType.SUCCEEDED ); listener.transferSucceeded( eventBuilder.build() ); } } public Map getChecksums() { if ( checksumCalculator == null ) { return Collections.emptyMap(); } return checksumCalculator.get(); } public void setChecksumCalculator( ChecksumCalculator checksumCalculator ) { this.checksumCalculator = checksumCalculator; } } package-info.java000066400000000000000000000012501245546356100346760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Support for downloads/uploads using remote repositories that have a URI-based content structure/layout. */ package org.eclipse.aether.connector.basic; aether-1.0.2.v20150114/aether-connector-basic/src/main/resources/000077500000000000000000000000001245546356100241235ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/main/resources/about.html000066400000000000000000000026401245546356100261250ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-connector-basic/src/test/000077500000000000000000000000001245546356100221445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/000077500000000000000000000000001245546356100230655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/000077500000000000000000000000001245546356100236545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/000077500000000000000000000000001245546356100253005ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100265505ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/connector/000077500000000000000000000000001245546356100305425ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/000077500000000000000000000000001245546356100316235ustar00rootroot00000000000000ChecksumCalculatorTest.java000066400000000000000000000130261245546356100370250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; import java.nio.ByteBuffer; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.junit.Before; import org.junit.Test; public class ChecksumCalculatorTest { private static final String SHA1 = "SHA-1"; private static final String MD5 = "MD5"; private File file; private ChecksumCalculator newCalculator( String... algos ) { List checksums = new ArrayList(); for ( String algo : algos ) { checksums.add( new RepositoryLayout.Checksum( algo, URI.create( "irrelevant" ) ) ); } return ChecksumCalculator.newInstance( file, checksums ); } private ByteBuffer toBuffer( String data ) { try { return ByteBuffer.wrap( data.getBytes( "UTF-8" ) ); } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException( e ); } } @Before public void init() throws Exception { file = TestFileUtils.createTempFile( "Hello World!" ); } @Test public void testNoOffset() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.init( 0 ); calculator.update( toBuffer( "Hello World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertEquals( "ed076287532e86365e841e92bfc50d8c", digests.get( MD5 ) ); assertEquals( 2, digests.size() ); } @Test public void testWithOffset() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.init( 6 ); calculator.update( toBuffer( "World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertEquals( "ed076287532e86365e841e92bfc50d8c", digests.get( MD5 ) ); assertEquals( 2, digests.size() ); } @Test public void testWithExcessiveOffset() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.init( 100 ); calculator.update( toBuffer( "World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertTrue( digests.get( SHA1 ) instanceof IOException ); assertTrue( digests.get( MD5 ) instanceof IOException ); assertEquals( 2, digests.size() ); } @Test public void testUnknownAlgorithm() { ChecksumCalculator calculator = newCalculator( "unknown", SHA1 ); calculator.init( 0 ); calculator.update( toBuffer( "Hello World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertTrue( digests.get( "unknown" ) instanceof NoSuchAlgorithmException ); assertEquals( 2, digests.size() ); } @Test public void testNoInitCall() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.update( toBuffer( "Hello World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertEquals( "ed076287532e86365e841e92bfc50d8c", digests.get( MD5 ) ); assertEquals( 2, digests.size() ); } @Test public void testRestart() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.init( 0 ); calculator.update( toBuffer( "Ignored" ) ); calculator.init( 0 ); calculator.update( toBuffer( "Hello World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertEquals( "ed076287532e86365e841e92bfc50d8c", digests.get( MD5 ) ); assertEquals( 2, digests.size() ); } @Test public void testRestartAfterError() { ChecksumCalculator calculator = newCalculator( SHA1, MD5 ); calculator.init( 100 ); calculator.init( 0 ); calculator.update( toBuffer( "Hello World!" ) ); Map digests = calculator.get(); assertNotNull( digests ); assertEquals( "2ef7bde608ce5404e97d5f042f95f89f1c232871", digests.get( SHA1 ) ); assertEquals( "ed076287532e86365e841e92bfc50d8c", digests.get( MD5 ) ); assertEquals( 2, digests.size() ); } } ChecksumValidatorTest.java000066400000000000000000000350451245546356100366660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.internal.test.util.TestFileProcessor; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.transfer.ChecksumFailureException; import org.junit.Before; import org.junit.Test; public class ChecksumValidatorTest { private static class StubChecksumPolicy implements ChecksumPolicy { boolean inspectAll; boolean tolerateFailure; private List callbacks = new ArrayList(); private Object conclusion; public boolean onChecksumMatch( String algorithm, int kind ) { callbacks.add( String.format( "match(%s, %04x)", algorithm, kind ) ); if ( inspectAll ) { if ( conclusion == null ) { conclusion = true; } return false; } return true; } public void onChecksumMismatch( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException { callbacks.add( String.format( "mismatch(%s, %04x)", algorithm, kind ) ); if ( inspectAll ) { conclusion = exception; return; } throw exception; } public void onChecksumError( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException { callbacks.add( String.format( "error(%s, %04x, %s)", algorithm, kind, exception.getCause().getMessage() ) ); } public void onNoMoreChecksums() throws ChecksumFailureException { callbacks.add( String.format( "noMore()" ) ); if ( conclusion instanceof ChecksumFailureException ) { throw (ChecksumFailureException) conclusion; } else if ( !Boolean.TRUE.equals( conclusion ) ) { throw new ChecksumFailureException( "no checksums" ); } } public void onTransferRetry() { callbacks.add( String.format( "retry()" ) ); } public boolean onTransferChecksumFailure( ChecksumFailureException exception ) { callbacks.add( String.format( "fail(%s)", exception.getMessage() ) ); return tolerateFailure; } void assertCallbacks( String... callbacks ) { assertEquals( Arrays.asList( callbacks ), this.callbacks ); } } private static class StubChecksumFetcher implements ChecksumValidator.ChecksumFetcher { Map checksums = new HashMap(); List checksumFiles = new ArrayList(); private List fetchedFiles = new ArrayList(); public boolean fetchChecksum( URI remote, File local ) throws Exception { fetchedFiles.add( remote ); Object checksum = checksums.get( remote ); if ( checksum == null ) { return false; } if ( checksum instanceof Exception ) { throw (Exception) checksum; } TestFileUtils.writeString( local, checksum.toString() ); checksumFiles.add( local ); return true; } void mock( String algo, Object value ) { checksums.put( toUri( algo ), value ); } void assertFetchedFiles( String... algos ) { List expected = new ArrayList(); for ( String algo : algos ) { expected.add( toUri( algo ) ); } assertEquals( expected, fetchedFiles ); } private static URI toUri( String algo ) { return newChecksum( algo ).getLocation(); } } private static final String SHA1 = "SHA-1"; private static final String MD5 = "MD5"; private StubChecksumPolicy policy; private StubChecksumFetcher fetcher; private File dataFile; private static RepositoryLayout.Checksum newChecksum( String algo ) { return RepositoryLayout.Checksum.forLocation( URI.create( "file" ), algo ); } private List newChecksums( String... algos ) { List checksums = new ArrayList(); for ( String algo : algos ) { checksums.add( newChecksum( algo ) ); } return checksums; } private ChecksumValidator newValidator( String... algos ) { return new ChecksumValidator( new TestLoggerFactory().getLogger( "" ), dataFile, new TestFileProcessor(), fetcher, policy, newChecksums( algos ) ); } private Map checksums( String... algoDigestPairs ) { Map checksums = new LinkedHashMap(); for ( int i = 0; i < algoDigestPairs.length; i += 2 ) { String algo = algoDigestPairs[i]; String digest = algoDigestPairs[i + 1]; if ( digest == null ) { checksums.put( algo, new IOException( "error" ) ); } else { checksums.put( algo, digest ); } } return checksums; } @Before public void init() throws Exception { dataFile = TestFileUtils.createTempFile( "" ); dataFile.delete(); policy = new StubChecksumPolicy(); fetcher = new StubChecksumFetcher(); } @Test public void testValidate_NullPolicy() throws Exception { policy = null; ChecksumValidator validator = newValidator( SHA1 ); validator.validate( checksums( SHA1, "ignored" ), null ); fetcher.assertFetchedFiles(); } @Test public void testValidate_AcceptOnFirstMatch() throws Exception { ChecksumValidator validator = newValidator( SHA1 ); fetcher.mock( SHA1, "foo" ); validator.validate( checksums( SHA1, "foo" ), null ); fetcher.assertFetchedFiles( SHA1 ); policy.assertCallbacks( "match(SHA-1, 0000)" ); } @Test public void testValidate_FailOnFirstMismatch() throws Exception { ChecksumValidator validator = newValidator( SHA1 ); fetcher.mock( SHA1, "foo" ); try { validator.validate( checksums( SHA1, "not-foo" ), null ); fail( "expected exception" ); } catch ( ChecksumFailureException e ) { assertEquals( "foo", e.getExpected() ); assertEquals( "not-foo", e.getActual() ); assertTrue( e.isRetryWorthy() ); } fetcher.assertFetchedFiles( SHA1 ); policy.assertCallbacks( "mismatch(SHA-1, 0000)" ); } @Test public void testValidate_AcceptOnEnd() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, "foo" ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( SHA1, "foo", MD5, "bar" ), null ); fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "match(SHA-1, 0000)", "match(MD5, 0000)", "noMore()" ); } @Test public void testValidate_FailOnEnd() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, "foo" ); fetcher.mock( MD5, "bar" ); try { validator.validate( checksums( SHA1, "not-foo", MD5, "bar" ), null ); fail( "expected exception" ); } catch ( ChecksumFailureException e ) { assertEquals( "foo", e.getExpected() ); assertEquals( "not-foo", e.getActual() ); assertTrue( e.isRetryWorthy() ); } fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "mismatch(SHA-1, 0000)", "match(MD5, 0000)", "noMore()" ); } @Test public void testValidate_InlinedBeforeExternal() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, "foo" ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( SHA1, "foo", MD5, "bar" ), checksums( SHA1, "foo", MD5, "bar" ) ); fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "match(SHA-1, 0001)", "match(MD5, 0001)", "match(SHA-1, 0000)", "match(MD5, 0000)", "noMore()" ); } @Test public void testValidate_CaseInsensitive() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1 ); fetcher.mock( SHA1, "FOO" ); validator.validate( checksums( SHA1, "foo" ), checksums( SHA1, "foo" ) ); policy.assertCallbacks( "match(SHA-1, 0001)", "match(SHA-1, 0000)", "noMore()" ); } @Test public void testValidate_MissingRemoteChecksum() throws Exception { ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( MD5, "bar" ), null ); fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "match(MD5, 0000)" ); } @Test public void testValidate_InaccessibleRemoteChecksum() throws Exception { ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, new IOException( "inaccessible" ) ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( MD5, "bar" ), null ); fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "error(SHA-1, 0000, inaccessible)", "match(MD5, 0000)" ); } @Test public void testValidate_InaccessibleLocalChecksum() throws Exception { ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, "foo" ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( SHA1, null, MD5, "bar" ), null ); fetcher.assertFetchedFiles( MD5 ); policy.assertCallbacks( "error(SHA-1, 0000, error)", "match(MD5, 0000)" ); } @Test public void testHandle_Accept() throws Exception { policy.tolerateFailure = true; ChecksumValidator validator = newValidator( SHA1 ); assertEquals( true, validator.handle( new ChecksumFailureException( "accept" ) ) ); policy.assertCallbacks( "fail(accept)" ); } @Test public void testHandle_Reject() throws Exception { policy.tolerateFailure = false; ChecksumValidator validator = newValidator( SHA1 ); assertEquals( false, validator.handle( new ChecksumFailureException( "reject" ) ) ); policy.assertCallbacks( "fail(reject)" ); } @Test public void testRetry_ResetPolicy() throws Exception { ChecksumValidator validator = newValidator( SHA1 ); validator.retry(); policy.assertCallbacks( "retry()" ); } @Test public void testRetry_RemoveTempFiles() throws Exception { ChecksumValidator validator = newValidator( SHA1 ); fetcher.mock( SHA1, "foo" ); validator.validate( checksums( SHA1, "foo" ), null ); fetcher.assertFetchedFiles( SHA1 ); assertEquals( 1, fetcher.checksumFiles.size() ); for ( File file : fetcher.checksumFiles ) { assertTrue( file.getAbsolutePath(), file.isFile() ); } validator.retry(); for ( File file : fetcher.checksumFiles ) { assertFalse( file.getAbsolutePath(), file.exists() ); } } @Test public void testCommit_SaveChecksumFiles() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( SHA1, "foo", MD5, "bar" ), checksums( SHA1, "foo" ) ); assertEquals( 1, fetcher.checksumFiles.size() ); for ( File file : fetcher.checksumFiles ) { assertTrue( file.getAbsolutePath(), file.isFile() ); } validator.commit(); File checksumFile = new File( dataFile.getPath() + ".sha1" ); assertTrue( checksumFile.getAbsolutePath(), checksumFile.isFile() ); assertEquals( "foo", TestFileUtils.readString( checksumFile ) ); checksumFile = new File( dataFile.getPath() + ".md5" ); assertTrue( checksumFile.getAbsolutePath(), checksumFile.isFile() ); assertEquals( "bar", TestFileUtils.readString( checksumFile ) ); for ( File file : fetcher.checksumFiles ) { assertFalse( file.getAbsolutePath(), file.exists() ); } } @Test public void testClose_RemoveTempFiles() throws Exception { ChecksumValidator validator = newValidator( SHA1 ); fetcher.mock( SHA1, "foo" ); validator.validate( checksums( SHA1, "foo" ), null ); fetcher.assertFetchedFiles( SHA1 ); assertEquals( 1, fetcher.checksumFiles.size() ); for ( File file : fetcher.checksumFiles ) { assertTrue( file.getAbsolutePath(), file.isFile() ); } validator.close(); for ( File file : fetcher.checksumFiles ) { assertFalse( file.getAbsolutePath(), file.exists() ); } } } PartialFileTest.java000066400000000000000000000236231245546356100354510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.connector.basic; import static org.junit.Assert.*; import static org.junit.Assume.*; import java.io.Closeable; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileLock; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.concurrent.CountDownLatch; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.junit.After; import org.junit.Before; import org.junit.Test; public class PartialFileTest { private static class StubRemoteAccessChecker implements PartialFile.RemoteAccessChecker { Exception exception; int invocations; public void checkRemoteAccess() throws Exception { invocations++; if ( exception != null ) { throw exception; } } } private static class ConcurrentWriter extends Thread { private final File dstFile; private final File partFile; private final File lockFile; private final CountDownLatch locked; private final int sleep; volatile int length; Exception error; public ConcurrentWriter( File dstFile, int sleep, int length ) throws InterruptedException { super( "ConcurrentWriter-" + dstFile.getAbsolutePath() ); this.dstFile = dstFile; partFile = new File( dstFile.getPath() + PartialFile.EXT_PART ); lockFile = new File( partFile.getPath() + PartialFile.EXT_LOCK ); this.sleep = sleep; this.length = length; locked = new CountDownLatch( 1 ); start(); locked.await(); } @Override public void run() { try { RandomAccessFile raf = new RandomAccessFile( lockFile, "rw" ); try { FileLock lock = raf.getChannel().lock( 0, 1, false ); locked.countDown(); FileOutputStream fos = new FileOutputStream( partFile ); try { for ( int i = 0, n = Math.abs( length ); i < n; i++ ) { for ( long start = System.currentTimeMillis(); System.currentTimeMillis() - start < sleep; ) { Thread.sleep( 10 ); } fos.write( 65 ); fos.flush(); System.out.println( " " + System.currentTimeMillis() + " Wrote byte " + ( i + 1 ) + "/" + n ); } if ( length >= 0 && !dstFile.setLastModified( System.currentTimeMillis() ) ) { throw new IOException( "Could not update destination file" ); } } finally { fos.close(); } lock.release(); } finally { raf.close(); lockFile.delete(); } } catch ( Exception e ) { error = e; } } } private static final boolean PROPER_LOCK_SUPPORT; static { String javaVersion = System.getProperty( "java.version" ).trim(); boolean notJava5 = !javaVersion.startsWith( "1.5." ); String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH ); boolean windows = osName.contains( "windows" ); PROPER_LOCK_SUPPORT = notJava5 || windows; } private StubRemoteAccessChecker remoteAccessChecker; private File dstFile; private File partFile; private File lockFile; private List closeables; private PartialFile newPartialFile( long resumeThreshold, int requestTimeout ) throws Exception { PartialFile.Factory factory = new PartialFile.Factory( resumeThreshold >= 0, resumeThreshold, requestTimeout, new TestLoggerFactory().getLogger( "" ) ); PartialFile partFile = factory.newInstance( dstFile, remoteAccessChecker ); if ( partFile != null ) { closeables.add( partFile ); } return partFile; } @Before public void init() throws Exception { closeables = new ArrayList(); remoteAccessChecker = new StubRemoteAccessChecker(); dstFile = TestFileUtils.createTempFile( "Hello World!" ); partFile = new File( dstFile.getPath() + PartialFile.EXT_PART ); lockFile = new File( partFile.getPath() + PartialFile.EXT_LOCK ); } @After public void exit() { for ( Closeable closeable : closeables ) { try { closeable.close(); } catch ( Exception e ) { e.printStackTrace(); } } } @Test public void testCloseNonResumableFile() throws Exception { PartialFile partialFile = newPartialFile( -1, 100 ); assertNotNull( partialFile ); assertNotNull( partialFile.getFile() ); assertTrue( partialFile.getFile().getAbsolutePath(), partialFile.getFile().isFile() ); partialFile.close(); assertFalse( partialFile.getFile().getAbsolutePath(), partialFile.getFile().exists() ); } @Test public void testCloseResumableFile() throws Exception { PartialFile partialFile = newPartialFile( 0, 100 ); assertNotNull( partialFile ); assertNotNull( partialFile.getFile() ); assertTrue( partialFile.getFile().getAbsolutePath(), partialFile.getFile().isFile() ); assertEquals( partFile, partialFile.getFile() ); assertTrue( lockFile.getAbsolutePath(), lockFile.isFile() ); partialFile.close(); assertTrue( partialFile.getFile().getAbsolutePath(), partialFile.getFile().isFile() ); assertFalse( lockFile.getAbsolutePath(), lockFile.exists() ); } @Test public void testResumableFileCreationError() throws Exception { assertTrue( partFile.getAbsolutePath(), partFile.mkdirs() ); PartialFile partialFile = newPartialFile( 0, 100 ); assertNotNull( partialFile ); assertFalse( partialFile.isResume() ); assertFalse( lockFile.getAbsolutePath(), lockFile.exists() ); } @Test public void testResumeThreshold() throws Exception { PartialFile partialFile = newPartialFile( 0, 100 ); assertNotNull( partialFile ); assertTrue( partialFile.isResume() ); partialFile.close(); partialFile = newPartialFile( 1, 100 ); assertNotNull( partialFile ); assertFalse( partialFile.isResume() ); partialFile.close(); } @Test( timeout = 10000 ) public void testResumeConcurrently_RequestTimeout() throws Exception { assumeTrue( PROPER_LOCK_SUPPORT ); ConcurrentWriter writer = new ConcurrentWriter( dstFile, 5 * 1000, 1 ); try { newPartialFile( 0, 1000 ); fail( "expected exception" ); } catch ( Exception e ) { assertTrue( e.getMessage().contains( "Timeout" ) ); } writer.interrupt(); writer.join(); } @Test( timeout = 10000 ) public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterSucceeds() throws Exception { assumeTrue( PROPER_LOCK_SUPPORT ); assertTrue( dstFile.setLastModified( System.currentTimeMillis() - 60 * 1000 ) ); ConcurrentWriter writer = new ConcurrentWriter( dstFile, 100, 10 ); assertNull( newPartialFile( 0, 500 ) ); writer.join(); assertNull( writer.error ); assertEquals( 1, remoteAccessChecker.invocations ); } @Test( timeout = 10000 ) public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterFails() throws Exception { assumeTrue( PROPER_LOCK_SUPPORT ); assertTrue( dstFile.setLastModified( System.currentTimeMillis() - 60 * 1000 ) ); ConcurrentWriter writer = new ConcurrentWriter( dstFile, 100, -10 ); PartialFile partialFile = newPartialFile( 0, 500 ); assertNotNull( partialFile ); assertTrue( partialFile.isResume() ); writer.join(); assertNull( writer.error ); assertEquals( 1, remoteAccessChecker.invocations ); } @Test( timeout = 10000 ) public void testResumeConcurrently_CheckRemoteAccess() throws Exception { assumeTrue( PROPER_LOCK_SUPPORT ); remoteAccessChecker.exception = new IOException( "missing" ); ConcurrentWriter writer = new ConcurrentWriter( dstFile, 1000, 1 ); try { newPartialFile( 0, 1000 ); fail( "expected exception" ); } catch ( Exception e ) { assertSame( remoteAccessChecker.exception, e ); } writer.interrupt(); writer.join(); } } aether-1.0.2.v20150114/aether-impl/000077500000000000000000000000001245546356100162665ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/pom.xml000066400000000000000000000064421245546356100176110ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-impl Aether Implementation An implementation of the repository system. org.eclipse.aether.impl org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util javax.inject javax.inject provided true org.eclipse.sisu org.eclipse.sisu.inject provided true org.sonatype.sisu sisu-guice no_aop provided true org.slf4j slf4j-api provided true junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.codehaus.mojo animal-sniffer-maven-plugin org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin com.google.inject.*;version="[1.3,2)",* aether-1.0.2.v20150114/aether-impl/src/000077500000000000000000000000001245546356100170555ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/000077500000000000000000000000001245546356100200015ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/000077500000000000000000000000001245546356100207225ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/000077500000000000000000000000001245546356100215115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/000077500000000000000000000000001245546356100231355ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100244055ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/000077500000000000000000000000001245546356100253465ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java000066400000000000000000000021361245546356100305710ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2011, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; /** * A ready-made Guice module that sets up bindings for all components from this library. To acquire a complete * repository system, clients need to bind an artifact descriptor reader, a version resolver, a version range resolver, * zero or more metadata generator factories, some repository connector and transporter factories to access remote * repositories. * * @deprecated Use {@link org.eclipse.aether.impl.guice.AetherModule} instead. */ @Deprecated public final class AetherModule extends org.eclipse.aether.impl.guice.AetherModule { } ArtifactDescriptorReader.java000066400000000000000000000041141245546356100330510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; /** * Provides information about an artifact that is relevant to transitive dependency resolution. Each artifact is expected * to have an accompanying artifact descriptor that among others lists the direct dependencies of the artifact. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface ArtifactDescriptorReader { /** * Gets information about an artifact like its direct dependencies and potential relocations. Implementations must * respect the {@link RepositorySystemSession#getArtifactDescriptorPolicy() artifact descriptor policy} of the * session when dealing with certain error cases. * * @param session The repository session, must not be {@code null}. * @param request The descriptor request, must not be {@code null} * @return The descriptor result, never {@code null}. * @throws ArtifactDescriptorException If the artifact descriptor could not be read. * @see RepositorySystem#readArtifactDescriptor(RepositorySystemSession, ArtifactDescriptorRequest) */ ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java000066400000000000000000000062011245546356100314670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.util.Collection; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; /** * Resolves artifacts, that is gets a local filesystem path to their binary contents. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface ArtifactResolver { /** * Resolves the path for an artifact. The artifact will be downloaded to the local repository if necessary. An * artifact that is already resolved will be skipped and is not re-resolved. Note that this method assumes that any * relocations have already been processed and the artifact coordinates are used as-is. * * @param session The repository session, must not be {@code null}. * @param request The resolution request, must not be {@code null}. * @return The resolution result, never {@code null}. * @throws ArtifactResolutionException If the artifact could not be resolved. * @see Artifact#getFile() * @see RepositorySystem#resolveArtifact(RepositorySystemSession, ArtifactRequest) */ ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException; /** * Resolves the paths for a collection of artifacts. Artifacts will be downloaded to the local repository if * necessary. Artifacts that are already resolved will be skipped and are not re-resolved. Note that this method * assumes that any relocations have already been processed and the artifact coordinates are used as-is. * * @param session The repository session, must not be {@code null}. * @param requests The resolution requests, must not be {@code null}. * @return The resolution results (in request order), never {@code null}. * @throws ArtifactResolutionException If any artifact could not be resolved. * @see Artifact#getFile() * @see RepositorySystem#resolveArtifacts(RepositorySystemSession, Collection) */ List resolveArtifacts( RepositorySystemSession session, Collection requests ) throws ArtifactResolutionException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java000066400000000000000000000322121245546356100324420ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; import org.eclipse.aether.internal.impl.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.DefaultDeployer; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.impl.DefaultInstaller; import org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider; import org.eclipse.aether.internal.impl.DefaultMetadataResolver; import org.eclipse.aether.internal.impl.DefaultOfflineController; import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager; import org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider; import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher; import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider; import org.eclipse.aether.internal.impl.DefaultRepositorySystem; import org.eclipse.aether.internal.impl.DefaultSyncContextFactory; import org.eclipse.aether.internal.impl.DefaultTransporterProvider; import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; import org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer; import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.LoggerFactory; /** * A simple service locator that is already setup with all components from this library. To acquire a complete * repository system, clients need to add an artifact descriptor reader, a version resolver, a version range resolver * and optionally some repository connector and transporter factories to access remote repositories. Once the locator is * fully populated, the repository system can be created like this: * *
 * RepositorySystem repoSystem = serviceLocator.getService( RepositorySystem.class );
 * 
* * Note: This class is not thread-safe. Clients are expected to create the service locator and the repository * system on a single thread. */ public final class DefaultServiceLocator implements ServiceLocator { private class Entry { private final Class type; private final Collection providers; private List instances; public Entry( Class type ) { if ( type == null ) { throw new IllegalArgumentException( "service type not specified" ); } this.type = type; providers = new LinkedHashSet( 8 ); } public synchronized void setServices( T... services ) { providers.clear(); if ( services != null ) { for ( T service : services ) { if ( service == null ) { throw new IllegalArgumentException( "service instance not specified" ); } providers.add( service ); } } instances = null; } public synchronized void setService( Class impl ) { providers.clear(); addService( impl ); } public synchronized void addService( Class impl ) { if ( impl == null ) { throw new IllegalArgumentException( "implementation class not specified" ); } providers.add( impl ); instances = null; } public T getInstance() { List instances = getInstances(); return instances.isEmpty() ? null : instances.get( 0 ); } public synchronized List getInstances() { if ( instances == null ) { instances = new ArrayList( providers.size() ); for ( Object provider : providers ) { T instance; if ( provider instanceof Class ) { instance = newInstance( (Class) provider ); } else { instance = type.cast( provider ); } if ( instance != null ) { instances.add( instance ); } } instances = Collections.unmodifiableList( instances ); } return instances; } private T newInstance( Class impl ) { try { Constructor constr = impl.getDeclaredConstructor(); if ( !Modifier.isPublic( constr.getModifiers() ) ) { constr.setAccessible( true ); } Object obj = constr.newInstance(); T instance = type.cast( obj ); if ( instance instanceof Service ) { ( (Service) instance ).initService( DefaultServiceLocator.this ); } return instance; } catch ( Exception e ) { serviceCreationFailed( type, impl, e ); } catch ( LinkageError e ) { serviceCreationFailed( type, impl, e ); } return null; } } private final Map, Entry> entries; private ErrorHandler errorHandler; /** * Creates a new service locator that already knows about all service implementations included this library. */ public DefaultServiceLocator() { entries = new HashMap, Entry>(); addService( RepositorySystem.class, DefaultRepositorySystem.class ); addService( ArtifactResolver.class, DefaultArtifactResolver.class ); addService( DependencyCollector.class, DefaultDependencyCollector.class ); addService( Deployer.class, DefaultDeployer.class ); addService( Installer.class, DefaultInstaller.class ); addService( MetadataResolver.class, DefaultMetadataResolver.class ); addService( RepositoryLayoutProvider.class, DefaultRepositoryLayoutProvider.class ); addService( RepositoryLayoutFactory.class, Maven2RepositoryLayoutFactory.class ); addService( TransporterProvider.class, DefaultTransporterProvider.class ); addService( ChecksumPolicyProvider.class, DefaultChecksumPolicyProvider.class ); addService( RepositoryConnectorProvider.class, DefaultRepositoryConnectorProvider.class ); addService( RemoteRepositoryManager.class, DefaultRemoteRepositoryManager.class ); addService( UpdateCheckManager.class, DefaultUpdateCheckManager.class ); addService( UpdatePolicyAnalyzer.class, DefaultUpdatePolicyAnalyzer.class ); addService( FileProcessor.class, DefaultFileProcessor.class ); addService( SyncContextFactory.class, DefaultSyncContextFactory.class ); addService( RepositoryEventDispatcher.class, DefaultRepositoryEventDispatcher.class ); addService( OfflineController.class, DefaultOfflineController.class ); addService( LocalRepositoryProvider.class, DefaultLocalRepositoryProvider.class ); addService( LocalRepositoryManagerFactory.class, SimpleLocalRepositoryManagerFactory.class ); addService( LocalRepositoryManagerFactory.class, EnhancedLocalRepositoryManagerFactory.class ); if ( Slf4jLoggerFactory.isSlf4jAvailable() ) { addService( LoggerFactory.class, Slf4jLoggerFactory.class ); } } private Entry getEntry( Class type, boolean create ) { if ( type == null ) { throw new IllegalArgumentException( "service type not specified" ); } @SuppressWarnings( "unchecked" ) Entry entry = (Entry) entries.get( type ); if ( entry == null && create ) { entry = new Entry( type ); entries.put( type, entry ); } return entry; } /** * Sets the implementation class for a service. The specified class must have a no-arg constructor (of any * visibility). If the service implementation itself requires other services for its operation, it should implement * {@link Service} to gain access to this service locator. * * @param The service type. * @param type The interface describing the service, must not be {@code null}. * @param impl The implementation class of the service, must not be {@code null}. * @return This locator for chaining, never {@code null}. */ public DefaultServiceLocator setService( Class type, Class impl ) { getEntry( type, true ).setService( impl ); return this; } /** * Adds an implementation class for a service. The specified class must have a no-arg constructor (of any * visibility). If the service implementation itself requires other services for its operation, it should implement * {@link Service} to gain access to this service locator. * * @param The service type. * @param type The interface describing the service, must not be {@code null}. * @param impl The implementation class of the service, must not be {@code null}. * @return This locator for chaining, never {@code null}. */ public DefaultServiceLocator addService( Class type, Class impl ) { getEntry( type, true ).addService( impl ); return this; } /** * Sets the instances for a service. * * @param The service type. * @param type The interface describing the service, must not be {@code null}. * @param services The instances of the service, may be {@code null} but must not contain {@code null} elements. * @return This locator for chaining, never {@code null}. */ public DefaultServiceLocator setServices( Class type, T... services ) { getEntry( type, true ).setServices( services ); return this; } public T getService( Class type ) { Entry entry = getEntry( type, false ); return ( entry != null ) ? entry.getInstance() : null; } public List getServices( Class type ) { Entry entry = getEntry( type, false ); return ( entry != null ) ? entry.getInstances() : null; } private void serviceCreationFailed( Class type, Class impl, Throwable exception ) { if ( errorHandler != null ) { errorHandler.serviceCreationFailed( type, impl, exception ); } } /** * Sets the error handler to use. * * @param errorHandler The error handler to use, may be {@code null} to ignore/swallow errors. */ public void setErrorHandler( ErrorHandler errorHandler ) { this.errorHandler = errorHandler; } /** * A hook to customize the handling of errors encountered while locating a service implementation. */ public static abstract class ErrorHandler { /** * Handles errors during creation of a service. The default implemention does nothing. * * @param type The interface describing the service, must not be {@code null}. * @param impl The implementation class of the service, must not be {@code null}. * @param exception The error that occurred while trying to instantiate the implementation class, must not be * {@code null}. */ public void serviceCreationFailed( Class type, Class impl, Throwable exception ) { } } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java000066400000000000000000000047221245546356100321430ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionException; /** * Given a collection of direct dependencies, recursively gathers their transitive dependencies and calculates the * dependency graph. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface DependencyCollector { /** * Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is * only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the * artifact files. The supplied session carries various hooks to customize the dependency graph that must be invoked * throughout the operation. * * @param session The repository session, must not be {@code null}. * @param request The collection request, must not be {@code null}. * @return The collection result, never {@code null}. * @throws DependencyCollectionException If the dependency tree could not be built. * @see RepositorySystemSession#getDependencyTraverser() * @see RepositorySystemSession#getDependencyManager() * @see RepositorySystemSession#getDependencySelector() * @see RepositorySystemSession#getVersionFilter() * @see RepositorySystemSession#getDependencyGraphTransformer() * @see RepositorySystem#collectDependencies(RepositorySystemSession, CollectRequest) */ CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/Deployer.java000066400000000000000000000035061245546356100300000ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; /** * Publishes artifacts to a remote repository. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface Deployer { /** * Uploads a collection of artifacts and their accompanying metadata to a remote repository. * * @param session The repository session, must not be {@code null}. * @param request The deployment request, must not be {@code null}. * @return The deployment result, never {@code null}. * @throws DeploymentException If any artifact/metadata from the request could not be deployed. * @see RepositorySystem#deploy(RepositorySystemSession, DeployRequest) * @see MetadataGeneratorFactory#newInstance(RepositorySystemSession, DeployRequest) */ DeployResult deploy( RepositorySystemSession session, DeployRequest request ) throws DeploymentException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/Installer.java000066400000000000000000000035431245546356100301530ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; /** * Publishes artifacts to the local repository. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface Installer { /** * Installs a collection of artifacts and their accompanying metadata to the local repository. * * @param session The repository session, must not be {@code null}. * @param request The installation request, must not be {@code null}. * @return The installation result, never {@code null}. * @throws InstallationException If any artifact/metadata from the request could not be installed. * @see RepositorySystem#install(RepositorySystemSession, InstallRequest) * @see MetadataGeneratorFactory#newInstance(RepositorySystemSession, InstallRequest) */ InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException; } LocalRepositoryProvider.java000066400000000000000000000044551245546356100330070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; /** * Retrieves a local repository manager from the installed local repository manager factories. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface LocalRepositoryProvider { /** * Creates a new manager for the specified local repository. If the specified local repository has no type, the * default local repository type of the system will be used. Note: It is expected that this method * invocation is one of the last steps of setting up a new session, in particular any configuration properties * should have been set already. * * @param session The repository system session from which to configure the manager, must not be {@code null}. * @param localRepository The local repository to create a manager for, must not be {@code null}. * @return The local repository manager, never {@code null}. * @throws NoLocalRepositoryManagerException If the specified repository type is not recognized or no base directory * is given. * @see RepositorySystem#newLocalRepositoryManager(RepositorySystemSession, LocalRepository) */ LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session, LocalRepository localRepository ) throws NoLocalRepositoryManagerException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java000066400000000000000000000037411245546356100316050ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.util.Collection; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * A metadata generator that participates in the installation/deployment of artifacts. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface MetadataGenerator { /** * Prepares the generator to transform artifacts. * * @param artifacts The artifacts to install/deploy, must not be {@code null}. * @return The metadata to process (e.g. merge with existing metadata) before artifact transformations, never * {@code null}. */ Collection prepare( Collection artifacts ); /** * Enables the metadata generator to transform the specified artifact. * * @param artifact The artifact to transform, must not be {@code null}. * @return The transformed artifact (or just the input artifact), never {@code null}. */ Artifact transformArtifact( Artifact artifact ); /** * Allows for metadata generation based on the transformed artifacts. * * @param artifacts The (transformed) artifacts to install/deploy, must not be {@code null}. * @return The additional metadata to process after artifact transformations, never {@code null}. */ Collection finish( Collection artifacts ); } MetadataGeneratorFactory.java000066400000000000000000000042571245546356100330610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.installation.InstallRequest; /** * A factory to create metadata generators. Metadata generators can contribute additional metadata during the * installation/deployment of artifacts. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface MetadataGeneratorFactory { /** * Creates a new metadata generator for the specified install request. * * @param session The repository system session from which to configure the generator, must not be {@code null}. * @param request The install request the metadata generator is used for, must not be {@code null}. * @return The metadata generator for the request or {@code null} if none. */ MetadataGenerator newInstance( RepositorySystemSession session, InstallRequest request ); /** * Creates a new metadata generator for the specified deploy request. * * @param session The repository system session from which to configure the generator, must not be {@code null}. * @param request The deploy request the metadata generator is used for, must not be {@code null}. * @return The metadata generator for the request or {@code null} if none. */ MetadataGenerator newInstance( RepositorySystemSession session, DeployRequest request ); /** * The priority of this factory. Factories with higher priority are invoked before those with lower priority. * * @return The priority of this factory. */ float getPriority(); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java000066400000000000000000000036671245546356100314670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.util.Collection; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; /** * Resolves metadata, that is gets a local filesystem path to their binary contents. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface MetadataResolver { /** * Resolves the paths for a collection of metadata. Metadata will be downloaded to the local repository if * necessary, e.g. because it hasn't been cached yet or the cache is deemed outdated. * * @param session The repository session, must not be {@code null}. * @param requests The resolution requests, must not be {@code null}. * @return The resolution results (in request order), never {@code null}. * @see Metadata#getFile() * @see RepositorySystem#resolveMetadata(RepositorySystemSession, Collection) */ List resolveMetadata( RepositorySystemSession session, Collection requests ); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java000066400000000000000000000045061245546356100316440ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.RepositoryOfflineException; /** * Determines whether a remote repository is accessible in offline mode. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface OfflineController { /** * Determines whether the specified repository is accessible if the system was in offline mode. A simple * implementation might unconditionally throw {@link RepositoryOfflineException} to block all remote repository * access when in offline mode. More sophisticated implementations might inspect * {@link RepositorySystemSession#getConfigProperties() configuration properties} of the session to check for some * kind of whitelist that allows certain remote repositories even when offline. At any rate, the session's current * {@link RepositorySystemSession#isOffline() offline state} is irrelevant to the outcome of the check. * * @param session The repository session during which the check is made, must not be {@code null}. * @param repository The remote repository to check for offline access, must not be {@code null}. * @throws RepositoryOfflineException If the repository is not accessible in offline mode. If the method returns * normally, the repository is considered accessible even in offline mode. * @see RepositorySystemSession#isOffline() */ void checkOffline( RepositorySystemSession session, RemoteRepository repository ) throws RepositoryOfflineException; } RemoteRepositoryManager.java000066400000000000000000000066371245546356100327740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; /** * Helps dealing with remote repository definitions. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface RemoteRepositoryManager { /** * Aggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and * authentication settings from the supplied session. * * @param session The repository session during which the repositories will be accessed, must not be {@code null}. * @param dominantRepositories The current list of remote repositories to merge the new definitions into, must not * be {@code null}. * @param recessiveRepositories The remote repositories to merge into the existing list, must not be {@code null}. * @param recessiveIsRaw {@code true} if the recessive repository definitions have not yet been subjected to mirror, * proxy and authentication settings, {@code false} otherwise. * @return The aggregated list of remote repositories, never {@code null}. * @see RepositorySystemSession#getMirrorSelector() * @see RepositorySystemSession#getProxySelector() * @see RepositorySystemSession#getAuthenticationSelector() */ List aggregateRepositories( RepositorySystemSession session, List dominantRepositories, List recessiveRepositories, boolean recessiveIsRaw ); /** * Gets the effective repository policy for the specified remote repository by merging the applicable * snapshot/release policy of the repository with global settings from the supplied session. * * @param session The repository session during which the repository will be accessed, must not be {@code null}. * @param repository The remote repository to determine the effective policy for, must not be {@code null}. * @param releases {@code true} if the policy for release artifacts needs to be considered, {@code false} if not. * @param snapshots {@code true} if the policy for snapshot artifacts needs to be considered, {@code false} if not. * @return The effective repository policy, never {@code null}. * @see RepositorySystemSession#getChecksumPolicy() * @see RepositorySystemSession#getUpdatePolicy() */ RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ); } RepositoryConnectorProvider.java000066400000000000000000000035531245546356100337050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.transfer.NoRepositoryConnectorException; /** * Retrieves a repository connector from the installed repository connector factories. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface RepositoryConnectorProvider { /** * Tries to create a repository connector for the specified remote repository. * * @param session The repository system session from which to configure the connector, must not be {@code null}. * @param repository The remote repository to create a connector for, must not be {@code null}. * @return The connector for the given repository, never {@code null}. * @throws NoRepositoryConnectorException If no available factory can create a connector for the specified remote * repository. */ RepositoryConnector newRepositoryConnector( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryConnectorException; } RepositoryEventDispatcher.java000066400000000000000000000022411245546356100333210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositoryEvent; /** * Dispatches repository events to registered listeners. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface RepositoryEventDispatcher { /** * Dispatches the specified repository event to all registered listeners. * * @param event The event to dispatch, must not be {@code null}. */ void dispatch( RepositoryEvent event ); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java000066400000000000000000000031331245546356100320220ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.SyncContext; /** * A factory to create synchronization contexts. A synchronization context is used to coordinate concurrent access to * artifacts or metadata. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface SyncContextFactory { /** * Creates a new synchronization context. * * @param session The repository session during which the context will be used, must not be {@code null}. * @param shared A flag indicating whether access to the artifacts/metadata associated with the new context can be * shared among concurrent readers or whether access needs to be exclusive to the calling thread. * @return The synchronization context, never {@code null}. * @see RepositorySystem#newSyncContext(RepositorySystemSession, boolean) */ SyncContext newInstance( RepositorySystemSession session, boolean shared ); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java000066400000000000000000000203261245546356100303740ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import java.io.File; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; /** * A request to check if an update of an artifact/metadata from a remote repository is needed. * * @see UpdateCheckManager * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public final class UpdateCheck { private long localLastUpdated; private T item; private File file; private boolean fileValid = true; private String policy; private RemoteRepository repository; private RemoteRepository authoritativeRepository; private boolean required; private E exception; /** * Creates an uninitialized update check request. */ public UpdateCheck() { } /** * Gets the last-modified timestamp of the corresponding item produced by a local installation. If non-zero, a * remote update will be surpressed if the local item is up-to-date, even if the remote item has not been cached * locally. * * @return The last-modified timestamp of the corresponding item produced by a local installation or {@code 0} to * ignore any local item. */ public long getLocalLastUpdated() { return localLastUpdated; } /** * Sets the last-modified timestamp of the corresponding item produced by a local installation. If non-zero, a * remote update will be surpressed if the local item is up-to-date, even if the remote item has not been cached * locally. * * @param localLastUpdated The last-modified timestamp of the corresponding item produced by a local installation or * {@code 0} to ignore any local item. * @return This object for chaining. */ public UpdateCheck setLocalLastUpdated( long localLastUpdated ) { this.localLastUpdated = localLastUpdated; return this; } /** * Gets the item of the check. * * @return The item of the check, never {@code null}. */ public T getItem() { return item; } /** * Sets the item of the check. * * @param item The item of the check, must not be {@code null}. * @return This object for chaining. */ public UpdateCheck setItem( T item ) { this.item = item; return this; } /** * Returns the local file of the item. * * @return The local file of the item. */ public File getFile() { return file; } /** * Sets the local file of the item. * * @param file The file of the item, never {@code null} . * @return This object for chaining. */ public UpdateCheck setFile( File file ) { this.file = file; return this; } /** * Indicates whether the local file given by {@link #getFile()}, if existent, should be considered valid or not. An * invalid file is equivalent to a physically missing file. * * @return {@code true} if the file should be considered valid if existent, {@code false} if the file should be * treated as if it was missing. */ public boolean isFileValid() { return fileValid; } /** * Controls whether the local file given by {@link #getFile()}, if existent, should be considered valid or not. An * invalid file is equivalent to a physically missing file. * * @param fileValid {@code true} if the file should be considered valid if existent, {@code false} if the file * should be treated as if it was missing. * @return This object for chaining. */ public UpdateCheck setFileValid( boolean fileValid ) { this.fileValid = fileValid; return this; } /** * Gets the policy to use for the check. * * @return The policy to use for the check. * @see org.eclipse.aether.repository.RepositoryPolicy */ public String getPolicy() { return policy; } /** * Sets the policy to use for the check. * * @param policy The policy to use for the check, may be {@code null}. * @return This object for chaining. * @see org.eclipse.aether.repository.RepositoryPolicy */ public UpdateCheck setPolicy( String policy ) { this.policy = policy; return this; } /** * Gets the repository from which a potential update/download will performed. * * @return The repository to use for the check. */ public RemoteRepository getRepository() { return repository; } /** * Sets the repository from which a potential update/download will performed. * * @param repository The repository to use for the check, must not be {@code null}. * @return This object for chaining. */ public UpdateCheck setRepository( RemoteRepository repository ) { this.repository = repository; return this; } /** * Gets the repository which ultimately hosts the metadata to update. This will be different from the repository * given by {@link #getRepository()} in case the latter denotes a repository manager. * * @return The actual repository hosting the authoritative copy of the metadata to update, never {@code null} for a * metadata update check. */ public RemoteRepository getAuthoritativeRepository() { return authoritativeRepository != null ? authoritativeRepository : repository; } /** * Sets the repository which ultimately hosts the metadata to update. This will be different from the repository * given by {@link #getRepository()} in case the latter denotes a repository manager. * * @param authoritativeRepository The actual repository hosting the authoritative copy of the metadata to update, * must not be {@code null} for a metadata update check. * @return This object for chaining. */ public UpdateCheck setAuthoritativeRepository( RemoteRepository authoritativeRepository ) { this.authoritativeRepository = authoritativeRepository; return this; } /** * Gets the result of a check, denoting whether the remote repository should be checked for updates. * * @return The result of a check. */ public boolean isRequired() { return required; } /** * Sets the result of an update check. * * @param required The result of an update check. In case of {@code false} and the local file given by * {@link #getFile()} does actually not exist, {@link #setException(RepositoryException)} should be used * to provide the previous/cached failure that explains the absence of the file. * @return This object for chaining. */ public UpdateCheck setRequired( boolean required ) { this.required = required; return this; } /** * Gets the exception that occurred during the update check. * * @return The occurred exception or {@code null} if the update check was successful. */ public E getException() { return exception; } /** * Sets the exception for this update check. * * @param exception The exception for this update check, may be {@code null} if the check was successful. * @return This object for chaining. */ public UpdateCheck setException( E exception ) { this.exception = exception; return this; } @Override public String toString() { return getPolicy() + ": " + getFile() + " < " + getRepository(); } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java000066400000000000000000000054021245546356100316650ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataTransferException; /** * Determines if updates of artifacts and metadata from remote repositories are needed. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface UpdateCheckManager { /** * Checks whether an artifact has to be updated from a remote repository. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param check The update check request, must not be {@code null}. */ void checkArtifact( RepositorySystemSession session, UpdateCheck check ); /** * Updates the timestamp for the artifact contained in the update check. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param check The update check request, must not be {@code null}. */ void touchArtifact( RepositorySystemSession session, UpdateCheck check ); /** * Checks whether metadata has to be updated from a remote repository. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param check The update check request, must not be {@code null}. */ void checkMetadata( RepositorySystemSession session, UpdateCheck check ); /** * Updates the timestamp for the metadata contained in the update check. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param check The update check request, must not be {@code null}. */ void touchMetadata( RepositorySystemSession session, UpdateCheck check ); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java000066400000000000000000000040541245546356100323240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; /** * Evaluates update policies. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface UpdatePolicyAnalyzer { /** * Returns the policy with the shorter update interval. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param policy1 A policy to compare, may be {@code null}. * @param policy2 A policy to compare, may be {@code null}. * @return The policy with the shorter update interval. */ String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ); /** * Determines whether the specified modification timestamp satisfies the freshness constraint expressed by the given * update policy. * * @param session The repository system session during which the check is made, must not be {@code null}. * @param lastModified The timestamp to check against the update policy. * @param policy The update policy, may be {@code null}. * @return {@code true} if the specified timestamp is older than acceptable by the update policy, {@code false} * otherwise. */ boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy ); } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java000066400000000000000000000044471245546356100323460ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; /** * Parses and evaluates version ranges encountered in dependency declarations. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface VersionRangeResolver { /** * Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to * "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their * contents, the list is not processed by the {@link RepositorySystemSession#getVersionFilter() session's version * filter}. *

* The supplied request may also refer to a single concrete version rather than a version range. In this case * though, the result contains simply the (parsed) input version, regardless of the repositories and their contents. * * @param session The repository session, must not be {@code null}. * @param request The version range request, must not be {@code null}. * @return The version range result, never {@code null}. * @throws VersionRangeResolutionException If the requested range could not be parsed. Note that an empty range does * not raise an exception. * @see RepositorySystem#resolveVersionRange(RepositorySystemSession, VersionRangeRequest) */ VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java000066400000000000000000000032731245546356100313650ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; /** * Evaluates artifact meta/pseudo versions. * * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ public interface VersionResolver { /** * Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to * "1.0-20090208.132618-23" or "RELEASE"/"LATEST" to "2.0". * * @param session The repository session, must not be {@code null}. * @param request The version request, must not be {@code null} * @return The version result, never {@code null}. * @throws VersionResolutionException If the metaversion could not be resolved. * @see RepositorySystem#resolveVersion(RepositorySystemSession, VersionRequest) */ VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException; } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/guice/000077500000000000000000000000001245546356100264425ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java000066400000000000000000000214021245546356100316620ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2011, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl.guice; import java.util.Collections; import java.util.HashSet; import java.util.Set; import javax.inject.Named; import javax.inject.Singleton; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.impl.ArtifactResolver; import org.eclipse.aether.impl.DependencyCollector; import org.eclipse.aether.impl.Deployer; import org.eclipse.aether.impl.Installer; import org.eclipse.aether.impl.LocalRepositoryProvider; import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; import org.eclipse.aether.internal.impl.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.DefaultDeployer; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.impl.DefaultInstaller; import org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider; import org.eclipse.aether.internal.impl.DefaultMetadataResolver; import org.eclipse.aether.internal.impl.DefaultOfflineController; import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager; import org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider; import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher; import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider; import org.eclipse.aether.internal.impl.DefaultRepositorySystem; import org.eclipse.aether.internal.impl.DefaultSyncContextFactory; import org.eclipse.aether.internal.impl.DefaultTransporterProvider; import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; import org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer; import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.slf4j.ILoggerFactory; import com.google.inject.AbstractModule; import com.google.inject.Provides; import com.google.inject.name.Names; /** * A ready-made Guice module that sets up bindings * for all components from this library. To acquire a complete repository system, clients need to bind an artifact * descriptor reader, a version resolver, a version range resolver, zero or more metadata generator factories, some * repository connector and transporter factories to access remote repositories. * * @noextend This class must not be extended by clients and will eventually be marked {@code final} without prior * notice. */ public class AetherModule extends AbstractModule { /** * Creates a new instance of this Guice module, typically for invoking * {@link com.google.inject.Binder#install(com.google.inject.Module)}. */ public AetherModule() { } /** * Configures Guice with bindings for Aether components provided by this library. */ @Override protected void configure() { bind( RepositorySystem.class ) // .to( DefaultRepositorySystem.class ).in( Singleton.class ); bind( ArtifactResolver.class ) // .to( DefaultArtifactResolver.class ).in( Singleton.class ); bind( DependencyCollector.class ) // .to( DefaultDependencyCollector.class ).in( Singleton.class ); bind( Deployer.class ) // .to( DefaultDeployer.class ).in( Singleton.class ); bind( Installer.class ) // .to( DefaultInstaller.class ).in( Singleton.class ); bind( MetadataResolver.class ) // .to( DefaultMetadataResolver.class ).in( Singleton.class ); bind( RepositoryLayoutProvider.class ) // .to( DefaultRepositoryLayoutProvider.class ).in( Singleton.class ); bind( RepositoryLayoutFactory.class ).annotatedWith( Names.named( "maven2" ) ) // .to( Maven2RepositoryLayoutFactory.class ).in( Singleton.class ); bind( TransporterProvider.class ) // .to( DefaultTransporterProvider.class ).in( Singleton.class ); bind( ChecksumPolicyProvider.class ) // .to( DefaultChecksumPolicyProvider.class ).in( Singleton.class ); bind( RepositoryConnectorProvider.class ) // .to( DefaultRepositoryConnectorProvider.class ).in( Singleton.class ); bind( RemoteRepositoryManager.class ) // .to( DefaultRemoteRepositoryManager.class ).in( Singleton.class ); bind( UpdateCheckManager.class ) // .to( DefaultUpdateCheckManager.class ).in( Singleton.class ); bind( UpdatePolicyAnalyzer.class ) // .to( DefaultUpdatePolicyAnalyzer.class ).in( Singleton.class ); bind( FileProcessor.class ) // .to( DefaultFileProcessor.class ).in( Singleton.class ); bind( SyncContextFactory.class ) // .to( DefaultSyncContextFactory.class ).in( Singleton.class ); bind( RepositoryEventDispatcher.class ) // .to( DefaultRepositoryEventDispatcher.class ).in( Singleton.class ); bind( OfflineController.class ) // .to( DefaultOfflineController.class ).in( Singleton.class ); bind( LocalRepositoryProvider.class ) // .to( DefaultLocalRepositoryProvider.class ).in( Singleton.class ); bind( LocalRepositoryManagerFactory.class ).annotatedWith( Names.named( "simple" ) ) // .to( SimpleLocalRepositoryManagerFactory.class ).in( Singleton.class ); bind( LocalRepositoryManagerFactory.class ).annotatedWith( Names.named( "enhanced" ) ) // .to( EnhancedLocalRepositoryManagerFactory.class ).in( Singleton.class ); if ( Slf4jLoggerFactory.isSlf4jAvailable() ) { bindSlf4j(); } else { bind( LoggerFactory.class ) // .toInstance( NullLoggerFactory.INSTANCE ); } } private void bindSlf4j() { install( new Slf4jModule() ); } @Provides @Singleton Set provideLocalRepositoryManagerFactories( @Named( "simple" ) LocalRepositoryManagerFactory simple, @Named( "enhanced" ) LocalRepositoryManagerFactory enhanced ) { Set factories = new HashSet(); factories.add( simple ); factories.add( enhanced ); return Collections.unmodifiableSet( factories ); } @Provides @Singleton Set provideRepositoryLayoutFactories( @Named( "maven2" ) RepositoryLayoutFactory maven2 ) { Set factories = new HashSet(); factories.add( maven2 ); return Collections.unmodifiableSet( factories ); } @Provides @Singleton Set providesRepositoryListeners() { return Collections.emptySet(); } private static class Slf4jModule extends AbstractModule { @Override protected void configure() { bind( LoggerFactory.class ) // .to( Slf4jLoggerFactory.class ); } @Provides @Singleton ILoggerFactory getLoggerFactory() { return org.slf4j.LoggerFactory.getILoggerFactory(); } } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java000066400000000000000000000013071245546356100316320ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The integration with the dependency injection framework Google Guice. */ package org.eclipse.aether.impl.guice; aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/impl/package-info.java000066400000000000000000000024041245546356100305350ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The provisional interfaces defining the various sub components that implement the repository system. Aether Core * provides stock implementations for most of these components but not all. To obtain a complete/runnable repository * system, the application needs to provide implementations of the following component contracts: * {@link org.eclipse.aether.impl.ArtifactDescriptorReader}, {@link org.eclipse.aether.impl.VersionResolver}, * {@link org.eclipse.aether.impl.VersionRangeResolver} and potentially * {@link org.eclipse.aether.impl.MetadataGeneratorFactory}. Said components basically define the file format of the * metadata that is used to reason about an artifact's dependencies and available versions. */ package org.eclipse.aether.impl; aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/000077500000000000000000000000001245546356100262215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/000077500000000000000000000000001245546356100271625ustar00rootroot00000000000000AbstractChecksumPolicy.java000066400000000000000000000041151245546356100343550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; abstract class AbstractChecksumPolicy implements ChecksumPolicy { protected final Logger logger; protected final TransferResource resource; protected AbstractChecksumPolicy( LoggerFactory loggerFactory, TransferResource resource ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); this.resource = resource; } public boolean onChecksumMatch( String algorithm, int kind ) { return true; } public void onChecksumMismatch( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException { if ( ( kind & KIND_UNOFFICIAL ) == 0 ) { throw exception; } } public void onChecksumError( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException { logger.debug( "Could not validate " + algorithm + " checksum for " + resource.getResourceName(), exception ); } public void onNoMoreChecksums() throws ChecksumFailureException { throw new ChecksumFailureException( "Checksum validation failed, no checksums available" ); } public void onTransferRetry() { } } ArtifactRequestBuilder.java000066400000000000000000000030741245546356100343670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.List; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; import org.eclipse.aether.resolution.ArtifactRequest; /** */ class ArtifactRequestBuilder implements DependencyVisitor { private final RequestTrace trace; private List requests; public ArtifactRequestBuilder( RequestTrace trace ) { this.trace = trace; this.requests = new ArrayList(); } public List getRequests() { return requests; } public boolean visitEnter( DependencyNode node ) { if ( node.getDependency() != null ) { ArtifactRequest request = new ArtifactRequest( node ); request.setTrace( trace ); requests.add( request ); } return true; } public boolean visitLeave( DependencyNode node ) { return true; } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java000066400000000000000000000101531245546356100320510ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Iterator; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.repository.WorkspaceRepository; /** * @deprecated To be deleted without replacement. */ @Deprecated public final class CacheUtils { public static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } public static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } public static int repositoriesHashCode( List repositories ) { int result = 17; for ( RemoteRepository repository : repositories ) { result = 31 * result + repositoryHashCode( repository ); } return result; } private static int repositoryHashCode( RemoteRepository repository ) { int result = 17; result = 31 * result + hash( repository.getUrl() ); return result; } private static boolean repositoryEquals( RemoteRepository r1, RemoteRepository r2 ) { if ( r1 == r2 ) { return true; } return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() ) && policyEquals( r1.getPolicy( false ), r2.getPolicy( false ) ) && policyEquals( r1.getPolicy( true ), r2.getPolicy( true ) ); } private static boolean policyEquals( RepositoryPolicy p1, RepositoryPolicy p2 ) { if ( p1 == p2 ) { return true; } // update policy doesn't affect contents return p1.isEnabled() == p2.isEnabled() && eq( p1.getChecksumPolicy(), p2.getChecksumPolicy() ); } public static boolean repositoriesEquals( List r1, List r2 ) { if ( r1.size() != r2.size() ) { return false; } for ( Iterator it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); ) { if ( !repositoryEquals( it1.next(), it2.next() ) ) { return false; } } return true; } public static WorkspaceRepository getWorkspace( RepositorySystemSession session ) { WorkspaceReader reader = session.getWorkspaceReader(); return ( reader != null ) ? reader.getRepository() : null; } public static ArtifactRepository getRepository( RepositorySystemSession session, List repositories, Class repoClass, String repoId ) { if ( repoClass != null ) { if ( WorkspaceRepository.class.isAssignableFrom( repoClass ) ) { return session.getWorkspaceReader().getRepository(); } else if ( LocalRepository.class.isAssignableFrom( repoClass ) ) { return session.getLocalRepository(); } else { for ( RemoteRepository repository : repositories ) { if ( repoId.equals( repository.getId() ) ) { return repository; } } } } return null; } } CachingArtifactTypeRegistry.java000066400000000000000000000034651245546356100353630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; /** * A short-lived artifact type registry that caches results from a presumedly slower type registry. */ class CachingArtifactTypeRegistry implements ArtifactTypeRegistry { private final ArtifactTypeRegistry delegate; private final Map types; public static ArtifactTypeRegistry newInstance( RepositorySystemSession session ) { return newInstance( session.getArtifactTypeRegistry() ); } public static ArtifactTypeRegistry newInstance( ArtifactTypeRegistry delegate ) { return ( delegate != null ) ? new CachingArtifactTypeRegistry( delegate ) : null; } private CachingArtifactTypeRegistry( ArtifactTypeRegistry delegate ) { this.delegate = delegate; types = new HashMap(); } public ArtifactType get( String typeId ) { ArtifactType type = types.get( typeId ); if ( type == null ) { type = delegate.get( typeId ); types.put( typeId, type ); } return type; } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DataPool.java000066400000000000000000000317161245546356100315400ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.WeakHashMap; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** */ final class DataPool { private static final String ARTIFACT_POOL = DataPool.class.getName() + "$Artifact"; private static final String DEPENDENCY_POOL = DataPool.class.getName() + "$Dependency"; private static final String DESCRIPTORS = DataPool.class.getName() + "$Descriptors"; public static final ArtifactDescriptorResult NO_DESCRIPTOR = new ArtifactDescriptorResult( new ArtifactDescriptorRequest() ); private ObjectPool artifacts; private ObjectPool dependencies; private Map descriptors; private Map constraints = new HashMap(); private Map> nodes = new HashMap>( 256 ); @SuppressWarnings( "unchecked" ) public DataPool( RepositorySystemSession session ) { RepositoryCache cache = session.getCache(); if ( cache != null ) { artifacts = (ObjectPool) cache.get( session, ARTIFACT_POOL ); dependencies = (ObjectPool) cache.get( session, DEPENDENCY_POOL ); descriptors = (Map) cache.get( session, DESCRIPTORS ); } if ( artifacts == null ) { artifacts = new ObjectPool(); if ( cache != null ) { cache.put( session, ARTIFACT_POOL, artifacts ); } } if ( dependencies == null ) { dependencies = new ObjectPool(); if ( cache != null ) { cache.put( session, DEPENDENCY_POOL, dependencies ); } } if ( descriptors == null ) { descriptors = Collections.synchronizedMap( new WeakHashMap( 256 ) ); if ( cache != null ) { cache.put( session, DESCRIPTORS, descriptors ); } } } public Artifact intern( Artifact artifact ) { return artifacts.intern( artifact ); } public Dependency intern( Dependency dependency ) { return dependencies.intern( dependency ); } public Object toKey( ArtifactDescriptorRequest request ) { return request.getArtifact(); } public ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorRequest request ) { Descriptor descriptor = descriptors.get( key ); if ( descriptor != null ) { return descriptor.toResult( request ); } return null; } public void putDescriptor( Object key, ArtifactDescriptorResult result ) { descriptors.put( key, new GoodDescriptor( result ) ); } public void putDescriptor( Object key, ArtifactDescriptorException e ) { descriptors.put( key, BadDescriptor.INSTANCE ); } public Object toKey( VersionRangeRequest request ) { return new ConstraintKey( request ); } public VersionRangeResult getConstraint( Object key, VersionRangeRequest request ) { Constraint constraint = constraints.get( key ); if ( constraint != null ) { return constraint.toResult( request ); } return null; } public void putConstraint( Object key, VersionRangeResult result ) { constraints.put( key, new Constraint( result ) ); } public Object toKey( Artifact artifact, List repositories, DependencySelector selector, DependencyManager manager, DependencyTraverser traverser, VersionFilter filter ) { return new GraphKey( artifact, repositories, selector, manager, traverser, filter ); } public List getChildren( Object key ) { return nodes.get( key ); } public void putChildren( Object key, List children ) { nodes.put( key, children ); } static abstract class Descriptor { public abstract ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ); } static final class GoodDescriptor extends Descriptor { final Artifact artifact; final List relocations; final Collection aliases; final List repositories; final List dependencies; final List managedDependencies; public GoodDescriptor( ArtifactDescriptorResult result ) { artifact = result.getArtifact(); relocations = result.getRelocations(); aliases = result.getAliases(); dependencies = result.getDependencies(); managedDependencies = result.getManagedDependencies(); repositories = result.getRepositories(); } public ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ) { ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); result.setArtifact( artifact ); result.setRelocations( relocations ); result.setAliases( aliases ); result.setDependencies( dependencies ); result.setManagedDependencies( managedDependencies ); result.setRepositories( repositories ); return result; } } static final class BadDescriptor extends Descriptor { static final BadDescriptor INSTANCE = new BadDescriptor(); public ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ) { return NO_DESCRIPTOR; } } static final class Constraint { final VersionRepo[] repositories; final VersionConstraint versionConstraint; public Constraint( VersionRangeResult result ) { versionConstraint = result.getVersionConstraint(); List versions = result.getVersions(); repositories = new VersionRepo[versions.size()]; int i = 0; for ( Version version : versions ) { repositories[i++] = new VersionRepo( version, result.getRepository( version ) ); } } public VersionRangeResult toResult( VersionRangeRequest request ) { VersionRangeResult result = new VersionRangeResult( request ); for ( VersionRepo vr : repositories ) { result.addVersion( vr.version ); result.setRepository( vr.version, vr.repo ); } result.setVersionConstraint( versionConstraint ); return result; } static final class VersionRepo { final Version version; final ArtifactRepository repo; VersionRepo( Version version, ArtifactRepository repo ) { this.version = version; this.repo = repo; } } } static final class ConstraintKey { private final Artifact artifact; private final List repositories; private final int hashCode; public ConstraintKey( VersionRangeRequest request ) { artifact = request.getArtifact(); repositories = request.getRepositories(); hashCode = artifact.hashCode(); } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof ConstraintKey ) ) { return false; } ConstraintKey that = (ConstraintKey) obj; return artifact.equals( that.artifact ) && equals( repositories, that.repositories ); } private static boolean equals( List repos1, List repos2 ) { if ( repos1.size() != repos2.size() ) { return false; } for ( int i = 0, n = repos1.size(); i < n; i++ ) { RemoteRepository repo1 = repos1.get( i ); RemoteRepository repo2 = repos2.get( i ); if ( repo1.isRepositoryManager() != repo2.isRepositoryManager() ) { return false; } if ( repo1.isRepositoryManager() ) { if ( !equals( repo1.getMirroredRepositories(), repo2.getMirroredRepositories() ) ) { return false; } } else if ( !repo1.getUrl().equals( repo2.getUrl() ) ) { return false; } else if ( repo1.getPolicy( true ).isEnabled() != repo2.getPolicy( true ).isEnabled() ) { return false; } else if ( repo1.getPolicy( false ).isEnabled() != repo2.getPolicy( false ).isEnabled() ) { return false; } } return true; } @Override public int hashCode() { return hashCode; } } static final class GraphKey { private final Artifact artifact; private final List repositories; private final DependencySelector selector; private final DependencyManager manager; private final DependencyTraverser traverser; private final VersionFilter filter; private final int hashCode; public GraphKey( Artifact artifact, List repositories, DependencySelector selector, DependencyManager manager, DependencyTraverser traverser, VersionFilter filter ) { this.artifact = artifact; this.repositories = repositories; this.selector = selector; this.manager = manager; this.traverser = traverser; this.filter = filter; int hash = 17; hash = hash * 31 + artifact.hashCode(); hash = hash * 31 + repositories.hashCode(); hash = hash * 31 + hash( selector ); hash = hash * 31 + hash( manager ); hash = hash * 31 + hash( traverser ); hash = hash * 31 + hash( filter ); hashCode = hash; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof GraphKey ) ) { return false; } GraphKey that = (GraphKey) obj; return artifact.equals( that.artifact ) && repositories.equals( that.repositories ) && eq( selector, that.selector ) && eq( manager, that.manager ) && eq( traverser, that.traverser ) && eq( filter, that.filter ); } @Override public int hashCode() { return hashCode; } private static boolean eq( T o1, T o2 ) { return ( o1 != null ) ? o1.equals( o2 ) : o2 == null; } private static int hash( Object o ) { return ( o != null ) ? o.hashCode() : 0; } } } DefaultArtifactResolver.java000066400000000000000000000706061245546356100345430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.impl.ArtifactResolver; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.NoRepositoryConnectorException; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.eclipse.aether.util.ConfigUtils; /** */ @Named public class DefaultArtifactResolver implements ArtifactResolver, Service { private static final String CONFIG_PROP_SNAPSHOT_NORMALIZATION = "aether.artifactResolver.snapshotNormalization"; private Logger logger = NullLoggerFactory.LOGGER; private FileProcessor fileProcessor; private RepositoryEventDispatcher repositoryEventDispatcher; private VersionResolver versionResolver; private UpdateCheckManager updateCheckManager; private RepositoryConnectorProvider repositoryConnectorProvider; private RemoteRepositoryManager remoteRepositoryManager; private SyncContextFactory syncContextFactory; private OfflineController offlineController; public DefaultArtifactResolver() { // enables default constructor } @Inject DefaultArtifactResolver( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher, VersionResolver versionResolver, UpdateCheckManager updateCheckManager, RepositoryConnectorProvider repositoryConnectorProvider, RemoteRepositoryManager remoteRepositoryManager, SyncContextFactory syncContextFactory, OfflineController offlineController, LoggerFactory loggerFactory ) { setFileProcessor( fileProcessor ); setRepositoryEventDispatcher( repositoryEventDispatcher ); setVersionResolver( versionResolver ); setUpdateCheckManager( updateCheckManager ); setRepositoryConnectorProvider( repositoryConnectorProvider ); setRemoteRepositoryManager( remoteRepositoryManager ); setSyncContextFactory( syncContextFactory ); setOfflineController( offlineController ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setFileProcessor( locator.getService( FileProcessor.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); setVersionResolver( locator.getService( VersionResolver.class ) ); setUpdateCheckManager( locator.getService( UpdateCheckManager.class ) ); setRepositoryConnectorProvider( locator.getService( RepositoryConnectorProvider.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); setOfflineController( locator.getService( OfflineController.class ) ); } public DefaultArtifactResolver setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultArtifactResolver setFileProcessor( FileProcessor fileProcessor ) { if ( fileProcessor == null ) { throw new IllegalArgumentException( "file processor has not been specified" ); } this.fileProcessor = fileProcessor; return this; } public DefaultArtifactResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) { if ( repositoryEventDispatcher == null ) { throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); } this.repositoryEventDispatcher = repositoryEventDispatcher; return this; } public DefaultArtifactResolver setVersionResolver( VersionResolver versionResolver ) { if ( versionResolver == null ) { throw new IllegalArgumentException( "version resolver has not been specified" ); } this.versionResolver = versionResolver; return this; } public DefaultArtifactResolver setUpdateCheckManager( UpdateCheckManager updateCheckManager ) { if ( updateCheckManager == null ) { throw new IllegalArgumentException( "update check manager has not been specified" ); } this.updateCheckManager = updateCheckManager; return this; } public DefaultArtifactResolver setRepositoryConnectorProvider( RepositoryConnectorProvider repositoryConnectorProvider ) { if ( repositoryConnectorProvider == null ) { throw new IllegalArgumentException( "repository connector provider has not been specified" ); } this.repositoryConnectorProvider = repositoryConnectorProvider; return this; } public DefaultArtifactResolver setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) { throw new IllegalArgumentException( "remote repository manager has not been specified" ); } this.remoteRepositoryManager = remoteRepositoryManager; return this; } public DefaultArtifactResolver setSyncContextFactory( SyncContextFactory syncContextFactory ) { if ( syncContextFactory == null ) { throw new IllegalArgumentException( "sync context factory has not been specified" ); } this.syncContextFactory = syncContextFactory; return this; } public DefaultArtifactResolver setOfflineController( OfflineController offlineController ) { if ( offlineController == null ) { throw new IllegalArgumentException( "offline controller has not been specified" ); } this.offlineController = offlineController; return this; } public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { return resolveArtifacts( session, Collections.singleton( request ) ).get( 0 ); } public List resolveArtifacts( RepositorySystemSession session, Collection requests ) throws ArtifactResolutionException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { Collection artifacts = new ArrayList( requests.size() ); for ( ArtifactRequest request : requests ) { if ( request.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null ) { continue; } artifacts.add( request.getArtifact() ); } syncContext.acquire( artifacts, null ); return resolve( session, requests ); } finally { syncContext.close(); } } private List resolve( RepositorySystemSession session, Collection requests ) throws ArtifactResolutionException { List results = new ArrayList( requests.size() ); boolean failures = false; LocalRepositoryManager lrm = session.getLocalRepositoryManager(); WorkspaceReader workspace = session.getWorkspaceReader(); List groups = new ArrayList(); for ( ArtifactRequest request : requests ) { RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); ArtifactResult result = new ArtifactResult( request ); results.add( result ); Artifact artifact = request.getArtifact(); List repos = request.getRepositories(); artifactResolving( session, trace, artifact ); String localPath = artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ); if ( localPath != null ) { // unhosted artifact, just validate file File file = new File( localPath ); if ( !file.isFile() ) { failures = true; result.addException( new ArtifactNotFoundException( artifact, null ) ); } else { artifact = artifact.setFile( file ); result.setArtifact( artifact ); artifactResolved( session, trace, artifact, null, result.getExceptions() ); } continue; } VersionResult versionResult; try { VersionRequest versionRequest = new VersionRequest( artifact, repos, request.getRequestContext() ); versionRequest.setTrace( trace ); versionResult = versionResolver.resolveVersion( session, versionRequest ); } catch ( VersionResolutionException e ) { result.addException( e ); continue; } artifact = artifact.setVersion( versionResult.getVersion() ); if ( versionResult.getRepository() != null ) { if ( versionResult.getRepository() instanceof RemoteRepository ) { repos = Collections.singletonList( (RemoteRepository) versionResult.getRepository() ); } else { repos = Collections.emptyList(); } } if ( workspace != null ) { File file = workspace.findArtifact( artifact ); if ( file != null ) { artifact = artifact.setFile( file ); result.setArtifact( artifact ); result.setRepository( workspace.getRepository() ); artifactResolved( session, trace, artifact, result.getRepository(), null ); continue; } } LocalArtifactResult local = lrm.find( session, new LocalArtifactRequest( artifact, repos, request.getRequestContext() ) ); if ( isLocallyInstalled( local, versionResult ) ) { if ( local.getRepository() != null ) { result.setRepository( local.getRepository() ); } else { result.setRepository( lrm.getRepository() ); } try { artifact = artifact.setFile( getFile( session, artifact, local.getFile() ) ); result.setArtifact( artifact ); artifactResolved( session, trace, artifact, result.getRepository(), null ); } catch ( ArtifactTransferException e ) { result.addException( e ); } if ( !local.isAvailable() ) { /* * NOTE: Interop with simple local repository: An artifact installed by a simple local repo manager * will not show up in the repository tracking file of the enhanced local repository. If however the * maven-metadata-local.xml tells us the artifact was installed locally, we sync the repository * tracking file. */ lrm.add( session, new LocalArtifactRegistration( artifact ) ); } continue; } else if ( local.getFile() != null ) { logger.debug( "Verifying availability of " + local.getFile() + " from " + repos ); } AtomicBoolean resolved = new AtomicBoolean( false ); Iterator groupIt = groups.iterator(); for ( RemoteRepository repo : repos ) { if ( !repo.getPolicy( artifact.isSnapshot() ).isEnabled() ) { continue; } try { Utils.checkOffline( session, offlineController, repo ); } catch ( RepositoryOfflineException e ) { Exception exception = new ArtifactNotFoundException( artifact, repo, "Cannot access " + repo.getId() + " (" + repo.getUrl() + ") in offline mode and the artifact " + artifact + " has not been downloaded from it before.", e ); result.addException( exception ); continue; } ResolutionGroup group = null; while ( groupIt.hasNext() ) { ResolutionGroup t = groupIt.next(); if ( t.matches( repo ) ) { group = t; break; } } if ( group == null ) { group = new ResolutionGroup( repo ); groups.add( group ); groupIt = Collections. emptyList().iterator(); } group.items.add( new ResolutionItem( trace, artifact, resolved, result, local, repo ) ); } } for ( ResolutionGroup group : groups ) { performDownloads( session, group ); } for ( ArtifactResult result : results ) { ArtifactRequest request = result.getRequest(); Artifact artifact = result.getArtifact(); if ( artifact == null || artifact.getFile() == null ) { failures = true; if ( result.getExceptions().isEmpty() ) { Exception exception = new ArtifactNotFoundException( request.getArtifact(), null ); result.addException( exception ); } RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); artifactResolved( session, trace, request.getArtifact(), null, result.getExceptions() ); } } if ( failures ) { throw new ArtifactResolutionException( results ); } return results; } private boolean isLocallyInstalled( LocalArtifactResult lar, VersionResult vr ) { if ( lar.isAvailable() ) { return true; } if ( lar.getFile() != null ) { if ( vr.getRepository() instanceof LocalRepository ) { // resolution of (snapshot) version found locally installed artifact return true; } else if ( vr.getRepository() == null && lar.getRequest().getRepositories().isEmpty() ) { // resolution of version range found locally installed artifact return true; } } return false; } private File getFile( RepositorySystemSession session, Artifact artifact, File file ) throws ArtifactTransferException { if ( artifact.isSnapshot() && !artifact.getVersion().equals( artifact.getBaseVersion() ) && ConfigUtils.getBoolean( session, true, CONFIG_PROP_SNAPSHOT_NORMALIZATION ) ) { String name = file.getName().replace( artifact.getVersion(), artifact.getBaseVersion() ); File dst = new File( file.getParent(), name ); boolean copy = dst.length() != file.length() || dst.lastModified() != file.lastModified(); if ( copy ) { try { fileProcessor.copy( file, dst ); dst.setLastModified( file.lastModified() ); } catch ( IOException e ) { throw new ArtifactTransferException( artifact, null, e ); } } file = dst; } return file; } private void performDownloads( RepositorySystemSession session, ResolutionGroup group ) { List downloads = gatherDownloads( session, group ); if ( downloads.isEmpty() ) { return; } for ( ArtifactDownload download : downloads ) { artifactDownloading( session, download.getTrace(), download.getArtifact(), group.repository ); } try { RepositoryConnector connector = repositoryConnectorProvider.newRepositoryConnector( session, group.repository ); try { connector.get( downloads, null ); } finally { connector.close(); } } catch ( NoRepositoryConnectorException e ) { for ( ArtifactDownload download : downloads ) { download.setException( new ArtifactTransferException( download.getArtifact(), group.repository, e ) ); } } evaluateDownloads( session, group ); } private List gatherDownloads( RepositorySystemSession session, ResolutionGroup group ) { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); List downloads = new ArrayList(); for ( ResolutionItem item : group.items ) { Artifact artifact = item.artifact; if ( item.resolved.get() ) { // resolved in previous resolution group continue; } ArtifactDownload download = new ArtifactDownload(); download.setArtifact( artifact ); download.setRequestContext( item.request.getRequestContext() ); download.setListener( SafeTransferListener.wrap( session, logger ) ); download.setTrace( item.trace ); if ( item.local.getFile() != null ) { download.setFile( item.local.getFile() ); download.setExistenceCheck( true ); } else { String path = lrm.getPathForRemoteArtifact( artifact, group.repository, item.request.getRequestContext() ); download.setFile( new File( lrm.getRepository().getBasedir(), path ) ); } boolean snapshot = artifact.isSnapshot(); RepositoryPolicy policy = remoteRepositoryManager.getPolicy( session, group.repository, !snapshot, snapshot ); int errorPolicy = Utils.getPolicy( session, artifact, group.repository ); if ( ( errorPolicy & ResolutionErrorPolicy.CACHE_ALL ) != 0 ) { UpdateCheck check = new UpdateCheck(); check.setItem( artifact ); check.setFile( download.getFile() ); check.setFileValid( false ); check.setRepository( group.repository ); check.setPolicy( policy.getUpdatePolicy() ); item.updateCheck = check; updateCheckManager.checkArtifact( session, check ); if ( !check.isRequired() ) { item.result.addException( check.getException() ); continue; } } download.setChecksumPolicy( policy.getChecksumPolicy() ); download.setRepositories( item.repository.getMirroredRepositories() ); downloads.add( download ); item.download = download; } return downloads; } private void evaluateDownloads( RepositorySystemSession session, ResolutionGroup group ) { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); for ( ResolutionItem item : group.items ) { ArtifactDownload download = item.download; if ( download == null ) { continue; } Artifact artifact = download.getArtifact(); if ( download.getException() == null ) { item.resolved.set( true ); item.result.setRepository( group.repository ); try { artifact = artifact.setFile( getFile( session, artifact, download.getFile() ) ); item.result.setArtifact( artifact ); lrm.add( session, new LocalArtifactRegistration( artifact, group.repository, download.getSupportedContexts() ) ); } catch ( ArtifactTransferException e ) { download.setException( e ); item.result.addException( e ); } } else { item.result.addException( download.getException() ); } /* * NOTE: Touch after registration with local repo to ensure concurrent resolution is not rejected with * "already updated" via session data when actual update to local repo is still pending. */ if ( item.updateCheck != null ) { item.updateCheck.setException( download.getException() ); updateCheckManager.touchArtifact( session, item.updateCheck ); } artifactDownloaded( session, download.getTrace(), artifact, group.repository, download.getException() ); if ( download.getException() == null ) { artifactResolved( session, download.getTrace(), artifact, group.repository, null ); } } } private void artifactResolving( RepositorySystemSession session, RequestTrace trace, Artifact artifact ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_RESOLVING ); event.setTrace( trace ); event.setArtifact( artifact ); repositoryEventDispatcher.dispatch( event.build() ); } private void artifactResolved( RepositorySystemSession session, RequestTrace trace, Artifact artifact, ArtifactRepository repository, List exceptions ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_RESOLVED ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( repository ); event.setExceptions( exceptions ); if ( artifact != null ) { event.setFile( artifact.getFile() ); } repositoryEventDispatcher.dispatch( event.build() ); } private void artifactDownloading( RepositorySystemSession session, RequestTrace trace, Artifact artifact, RemoteRepository repository ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DOWNLOADING ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( repository ); repositoryEventDispatcher.dispatch( event.build() ); } private void artifactDownloaded( RepositorySystemSession session, RequestTrace trace, Artifact artifact, RemoteRepository repository, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DOWNLOADED ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( repository ); event.setException( exception ); if ( artifact != null ) { event.setFile( artifact.getFile() ); } repositoryEventDispatcher.dispatch( event.build() ); } static class ResolutionGroup { final RemoteRepository repository; final List items = new ArrayList(); ResolutionGroup( RemoteRepository repository ) { this.repository = repository; } boolean matches( RemoteRepository repo ) { return repository.getUrl().equals( repo.getUrl() ) && repository.getContentType().equals( repo.getContentType() ) && repository.isRepositoryManager() == repo.isRepositoryManager(); } } static class ResolutionItem { final RequestTrace trace; final ArtifactRequest request; final ArtifactResult result; final LocalArtifactResult local; final RemoteRepository repository; final Artifact artifact; final AtomicBoolean resolved; ArtifactDownload download; UpdateCheck updateCheck; ResolutionItem( RequestTrace trace, Artifact artifact, AtomicBoolean resolved, ArtifactResult result, LocalArtifactResult local, RemoteRepository repository ) { this.trace = trace; this.artifact = artifact; this.resolved = resolved; this.result = result; this.request = result.getRequest(); this.local = local; this.repository = repository; } } } DefaultChecksumPolicyProvider.java000066400000000000000000000070311245546356100357110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.TransferResource; /** */ @Named public final class DefaultChecksumPolicyProvider implements ChecksumPolicyProvider, Service { private static final int ORDINAL_IGNORE = 0; private static final int ORDINAL_WARN = 1; private static final int ORDINAL_FAIL = 2; private LoggerFactory loggerFactory = NullLoggerFactory.INSTANCE; public DefaultChecksumPolicyProvider() { // enables default constructor } @Inject DefaultChecksumPolicyProvider( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } public DefaultChecksumPolicyProvider setLoggerFactory( LoggerFactory loggerFactory ) { this.loggerFactory = loggerFactory; return this; } public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); } public String getEffectiveChecksumPolicy( RepositorySystemSession session, String policy1, String policy2 ) { if ( policy1 != null && policy1.equals( policy2 ) ) { return policy1; } int ordinal1 = ordinalOfPolicy( policy1 ); int ordinal2 = ordinalOfPolicy( policy2 ); if ( ordinal2 < ordinal1 ) { return ( ordinal2 != ORDINAL_WARN ) ? policy2 : RepositoryPolicy.CHECKSUM_POLICY_WARN; } else { return ( ordinal1 != ORDINAL_WARN ) ? policy1 : RepositoryPolicy.CHECKSUM_POLICY_WARN; } } private static int ordinalOfPolicy( String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return ORDINAL_FAIL; } else if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return ORDINAL_IGNORE; } else { return ORDINAL_WARN; } } } DefaultDependencyCollectionContext.java000066400000000000000000000042541245546356100367170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.graph.Dependency; /** * @see DefaultDependencyCollector */ final class DefaultDependencyCollectionContext implements DependencyCollectionContext { private final RepositorySystemSession session; private Artifact artifact; private Dependency dependency; private List managedDependencies; public DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact, Dependency dependency, List managedDependencies ) { this.session = session; this.artifact = ( dependency != null ) ? dependency.getArtifact() : artifact; this.dependency = dependency; this.managedDependencies = managedDependencies; } public RepositorySystemSession getSession() { return session; } public Artifact getArtifact() { return artifact; } public Dependency getDependency() { return dependency; } public List getManagedDependencies() { return managedDependencies; } public void set( Dependency dependency, List managedDependencies ) { artifact = dependency.getArtifact(); this.dependency = dependency; this.managedDependencies = managedDependencies; } @Override public String toString() { return String.valueOf( getDependency() ); } } DefaultDependencyCollector.java000066400000000000000000001107701245546356100352060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.impl.DependencyCollector; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.ConfigUtils; import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; import org.eclipse.aether.version.Version; /** */ @Named public class DefaultDependencyCollector implements DependencyCollector, Service { private static final String CONFIG_PROP_MAX_EXCEPTIONS = "aether.dependencyCollector.maxExceptions"; private static final String CONFIG_PROP_MAX_CYCLES = "aether.dependencyCollector.maxCycles"; private Logger logger = NullLoggerFactory.LOGGER; private RemoteRepositoryManager remoteRepositoryManager; private ArtifactDescriptorReader descriptorReader; private VersionRangeResolver versionRangeResolver; public DefaultDependencyCollector() { // enables default constructor } @Inject DefaultDependencyCollector( RemoteRepositoryManager remoteRepositoryManager, ArtifactDescriptorReader artifactDescriptorReader, VersionRangeResolver versionRangeResolver, LoggerFactory loggerFactory ) { setRemoteRepositoryManager( remoteRepositoryManager ); setArtifactDescriptorReader( artifactDescriptorReader ); setVersionRangeResolver( versionRangeResolver ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setArtifactDescriptorReader( locator.getService( ArtifactDescriptorReader.class ) ); setVersionRangeResolver( locator.getService( VersionRangeResolver.class ) ); } public DefaultDependencyCollector setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultDependencyCollector setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) { throw new IllegalArgumentException( "remote repository manager has not been specified" ); } this.remoteRepositoryManager = remoteRepositoryManager; return this; } public DefaultDependencyCollector setArtifactDescriptorReader( ArtifactDescriptorReader artifactDescriptorReader ) { if ( artifactDescriptorReader == null ) { throw new IllegalArgumentException( "artifact descriptor reader has not been specified" ); } descriptorReader = artifactDescriptorReader; return this; } public DefaultDependencyCollector setVersionRangeResolver( VersionRangeResolver versionRangeResolver ) { if ( versionRangeResolver == null ) { throw new IllegalArgumentException( "version range resolver has not been specified" ); } this.versionRangeResolver = versionRangeResolver; return this; } public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( request ); DependencySelector depSelector = session.getDependencySelector(); DependencyManager depManager = session.getDependencyManager(); DependencyTraverser depTraverser = session.getDependencyTraverser(); VersionFilter verFilter = session.getVersionFilter(); Dependency root = request.getRoot(); List repositories = request.getRepositories(); List dependencies = request.getDependencies(); List managedDependencies = request.getManagedDependencies(); Map stats = logger.isDebugEnabled() ? new LinkedHashMap() : null; long time1 = System.currentTimeMillis(); DefaultDependencyNode node; if ( root != null ) { List versions; VersionRangeResult rangeResult; try { VersionRangeRequest rangeRequest = new VersionRangeRequest( root.getArtifact(), request.getRepositories(), request.getRequestContext() ); rangeRequest.setTrace( trace ); rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); versions = filterVersions( root, rangeResult, verFilter, new DefaultVersionFilterContext( session ) ); } catch ( VersionRangeResolutionException e ) { result.addException( e ); throw new DependencyCollectionException( result, e.getMessage() ); } Version version = versions.get( versions.size() - 1 ); root = root.setArtifact( root.getArtifact().setVersion( version.toString() ) ); ArtifactDescriptorResult descriptorResult; try { ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); descriptorRequest.setArtifact( root.getArtifact() ); descriptorRequest.setRepositories( request.getRepositories() ); descriptorRequest.setRequestContext( request.getRequestContext() ); descriptorRequest.setTrace( trace ); if ( isLackingDescriptor( root.getArtifact() ) ) { descriptorResult = new ArtifactDescriptorResult( descriptorRequest ); } else { descriptorResult = descriptorReader.readArtifactDescriptor( session, descriptorRequest ); } } catch ( ArtifactDescriptorException e ) { result.addException( e ); throw new DependencyCollectionException( result, e.getMessage() ); } root = root.setArtifact( descriptorResult.getArtifact() ); if ( !session.isIgnoreArtifactDescriptorRepositories() ) { repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, descriptorResult.getRepositories(), true ); } dependencies = mergeDeps( dependencies, descriptorResult.getDependencies() ); managedDependencies = mergeDeps( managedDependencies, descriptorResult.getManagedDependencies() ); node = new DefaultDependencyNode( root ); node.setRequestContext( request.getRequestContext() ); node.setRelocations( descriptorResult.getRelocations() ); node.setVersionConstraint( rangeResult.getVersionConstraint() ); node.setVersion( version ); node.setAliases( descriptorResult.getAliases() ); node.setRepositories( request.getRepositories() ); } else { node = new DefaultDependencyNode( request.getRootArtifact() ); } result.setRoot( node ); boolean traverse = root == null || depTraverser == null || depTraverser.traverseDependency( root ); String errorPath = null; if ( traverse && !dependencies.isEmpty() ) { DataPool pool = new DataPool( session ); NodeStack nodes = new NodeStack(); nodes.push( node ); DefaultDependencyCollectionContext context = new DefaultDependencyCollectionContext( session, request.getRootArtifact(), root, managedDependencies ); DefaultVersionFilterContext versionContext = new DefaultVersionFilterContext( session ); Args args = new Args( session, trace, pool, nodes, context, versionContext, request ); Results results = new Results( result, session ); process( args, results, dependencies, repositories, depSelector != null ? depSelector.deriveChildSelector( context ) : null, depManager != null ? depManager.deriveChildManager( context ) : null, depTraverser != null ? depTraverser.deriveChildTraverser( context ) : null, verFilter != null ? verFilter.deriveChildFilter( context ) : null ); errorPath = results.errorPath; } long time2 = System.currentTimeMillis(); DependencyGraphTransformer transformer = session.getDependencyGraphTransformer(); if ( transformer != null ) { try { DefaultDependencyGraphTransformationContext context = new DefaultDependencyGraphTransformationContext( session ); context.put( TransformationContextKeys.STATS, stats ); result.setRoot( transformer.transformGraph( node, context ) ); } catch ( RepositoryException e ) { result.addException( e ); } } if ( stats != null ) { long time3 = System.currentTimeMillis(); stats.put( "DefaultDependencyCollector.collectTime", time2 - time1 ); stats.put( "DefaultDependencyCollector.transformTime", time3 - time2 ); logger.debug( "Dependency collection stats: " + stats ); } if ( errorPath != null ) { throw new DependencyCollectionException( result, "Failed to collect dependencies at " + errorPath ); } if ( !result.getExceptions().isEmpty() ) { throw new DependencyCollectionException( result ); } return result; } private static RepositorySystemSession optimizeSession( RepositorySystemSession session ) { DefaultRepositorySystemSession optimized = new DefaultRepositorySystemSession( session ); optimized.setArtifactTypeRegistry( CachingArtifactTypeRegistry.newInstance( session ) ); return optimized; } private List mergeDeps( List dominant, List recessive ) { List result; if ( dominant == null || dominant.isEmpty() ) { result = recessive; } else if ( recessive == null || recessive.isEmpty() ) { result = dominant; } else { int initialCapacity = dominant.size() + recessive.size(); result = new ArrayList( initialCapacity ); Collection ids = new HashSet(initialCapacity, 1.0f); for ( Dependency dependency : dominant ) { ids.add( getId( dependency.getArtifact() ) ); result.add( dependency ); } for ( Dependency dependency : recessive ) { if ( !ids.contains( getId( dependency.getArtifact() ) ) ) { result.add( dependency ); } } } return result; } private static String getId( Artifact a ) { return a.getGroupId() + ':' + a.getArtifactId() + ':' + a.getClassifier() + ':' + a.getExtension(); } private void process( final Args args, Results results, List dependencies, List repositories, DependencySelector depSelector, DependencyManager depManager, DependencyTraverser depTraverser, VersionFilter verFilter ) { for ( Dependency dependency : dependencies ) { processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, dependency ); } } private void processDependency( Args args, Results results, List repositories, DependencySelector depSelector, DependencyManager depManager, DependencyTraverser depTraverser, VersionFilter verFilter, Dependency dependency ) { List relocations = Collections.emptyList(); boolean disableVersionManagement = false; processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, dependency, relocations, disableVersionManagement ); } private void processDependency( Args args, Results results, List repositories, DependencySelector depSelector, DependencyManager depManager, DependencyTraverser depTraverser, VersionFilter verFilter, Dependency dependency, List relocations, boolean disableVersionManagement ) { if ( depSelector != null && !depSelector.selectDependency( dependency ) ) { return; } PremanagedDependency preManaged = PremanagedDependency.create( depManager, dependency, disableVersionManagement, args.premanagedState ); dependency = preManaged.managedDependency; boolean noDescriptor = isLackingDescriptor( dependency.getArtifact() ); boolean traverse = !noDescriptor && ( depTraverser == null || depTraverser.traverseDependency( dependency ) ); List versions; VersionRangeResult rangeResult; try { VersionRangeRequest rangeRequest = createVersionRangeRequest( args, repositories, dependency ); rangeResult = cachedResolveRangeResult( rangeRequest, args.pool, args.session ); versions = filterVersions( dependency, rangeResult, verFilter, args.versionContext ); } catch ( VersionRangeResolutionException e ) { results.addException( dependency, e, args.nodes ); return; } for ( Version version : versions ) { Artifact originalArtifact = dependency.getArtifact().setVersion( version.toString() ); Dependency d = dependency.setArtifact( originalArtifact ); ArtifactDescriptorRequest descriptorRequest = createArtifactDescriptorRequest( args, repositories, d ); final ArtifactDescriptorResult descriptorResult = getArtifactDescriptorResult( args, results, noDescriptor, d, descriptorRequest ); if ( descriptorResult != null ) { d = d.setArtifact( descriptorResult.getArtifact() ); DependencyNode node = args.nodes.top(); int cycleEntry = args.nodes.find( d.getArtifact() ); if ( cycleEntry >= 0 ) { results.addCycle( args.nodes, cycleEntry, d ); DependencyNode cycleNode = args.nodes.get( cycleEntry ); if ( cycleNode.getDependency() != null ) { DefaultDependencyNode child = createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult, cycleNode ); node.getChildren().add( child ); continue; } } if ( !descriptorResult.getRelocations().isEmpty() ) { boolean disableVersionManagementSubsequently = originalArtifact.getGroupId().equals( d.getArtifact().getGroupId() ) && originalArtifact.getArtifactId().equals( d.getArtifact().getArtifactId() ); processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, d, descriptorResult.getRelocations(), disableVersionManagementSubsequently ); return; } else { d = args.pool.intern( d.setArtifact( args.pool.intern( d.getArtifact() ) ) ); List repos = getRemoteRepositories( rangeResult.getRepository( version ), repositories ); DefaultDependencyNode child = createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult.getAliases(), repos, args.request.getRequestContext() ); node.getChildren().add( child ); boolean recurse = traverse && !descriptorResult.getDependencies().isEmpty(); if ( recurse ) { doRecurse( args, results, repositories, depSelector, depManager, depTraverser, verFilter, d, descriptorResult, child ); } } } else { DependencyNode node = args.nodes.top(); List repos = getRemoteRepositories( rangeResult.getRepository( version ), repositories ); DefaultDependencyNode child = createDependencyNode( relocations, preManaged, rangeResult, version, d, null, repos, args.request.getRequestContext() ); node.getChildren().add( child ); } } } private void doRecurse( Args args, Results results, List repositories, DependencySelector depSelector, DependencyManager depManager, DependencyTraverser depTraverser, VersionFilter verFilter, Dependency d, ArtifactDescriptorResult descriptorResult, DefaultDependencyNode child ) { DefaultDependencyCollectionContext context = args.collectionContext; context.set( d, descriptorResult.getManagedDependencies() ); DependencySelector childSelector = depSelector != null ? depSelector.deriveChildSelector( context ) : null; DependencyManager childManager = depManager != null ? depManager.deriveChildManager( context ) : null; DependencyTraverser childTraverser = depTraverser != null ? depTraverser.deriveChildTraverser( context ) : null; VersionFilter childFilter = verFilter != null ? verFilter.deriveChildFilter( context ) : null; final List childRepos = args.ignoreRepos ? repositories : remoteRepositoryManager.aggregateRepositories( args.session, repositories, descriptorResult.getRepositories(), true ); Object key = args.pool.toKey( d.getArtifact(), childRepos, childSelector, childManager, childTraverser, childFilter ); List children = args.pool.getChildren( key ); if ( children == null ) { args.pool.putChildren( key, child.getChildren() ); args.nodes.push( child ); process( args, results, descriptorResult.getDependencies(), childRepos, childSelector, childManager, childTraverser, childFilter ); args.nodes.pop(); } else { child.setChildren( children ); } } private ArtifactDescriptorResult getArtifactDescriptorResult( Args args, Results results, boolean noDescriptor, Dependency d, ArtifactDescriptorRequest descriptorRequest ) { return noDescriptor ? new ArtifactDescriptorResult( descriptorRequest ) : resolveCachedArtifactDescriptor( args.pool, descriptorRequest, args.session, d, results, args ); } private ArtifactDescriptorResult resolveCachedArtifactDescriptor( DataPool pool, ArtifactDescriptorRequest descriptorRequest, RepositorySystemSession session, Dependency d, Results results, Args args ) { Object key = pool.toKey( descriptorRequest ); ArtifactDescriptorResult descriptorResult = pool.getDescriptor( key, descriptorRequest ); if ( descriptorResult == null ) { try { descriptorResult = descriptorReader.readArtifactDescriptor( session, descriptorRequest ); pool.putDescriptor( key, descriptorResult ); } catch ( ArtifactDescriptorException e ) { results.addException( d, e, args.nodes ); pool.putDescriptor( key, e ); return null; } } else if ( descriptorResult == DataPool.NO_DESCRIPTOR ) { return null; } return descriptorResult; } private static DefaultDependencyNode createDependencyNode( List relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, Collection aliases, List repos, String requestContext ) { DefaultDependencyNode child = new DefaultDependencyNode( d ); preManaged.applyTo( child ); child.setRelocations( relocations ); child.setVersionConstraint( rangeResult.getVersionConstraint() ); child.setVersion( version ); child.setAliases( aliases ); child.setRepositories( repos ); child.setRequestContext( requestContext ); return child; } private static DefaultDependencyNode createDependencyNode( List relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, ArtifactDescriptorResult descriptorResult, DependencyNode cycleNode ) { DefaultDependencyNode child = createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult.getAliases(), cycleNode.getRepositories(), cycleNode.getRequestContext() ); child.setChildren( cycleNode.getChildren() ); return child; } private static ArtifactDescriptorRequest createArtifactDescriptorRequest( Args args, List repositories, Dependency d ) { ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); descriptorRequest.setArtifact( d.getArtifact() ); descriptorRequest.setRepositories( repositories ); descriptorRequest.setRequestContext( args.request.getRequestContext() ); descriptorRequest.setTrace( args.trace ); return descriptorRequest; } private static VersionRangeRequest createVersionRangeRequest( Args args, List repositories, Dependency dependency ) { VersionRangeRequest rangeRequest = new VersionRangeRequest(); rangeRequest.setArtifact( dependency.getArtifact() ); rangeRequest.setRepositories( repositories ); rangeRequest.setRequestContext( args.request.getRequestContext() ); rangeRequest.setTrace( args.trace ); return rangeRequest; } private VersionRangeResult cachedResolveRangeResult( VersionRangeRequest rangeRequest, DataPool pool, RepositorySystemSession session ) throws VersionRangeResolutionException { Object key = pool.toKey( rangeRequest ); VersionRangeResult rangeResult = pool.getConstraint( key, rangeRequest ); if ( rangeResult == null ) { rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); pool.putConstraint( key, rangeResult ); } return rangeResult; } private static boolean isLackingDescriptor( Artifact artifact ) { return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null; } private static List getRemoteRepositories( ArtifactRepository repository, List repositories ) { if ( repository instanceof RemoteRepository ) { return Collections.singletonList( (RemoteRepository) repository ); } if ( repository != null ) { return Collections.emptyList(); } return repositories; } private static List filterVersions( Dependency dependency, VersionRangeResult rangeResult, VersionFilter verFilter, DefaultVersionFilterContext verContext ) throws VersionRangeResolutionException { if ( rangeResult.getVersions().isEmpty() ) { throw new VersionRangeResolutionException( rangeResult, "No versions available for " + dependency.getArtifact() + " within specified range" ); } List versions; if ( verFilter != null && rangeResult.getVersionConstraint().getRange() != null ) { verContext.set( dependency, rangeResult ); try { verFilter.filterVersions( verContext ); } catch ( RepositoryException e ) { throw new VersionRangeResolutionException( rangeResult, "Failed to filter versions for " + dependency.getArtifact() + ": " + e.getMessage(), e ); } versions = verContext.get(); if ( versions.isEmpty() ) { throw new VersionRangeResolutionException( rangeResult, "No acceptable versions for " + dependency.getArtifact() + ": " + rangeResult.getVersions() ); } } else { versions = rangeResult.getVersions(); } return versions; } static class Args { final RepositorySystemSession session; final boolean ignoreRepos; final boolean premanagedState; final RequestTrace trace; final DataPool pool; final NodeStack nodes; final DefaultDependencyCollectionContext collectionContext; final DefaultVersionFilterContext versionContext; final CollectRequest request; public Args( RepositorySystemSession session, RequestTrace trace, DataPool pool, NodeStack nodes, DefaultDependencyCollectionContext collectionContext, DefaultVersionFilterContext versionContext, CollectRequest request ) { this.session = session; this.request = request; this.ignoreRepos = session.isIgnoreArtifactDescriptorRepositories(); this.premanagedState = ConfigUtils.getBoolean( session, false, DependencyManagerUtils.CONFIG_PROP_VERBOSE ); this.trace = trace; this.pool = pool; this.nodes = nodes; this.collectionContext = collectionContext; this.versionContext = versionContext; } } static class Results { private final CollectResult result; final int maxExceptions; final int maxCycles; String errorPath; public Results( CollectResult result, RepositorySystemSession session ) { this.result = result; this.maxExceptions = ConfigUtils.getInteger( session, 50, CONFIG_PROP_MAX_EXCEPTIONS ); this.maxCycles = ConfigUtils.getInteger( session, 10, CONFIG_PROP_MAX_CYCLES ); } public void addException( Dependency dependency, Exception e, NodeStack nodes ) { if ( maxExceptions < 0 || result.getExceptions().size() < maxExceptions ) { result.addException( e ); if ( errorPath == null ) { StringBuilder buffer = new StringBuilder( 256 ); for ( int i = 0; i < nodes.size(); i++ ) { if ( buffer.length() > 0 ) { buffer.append( " -> " ); } Dependency dep = nodes.get( i ).getDependency(); if ( dep != null ) { buffer.append( dep.getArtifact() ); } } if ( buffer.length() > 0 ) { buffer.append( " -> " ); } buffer.append( dependency.getArtifact() ); errorPath = buffer.toString(); } } } public void addCycle( NodeStack nodes, int cycleEntry, Dependency dependency ) { if ( maxCycles < 0 || result.getCycles().size() < maxCycles ) { result.addCycle( new DefaultDependencyCycle( nodes, cycleEntry, dependency ) ); } } } static class PremanagedDependency { final String premanagedVersion; final String premanagedScope; final Boolean premanagedOptional; final int managedBits; final Dependency managedDependency; final boolean premanagedState; PremanagedDependency( String premanagedVersion, String premanagedScope, Boolean premanagedOptional, int managedBits, Dependency managedDependency, boolean premanagedState ) { this.premanagedVersion = premanagedVersion; this.premanagedScope = premanagedScope; this.premanagedOptional = premanagedOptional; this.managedBits = managedBits; this.managedDependency = managedDependency; this.premanagedState = premanagedState; } static PremanagedDependency create( DependencyManager depManager, Dependency dependency, boolean disableVersionManagement, boolean premanagedState ) { DependencyManagement depMngt = depManager != null ? depManager.manageDependency( dependency ) : null; int managedBits = 0; String premanagedVersion = null; String premanagedScope = null; Boolean premanagedOptional = null; if ( depMngt != null ) { if ( depMngt.getVersion() != null && !disableVersionManagement ) { Artifact artifact = dependency.getArtifact(); premanagedVersion = artifact.getVersion(); dependency = dependency.setArtifact( artifact.setVersion( depMngt.getVersion() ) ); managedBits |= DependencyNode.MANAGED_VERSION; } if ( depMngt.getProperties() != null ) { Artifact artifact = dependency.getArtifact(); dependency = dependency.setArtifact( artifact.setProperties( depMngt.getProperties() ) ); managedBits |= DependencyNode.MANAGED_PROPERTIES; } if ( depMngt.getScope() != null ) { premanagedScope = dependency.getScope(); dependency = dependency.setScope( depMngt.getScope() ); managedBits |= DependencyNode.MANAGED_SCOPE; } if ( depMngt.getOptional() != null ) { premanagedOptional = dependency.isOptional(); dependency = dependency.setOptional( depMngt.getOptional() ); managedBits |= DependencyNode.MANAGED_OPTIONAL; } if ( depMngt.getExclusions() != null ) { dependency = dependency.setExclusions( depMngt.getExclusions() ); managedBits |= DependencyNode.MANAGED_EXCLUSIONS; } } return new PremanagedDependency( premanagedVersion, premanagedScope, premanagedOptional, managedBits, dependency, premanagedState ); } public void applyTo( DefaultDependencyNode child ) { child.setManagedBits( managedBits ); if ( premanagedState ) { child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_VERSION, premanagedVersion ); child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_SCOPE, premanagedScope ); child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_OPTIONAL, premanagedOptional ); } } } } DefaultDependencyCycle.java000066400000000000000000000053101245546356100343100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyCycle; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.artifact.ArtifactIdUtils; /** * @see DefaultDependencyCollector */ final class DefaultDependencyCycle implements DependencyCycle { private final List dependencies; private final int cycleEntry; public DefaultDependencyCycle( NodeStack nodes, int cycleEntry, Dependency dependency ) { // skip root node unless it actually has a dependency or is considered the cycle entry (due to its label) int offset = ( cycleEntry > 0 && nodes.get( 0 ).getDependency() == null ) ? 1 : 0; Dependency[] dependencies = new Dependency[nodes.size() - offset + 1]; for ( int i = 0, n = dependencies.length - 1; i < n; i++ ) { DependencyNode node = nodes.get( i + offset ); dependencies[i] = node.getDependency(); // when cycle starts at root artifact as opposed to root dependency, synthesize a dependency if ( dependencies[i] == null ) { dependencies[i] = new Dependency( node.getArtifact(), null ); } } dependencies[dependencies.length - 1] = dependency; this.dependencies = Collections.unmodifiableList( Arrays.asList( dependencies ) ); this.cycleEntry = cycleEntry; } public List getPrecedingDependencies() { return dependencies.subList( 0, cycleEntry ); } public List getCyclicDependencies() { return dependencies.subList( cycleEntry, dependencies.size() ); } @Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); for ( int i = 0, n = dependencies.size(); i < n; i++ ) { if ( i > 0 ) { buffer.append( " -> " ); } buffer.append( ArtifactIdUtils.toVersionlessId( dependencies.get( i ).getArtifact() ) ); } return buffer.toString(); } } DefaultDependencyGraphTransformationContext.java000066400000000000000000000035131245546356100406110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformationContext; /** */ class DefaultDependencyGraphTransformationContext implements DependencyGraphTransformationContext { private final RepositorySystemSession session; private final Map map; public DefaultDependencyGraphTransformationContext( RepositorySystemSession session ) { this.session = session; this.map = new HashMap(); } public RepositorySystemSession getSession() { return session; } public Object get( Object key ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } return map.get( key ); } public Object put( Object key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } if ( value != null ) { return map.put( key, value ); } else { return map.remove( key ); } } @Override public String toString() { return String.valueOf( map ); } } DefaultDeployer.java000066400000000000000000000606471245546356100330530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.IdentityHashMap; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.impl.Deployer; import org.eclipse.aether.impl.MetadataGenerator; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.metadata.MergeableMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.ArtifactUpload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.spi.connector.MetadataUpload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.NoRepositoryConnectorException; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.transfer.TransferEvent; /** */ @Named public class DefaultDeployer implements Deployer, Service { private Logger logger = NullLoggerFactory.LOGGER; private FileProcessor fileProcessor; private RepositoryEventDispatcher repositoryEventDispatcher; private RepositoryConnectorProvider repositoryConnectorProvider; private RemoteRepositoryManager remoteRepositoryManager; private UpdateCheckManager updateCheckManager; private Collection metadataFactories = new ArrayList(); private SyncContextFactory syncContextFactory; private OfflineController offlineController; public DefaultDeployer() { // enables default constructor } @Inject DefaultDeployer( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher, RepositoryConnectorProvider repositoryConnectorProvider, RemoteRepositoryManager remoteRepositoryManager, UpdateCheckManager updateCheckManager, Set metadataFactories, SyncContextFactory syncContextFactory, OfflineController offlineController, LoggerFactory loggerFactory ) { setFileProcessor( fileProcessor ); setRepositoryEventDispatcher( repositoryEventDispatcher ); setRepositoryConnectorProvider( repositoryConnectorProvider ); setRemoteRepositoryManager( remoteRepositoryManager ); setUpdateCheckManager( updateCheckManager ); setMetadataGeneratorFactories( metadataFactories ); setSyncContextFactory( syncContextFactory ); setLoggerFactory( loggerFactory ); setOfflineController( offlineController ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setFileProcessor( locator.getService( FileProcessor.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); setRepositoryConnectorProvider( locator.getService( RepositoryConnectorProvider.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setUpdateCheckManager( locator.getService( UpdateCheckManager.class ) ); setMetadataGeneratorFactories( locator.getServices( MetadataGeneratorFactory.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); setOfflineController( locator.getService( OfflineController.class ) ); } public DefaultDeployer setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultDeployer setFileProcessor( FileProcessor fileProcessor ) { if ( fileProcessor == null ) { throw new IllegalArgumentException( "file processor has not been specified" ); } this.fileProcessor = fileProcessor; return this; } public DefaultDeployer setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) { if ( repositoryEventDispatcher == null ) { throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); } this.repositoryEventDispatcher = repositoryEventDispatcher; return this; } public DefaultDeployer setRepositoryConnectorProvider( RepositoryConnectorProvider repositoryConnectorProvider ) { if ( repositoryConnectorProvider == null ) { throw new IllegalArgumentException( "repository connector provider has not been specified" ); } this.repositoryConnectorProvider = repositoryConnectorProvider; return this; } public DefaultDeployer setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) { throw new IllegalArgumentException( "remote repository manager has not been specified" ); } this.remoteRepositoryManager = remoteRepositoryManager; return this; } public DefaultDeployer setUpdateCheckManager( UpdateCheckManager updateCheckManager ) { if ( updateCheckManager == null ) { throw new IllegalArgumentException( "update check manager has not been specified" ); } this.updateCheckManager = updateCheckManager; return this; } public DefaultDeployer addMetadataGeneratorFactory( MetadataGeneratorFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "metadata generator factory has not been specified" ); } metadataFactories.add( factory ); return this; } public DefaultDeployer setMetadataGeneratorFactories( Collection metadataFactories ) { if ( metadataFactories == null ) { this.metadataFactories = new ArrayList(); } else { this.metadataFactories = metadataFactories; } return this; } public DefaultDeployer setSyncContextFactory( SyncContextFactory syncContextFactory ) { if ( syncContextFactory == null ) { throw new IllegalArgumentException( "sync context factory has not been specified" ); } this.syncContextFactory = syncContextFactory; return this; } public DefaultDeployer setOfflineController( OfflineController offlineController ) { if ( offlineController == null ) { throw new IllegalArgumentException( "offline controller has not been specified" ); } this.offlineController = offlineController; return this; } public DeployResult deploy( RepositorySystemSession session, DeployRequest request ) throws DeploymentException { try { Utils.checkOffline( session, offlineController, request.getRepository() ); } catch ( RepositoryOfflineException e ) { throw new DeploymentException( "Cannot deploy while " + request.getRepository().getId() + " (" + request.getRepository().getUrl() + ") is in offline mode", e ); } SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return deploy( syncContext, session, request ); } finally { syncContext.close(); } } private DeployResult deploy( SyncContext syncContext, RepositorySystemSession session, DeployRequest request ) throws DeploymentException { DeployResult result = new DeployResult( request ); RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); RemoteRepository repository = request.getRepository(); RepositoryConnector connector; try { connector = repositoryConnectorProvider.newRepositoryConnector( session, repository ); } catch ( NoRepositoryConnectorException e ) { throw new DeploymentException( "Failed to deploy artifacts/metadata: " + e.getMessage(), e ); } try { List generators = getMetadataGenerators( session, request ); List artifactUploads = new ArrayList(); List metadataUploads = new ArrayList(); IdentityHashMap processedMetadata = new IdentityHashMap(); EventCatapult catapult = new EventCatapult( session, trace, repository, repositoryEventDispatcher ); List artifacts = new ArrayList( request.getArtifacts() ); List metadatas = Utils.prepareMetadata( generators, artifacts ); syncContext.acquire( artifacts, Utils.combine( request.getMetadata(), metadatas ) ); for ( Metadata metadata : metadatas ) { upload( metadataUploads, session, metadata, repository, connector, catapult ); processedMetadata.put( metadata, null ); } for ( int i = 0; i < artifacts.size(); i++ ) { Artifact artifact = artifacts.get( i ); for ( MetadataGenerator generator : generators ) { artifact = generator.transformArtifact( artifact ); } artifacts.set( i, artifact ); ArtifactUpload upload = new ArtifactUpload( artifact, artifact.getFile() ); upload.setTrace( trace ); upload.setListener( new ArtifactUploadListener( catapult, upload, logger ) ); artifactUploads.add( upload ); } connector.put( artifactUploads, null ); for ( ArtifactUpload upload : artifactUploads ) { if ( upload.getException() != null ) { throw new DeploymentException( "Failed to deploy artifacts: " + upload.getException().getMessage(), upload.getException() ); } result.addArtifact( upload.getArtifact() ); } metadatas = Utils.finishMetadata( generators, artifacts ); syncContext.acquire( null, metadatas ); for ( Metadata metadata : metadatas ) { upload( metadataUploads, session, metadata, repository, connector, catapult ); processedMetadata.put( metadata, null ); } for ( Metadata metadata : request.getMetadata() ) { if ( !processedMetadata.containsKey( metadata ) ) { upload( metadataUploads, session, metadata, repository, connector, catapult ); processedMetadata.put( metadata, null ); } } connector.put( null, metadataUploads ); for ( MetadataUpload upload : metadataUploads ) { if ( upload.getException() != null ) { throw new DeploymentException( "Failed to deploy metadata: " + upload.getException().getMessage(), upload.getException() ); } result.addMetadata( upload.getMetadata() ); } } finally { connector.close(); } return result; } private List getMetadataGenerators( RepositorySystemSession session, DeployRequest request ) { PrioritizedComponents factories = Utils.sortMetadataGeneratorFactories( session, this.metadataFactories ); List generators = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { MetadataGenerator generator = factory.getComponent().newInstance( session, request ); if ( generator != null ) { generators.add( generator ); } } return generators; } private void upload( Collection metadataUploads, RepositorySystemSession session, Metadata metadata, RemoteRepository repository, RepositoryConnector connector, EventCatapult catapult ) throws DeploymentException { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); File basedir = lrm.getRepository().getBasedir(); File dstFile = new File( basedir, lrm.getPathForRemoteMetadata( metadata, repository, "" ) ); if ( metadata instanceof MergeableMetadata ) { if ( !( (MergeableMetadata) metadata ).isMerged() ) { { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_RESOLVING ); event.setTrace( catapult.getTrace() ); event.setMetadata( metadata ); event.setRepository( repository ); repositoryEventDispatcher.dispatch( event.build() ); event = new RepositoryEvent.Builder( session, EventType.METADATA_DOWNLOADING ); event.setTrace( catapult.getTrace() ); event.setMetadata( metadata ); event.setRepository( repository ); repositoryEventDispatcher.dispatch( event.build() ); } RepositoryPolicy policy = getPolicy( session, repository, metadata.getNature() ); MetadataDownload download = new MetadataDownload(); download.setMetadata( metadata ); download.setFile( dstFile ); download.setChecksumPolicy( policy.getChecksumPolicy() ); download.setListener( SafeTransferListener.wrap( session, logger ) ); download.setTrace( catapult.getTrace() ); connector.get( null, Arrays.asList( download ) ); Exception error = download.getException(); if ( error instanceof MetadataNotFoundException ) { dstFile.delete(); } { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_DOWNLOADED ); event.setTrace( catapult.getTrace() ); event.setMetadata( metadata ); event.setRepository( repository ); event.setException( error ); event.setFile( dstFile ); repositoryEventDispatcher.dispatch( event.build() ); event = new RepositoryEvent.Builder( session, EventType.METADATA_RESOLVED ); event.setTrace( catapult.getTrace() ); event.setMetadata( metadata ); event.setRepository( repository ); event.setException( error ); event.setFile( dstFile ); repositoryEventDispatcher.dispatch( event.build() ); } if ( error != null && !( error instanceof MetadataNotFoundException ) ) { throw new DeploymentException( "Failed to retrieve remote metadata " + metadata + ": " + error.getMessage(), error ); } } try { ( (MergeableMetadata) metadata ).merge( dstFile, dstFile ); } catch ( RepositoryException e ) { throw new DeploymentException( "Failed to update metadata " + metadata + ": " + e.getMessage(), e ); } } else { if ( metadata.getFile() == null ) { throw new DeploymentException( "Failed to update metadata " + metadata + ": No file attached." ); } try { fileProcessor.copy( metadata.getFile(), dstFile ); } catch ( IOException e ) { throw new DeploymentException( "Failed to update metadata " + metadata + ": " + e.getMessage(), e ); } } UpdateCheck check = new UpdateCheck(); check.setItem( metadata ); check.setFile( dstFile ); check.setRepository( repository ); check.setAuthoritativeRepository( repository ); updateCheckManager.touchMetadata( session, check ); MetadataUpload upload = new MetadataUpload( metadata, dstFile ); upload.setTrace( catapult.getTrace() ); upload.setListener( new MetadataUploadListener( catapult, upload, logger ) ); metadataUploads.add( upload ); } private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); } static final class EventCatapult { private final RepositorySystemSession session; private final RequestTrace trace; private final RemoteRepository repository; private final RepositoryEventDispatcher dispatcher; public EventCatapult( RepositorySystemSession session, RequestTrace trace, RemoteRepository repository, RepositoryEventDispatcher dispatcher ) { this.session = session; this.trace = trace; this.repository = repository; this.dispatcher = dispatcher; } public RepositorySystemSession getSession() { return session; } public RequestTrace getTrace() { return trace; } public void artifactDeploying( Artifact artifact, File file ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DEPLOYING ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( repository ); event.setFile( file ); dispatcher.dispatch( event.build() ); } public void artifactDeployed( Artifact artifact, File file, ArtifactTransferException exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DEPLOYED ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( repository ); event.setFile( file ); event.setException( exception ); dispatcher.dispatch( event.build() ); } public void metadataDeploying( Metadata metadata, File file ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_DEPLOYING ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); event.setFile( file ); dispatcher.dispatch( event.build() ); } public void metadataDeployed( Metadata metadata, File file, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_DEPLOYED ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); event.setFile( file ); event.setException( exception ); dispatcher.dispatch( event.build() ); } } static final class ArtifactUploadListener extends SafeTransferListener { private final EventCatapult catapult; private final ArtifactUpload transfer; public ArtifactUploadListener( EventCatapult catapult, ArtifactUpload transfer, Logger logger ) { super( catapult.getSession(), logger ); this.catapult = catapult; this.transfer = transfer; } @Override public void transferInitiated( TransferEvent event ) throws TransferCancelledException { super.transferInitiated( event ); catapult.artifactDeploying( transfer.getArtifact(), transfer.getFile() ); } @Override public void transferFailed( TransferEvent event ) { super.transferFailed( event ); catapult.artifactDeployed( transfer.getArtifact(), transfer.getFile(), transfer.getException() ); } @Override public void transferSucceeded( TransferEvent event ) { super.transferSucceeded( event ); catapult.artifactDeployed( transfer.getArtifact(), transfer.getFile(), null ); } } static final class MetadataUploadListener extends SafeTransferListener { private final EventCatapult catapult; private final MetadataUpload transfer; public MetadataUploadListener( EventCatapult catapult, MetadataUpload transfer, Logger logger ) { super( catapult.getSession(), logger ); this.catapult = catapult; this.transfer = transfer; } @Override public void transferInitiated( TransferEvent event ) throws TransferCancelledException { super.transferInitiated( event ); catapult.metadataDeploying( transfer.getMetadata(), transfer.getFile() ); } @Override public void transferFailed( TransferEvent event ) { super.transferFailed( event ); catapult.metadataDeployed( transfer.getMetadata(), transfer.getFile(), transfer.getException() ); } @Override public void transferSucceeded( TransferEvent event ) { super.transferSucceeded( event ); catapult.metadataDeployed( transfer.getMetadata(), transfer.getFile(), null ); } } } DefaultFileProcessor.java000066400000000000000000000124641245546356100340410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; import javax.inject.Named; import org.eclipse.aether.spi.io.FileProcessor; /** * A utility class helping with file-based operations. */ @Named public class DefaultFileProcessor implements FileProcessor { private static void close( Closeable closeable ) { if ( closeable != null ) { try { closeable.close(); } catch ( IOException e ) { // too bad but who cares } } } /** * Thread-safe variant of {@link File#mkdirs()}. Creates the directory named by the given abstract pathname, * including any necessary but nonexistent parent directories. Note that if this operation fails it may have * succeeded in creating some of the necessary parent directories. * * @param directory The directory to create, may be {@code null}. * @return {@code true} if and only if the directory was created, along with all necessary parent directories; * {@code false} otherwise */ public boolean mkdirs( File directory ) { if ( directory == null ) { return false; } if ( directory.exists() ) { return false; } if ( directory.mkdir() ) { return true; } File canonDir; try { canonDir = directory.getCanonicalFile(); } catch ( IOException e ) { return false; } File parentDir = canonDir.getParentFile(); return ( parentDir != null && ( mkdirs( parentDir ) || parentDir.exists() ) && canonDir.mkdir() ); } public void write( File target, String data ) throws IOException { mkdirs( target.getAbsoluteFile().getParentFile() ); OutputStream fos = null; try { fos = new FileOutputStream( target ); if ( data != null ) { fos.write( data.getBytes( "UTF-8" ) ); } // allow output to report any flush/close errors fos.close(); } finally { close( fos ); } } public void write( File target, InputStream source ) throws IOException { mkdirs( target.getAbsoluteFile().getParentFile() ); OutputStream fos = null; try { fos = new FileOutputStream( target ); copy( fos, source, null ); // allow output to report any flush/close errors fos.close(); } finally { close( fos ); } } public void copy( File source, File target ) throws IOException { copy( source, target, null ); } public long copy( File source, File target, ProgressListener listener ) throws IOException { long total = 0; InputStream fis = null; OutputStream fos = null; try { fis = new FileInputStream( source ); mkdirs( target.getAbsoluteFile().getParentFile() ); fos = new FileOutputStream( target ); total = copy( fos, fis, listener ); // allow output to report any flush/close errors fos.close(); } finally { close( fis ); close( fos ); } return total; } private long copy( OutputStream os, InputStream is, ProgressListener listener ) throws IOException { long total = 0; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); byte[] array = buffer.array(); while ( true ) { int bytes = is.read( array ); if ( bytes < 0 ) { break; } os.write( array, 0, bytes ); total += bytes; if ( listener != null && bytes > 0 ) { try { buffer.rewind(); buffer.limit( bytes ); listener.progressed( buffer ); } catch ( Exception e ) { // too bad } } } return total; } public void move( File source, File target ) throws IOException { if ( !source.renameTo( target ) ) { copy( source, target ); target.setLastModified( source.lastModified() ); source.delete(); } } } DefaultInstaller.java000066400000000000000000000332051245546356100332130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.IdentityHashMap; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.Installer; import org.eclipse.aether.impl.MetadataGenerator; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; import org.eclipse.aether.metadata.MergeableMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** */ @Named public class DefaultInstaller implements Installer, Service { private Logger logger = NullLoggerFactory.LOGGER; private FileProcessor fileProcessor; private RepositoryEventDispatcher repositoryEventDispatcher; private Collection metadataFactories = new ArrayList(); private SyncContextFactory syncContextFactory; public DefaultInstaller() { // enables default constructor } @Inject DefaultInstaller( FileProcessor fileProcessor, RepositoryEventDispatcher repositoryEventDispatcher, Set metadataFactories, SyncContextFactory syncContextFactory, LoggerFactory loggerFactory ) { setFileProcessor( fileProcessor ); setRepositoryEventDispatcher( repositoryEventDispatcher ); setMetadataGeneratorFactories( metadataFactories ); setSyncContextFactory( syncContextFactory ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setFileProcessor( locator.getService( FileProcessor.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); setMetadataGeneratorFactories( locator.getServices( MetadataGeneratorFactory.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); } public DefaultInstaller setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultInstaller setFileProcessor( FileProcessor fileProcessor ) { if ( fileProcessor == null ) { throw new IllegalArgumentException( "file processor has not been specified" ); } this.fileProcessor = fileProcessor; return this; } public DefaultInstaller setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) { if ( repositoryEventDispatcher == null ) { throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); } this.repositoryEventDispatcher = repositoryEventDispatcher; return this; } public DefaultInstaller addMetadataGeneratorFactory( MetadataGeneratorFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "metadata generator factory has not been specified" ); } metadataFactories.add( factory ); return this; } public DefaultInstaller setMetadataGeneratorFactories( Collection metadataFactories ) { if ( metadataFactories == null ) { this.metadataFactories = new ArrayList(); } else { this.metadataFactories = metadataFactories; } return this; } public DefaultInstaller setSyncContextFactory( SyncContextFactory syncContextFactory ) { if ( syncContextFactory == null ) { throw new IllegalArgumentException( "sync context factory has not been specified" ); } this.syncContextFactory = syncContextFactory; return this; } public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { return install( syncContext, session, request ); } finally { syncContext.close(); } } private InstallResult install( SyncContext syncContext, RepositorySystemSession session, InstallRequest request ) throws InstallationException { InstallResult result = new InstallResult( request ); RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); List generators = getMetadataGenerators( session, request ); List artifacts = new ArrayList( request.getArtifacts() ); IdentityHashMap processedMetadata = new IdentityHashMap(); List metadatas = Utils.prepareMetadata( generators, artifacts ); syncContext.acquire( artifacts, Utils.combine( request.getMetadata(), metadatas ) ); for ( Metadata metadata : metadatas ) { install( session, trace, metadata ); processedMetadata.put( metadata, null ); result.addMetadata( metadata ); } for ( int i = 0; i < artifacts.size(); i++ ) { Artifact artifact = artifacts.get( i ); for ( MetadataGenerator generator : generators ) { artifact = generator.transformArtifact( artifact ); } artifacts.set( i, artifact ); install( session, trace, artifact ); result.addArtifact( artifact ); } metadatas = Utils.finishMetadata( generators, artifacts ); syncContext.acquire( null, metadatas ); for ( Metadata metadata : metadatas ) { install( session, trace, metadata ); processedMetadata.put( metadata, null ); result.addMetadata( metadata ); } for ( Metadata metadata : request.getMetadata() ) { if ( !processedMetadata.containsKey( metadata ) ) { install( session, trace, metadata ); result.addMetadata( metadata ); } } return result; } private List getMetadataGenerators( RepositorySystemSession session, InstallRequest request ) { PrioritizedComponents factories = Utils.sortMetadataGeneratorFactories( session, this.metadataFactories ); List generators = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { MetadataGenerator generator = factory.getComponent().newInstance( session, request ); if ( generator != null ) { generators.add( generator ); } } return generators; } private void install( RepositorySystemSession session, RequestTrace trace, Artifact artifact ) throws InstallationException { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); File srcFile = artifact.getFile(); File dstFile = new File( lrm.getRepository().getBasedir(), lrm.getPathForLocalArtifact( artifact ) ); artifactInstalling( session, trace, artifact, dstFile ); Exception exception = null; try { if ( dstFile.equals( srcFile ) ) { throw new IllegalArgumentException( "Cannot install " + dstFile + " to same path" ); } boolean copy = "pom".equals( artifact.getExtension() ) || srcFile.lastModified() != dstFile.lastModified() || srcFile.length() != dstFile.length() || !srcFile.exists(); if ( copy ) { fileProcessor.copy( srcFile, dstFile ); dstFile.setLastModified( srcFile.lastModified() ); } else { logger.debug( "Skipped re-installing " + srcFile + " to " + dstFile + ", seems unchanged" ); } lrm.add( session, new LocalArtifactRegistration( artifact ) ); } catch ( Exception e ) { exception = e; throw new InstallationException( "Failed to install artifact " + artifact + ": " + e.getMessage(), e ); } finally { artifactInstalled( session, trace, artifact, dstFile, exception ); } } private void install( RepositorySystemSession session, RequestTrace trace, Metadata metadata ) throws InstallationException { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); File dstFile = new File( lrm.getRepository().getBasedir(), lrm.getPathForLocalMetadata( metadata ) ); metadataInstalling( session, trace, metadata, dstFile ); Exception exception = null; try { if ( metadata instanceof MergeableMetadata ) { ( (MergeableMetadata) metadata ).merge( dstFile, dstFile ); } else { if ( dstFile.equals( metadata.getFile() ) ) { throw new IllegalArgumentException( "Cannot install " + dstFile + " to same path" ); } fileProcessor.copy( metadata.getFile(), dstFile ); } lrm.add( session, new LocalMetadataRegistration( metadata ) ); } catch ( Exception e ) { exception = e; throw new InstallationException( "Failed to install metadata " + metadata + ": " + e.getMessage(), e ); } finally { metadataInstalled( session, trace, metadata, dstFile, exception ); } } private void artifactInstalling( RepositorySystemSession session, RequestTrace trace, Artifact artifact, File dstFile ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_INSTALLING ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( session.getLocalRepositoryManager().getRepository() ); event.setFile( dstFile ); repositoryEventDispatcher.dispatch( event.build() ); } private void artifactInstalled( RepositorySystemSession session, RequestTrace trace, Artifact artifact, File dstFile, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_INSTALLED ); event.setTrace( trace ); event.setArtifact( artifact ); event.setRepository( session.getLocalRepositoryManager().getRepository() ); event.setFile( dstFile ); event.setException( exception ); repositoryEventDispatcher.dispatch( event.build() ); } private void metadataInstalling( RepositorySystemSession session, RequestTrace trace, Metadata metadata, File dstFile ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INSTALLING ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( session.getLocalRepositoryManager().getRepository() ); event.setFile( dstFile ); repositoryEventDispatcher.dispatch( event.build() ); } private void metadataInstalled( RepositorySystemSession session, RequestTrace trace, Metadata metadata, File dstFile, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INSTALLED ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( session.getLocalRepositoryManager().getRepository() ); event.setFile( dstFile ); event.setException( exception ); repositoryEventDispatcher.dispatch( event.build() ); } } DefaultLocalRepositoryProvider.java000066400000000000000000000130601245546356100361200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.LocalRepositoryProvider; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** */ @Named public class DefaultLocalRepositoryProvider implements LocalRepositoryProvider, Service { private Logger logger = NullLoggerFactory.LOGGER; private Collection managerFactories = new ArrayList(); public DefaultLocalRepositoryProvider() { // enables default constructor } @Inject DefaultLocalRepositoryProvider( Set factories, LoggerFactory loggerFactory ) { setLocalRepositoryManagerFactories( factories ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setLocalRepositoryManagerFactories( locator.getServices( LocalRepositoryManagerFactory.class ) ); } public DefaultLocalRepositoryProvider setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultLocalRepositoryProvider addLocalRepositoryManagerFactory( LocalRepositoryManagerFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "Local repository manager factory has not been specified." ); } managerFactories.add( factory ); return this; } public DefaultLocalRepositoryProvider setLocalRepositoryManagerFactories( Collection factories ) { if ( factories == null ) { managerFactories = new ArrayList( 2 ); } else { managerFactories = factories; } return this; } public LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session, LocalRepository repository ) throws NoLocalRepositoryManagerException { PrioritizedComponents factories = new PrioritizedComponents( session ); for ( LocalRepositoryManagerFactory factory : this.managerFactories ) { factories.add( factory, factory.getPriority() ); } List errors = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { try { LocalRepositoryManager manager = factory.getComponent().newInstance( session, repository ); if ( logger.isDebugEnabled() ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Using manager " ).append( manager.getClass().getSimpleName() ); Utils.appendClassLoader( buffer, manager ); buffer.append( " with priority " ).append( factory.getPriority() ); buffer.append( " for " ).append( repository.getBasedir() ); logger.debug( buffer.toString() ); } return manager; } catch ( NoLocalRepositoryManagerException e ) { // continue and try next factory errors.add( e ); } } if ( logger.isDebugEnabled() && errors.size() > 1 ) { String msg = "Could not obtain local repository manager for " + repository; for ( Exception e : errors ) { logger.debug( msg, e ); } } StringBuilder buffer = new StringBuilder( 256 ); if ( factories.isEmpty() ) { buffer.append( "No local repository managers registered" ); } else { buffer.append( "Cannot access " ).append( repository.getBasedir() ); buffer.append( " with type " ).append( repository.getContentType() ); buffer.append( " using the available factories " ); factories.list( buffer ); } throw new NoLocalRepositoryManagerException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null ); } } DefaultMetadataResolver.java000066400000000000000000000617301245546356100345240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.LocalMetadataRequest; import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.NoRepositoryConnectorException; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.eclipse.aether.util.ConfigUtils; import org.eclipse.aether.util.concurrency.RunnableErrorForwarder; import org.eclipse.aether.util.concurrency.WorkerThreadFactory; /** */ @Named public class DefaultMetadataResolver implements MetadataResolver, Service { private static final String CONFIG_PROP_THREADS = "aether.metadataResolver.threads"; private Logger logger = NullLoggerFactory.LOGGER; private RepositoryEventDispatcher repositoryEventDispatcher; private UpdateCheckManager updateCheckManager; private RepositoryConnectorProvider repositoryConnectorProvider; private RemoteRepositoryManager remoteRepositoryManager; private SyncContextFactory syncContextFactory; private OfflineController offlineController; public DefaultMetadataResolver() { // enables default constructor } @Inject DefaultMetadataResolver( RepositoryEventDispatcher repositoryEventDispatcher, UpdateCheckManager updateCheckManager, RepositoryConnectorProvider repositoryConnectorProvider, RemoteRepositoryManager remoteRepositoryManager, SyncContextFactory syncContextFactory, OfflineController offlineController, LoggerFactory loggerFactory ) { setRepositoryEventDispatcher( repositoryEventDispatcher ); setUpdateCheckManager( updateCheckManager ); setRepositoryConnectorProvider( repositoryConnectorProvider ); setRemoteRepositoryManager( remoteRepositoryManager ); setSyncContextFactory( syncContextFactory ); setOfflineController( offlineController ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) ); setUpdateCheckManager( locator.getService( UpdateCheckManager.class ) ); setRepositoryConnectorProvider( locator.getService( RepositoryConnectorProvider.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); setOfflineController( locator.getService( OfflineController.class ) ); } public DefaultMetadataResolver setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultMetadataResolver setRepositoryEventDispatcher( RepositoryEventDispatcher repositoryEventDispatcher ) { if ( repositoryEventDispatcher == null ) { throw new IllegalArgumentException( "repository event dispatcher has not been specified" ); } this.repositoryEventDispatcher = repositoryEventDispatcher; return this; } public DefaultMetadataResolver setUpdateCheckManager( UpdateCheckManager updateCheckManager ) { if ( updateCheckManager == null ) { throw new IllegalArgumentException( "update check manager has not been specified" ); } this.updateCheckManager = updateCheckManager; return this; } public DefaultMetadataResolver setRepositoryConnectorProvider( RepositoryConnectorProvider repositoryConnectorProvider ) { if ( repositoryConnectorProvider == null ) { throw new IllegalArgumentException( "repository connector provider has not been specified" ); } this.repositoryConnectorProvider = repositoryConnectorProvider; return this; } public DefaultMetadataResolver setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) { throw new IllegalArgumentException( "remote repository manager has not been specified" ); } this.remoteRepositoryManager = remoteRepositoryManager; return this; } public DefaultMetadataResolver setSyncContextFactory( SyncContextFactory syncContextFactory ) { if ( syncContextFactory == null ) { throw new IllegalArgumentException( "sync context factory has not been specified" ); } this.syncContextFactory = syncContextFactory; return this; } public DefaultMetadataResolver setOfflineController( OfflineController offlineController ) { if ( offlineController == null ) { throw new IllegalArgumentException( "offline controller has not been specified" ); } this.offlineController = offlineController; return this; } public List resolveMetadata( RepositorySystemSession session, Collection requests ) { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { Collection metadata = new ArrayList( requests.size() ); for ( MetadataRequest request : requests ) { metadata.add( request.getMetadata() ); } syncContext.acquire( null, metadata ); return resolve( session, requests ); } finally { syncContext.close(); } } private List resolve( RepositorySystemSession session, Collection requests ) { List results = new ArrayList( requests.size() ); List tasks = new ArrayList( requests.size() ); Map localLastUpdates = new HashMap(); for ( MetadataRequest request : requests ) { RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); MetadataResult result = new MetadataResult( request ); results.add( result ); Metadata metadata = request.getMetadata(); RemoteRepository repository = request.getRepository(); if ( repository == null ) { LocalRepository localRepo = session.getLocalRepositoryManager().getRepository(); metadataResolving( session, trace, metadata, localRepo ); File localFile = getLocalFile( session, metadata ); if ( localFile != null ) { metadata = metadata.setFile( localFile ); result.setMetadata( metadata ); } else { result.setException( new MetadataNotFoundException( metadata, localRepo ) ); } metadataResolved( session, trace, metadata, localRepo, result.getException() ); continue; } List repositories = getEnabledSourceRepositories( repository, metadata.getNature() ); if ( repositories.isEmpty() ) { continue; } metadataResolving( session, trace, metadata, repository ); LocalRepositoryManager lrm = session.getLocalRepositoryManager(); LocalMetadataRequest localRequest = new LocalMetadataRequest( metadata, repository, request.getRequestContext() ); LocalMetadataResult lrmResult = lrm.find( session, localRequest ); File metadataFile = lrmResult.getFile(); try { Utils.checkOffline( session, offlineController, repository ); } catch ( RepositoryOfflineException e ) { if ( metadataFile != null ) { metadata = metadata.setFile( metadataFile ); result.setMetadata( metadata ); } else { String msg = "Cannot access " + repository.getId() + " (" + repository.getUrl() + ") in offline mode and the metadata " + metadata + " has not been downloaded from it before"; result.setException( new MetadataNotFoundException( metadata, repository, msg, e ) ); } metadataResolved( session, trace, metadata, repository, result.getException() ); continue; } Long localLastUpdate = null; if ( request.isFavorLocalRepository() ) { File localFile = getLocalFile( session, metadata ); localLastUpdate = localLastUpdates.get( localFile ); if ( localLastUpdate == null ) { localLastUpdate = localFile != null ? localFile.lastModified() : 0; localLastUpdates.put( localFile, localLastUpdate ); } } List> checks = new ArrayList>(); Exception exception = null; for ( RemoteRepository repo : repositories ) { UpdateCheck check = new UpdateCheck(); check.setLocalLastUpdated( ( localLastUpdate != null ) ? localLastUpdate : 0 ); check.setItem( metadata ); // use 'main' installation file for the check (-> use requested repository) File checkFile = new File( session.getLocalRepository().getBasedir(), session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, repository, request.getRequestContext() ) ); check.setFile( checkFile ); check.setRepository( repository ); check.setAuthoritativeRepository( repo ); check.setPolicy( getPolicy( session, repo, metadata.getNature() ).getUpdatePolicy() ); if ( lrmResult.isStale() ) { checks.add( check ); } else { updateCheckManager.checkMetadata( session, check ); if ( check.isRequired() ) { checks.add( check ); } else if ( exception == null ) { exception = check.getException(); } } } if ( !checks.isEmpty() ) { RepositoryPolicy policy = getPolicy( session, repository, metadata.getNature() ); // install path may be different from lookup path File installFile = new File( session.getLocalRepository().getBasedir(), session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, request.getRepository(), request.getRequestContext() ) ); ResolveTask task = new ResolveTask( session, trace, result, installFile, checks, policy.getChecksumPolicy() ); tasks.add( task ); } else { result.setException( exception ); if ( metadataFile != null ) { metadata = metadata.setFile( metadataFile ); result.setMetadata( metadata ); } metadataResolved( session, trace, metadata, repository, result.getException() ); } } if ( !tasks.isEmpty() ) { int threads = ConfigUtils.getInteger( session, 4, CONFIG_PROP_THREADS ); Executor executor = getExecutor( Math.min( tasks.size(), threads ) ); try { RunnableErrorForwarder errorForwarder = new RunnableErrorForwarder(); for ( ResolveTask task : tasks ) { executor.execute( errorForwarder.wrap( task ) ); } errorForwarder.await(); for ( ResolveTask task : tasks ) { task.result.setException( task.exception ); } } finally { shutdown( executor ); } for ( ResolveTask task : tasks ) { Metadata metadata = task.request.getMetadata(); // re-lookup metadata for resolve LocalMetadataRequest localRequest = new LocalMetadataRequest( metadata, task.request.getRepository(), task.request.getRequestContext() ); File metadataFile = session.getLocalRepositoryManager().find( session, localRequest ).getFile(); if ( metadataFile != null ) { metadata = metadata.setFile( metadataFile ); task.result.setMetadata( metadata ); } if ( task.result.getException() == null ) { task.result.setUpdated( true ); } metadataResolved( session, task.trace, metadata, task.request.getRepository(), task.result.getException() ); } } return results; } private File getLocalFile( RepositorySystemSession session, Metadata metadata ) { LocalRepositoryManager lrm = session.getLocalRepositoryManager(); LocalMetadataResult localResult = lrm.find( session, new LocalMetadataRequest( metadata, null, null ) ); File localFile = localResult.getFile(); return localFile; } private List getEnabledSourceRepositories( RemoteRepository repository, Metadata.Nature nature ) { List repositories = new ArrayList(); if ( repository.isRepositoryManager() ) { for ( RemoteRepository repo : repository.getMirroredRepositories() ) { if ( isEnabled( repo, nature ) ) { repositories.add( repo ); } } } else if ( isEnabled( repository, nature ) ) { repositories.add( repository ); } return repositories; } private boolean isEnabled( RemoteRepository repository, Metadata.Nature nature ) { if ( !Metadata.Nature.SNAPSHOT.equals( nature ) && repository.getPolicy( false ).isEnabled() ) { return true; } if ( !Metadata.Nature.RELEASE.equals( nature ) && repository.getPolicy( true ).isEnabled() ) { return true; } return false; } private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); } private void metadataResolving( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_RESOLVING ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); repositoryEventDispatcher.dispatch( event.build() ); } private void metadataResolved( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_RESOLVED ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); event.setException( exception ); event.setFile( metadata.getFile() ); repositoryEventDispatcher.dispatch( event.build() ); } private void metadataDownloading( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_DOWNLOADING ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); repositoryEventDispatcher.dispatch( event.build() ); } private void metadataDownloaded( RepositorySystemSession session, RequestTrace trace, Metadata metadata, ArtifactRepository repository, File file, Exception exception ) { RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_DOWNLOADED ); event.setTrace( trace ); event.setMetadata( metadata ); event.setRepository( repository ); event.setException( exception ); event.setFile( file ); repositoryEventDispatcher.dispatch( event.build() ); } private Executor getExecutor( int threads ) { if ( threads <= 1 ) { return new Executor() { public void execute( Runnable command ) { command.run(); } }; } else { return new ThreadPoolExecutor( threads, threads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue(), new WorkerThreadFactory( null ) ); } } private void shutdown( Executor executor ) { if ( executor instanceof ExecutorService ) { ( (ExecutorService) executor ).shutdown(); } } class ResolveTask implements Runnable { final RepositorySystemSession session; final RequestTrace trace; final MetadataResult result; final MetadataRequest request; final File metadataFile; final String policy; final List> checks; volatile MetadataTransferException exception; public ResolveTask( RepositorySystemSession session, RequestTrace trace, MetadataResult result, File metadataFile, List> checks, String policy ) { this.session = session; this.trace = trace; this.result = result; this.request = result.getRequest(); this.metadataFile = metadataFile; this.policy = policy; this.checks = checks; } public void run() { Metadata metadata = request.getMetadata(); RemoteRepository requestRepository = request.getRepository(); metadataDownloading( session, trace, metadata, requestRepository ); try { List repositories = new ArrayList(); for ( UpdateCheck check : checks ) { repositories.add( check.getAuthoritativeRepository() ); } MetadataDownload download = new MetadataDownload(); download.setMetadata( metadata ); download.setRequestContext( request.getRequestContext() ); download.setFile( metadataFile ); download.setChecksumPolicy( policy ); download.setRepositories( repositories ); download.setListener( SafeTransferListener.wrap( session, logger ) ); download.setTrace( trace ); RepositoryConnector connector = repositoryConnectorProvider.newRepositoryConnector( session, requestRepository ); try { connector.get( null, Arrays.asList( download ) ); } finally { connector.close(); } exception = download.getException(); if ( exception == null ) { List contexts = Collections.singletonList( request.getRequestContext() ); LocalMetadataRegistration registration = new LocalMetadataRegistration( metadata, requestRepository, contexts ); session.getLocalRepositoryManager().add( session, registration ); } else if ( request.isDeleteLocalCopyIfMissing() && exception instanceof MetadataNotFoundException ) { download.getFile().delete(); } } catch ( NoRepositoryConnectorException e ) { exception = new MetadataTransferException( metadata, requestRepository, e ); } /* * NOTE: Touch after registration with local repo to ensure concurrent resolution is not rejected with * "already updated" via session data when actual update to local repo is still pending. */ for ( UpdateCheck check : checks ) { updateCheckManager.touchMetadata( session, check.setException( exception ) ); } metadataDownloaded( session, trace, metadata, requestRepository, metadataFile, exception ); } } } DefaultOfflineController.java000066400000000000000000000075301245546356100347060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.regex.Pattern; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.eclipse.aether.util.ConfigUtils; @Named public class DefaultOfflineController implements OfflineController, Service { static final String CONFIG_PROP_OFFLINE_PROTOCOLS = "aether.offline.protocols"; static final String CONFIG_PROP_OFFLINE_HOSTS = "aether.offline.hosts"; private static final Pattern SEP = Pattern.compile( "\\s*,\\s*" ); private Logger logger = NullLoggerFactory.LOGGER; public DefaultOfflineController() { // enables default constructor } @Inject DefaultOfflineController( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } public DefaultOfflineController setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public void checkOffline( RepositorySystemSession session, RemoteRepository repository ) throws RepositoryOfflineException { if ( isOfflineProtocol( session, repository ) || isOfflineHost( session, repository ) ) { return; } throw new RepositoryOfflineException( repository ); } private boolean isOfflineProtocol( RepositorySystemSession session, RemoteRepository repository ) { String[] protocols = getConfig( session, CONFIG_PROP_OFFLINE_PROTOCOLS ); if ( protocols != null ) { String protocol = repository.getProtocol(); if ( protocol.length() > 0 ) { for ( String p : protocols ) { if ( p.equalsIgnoreCase( protocol ) ) { return true; } } } } return false; } private boolean isOfflineHost( RepositorySystemSession session, RemoteRepository repository ) { String[] hosts = getConfig( session, CONFIG_PROP_OFFLINE_HOSTS ); if ( hosts != null ) { String host = repository.getHost(); if ( host.length() > 0 ) { for ( String h : hosts ) { if ( h.equalsIgnoreCase( host ) ) { return true; } } } } return false; } private String[] getConfig( RepositorySystemSession session, String key ) { String value = ConfigUtils.getString( session, "", key ).trim(); if ( value.length() <= 0 ) { return null; } return SEP.split( value ); } } DefaultRemoteRepositoryManager.java000066400000000000000000000321221245546356100361010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.ListIterator; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.StringUtils; /** */ @Named public class DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { private static final class LoggedMirror { private final Object[] keys; public LoggedMirror( RemoteRepository original, RemoteRepository mirror ) { keys = new Object[] { mirror.getId(), mirror.getUrl(), original.getId(), original.getUrl() }; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( !( obj instanceof LoggedMirror ) ) { return false; } LoggedMirror that = (LoggedMirror) obj; return Arrays.equals( keys, that.keys ); } @Override public int hashCode() { return Arrays.hashCode( keys ); } } private Logger logger = NullLoggerFactory.LOGGER; private UpdatePolicyAnalyzer updatePolicyAnalyzer; private ChecksumPolicyProvider checksumPolicyProvider; public DefaultRemoteRepositoryManager() { // enables default constructor } @Inject DefaultRemoteRepositoryManager( UpdatePolicyAnalyzer updatePolicyAnalyzer, ChecksumPolicyProvider checksumPolicyProvider, LoggerFactory loggerFactory ) { setUpdatePolicyAnalyzer( updatePolicyAnalyzer ); setChecksumPolicyProvider( checksumPolicyProvider ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setUpdatePolicyAnalyzer( locator.getService( UpdatePolicyAnalyzer.class ) ); setChecksumPolicyProvider( locator.getService( ChecksumPolicyProvider.class ) ); } public DefaultRemoteRepositoryManager setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultRemoteRepositoryManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer ) { if ( updatePolicyAnalyzer == null ) { throw new IllegalArgumentException( "update policy analyzer has not been specified" ); } this.updatePolicyAnalyzer = updatePolicyAnalyzer; return this; } public DefaultRemoteRepositoryManager setChecksumPolicyProvider( ChecksumPolicyProvider checksumPolicyProvider ) { if ( checksumPolicyProvider == null ) { throw new IllegalArgumentException( "checksum policy provider has not been specified" ); } this.checksumPolicyProvider = checksumPolicyProvider; return this; } public List aggregateRepositories( RepositorySystemSession session, List dominantRepositories, List recessiveRepositories, boolean recessiveIsRaw ) { if ( recessiveRepositories.isEmpty() ) { return dominantRepositories; } MirrorSelector mirrorSelector = session.getMirrorSelector(); AuthenticationSelector authSelector = session.getAuthenticationSelector(); ProxySelector proxySelector = session.getProxySelector(); List result = new ArrayList( dominantRepositories ); next: for ( RemoteRepository recessiveRepository : recessiveRepositories ) { RemoteRepository repository = recessiveRepository; if ( recessiveIsRaw ) { RemoteRepository mirrorRepository = mirrorSelector.getMirror( recessiveRepository ); if ( mirrorRepository != null ) { logMirror( session, recessiveRepository, mirrorRepository ); repository = mirrorRepository; } } String key = getKey( repository ); for ( ListIterator it = result.listIterator(); it.hasNext(); ) { RemoteRepository dominantRepository = it.next(); if ( key.equals( getKey( dominantRepository ) ) ) { if ( !dominantRepository.getMirroredRepositories().isEmpty() && !repository.getMirroredRepositories().isEmpty() ) { RemoteRepository mergedRepository = mergeMirrors( session, dominantRepository, repository ); if ( mergedRepository != dominantRepository ) { it.set( mergedRepository ); } } continue next; } } if ( recessiveIsRaw ) { RemoteRepository.Builder builder = null; Authentication auth = authSelector.getAuthentication( repository ); if ( auth != null ) { builder = new RemoteRepository.Builder( repository ); builder.setAuthentication( auth ); } Proxy proxy = proxySelector.getProxy( repository ); if ( proxy != null ) { if ( builder == null ) { builder = new RemoteRepository.Builder( repository ); } builder.setProxy( proxy ); } if ( builder != null ) { repository = builder.build(); } } result.add( repository ); } return result; } private void logMirror( RepositorySystemSession session, RemoteRepository original, RemoteRepository mirror ) { if ( !logger.isDebugEnabled() ) { return; } RepositoryCache cache = session.getCache(); if ( cache != null ) { Object key = new LoggedMirror( original, mirror ); if ( cache.get( session, key ) != null ) { return; } cache.put( session, key, Boolean.TRUE ); } logger.debug( "Using mirror " + mirror.getId() + " (" + mirror.getUrl() + ") for " + original.getId() + " (" + original.getUrl() + ")." ); } private String getKey( RemoteRepository repository ) { return repository.getId(); } private RemoteRepository mergeMirrors( RepositorySystemSession session, RemoteRepository dominant, RemoteRepository recessive ) { RemoteRepository.Builder merged = null; RepositoryPolicy releases = null, snapshots = null; next: for ( RemoteRepository rec : recessive.getMirroredRepositories() ) { String recKey = getKey( rec ); for ( RemoteRepository dom : dominant.getMirroredRepositories() ) { if ( recKey.equals( getKey( dom ) ) ) { continue next; } } if ( merged == null ) { merged = new RemoteRepository.Builder( dominant ); releases = dominant.getPolicy( false ); snapshots = dominant.getPolicy( true ); } releases = merge( session, releases, rec.getPolicy( false ), false ); snapshots = merge( session, snapshots, rec.getPolicy( true ), false ); merged.addMirroredRepository( rec ); } if ( merged == null ) { return dominant; } return merged.setReleasePolicy( releases ).setSnapshotPolicy( snapshots ).build(); } public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; } private RepositoryPolicy merge( RepositorySystemSession session, RepositoryPolicy policy1, RepositoryPolicy policy2, boolean globalPolicy ) { RepositoryPolicy policy; if ( policy2 == null ) { if ( globalPolicy ) { policy = merge( policy1, session.getUpdatePolicy(), session.getChecksumPolicy() ); } else { policy = policy1; } } else if ( policy1 == null ) { if ( globalPolicy ) { policy = merge( policy2, session.getUpdatePolicy(), session.getChecksumPolicy() ); } else { policy = policy2; } } else if ( !policy2.isEnabled() ) { if ( globalPolicy ) { policy = merge( policy1, session.getUpdatePolicy(), session.getChecksumPolicy() ); } else { policy = policy1; } } else if ( !policy1.isEnabled() ) { if ( globalPolicy ) { policy = merge( policy2, session.getUpdatePolicy(), session.getChecksumPolicy() ); } else { policy = policy2; } } else { String checksums = session.getChecksumPolicy(); if ( globalPolicy && !StringUtils.isEmpty( checksums ) ) { // use global override } else { checksums = checksumPolicyProvider.getEffectiveChecksumPolicy( session, policy1.getChecksumPolicy(), policy2.getChecksumPolicy() ); } String updates = session.getUpdatePolicy(); if ( globalPolicy && !StringUtils.isEmpty( updates ) ) { // use global override } else { updates = updatePolicyAnalyzer.getEffectiveUpdatePolicy( session, policy1.getUpdatePolicy(), policy2.getUpdatePolicy() ); } policy = new RepositoryPolicy( true, updates, checksums ); } return policy; } private RepositoryPolicy merge( RepositoryPolicy policy, String updates, String checksums ) { if ( policy != null ) { if ( StringUtils.isEmpty( updates ) ) { updates = policy.getUpdatePolicy(); } if ( StringUtils.isEmpty( checksums ) ) { checksums = policy.getChecksumPolicy(); } if ( !policy.getUpdatePolicy().equals( updates ) || !policy.getChecksumPolicy().equals( checksums ) ) { policy = new RepositoryPolicy( policy.isEnabled(), updates, checksums ); } } return policy; } } DefaultRepositoryConnectorProvider.java000066400000000000000000000147171245546356100370320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoRepositoryConnectorException; /** */ @Named public class DefaultRepositoryConnectorProvider implements RepositoryConnectorProvider, Service { private Logger logger = NullLoggerFactory.LOGGER; private Collection connectorFactories = new ArrayList(); public DefaultRepositoryConnectorProvider() { // enables default constructor } @Inject DefaultRepositoryConnectorProvider( Set connectorFactories, LoggerFactory loggerFactory ) { setRepositoryConnectorFactories( connectorFactories ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); connectorFactories = locator.getServices( RepositoryConnectorFactory.class ); } public DefaultRepositoryConnectorProvider setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultRepositoryConnectorProvider addRepositoryConnectorFactory( RepositoryConnectorFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "repository connector factory has not been specified" ); } connectorFactories.add( factory ); return this; } public DefaultRepositoryConnectorProvider setRepositoryConnectorFactories( Collection factories ) { if ( factories == null ) { this.connectorFactories = new ArrayList(); } else { this.connectorFactories = factories; } return this; } public RepositoryConnector newRepositoryConnector( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryConnectorException { if ( repository == null ) { throw new IllegalArgumentException( "remote repository has not been specified" ); } PrioritizedComponents factories = new PrioritizedComponents( session ); for ( RepositoryConnectorFactory factory : this.connectorFactories ) { factories.add( factory, factory.getPriority() ); } List errors = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { try { RepositoryConnector connector = factory.getComponent().newInstance( session, repository ); if ( logger.isDebugEnabled() ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Using connector " ).append( connector.getClass().getSimpleName() ); Utils.appendClassLoader( buffer, connector ); buffer.append( " with priority " ).append( factory.getPriority() ); buffer.append( " for " ).append( repository.getUrl() ); Authentication auth = repository.getAuthentication(); if ( auth != null ) { buffer.append( " with " ).append( auth ); } Proxy proxy = repository.getProxy(); if ( proxy != null ) { buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ); auth = proxy.getAuthentication(); if ( auth != null ) { buffer.append( " with " ).append( auth ); } } logger.debug( buffer.toString() ); } return connector; } catch ( NoRepositoryConnectorException e ) { // continue and try next factory errors.add( e ); } } if ( logger.isDebugEnabled() && errors.size() > 1 ) { String msg = "Could not obtain connector factory for " + repository; for ( Exception e : errors ) { logger.debug( msg, e ); } } StringBuilder buffer = new StringBuilder( 256 ); if ( factories.isEmpty() ) { buffer.append( "No connector factories available" ); } else { buffer.append( "Cannot access " ).append( repository.getUrl() ); buffer.append( " with type " ).append( repository.getContentType() ); buffer.append( " using the available connector factories: " ); factories.list( buffer ); } throw new NoRepositoryConnectorException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null ); } } DefaultRepositoryEventDispatcher.java000066400000000000000000000145151245546356100364510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.impl.RepositoryEventDispatcher; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** */ @Named public class DefaultRepositoryEventDispatcher implements RepositoryEventDispatcher, Service { private Logger logger = NullLoggerFactory.LOGGER; private Collection listeners = new ArrayList(); public DefaultRepositoryEventDispatcher() { // enables no-arg constructor } @Inject DefaultRepositoryEventDispatcher( Set listeners, LoggerFactory loggerFactory ) { setRepositoryListeners( listeners ); setLoggerFactory( loggerFactory ); } public DefaultRepositoryEventDispatcher setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultRepositoryEventDispatcher addRepositoryListener( RepositoryListener listener ) { if ( listener == null ) { throw new IllegalArgumentException( "repository listener has not been specified" ); } this.listeners.add( listener ); return this; } public DefaultRepositoryEventDispatcher setRepositoryListeners( Collection listeners ) { if ( listeners == null ) { this.listeners = new ArrayList(); } else { this.listeners = listeners; } return this; } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setRepositoryListeners( locator.getServices( RepositoryListener.class ) ); } public void dispatch( RepositoryEvent event ) { if ( !listeners.isEmpty() ) { for ( RepositoryListener listener : listeners ) { dispatch( event, listener ); } } RepositoryListener listener = event.getSession().getRepositoryListener(); if ( listener != null ) { dispatch( event, listener ); } } private void dispatch( RepositoryEvent event, RepositoryListener listener ) { try { switch ( event.getType() ) { case ARTIFACT_DEPLOYED: listener.artifactDeployed( event ); break; case ARTIFACT_DEPLOYING: listener.artifactDeploying( event ); break; case ARTIFACT_DESCRIPTOR_INVALID: listener.artifactDescriptorInvalid( event ); break; case ARTIFACT_DESCRIPTOR_MISSING: listener.artifactDescriptorMissing( event ); break; case ARTIFACT_DOWNLOADED: listener.artifactDownloaded( event ); break; case ARTIFACT_DOWNLOADING: listener.artifactDownloading( event ); break; case ARTIFACT_INSTALLED: listener.artifactInstalled( event ); break; case ARTIFACT_INSTALLING: listener.artifactInstalling( event ); break; case ARTIFACT_RESOLVED: listener.artifactResolved( event ); break; case ARTIFACT_RESOLVING: listener.artifactResolving( event ); break; case METADATA_DEPLOYED: listener.metadataDeployed( event ); break; case METADATA_DEPLOYING: listener.metadataDeploying( event ); break; case METADATA_DOWNLOADED: listener.metadataDownloaded( event ); break; case METADATA_DOWNLOADING: listener.metadataDownloading( event ); break; case METADATA_INSTALLED: listener.metadataInstalled( event ); break; case METADATA_INSTALLING: listener.metadataInstalling( event ); break; case METADATA_INVALID: listener.metadataInvalid( event ); break; case METADATA_RESOLVED: listener.metadataResolved( event ); break; case METADATA_RESOLVING: listener.metadataResolving( event ); break; default: throw new IllegalStateException( "unknown repository event type " + event.getType() ); } } catch ( Exception e ) { logError( e, listener ); } catch ( LinkageError e ) { logError( e, listener ); } } private void logError( Throwable e, Object listener ) { String msg = "Failed to dispatch repository event to " + listener.getClass().getCanonicalName() + ": " + e.getMessage(); if ( logger.isDebugEnabled() ) { logger.warn( msg, e ); } else { logger.warn( msg ); } } } DefaultRepositoryLayoutProvider.java000066400000000000000000000120061245546356100363420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoRepositoryLayoutException; /** */ @Named public final class DefaultRepositoryLayoutProvider implements RepositoryLayoutProvider, Service { private Logger logger = NullLoggerFactory.LOGGER; private Collection factories = new ArrayList(); public DefaultRepositoryLayoutProvider() { // enables default constructor } @Inject DefaultRepositoryLayoutProvider( Set layoutFactories, LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); setRepositoryLayoutFactories( layoutFactories ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setRepositoryLayoutFactories( locator.getServices( RepositoryLayoutFactory.class ) ); } public DefaultRepositoryLayoutProvider setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultRepositoryLayoutProvider addRepositoryLayoutFactory( RepositoryLayoutFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "layout factory has not been specified" ); } factories.add( factory ); return this; } public DefaultRepositoryLayoutProvider setRepositoryLayoutFactories( Collection factories ) { if ( factories == null ) { this.factories = new ArrayList(); } else { this.factories = factories; } return this; } public RepositoryLayout newRepositoryLayout( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryLayoutException { if ( repository == null ) { throw new IllegalArgumentException( "remote repository has not been specified" ); } PrioritizedComponents factories = new PrioritizedComponents( session ); for ( RepositoryLayoutFactory factory : this.factories ) { factories.add( factory, factory.getPriority() ); } List errors = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { try { RepositoryLayout layout = factory.getComponent().newInstance( session, repository ); return layout; } catch ( NoRepositoryLayoutException e ) { // continue and try next factory errors.add( e ); } } if ( logger.isDebugEnabled() && errors.size() > 1 ) { String msg = "Could not obtain layout factory for " + repository; for ( Exception e : errors ) { logger.debug( msg, e ); } } StringBuilder buffer = new StringBuilder( 256 ); if ( factories.isEmpty() ) { buffer.append( "No layout factories registered" ); } else { buffer.append( "Cannot access " ).append( repository.getUrl() ); buffer.append( " with type " ).append( repository.getContentType() ); buffer.append( " using the available layout factories: " ); factories.list( buffer ); } throw new NoRepositoryLayoutException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null ); } } DefaultRepositorySystem.java000066400000000000000000000456551245546356100346560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyVisitor; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.impl.ArtifactResolver; import org.eclipse.aether.impl.DependencyCollector; import org.eclipse.aether.impl.Deployer; import org.eclipse.aether.impl.Installer; import org.eclipse.aether.impl.LocalRepositoryProvider; import org.eclipse.aether.impl.MetadataResolver; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.resolution.DependencyResult; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor; import org.eclipse.aether.util.graph.visitor.TreeDependencyVisitor; /** */ @Named public class DefaultRepositorySystem implements RepositorySystem, Service { private Logger logger = NullLoggerFactory.LOGGER; private VersionResolver versionResolver; private VersionRangeResolver versionRangeResolver; private ArtifactResolver artifactResolver; private MetadataResolver metadataResolver; private ArtifactDescriptorReader artifactDescriptorReader; private DependencyCollector dependencyCollector; private Installer installer; private Deployer deployer; private LocalRepositoryProvider localRepositoryProvider; private SyncContextFactory syncContextFactory; private RemoteRepositoryManager remoteRepositoryManager; public DefaultRepositorySystem() { // enables default constructor } @Inject DefaultRepositorySystem( VersionResolver versionResolver, VersionRangeResolver versionRangeResolver, ArtifactResolver artifactResolver, MetadataResolver metadataResolver, ArtifactDescriptorReader artifactDescriptorReader, DependencyCollector dependencyCollector, Installer installer, Deployer deployer, LocalRepositoryProvider localRepositoryProvider, SyncContextFactory syncContextFactory, RemoteRepositoryManager remoteRepositoryManager, LoggerFactory loggerFactory ) { setVersionResolver( versionResolver ); setVersionRangeResolver( versionRangeResolver ); setArtifactResolver( artifactResolver ); setMetadataResolver( metadataResolver ); setArtifactDescriptorReader( artifactDescriptorReader ); setDependencyCollector( dependencyCollector ); setInstaller( installer ); setDeployer( deployer ); setLocalRepositoryProvider( localRepositoryProvider ); setSyncContextFactory( syncContextFactory ); setRemoteRepositoryManager( remoteRepositoryManager ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setVersionResolver( locator.getService( VersionResolver.class ) ); setVersionRangeResolver( locator.getService( VersionRangeResolver.class ) ); setArtifactResolver( locator.getService( ArtifactResolver.class ) ); setMetadataResolver( locator.getService( MetadataResolver.class ) ); setArtifactDescriptorReader( locator.getService( ArtifactDescriptorReader.class ) ); setDependencyCollector( locator.getService( DependencyCollector.class ) ); setInstaller( locator.getService( Installer.class ) ); setDeployer( locator.getService( Deployer.class ) ); setLocalRepositoryProvider( locator.getService( LocalRepositoryProvider.class ) ); setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); setSyncContextFactory( locator.getService( SyncContextFactory.class ) ); } public DefaultRepositorySystem setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultRepositorySystem setVersionResolver( VersionResolver versionResolver ) { if ( versionResolver == null ) { throw new IllegalArgumentException( "version resolver has not been specified" ); } this.versionResolver = versionResolver; return this; } public DefaultRepositorySystem setVersionRangeResolver( VersionRangeResolver versionRangeResolver ) { if ( versionRangeResolver == null ) { throw new IllegalArgumentException( "version range resolver has not been specified" ); } this.versionRangeResolver = versionRangeResolver; return this; } public DefaultRepositorySystem setArtifactResolver( ArtifactResolver artifactResolver ) { if ( artifactResolver == null ) { throw new IllegalArgumentException( "artifact resolver has not been specified" ); } this.artifactResolver = artifactResolver; return this; } public DefaultRepositorySystem setMetadataResolver( MetadataResolver metadataResolver ) { if ( metadataResolver == null ) { throw new IllegalArgumentException( "metadata resolver has not been specified" ); } this.metadataResolver = metadataResolver; return this; } public DefaultRepositorySystem setArtifactDescriptorReader( ArtifactDescriptorReader artifactDescriptorReader ) { if ( artifactDescriptorReader == null ) { throw new IllegalArgumentException( "artifact descriptor reader has not been specified" ); } this.artifactDescriptorReader = artifactDescriptorReader; return this; } public DefaultRepositorySystem setDependencyCollector( DependencyCollector dependencyCollector ) { if ( dependencyCollector == null ) { throw new IllegalArgumentException( "dependency collector has not been specified" ); } this.dependencyCollector = dependencyCollector; return this; } public DefaultRepositorySystem setInstaller( Installer installer ) { if ( installer == null ) { throw new IllegalArgumentException( "installer has not been specified" ); } this.installer = installer; return this; } public DefaultRepositorySystem setDeployer( Deployer deployer ) { if ( deployer == null ) { throw new IllegalArgumentException( "deployer has not been specified" ); } this.deployer = deployer; return this; } public DefaultRepositorySystem setLocalRepositoryProvider( LocalRepositoryProvider localRepositoryProvider ) { if ( localRepositoryProvider == null ) { throw new IllegalArgumentException( "local repository provider has not been specified" ); } this.localRepositoryProvider = localRepositoryProvider; return this; } public DefaultRepositorySystem setSyncContextFactory( SyncContextFactory syncContextFactory ) { if ( syncContextFactory == null ) { throw new IllegalArgumentException( "sync context factory has not been specified" ); } this.syncContextFactory = syncContextFactory; return this; } public DefaultRepositorySystem setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) { if ( remoteRepositoryManager == null ) { throw new IllegalArgumentException( "remote repository manager has not been specified" ); } this.remoteRepositoryManager = remoteRepositoryManager; return this; } public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { validateSession( session ); return versionResolver.resolveVersion( session, request ); } public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException { validateSession( session ); return versionRangeResolver.resolveVersionRange( session, request ); } public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException { validateSession( session ); return artifactDescriptorReader.readArtifactDescriptor( session, request ); } public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request ) throws ArtifactResolutionException { validateSession( session ); return artifactResolver.resolveArtifact( session, request ); } public List resolveArtifacts( RepositorySystemSession session, Collection requests ) throws ArtifactResolutionException { validateSession( session ); return artifactResolver.resolveArtifacts( session, requests ); } public List resolveMetadata( RepositorySystemSession session, Collection requests ) { validateSession( session ); return metadataResolver.resolveMetadata( session, requests ); } public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { validateSession( session ); return dependencyCollector.collectDependencies( session, request ); } public DependencyResult resolveDependencies( RepositorySystemSession session, DependencyRequest request ) throws DependencyResolutionException { validateSession( session ); RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); DependencyResult result = new DependencyResult( request ); DependencyCollectionException dce = null; ArtifactResolutionException are = null; if ( request.getRoot() != null ) { result.setRoot( request.getRoot() ); } else if ( request.getCollectRequest() != null ) { CollectResult collectResult; try { request.getCollectRequest().setTrace( trace ); collectResult = dependencyCollector.collectDependencies( session, request.getCollectRequest() ); } catch ( DependencyCollectionException e ) { dce = e; collectResult = e.getResult(); } result.setRoot( collectResult.getRoot() ); result.setCycles( collectResult.getCycles() ); result.setCollectExceptions( collectResult.getExceptions() ); } else { throw new IllegalArgumentException( "dependency node or collect request missing" ); } ArtifactRequestBuilder builder = new ArtifactRequestBuilder( trace ); DependencyFilter filter = request.getFilter(); DependencyVisitor visitor = ( filter != null ) ? new FilteringDependencyVisitor( builder, filter ) : builder; visitor = new TreeDependencyVisitor( visitor ); result.getRoot().accept( visitor ); List requests = builder.getRequests(); List results; try { results = artifactResolver.resolveArtifacts( session, requests ); } catch ( ArtifactResolutionException e ) { are = e; results = e.getResults(); } result.setArtifactResults( results ); updateNodesWithResolvedArtifacts( results ); if ( dce != null ) { throw new DependencyResolutionException( result, dce ); } else if ( are != null ) { throw new DependencyResolutionException( result, are ); } return result; } private void updateNodesWithResolvedArtifacts( List results ) { for ( ArtifactResult result : results ) { Artifact artifact = result.getArtifact(); if ( artifact != null ) { result.getRequest().getDependencyNode().setArtifact( artifact ); } } } public InstallResult install( RepositorySystemSession session, InstallRequest request ) throws InstallationException { validateSession( session ); return installer.install( session, request ); } public DeployResult deploy( RepositorySystemSession session, DeployRequest request ) throws DeploymentException { validateSession( session ); return deployer.deploy( session, request ); } public LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session, LocalRepository localRepository ) { try { return localRepositoryProvider.newLocalRepositoryManager( session, localRepository ); } catch ( NoLocalRepositoryManagerException e ) { throw new IllegalArgumentException( e.getMessage(), e ); } } public SyncContext newSyncContext( RepositorySystemSession session, boolean shared ) { validateSession( session ); return syncContextFactory.newInstance( session, shared ); } public List newResolutionRepositories( RepositorySystemSession session, List repositories ) { validateSession( session ); repositories = remoteRepositoryManager.aggregateRepositories( session, new ArrayList(), repositories, true ); return repositories; } public RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository ) { validateSession( session ); RemoteRepository.Builder builder = new RemoteRepository.Builder( repository ); Authentication auth = session.getAuthenticationSelector().getAuthentication( repository ); builder.setAuthentication( auth ); Proxy proxy = session.getProxySelector().getProxy( repository ); builder.setProxy( proxy ); return builder.build(); } private void validateSession( RepositorySystemSession session ) { if ( session == null ) { throw new IllegalArgumentException( "Invalid repository system session: the session may not be null." ); } if ( session.getLocalRepositoryManager() == null ) { invalidSession( "LocalRepositoryManager" ); } if ( session.getSystemProperties() == null ) { invalidSession( "SystemProperties" ); } if ( session.getUserProperties() == null ) { invalidSession( "UserProperties" ); } if ( session.getConfigProperties() == null ) { invalidSession( "ConfigProperties" ); } if ( session.getMirrorSelector() == null ) { invalidSession( "MirrorSelector" ); } if ( session.getProxySelector() == null ) { invalidSession( "ProxySelector" ); } if ( session.getAuthenticationSelector() == null ) { invalidSession( "AuthenticationSelector" ); } if ( session.getArtifactTypeRegistry() == null ) { invalidSession( "ArtifactTypeRegistry" ); } if ( session.getData() == null ) { invalidSession( "Data" ); } } private void invalidSession( String name ) { throw new IllegalArgumentException( "Invalid repository system session: " + name + " is not set." ); } } DefaultSyncContextFactory.java000066400000000000000000000027721245546356100350740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Collection; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.metadata.Metadata; /** * A factory to create synchronization contexts. This default implementation actually does not provide any real * synchronization but merely completes the repository system. */ @Named public class DefaultSyncContextFactory implements SyncContextFactory { public SyncContext newInstance( RepositorySystemSession session, boolean shared ) { return new DefaultSyncContext(); } static class DefaultSyncContext implements SyncContext { public void acquire( Collection artifact, Collection metadata ) { } public void close() { } } } DefaultTransporterProvider.java000066400000000000000000000124741245546356100353210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoTransporterException; /** */ @Named public final class DefaultTransporterProvider implements TransporterProvider, Service { private Logger logger = NullLoggerFactory.LOGGER; private Collection factories = new ArrayList(); public DefaultTransporterProvider() { // enables default constructor } @Inject DefaultTransporterProvider( Set transporterFactories, LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); setTransporterFactories( transporterFactories ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setTransporterFactories( locator.getServices( TransporterFactory.class ) ); } public DefaultTransporterProvider setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultTransporterProvider addTransporterFactory( TransporterFactory factory ) { if ( factory == null ) { throw new IllegalArgumentException( "transporter factory has not been specified" ); } factories.add( factory ); return this; } public DefaultTransporterProvider setTransporterFactories( Collection factories ) { if ( factories == null ) { this.factories = new ArrayList(); } else { this.factories = factories; } return this; } public Transporter newTransporter( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException { if ( repository == null ) { throw new IllegalArgumentException( "remote repository has not been specified" ); } PrioritizedComponents factories = new PrioritizedComponents( session ); for ( TransporterFactory factory : this.factories ) { factories.add( factory, factory.getPriority() ); } List errors = new ArrayList(); for ( PrioritizedComponent factory : factories.getEnabled() ) { try { Transporter transporter = factory.getComponent().newInstance( session, repository ); if ( logger.isDebugEnabled() ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Using transporter " ).append( transporter.getClass().getSimpleName() ); Utils.appendClassLoader( buffer, transporter ); buffer.append( " with priority " ).append( factory.getPriority() ); buffer.append( " for " ).append( repository.getUrl() ); logger.debug( buffer.toString() ); } return transporter; } catch ( NoTransporterException e ) { // continue and try next factory errors.add( e ); } } if ( logger.isDebugEnabled() && errors.size() > 1 ) { String msg = "Could not obtain transporter factory for " + repository; for ( Exception e : errors ) { logger.debug( msg, e ); } } StringBuilder buffer = new StringBuilder( 256 ); if ( factories.isEmpty() ) { buffer.append( "No transporter factories registered" ); } else { buffer.append( "Cannot access " ).append( repository.getUrl() ); buffer.append( " using the registered transporter factories: " ); factories.list( buffer); } throw new NoTransporterException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null ); } } DefaultUpdateCheckManager.java000066400000000000000000000531511245546356100347330ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.SessionData; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.util.ConfigUtils; /** */ @Named public class DefaultUpdateCheckManager implements UpdateCheckManager, Service { private Logger logger = NullLoggerFactory.LOGGER; private UpdatePolicyAnalyzer updatePolicyAnalyzer; private static final String UPDATED_KEY_SUFFIX = ".lastUpdated"; private static final String ERROR_KEY_SUFFIX = ".error"; private static final String NOT_FOUND = ""; private static final String SESSION_CHECKS = "updateCheckManager.checks"; static final String CONFIG_PROP_SESSION_STATE = "aether.updateCheckManager.sessionState"; private static final int STATE_ENABLED = 0; private static final int STATE_BYPASS = 1; private static final int STATE_DISABLED = 2; public DefaultUpdateCheckManager() { // enables default constructor } @Inject DefaultUpdateCheckManager( UpdatePolicyAnalyzer updatePolicyAnalyzer, LoggerFactory loggerFactory ) { setUpdatePolicyAnalyzer( updatePolicyAnalyzer ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setUpdatePolicyAnalyzer( locator.getService( UpdatePolicyAnalyzer.class ) ); } public DefaultUpdateCheckManager setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public DefaultUpdateCheckManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer ) { if ( updatePolicyAnalyzer == null ) { throw new IllegalArgumentException( "update policy analyzer has not been specified" ); } this.updatePolicyAnalyzer = updatePolicyAnalyzer; return this; } public void checkArtifact( RepositorySystemSession session, UpdateCheck check ) { if ( check.getLocalLastUpdated() != 0 && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", locally installed artifact up-to-date." ); } check.setRequired( false ); return; } Artifact artifact = check.getItem(); RemoteRepository repository = check.getRepository(); File artifactFile = check.getFile(); if ( artifactFile == null ) { throw new IllegalArgumentException( String.format( "The artifact '%s' has no file attached", artifact ) ); } boolean fileExists = check.isFileValid() && artifactFile.exists(); File touchFile = getTouchFile( artifact, artifactFile ); Properties props = read( touchFile ); String updateKey = getUpdateKey( session, artifactFile, repository ); String dataKey = getDataKey( artifact, artifactFile, repository ); String error = getError( props, dataKey ); long lastUpdated; if ( error == null ) { if ( fileExists ) { // last update was successful lastUpdated = artifactFile.lastModified(); } else { // this is the first attempt ever lastUpdated = 0; } } else if ( error.length() <= 0 ) { // artifact did not exist lastUpdated = getLastUpdated( props, dataKey ); } else { // artifact could not be transferred String transferKey = getTransferKey( session, artifact, artifactFile, repository ); lastUpdated = getLastUpdated( props, transferKey ); } if ( lastUpdated == 0 ) { check.setRequired( true ); } else if ( isAlreadyUpdated( session, updateKey ) ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", already updated during this session." ); } check.setRequired( false ); if ( error != null ) { check.setException( newException( error, artifact, repository ) ); } } else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) ) { check.setRequired( true ); } else if ( fileExists ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", locally cached artifact up-to-date." ); } check.setRequired( false ); } else { int errorPolicy = Utils.getPolicy( session, artifact, repository ); int cacheFlag = getCacheFlag( error ); if ( ( errorPolicy & cacheFlag ) != 0 ) { check.setRequired( false ); check.setException( newException( error, artifact, repository ) ); } else { check.setRequired( true ); } } } private static int getCacheFlag( String error ) { if ( error == null || error.length() <= 0 ) { return ResolutionErrorPolicy.CACHE_NOT_FOUND; } else { return ResolutionErrorPolicy.CACHE_TRANSFER_ERROR; } } private ArtifactTransferException newException( String error, Artifact artifact, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new ArtifactNotFoundException( artifact, repository, "Failure to find " + artifact + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new ArtifactTransferException( artifact, repository, "Failure to transfer " + artifact + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } } public void checkMetadata( RepositorySystemSession session, UpdateCheck check ) { if ( check.getLocalLastUpdated() != 0 && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", locally installed metadata up-to-date." ); } check.setRequired( false ); return; } Metadata metadata = check.getItem(); RemoteRepository repository = check.getRepository(); File metadataFile = check.getFile(); if ( metadataFile == null ) { throw new IllegalArgumentException( String.format( "The metadata '%s' has no file attached", metadata ) ); } boolean fileExists = check.isFileValid() && metadataFile.exists(); File touchFile = getTouchFile( metadata, metadataFile ); Properties props = read( touchFile ); String updateKey = getUpdateKey( session, metadataFile, repository ); String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() ); String error = getError( props, dataKey ); long lastUpdated; if ( error == null ) { if ( fileExists ) { // last update was successful lastUpdated = getLastUpdated( props, dataKey ); } else { // this is the first attempt ever lastUpdated = 0; } } else if ( error.length() <= 0 ) { // metadata did not exist lastUpdated = getLastUpdated( props, dataKey ); } else { // metadata could not be transferred String transferKey = getTransferKey( session, metadata, metadataFile, repository ); lastUpdated = getLastUpdated( props, transferKey ); } if ( lastUpdated == 0 ) { check.setRequired( true ); } else if ( isAlreadyUpdated( session, updateKey ) ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", already updated during this session." ); } check.setRequired( false ); if ( error != null ) { check.setException( newException( error, metadata, repository ) ); } } else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) ) { check.setRequired( true ); } else if ( fileExists ) { if ( logger.isDebugEnabled() ) { logger.debug( "Skipped remote request for " + check.getItem() + ", locally cached metadata up-to-date." ); } check.setRequired( false ); } else { int errorPolicy = Utils.getPolicy( session, metadata, repository ); int cacheFlag = getCacheFlag( error ); if ( ( errorPolicy & cacheFlag ) != 0 ) { check.setRequired( false ); check.setException( newException( error, metadata, repository ) ); } else { check.setRequired( true ); } } } private MetadataTransferException newException( String error, Metadata metadata, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new MetadataNotFoundException( metadata, repository, "Failure to find " + metadata + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new MetadataTransferException( metadata, repository, "Failure to transfer " + metadata + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } } private long getLastUpdated( Properties props, String key ) { String value = props.getProperty( key + UPDATED_KEY_SUFFIX, "" ); try { return ( value.length() > 0 ) ? Long.parseLong( value ) : 1; } catch ( NumberFormatException e ) { logger.debug( "Cannot parse lastUpdated date: \'" + value + "\'. Ignoring.", e ); return 1; } } private String getError( Properties props, String key ) { return props.getProperty( key + ERROR_KEY_SUFFIX ); } private File getTouchFile( Artifact artifact, File artifactFile ) { return new File( artifactFile.getPath() + ".lastUpdated" ); } private File getTouchFile( Metadata metadata, File metadataFile ) { return new File( metadataFile.getParent(), "resolver-status.properties" ); } private String getDataKey( Artifact artifact, File artifactFile, RemoteRepository repository ) { Set mirroredUrls = Collections.emptySet(); if ( repository.isRepositoryManager() ) { mirroredUrls = new TreeSet(); for ( RemoteRepository mirroredRepository : repository.getMirroredRepositories() ) { mirroredUrls.add( normalizeRepoUrl( mirroredRepository.getUrl() ) ); } } StringBuilder buffer = new StringBuilder( 1024 ); buffer.append( normalizeRepoUrl( repository.getUrl() ) ); for ( String mirroredUrl : mirroredUrls ) { buffer.append( '+' ).append( mirroredUrl ); } return buffer.toString(); } private String getTransferKey( RepositorySystemSession session, Artifact artifact, File artifactFile, RemoteRepository repository ) { return getRepoKey( session, repository ); } private String getDataKey( Metadata metadata, File metadataFile, RemoteRepository repository ) { return metadataFile.getName(); } private String getTransferKey( RepositorySystemSession session, Metadata metadata, File metadataFile, RemoteRepository repository ) { return metadataFile.getName() + '/' + getRepoKey( session, repository ); } private String getRepoKey( RepositorySystemSession session, RemoteRepository repository ) { StringBuilder buffer = new StringBuilder( 128 ); Proxy proxy = repository.getProxy(); if ( proxy != null ) { buffer.append( AuthenticationDigest.forProxy( session, repository ) ).append( '@' ); buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' ); } buffer.append( AuthenticationDigest.forRepository( session, repository ) ).append( '@' ); buffer.append( repository.getContentType() ).append( '-' ); buffer.append( repository.getId() ).append( '-' ); buffer.append( normalizeRepoUrl( repository.getUrl() ) ); return buffer.toString(); } private String normalizeRepoUrl( String url ) { String result = url; if ( url != null && url.length() > 0 && !url.endsWith( "/" ) ) { result = url + '/'; } return result; } private String getUpdateKey( RepositorySystemSession session, File file, RemoteRepository repository ) { return file.getAbsolutePath() + '|' + getRepoKey( session, repository ); } private int getSessionState( RepositorySystemSession session ) { String mode = ConfigUtils.getString( session, "true", CONFIG_PROP_SESSION_STATE ); if ( Boolean.parseBoolean( mode ) ) { // perform update check at most once per session, regardless of update policy return STATE_ENABLED; } else if ( "bypass".equalsIgnoreCase( mode ) ) { // evaluate update policy but record update in session to prevent potential future checks return STATE_BYPASS; } else { // no session state at all, always evaluate update policy return STATE_DISABLED; } } private boolean isAlreadyUpdated( RepositorySystemSession session, Object updateKey ) { if ( getSessionState( session ) >= STATE_BYPASS ) { return false; } SessionData data = session.getData(); Object checkedFiles = data.get( SESSION_CHECKS ); if ( !( checkedFiles instanceof Map ) ) { return false; } return ( (Map) checkedFiles ).containsKey( updateKey ); } @SuppressWarnings( "unchecked" ) private void setUpdated( RepositorySystemSession session, Object updateKey ) { if ( getSessionState( session ) >= STATE_DISABLED ) { return; } SessionData data = session.getData(); Object checkedFiles = data.get( SESSION_CHECKS ); while ( !( checkedFiles instanceof Map ) ) { Object old = checkedFiles; checkedFiles = new ConcurrentHashMap( 256 ); if ( data.set( SESSION_CHECKS, old, checkedFiles ) ) { break; } checkedFiles = data.get( SESSION_CHECKS ); } ( (Map) checkedFiles ).put( updateKey, Boolean.TRUE ); } private boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy ) { return updatePolicyAnalyzer.isUpdatedRequired( session, lastModified, policy ); } private Properties read( File touchFile ) { Properties props = new TrackingFileManager().setLogger( logger ).read( touchFile ); return ( props != null ) ? props : new Properties(); } public void touchArtifact( RepositorySystemSession session, UpdateCheck check ) { Artifact artifact = check.getItem(); File artifactFile = check.getFile(); File touchFile = getTouchFile( artifact, artifactFile ); String updateKey = getUpdateKey( session, artifactFile, check.getRepository() ); String dataKey = getDataKey( artifact, artifactFile, check.getAuthoritativeRepository() ); String transferKey = getTransferKey( session, artifact, artifactFile, check.getRepository() ); setUpdated( session, updateKey ); Properties props = write( touchFile, dataKey, transferKey, check.getException() ); if ( artifactFile.exists() && !hasErrors( props ) ) { touchFile.delete(); } } private boolean hasErrors( Properties props ) { for ( Object key : props.keySet() ) { if ( key.toString().endsWith( ERROR_KEY_SUFFIX ) ) { return true; } } return false; } public void touchMetadata( RepositorySystemSession session, UpdateCheck check ) { Metadata metadata = check.getItem(); File metadataFile = check.getFile(); File touchFile = getTouchFile( metadata, metadataFile ); String updateKey = getUpdateKey( session, metadataFile, check.getRepository() ); String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() ); String transferKey = getTransferKey( session, metadata, metadataFile, check.getRepository() ); setUpdated( session, updateKey ); write( touchFile, dataKey, transferKey, check.getException() ); } private Properties write( File touchFile, String dataKey, String transferKey, Exception error ) { Map updates = new HashMap(); String timestamp = Long.toString( System.currentTimeMillis() ); if ( error == null ) { updates.put( dataKey + ERROR_KEY_SUFFIX, null ); updates.put( dataKey + UPDATED_KEY_SUFFIX, timestamp ); updates.put( transferKey + UPDATED_KEY_SUFFIX, null ); } else if ( error instanceof ArtifactNotFoundException || error instanceof MetadataNotFoundException ) { updates.put( dataKey + ERROR_KEY_SUFFIX, NOT_FOUND ); updates.put( dataKey + UPDATED_KEY_SUFFIX, timestamp ); updates.put( transferKey + UPDATED_KEY_SUFFIX, null ); } else { String msg = error.getMessage(); if ( msg == null || msg.length() <= 0 ) { msg = error.getClass().getSimpleName(); } updates.put( dataKey + ERROR_KEY_SUFFIX, msg ); updates.put( dataKey + UPDATED_KEY_SUFFIX, null ); updates.put( transferKey + UPDATED_KEY_SUFFIX, timestamp ); } return new TrackingFileManager().setLogger( logger ).update( touchFile, updates ); } } DefaultUpdatePolicyAnalyzer.java000066400000000000000000000107341245546356100353700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Calendar; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** */ @Named public class DefaultUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer, Service { private Logger logger = NullLoggerFactory.LOGGER; public DefaultUpdatePolicyAnalyzer() { // enables default constructor } @Inject DefaultUpdatePolicyAnalyzer( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } public DefaultUpdatePolicyAnalyzer setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); return this; } public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } private int ordinalOfUpdatePolicy( String policy ) { if ( RepositoryPolicy.UPDATE_POLICY_DAILY.equals( policy ) ) { return 1440; } else if ( RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy ) ) { return 0; } else if ( policy != null && policy.startsWith( RepositoryPolicy.UPDATE_POLICY_INTERVAL ) ) { return getMinutes( policy ); } else { // assume "never" return Integer.MAX_VALUE; } } public boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy ) { boolean checkForUpdates; if ( policy == null ) { policy = ""; } if ( RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy ) ) { checkForUpdates = true; } else if ( RepositoryPolicy.UPDATE_POLICY_DAILY.equals( policy ) ) { Calendar cal = Calendar.getInstance(); cal.set( Calendar.HOUR_OF_DAY, 0 ); cal.set( Calendar.MINUTE, 0 ); cal.set( Calendar.SECOND, 0 ); cal.set( Calendar.MILLISECOND, 0 ); checkForUpdates = cal.getTimeInMillis() > lastModified; } else if ( policy.startsWith( RepositoryPolicy.UPDATE_POLICY_INTERVAL ) ) { int minutes = getMinutes( policy ); Calendar cal = Calendar.getInstance(); cal.add( Calendar.MINUTE, -minutes ); checkForUpdates = cal.getTimeInMillis() > lastModified; } else { // assume "never" checkForUpdates = false; if ( !RepositoryPolicy.UPDATE_POLICY_NEVER.equals( policy ) ) { logger.warn( "Unknown repository update policy '" + policy + "', assuming '" + RepositoryPolicy.UPDATE_POLICY_NEVER + "'" ); } } return checkForUpdates; } private int getMinutes( String policy ) { int minutes; try { String s = policy.substring( RepositoryPolicy.UPDATE_POLICY_INTERVAL.length() + 1 ); minutes = Integer.valueOf( s ); } catch ( RuntimeException e ) { minutes = 24 * 60; logger.warn( "Non-parseable repository update policy '" + policy + "', assuming '" + RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":1440'" ); } return minutes; } } DefaultVersionFilterContext.java000066400000000000000000000123221245546356100354130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * @see DefaultDependencyCollector */ final class DefaultVersionFilterContext implements VersionFilter.VersionFilterContext { private final Iterator EMPTY = Collections. emptySet().iterator(); private final RepositorySystemSession session; private Dependency dependency; VersionRangeResult result; int count; byte[] deleted = new byte[64]; public DefaultVersionFilterContext( RepositorySystemSession session ) { this.session = session; } public void set( Dependency dependency, VersionRangeResult result ) { this.dependency = dependency; this.result = result; count = result.getVersions().size(); if ( deleted.length < count ) { deleted = new byte[count]; } else { for ( int i = count - 1; i >= 0; i-- ) { deleted[i] = 0; } } } public List get() { if ( count == result.getVersions().size() ) { return result.getVersions(); } if ( count <= 1 ) { if ( count <= 0 ) { return Collections.emptyList(); } return Collections.singletonList( iterator().next() ); } List versions = new ArrayList( count ); for ( Version version : this ) { versions.add( version ); } return versions; } public RepositorySystemSession getSession() { return session; } public Dependency getDependency() { return dependency; } public VersionConstraint getVersionConstraint() { return result.getVersionConstraint(); } public int getCount() { return count; } public ArtifactRepository getRepository( Version version ) { return result.getRepository( version ); } public List getRepositories() { return Collections.unmodifiableList( result.getRequest().getRepositories() ); } public Iterator iterator() { return ( count > 0 ) ? new VersionIterator() : EMPTY; } @Override public String toString() { return dependency + " " + result.getVersions(); } private class VersionIterator implements Iterator { private final List versions; private final int size; private int count; private int index; private int next; public VersionIterator() { count = DefaultVersionFilterContext.this.count; index = -1; next = 0; versions = result.getVersions(); size = versions.size(); advance(); } private void advance() { for ( next = index + 1; next < size && deleted[next] != 0; next++ ) { // just advancing index } } public boolean hasNext() { return next < size; } public Version next() { if ( count != DefaultVersionFilterContext.this.count ) { throw new ConcurrentModificationException(); } if ( next >= size ) { throw new NoSuchElementException(); } index = next; advance(); return versions.get( index ); } public void remove() { if ( count != DefaultVersionFilterContext.this.count ) { throw new ConcurrentModificationException(); } if ( index < 0 || deleted[index] == 1 ) { throw new IllegalStateException(); } deleted[index] = 1; count = --DefaultVersionFilterContext.this.count; } @Override public String toString() { return ( index < 0 ) ? "null" : String.valueOf( versions.get( index ) ); } } } EnhancedLocalRepositoryManager.java000066400000000000000000000163341245546356100360300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Properties; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.util.ConfigUtils; /** * These are implementation details for enhanced local repository manager, subject to change without prior notice. * Repositories from which a cached artifact was resolved are tracked in a properties file named * _remote.repositories, with content key as filename>repo_id and value as empty string. If a file has * been installed in the repository, but not downloaded from a remote repository, it is tracked as empty repository id * and always resolved. For example: * *

 * artifact-1.0.pom>=
 * artifact-1.0.jar>=
 * artifact-1.0.pom>central=
 * artifact-1.0.jar>central=
 * artifact-1.0.zip>central=
 * artifact-1.0-classifier.zip>central=
 * artifact-1.0.pom>my_repo_id=
 * 
* * @see EnhancedLocalRepositoryManagerFactory */ class EnhancedLocalRepositoryManager extends SimpleLocalRepositoryManager { private static final String LOCAL_REPO_ID = ""; private final String trackingFilename; private final TrackingFileManager trackingFileManager; public EnhancedLocalRepositoryManager( File basedir, RepositorySystemSession session ) { super( basedir, "enhanced" ); String filename = ConfigUtils.getString( session, "", "aether.enhancedLocalRepository.trackingFilename" ); if ( filename.length() <= 0 || filename.contains( "/" ) || filename.contains( "\\" ) || filename.contains( ".." ) ) { filename = "_remote.repositories"; } trackingFilename = filename; trackingFileManager = new TrackingFileManager(); } @Override public EnhancedLocalRepositoryManager setLogger( Logger logger ) { super.setLogger( logger ); trackingFileManager.setLogger( logger ); return this; } @Override public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { String path = getPathForArtifact( request.getArtifact(), false ); File file = new File( getRepository().getBasedir(), path ); LocalArtifactResult result = new LocalArtifactResult( request ); if ( file.isFile() ) { result.setFile( file ); Properties props = readRepos( file ); if ( props.get( getKey( file, LOCAL_REPO_ID ) ) != null ) { // artifact installed into the local repo is always accepted result.setAvailable( true ); } else { String context = request.getContext(); for ( RemoteRepository repository : request.getRepositories() ) { if ( props.get( getKey( file, getRepositoryKey( repository, context ) ) ) != null ) { // artifact downloaded from remote repository is accepted only downloaded from request // repositories result.setAvailable( true ); result.setRepository( repository ); break; } } if ( !result.isAvailable() && !isTracked( props, file ) ) { /* * NOTE: The artifact is present but not tracked at all, for inter-op with simple local repo, assume * the artifact was locally installed. */ result.setAvailable( true ); } } } return result; } @Override public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { Collection repositories; if ( request.getRepository() == null ) { repositories = Collections.singleton( LOCAL_REPO_ID ); } else { repositories = getRepositoryKeys( request.getRepository(), request.getContexts() ); } addArtifact( request.getArtifact(), repositories, request.getRepository() == null ); } private Collection getRepositoryKeys( RemoteRepository repository, Collection contexts ) { Collection keys = new HashSet(); if ( contexts != null ) { for ( String context : contexts ) { keys.add( getRepositoryKey( repository, context ) ); } } return keys; } private void addArtifact( Artifact artifact, Collection repositories, boolean local ) { if ( artifact == null ) { throw new IllegalArgumentException( "artifact to register not specified" ); } String path = getPathForArtifact( artifact, local ); File file = new File( getRepository().getBasedir(), path ); addRepo( file, repositories ); } private Properties readRepos( File artifactFile ) { File trackingFile = getTrackingFile( artifactFile ); Properties props = trackingFileManager.read( trackingFile ); return ( props != null ) ? props : new Properties(); } private void addRepo( File artifactFile, Collection repositories ) { Map updates = new HashMap(); for ( String repository : repositories ) { updates.put( getKey( artifactFile, repository ), "" ); } File trackingFile = getTrackingFile( artifactFile ); trackingFileManager.update( trackingFile, updates ); } private File getTrackingFile( File artifactFile ) { return new File( artifactFile.getParentFile(), trackingFilename ); } private String getKey( File file, String repository ) { return file.getName() + '>' + repository; } private boolean isTracked( Properties props, File file ) { if ( props != null ) { String keyPrefix = file.getName() + '>'; for ( Object key : props.keySet() ) { if ( key.toString().startsWith( keyPrefix ) ) { return true; } } } return false; } } EnhancedLocalRepositoryManagerFactory.java000066400000000000000000000066171245546356100373630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** * Creates enhanced local repository managers for repository types {@code "default"} or {@code "" (automatic)}. Enhanced * local repository manager is built upon the classical Maven 2.0 local repository structure but additionally keeps * track of from what repositories a cached artifact was resolved. Resolution of locally cached artifacts will be * rejected in case the current resolution request does not match the known source repositories of an artifact, thereby * emulating physically separated artifact caches per remote repository. */ @Named( "enhanced" ) public class EnhancedLocalRepositoryManagerFactory implements LocalRepositoryManagerFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private float priority = 10; public EnhancedLocalRepositoryManagerFactory() { // enable no-arg constructor } @Inject EnhancedLocalRepositoryManagerFactory( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public LocalRepositoryManager newInstance( RepositorySystemSession session, LocalRepository repository ) throws NoLocalRepositoryManagerException { if ( "".equals( repository.getContentType() ) || "default".equals( repository.getContentType() ) ) { return new EnhancedLocalRepositoryManager( repository.getBasedir(), session ).setLogger( logger ); } else { throw new NoLocalRepositoryManagerException( repository ); } } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } public EnhancedLocalRepositoryManagerFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, EnhancedLocalRepositoryManager.class ); return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public EnhancedLocalRepositoryManagerFactory setPriority( float priority ) { this.priority = priority; return this; } } FailChecksumPolicy.java000066400000000000000000000022021245546356100334600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; /** * Implements {@link org.eclipse.aether.repository.RepositoryPolicy#CHECKSUM_POLICY_FAIL}. */ final class FailChecksumPolicy extends AbstractChecksumPolicy { public FailChecksumPolicy( LoggerFactory loggerFactory, TransferResource resource ) { super( loggerFactory, resource ); } public boolean onTransferChecksumFailure( ChecksumFailureException error ) { return false; } } LoggerFactoryProvider.java000066400000000000000000000027211245546356100342320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Provider; import javax.inject.Singleton; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** * Helps Sisu-based applications to pick the right logger factory depending on the classpath. */ @Named @Singleton public class LoggerFactoryProvider implements Provider { @Inject @Named( "slf4j" ) private Provider slf4j; public LoggerFactory get() { try { LoggerFactory factory = slf4j.get(); if ( factory != null ) { return factory; } } catch ( LinkageError e ) { // fall through } catch ( RuntimeException e ) { // fall through } return NullLoggerFactory.INSTANCE; } } Maven2RepositoryLayoutFactory.java000066400000000000000000000130171245546356100357260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.net.URI; import java.net.URISyntaxException; import java.util.Arrays; import java.util.Collections; import java.util.List; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; import org.eclipse.aether.transfer.NoRepositoryLayoutException; import org.eclipse.aether.util.ConfigUtils; /** * Provides a Maven-2 repository layout for repositories with content type {@code "default"}. */ @Named( "maven2" ) public final class Maven2RepositoryLayoutFactory implements RepositoryLayoutFactory { static final String CONFIG_PROP_SIGNATURE_CHECKSUMS = "aether.checksums.forSignature"; private float priority; public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public Maven2RepositoryLayoutFactory setPriority( float priority ) { this.priority = priority; return this; } public RepositoryLayout newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryLayoutException { if ( !"default".equals( repository.getContentType() ) ) { throw new NoRepositoryLayoutException( repository ); } boolean forSignature = ConfigUtils.getBoolean( session, false, CONFIG_PROP_SIGNATURE_CHECKSUMS ); return forSignature ? Maven2RepositoryLayout.INSTANCE : Maven2RepositoryLayoutEx.INSTANCE; } private static class Maven2RepositoryLayout implements RepositoryLayout { public static final RepositoryLayout INSTANCE = new Maven2RepositoryLayout(); private URI toUri( String path ) { try { return new URI( null, null, path, null ); } catch ( URISyntaxException e ) { throw new IllegalStateException( e ); } } public URI getLocation( Artifact artifact, boolean upload ) { StringBuilder path = new StringBuilder( 128 ); path.append( artifact.getGroupId().replace( '.', '/' ) ).append( '/' ); path.append( artifact.getArtifactId() ).append( '/' ); path.append( artifact.getBaseVersion() ).append( '/' ); path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() ); if ( artifact.getClassifier().length() > 0 ) { path.append( '-' ).append( artifact.getClassifier() ); } if ( artifact.getExtension().length() > 0 ) { path.append( '.' ).append( artifact.getExtension() ); } return toUri( path.toString() ); } public URI getLocation( Metadata metadata, boolean upload ) { StringBuilder path = new StringBuilder( 128 ); if ( metadata.getGroupId().length() > 0 ) { path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' ); if ( metadata.getArtifactId().length() > 0 ) { path.append( metadata.getArtifactId() ).append( '/' ); if ( metadata.getVersion().length() > 0 ) { path.append( metadata.getVersion() ).append( '/' ); } } } path.append( metadata.getType() ); return toUri( path.toString() ); } public List getChecksums( Artifact artifact, boolean upload, URI location ) { return getChecksums( location ); } public List getChecksums( Metadata metadata, boolean upload, URI location ) { return getChecksums( location ); } private List getChecksums( URI location ) { return Arrays.asList( Checksum.forLocation( location, "SHA-1" ), Checksum.forLocation( location, "MD5" ) ); } } private static class Maven2RepositoryLayoutEx extends Maven2RepositoryLayout { public static final RepositoryLayout INSTANCE = new Maven2RepositoryLayoutEx(); @Override public List getChecksums( Artifact artifact, boolean upload, URI location ) { if ( isSignature( artifact.getExtension() ) ) { return Collections.emptyList(); } return super.getChecksums( artifact, upload, location ); } private boolean isSignature( String extension ) { return extension.endsWith( ".asc" ); } } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/NodeStack.java000066400000000000000000000060121245546356100316770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Arrays; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.DependencyNode; /** * @see DefaultDependencyCollector */ final class NodeStack { private DependencyNode[] nodes = new DependencyNode[96]; private int size; public DependencyNode top() { if ( size <= 0 ) { throw new IllegalStateException( "stack empty" ); } return nodes[size - 1]; } public void push( DependencyNode node ) { if ( size >= nodes.length ) { DependencyNode[] tmp = new DependencyNode[size + 64]; System.arraycopy( nodes, 0, tmp, 0, nodes.length ); nodes = tmp; } nodes[size++] = node; } public void pop() { if ( size <= 0 ) { throw new IllegalStateException( "stack empty" ); } size--; } public int find( Artifact artifact ) { for ( int i = size - 1; i >= 0; i-- ) { DependencyNode node = nodes[i]; Artifact a = node.getArtifact(); if ( a == null ) { break; } if ( !a.getArtifactId().equals( artifact.getArtifactId() ) ) { continue; } if ( !a.getGroupId().equals( artifact.getGroupId() ) ) { continue; } if ( !a.getExtension().equals( artifact.getExtension() ) ) { continue; } if ( !a.getClassifier().equals( artifact.getClassifier() ) ) { continue; } /* * NOTE: While a:1 and a:2 are technically different artifacts, we want to consider the path a:2 -> b:2 -> * a:1 a cycle in the current context. The artifacts themselves might not form a cycle but their producing * projects surely do. Furthermore, conflict resolution will always have to consider a:1 a loser (otherwise * its ancestor a:2 would get pruned and so would a:1) so there is no point in building the sub graph of * a:1. */ return i; } return -1; } public int size() { return size; } public DependencyNode get( int index ) { return nodes[index]; } @Override public String toString() { return Arrays.toString( nodes ); } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ObjectPool.java000066400000000000000000000025471245546356100320750ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.util.Map; import java.util.WeakHashMap; /** * Pool of immutable object instances, used to avoid excessive memory consumption of (dirty) dependency graph which * tends to have many duplicate artifacts/dependencies. */ class ObjectPool { private final Map> objects = new WeakHashMap>( 256 ); public synchronized T intern( T object ) { Reference pooledRef = objects.get( object ); if ( pooledRef != null ) { T pooled = pooledRef.get(); if ( pooled != null ) { return pooled; } } objects.put( object, new WeakReference( object ) ); return object; } } PrioritizedComponent.java000066400000000000000000000033741245546356100341440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; final class PrioritizedComponent implements Comparable> { private final T component; private final Class type; private final float priority; private final int index; public PrioritizedComponent( T component, Class type, float priority, int index ) { this.component = component; this.type = type; this.priority = priority; this.index = index; } public T getComponent() { return component; } public Class getType() { return type; } public float getPriority() { return priority; } public boolean isDisabled() { return Float.isNaN( priority ); } public int compareTo( PrioritizedComponent o ) { int rel = ( isDisabled() ? 1 : 0 ) - ( o.isDisabled() ? 1 : 0 ); if ( rel == 0 ) { rel = Float.compare( o.priority, priority ); if ( rel == 0 ) { rel = index - o.index; } } return rel; } @Override public String toString() { return priority + " (#" + index + "): " + String.valueOf( component ); } } PrioritizedComponents.java000066400000000000000000000106161245546356100343240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.util.ConfigUtils; /** * Helps to sort pluggable components by their priority. */ final class PrioritizedComponents { private final static String FACTORY_SUFFIX = "Factory"; private final Map configProps; private final boolean useInsertionOrder; private final List> components; private int firstDisabled; public PrioritizedComponents( RepositorySystemSession session ) { this( session.getConfigProperties() ); } PrioritizedComponents( Map configurationProperties ) { configProps = configurationProperties; useInsertionOrder = ConfigUtils.getBoolean( configProps, ConfigurationProperties.DEFAULT_IMPLICIT_PRIORITIES, ConfigurationProperties.IMPLICIT_PRIORITIES ); components = new ArrayList>(); firstDisabled = 0; } public void add( T component, float priority ) { Class type = getImplClass( component ); int index = components.size(); priority = useInsertionOrder ? -index : ConfigUtils.getFloat( configProps, priority, getConfigKeys( type ) ); PrioritizedComponent pc = new PrioritizedComponent( component, type, priority, index ); if ( !useInsertionOrder ) { index = Collections.binarySearch( components, pc ); if ( index < 0 ) { index = -index - 1; } else { index++; } } components.add( index, pc ); if ( index <= firstDisabled && !pc.isDisabled() ) { firstDisabled++; } } private static Class getImplClass( Object component ) { Class type = component.getClass(); // detect and ignore CGLIB-based proxy classes employed by Guice for AOP (cf. BytecodeGen.newEnhancer) int idx = type.getName().indexOf( "$$" ); if ( idx >= 0 ) { Class base = type.getSuperclass(); if ( base != null && idx == base.getName().length() && type.getName().startsWith( base.getName() ) ) { type = base; } } return type; } static String[] getConfigKeys( Class type ) { List keys = new ArrayList(); keys.add( ConfigurationProperties.PREFIX_PRIORITY + type.getName() ); String sn = type.getSimpleName(); keys.add( ConfigurationProperties.PREFIX_PRIORITY + sn ); if ( sn.endsWith( FACTORY_SUFFIX ) ) { keys.add( ConfigurationProperties.PREFIX_PRIORITY + sn.substring( 0, sn.length() - FACTORY_SUFFIX.length() ) ); } return keys.toArray( new String[keys.size()] ); } public boolean isEmpty() { return components.isEmpty(); } public List> getAll() { return components; } public List> getEnabled() { return components.subList( 0, firstDisabled ); } public void list( StringBuilder buffer ) { for ( int i = 0; i < components.size(); i++ ) { if ( i > 0 ) { buffer.append( ", " ); } PrioritizedComponent component = components.get( i ); buffer.append( component.getType().getSimpleName() ); if ( component.isDisabled() ) { buffer.append( " (disabled)" ); } } } @Override public String toString() { return components.toString(); } } SafeTransferListener.java000066400000000000000000000111241245546356100340360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.AbstractTransferListener; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferListener; class SafeTransferListener extends AbstractTransferListener { private final Logger logger; private final TransferListener listener; public static TransferListener wrap( RepositorySystemSession session, Logger logger ) { TransferListener listener = session.getTransferListener(); if ( listener == null ) { return null; } return new SafeTransferListener( listener, logger ); } protected SafeTransferListener( RepositorySystemSession session, Logger logger ) { this( session.getTransferListener(), logger ); } private SafeTransferListener( TransferListener listener, Logger logger ) { this.listener = listener; this.logger = logger; } private void logError( TransferEvent event, Throwable e ) { String msg = "Failed to dispatch transfer event '" + event + "' to " + listener.getClass().getCanonicalName(); logger.debug( msg, e ); } @Override public void transferInitiated( TransferEvent event ) throws TransferCancelledException { if ( listener != null ) { try { listener.transferInitiated( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } @Override public void transferStarted( TransferEvent event ) throws TransferCancelledException { if ( listener != null ) { try { listener.transferStarted( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } @Override public void transferProgressed( TransferEvent event ) throws TransferCancelledException { if ( listener != null ) { try { listener.transferProgressed( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } @Override public void transferCorrupted( TransferEvent event ) throws TransferCancelledException { if ( listener != null ) { try { listener.transferCorrupted( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } @Override public void transferSucceeded( TransferEvent event ) { if ( listener != null ) { try { listener.transferSucceeded( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } @Override public void transferFailed( TransferEvent event ) { if ( listener != null ) { try { listener.transferFailed( event ); } catch ( RuntimeException e ) { logError( event, e ); } catch ( LinkageError e ) { logError( event, e ); } } } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java000066400000000000000000000044351245546356100324240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; /** * A simple digester for strings. */ class SimpleDigest { private MessageDigest digest; private long hash; public SimpleDigest() { try { digest = MessageDigest.getInstance( "SHA-1" ); } catch ( NoSuchAlgorithmException e ) { try { digest = MessageDigest.getInstance( "MD5" ); } catch ( NoSuchAlgorithmException ne ) { digest = null; hash = 13; } } } public void update( String data ) { if ( data == null || data.length() <= 0 ) { return; } if ( digest != null ) { try { digest.update( data.getBytes( "UTF-8" ) ); } catch ( UnsupportedEncodingException e ) { // broken JVM } } else { hash = hash * 31 + data.hashCode(); } } public String digest() { if ( digest != null ) { StringBuilder buffer = new StringBuilder( 64 ); byte[] bytes = digest.digest(); for ( byte aByte : bytes ) { int b = aByte & 0xFF; if ( b < 0x10 ) { buffer.append( '0' ); } buffer.append( Integer.toHexString( b ) ); } return buffer.toString(); } else { return Long.toHexString( hash ); } } } SimpleLocalRepositoryManager.java000066400000000000000000000167731245546356100355630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.File; import java.util.SortedSet; import java.util.TreeSet; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.LocalMetadataRequest; import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.log.Logger; /** * A local repository manager that realizes the classical Maven 2.0 local repository. */ class SimpleLocalRepositoryManager implements LocalRepositoryManager { private final LocalRepository repository; public SimpleLocalRepositoryManager( File basedir ) { this( basedir, "simple" ); } public SimpleLocalRepositoryManager( String basedir ) { this( ( basedir != null ) ? new File( basedir ) : null, "simple" ); } SimpleLocalRepositoryManager( File basedir, String type ) { if ( basedir == null ) { throw new IllegalArgumentException( "base directory has not been specified" ); } repository = new LocalRepository( basedir.getAbsoluteFile(), type ); } public SimpleLocalRepositoryManager setLogger( Logger logger ) { return this; } public LocalRepository getRepository() { return repository; } String getPathForArtifact( Artifact artifact, boolean local ) { StringBuilder path = new StringBuilder( 128 ); path.append( artifact.getGroupId().replace( '.', '/' ) ).append( '/' ); path.append( artifact.getArtifactId() ).append( '/' ); path.append( artifact.getBaseVersion() ).append( '/' ); path.append( artifact.getArtifactId() ).append( '-' ); if ( local ) { path.append( artifact.getBaseVersion() ); } else { path.append( artifact.getVersion() ); } if ( artifact.getClassifier().length() > 0 ) { path.append( '-' ).append( artifact.getClassifier() ); } if ( artifact.getExtension().length() > 0 ) { path.append( '.' ).append( artifact.getExtension() ); } return path.toString(); } public String getPathForLocalArtifact( Artifact artifact ) { return getPathForArtifact( artifact, true ); } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return getPathForArtifact( artifact, false ); } public String getPathForLocalMetadata( Metadata metadata ) { return getPath( metadata, "local" ); } public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) { return getPath( metadata, getRepositoryKey( repository, context ) ); } String getRepositoryKey( RemoteRepository repository, String context ) { String key; if ( repository.isRepositoryManager() ) { // repository serves dynamic contents, take request parameters into account for key StringBuilder buffer = new StringBuilder( 128 ); buffer.append( repository.getId() ); buffer.append( '-' ); SortedSet subKeys = new TreeSet(); for ( RemoteRepository mirroredRepo : repository.getMirroredRepositories() ) { subKeys.add( mirroredRepo.getId() ); } SimpleDigest digest = new SimpleDigest(); digest.update( context ); for ( String subKey : subKeys ) { digest.update( subKey ); } buffer.append( digest.digest() ); key = buffer.toString(); } else { // repository serves static contents, its id is sufficient as key key = repository.getId(); } return key; } private String getPath( Metadata metadata, String repositoryKey ) { StringBuilder path = new StringBuilder( 128 ); if ( metadata.getGroupId().length() > 0 ) { path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' ); if ( metadata.getArtifactId().length() > 0 ) { path.append( metadata.getArtifactId() ).append( '/' ); if ( metadata.getVersion().length() > 0 ) { path.append( metadata.getVersion() ).append( '/' ); } } } path.append( insertRepositoryKey( metadata.getType(), repositoryKey ) ); return path.toString(); } private String insertRepositoryKey( String filename, String repositoryKey ) { String result; int idx = filename.indexOf( '.' ); if ( idx < 0 ) { result = filename + '-' + repositoryKey; } else { result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); } return result; } public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { String path = getPathForArtifact( request.getArtifact(), false ); File file = new File( getRepository().getBasedir(), path ); LocalArtifactResult result = new LocalArtifactResult( request ); if ( file.isFile() ) { result.setFile( file ); result.setAvailable( true ); } return result; } public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { // noop } @Override public String toString() { return String.valueOf( getRepository() ); } public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) { LocalMetadataResult result = new LocalMetadataResult( request ); String path; Metadata metadata = request.getMetadata(); String context = request.getContext(); RemoteRepository remote = request.getRepository(); if ( remote != null ) { path = getPathForRemoteMetadata( metadata, remote, context ); } else { path = getPathForLocalMetadata( metadata ); } File file = new File( getRepository().getBasedir(), path ); if ( file.isFile() ) { result.setFile( file ); } return result; } public void add( RepositorySystemSession session, LocalMetadataRegistration request ) { // noop } } SimpleLocalRepositoryManagerFactory.java000066400000000000000000000056331245546356100371040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; /** * Creates local repository managers for repository type {@code "simple"}. */ @Named( "simple" ) public class SimpleLocalRepositoryManagerFactory implements LocalRepositoryManagerFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private float priority; public SimpleLocalRepositoryManagerFactory() { // enable no-arg constructor } @Inject SimpleLocalRepositoryManagerFactory( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public LocalRepositoryManager newInstance( RepositorySystemSession session, LocalRepository repository ) throws NoLocalRepositoryManagerException { if ( "".equals( repository.getContentType() ) || "simple".equals( repository.getContentType() ) ) { return new SimpleLocalRepositoryManager( repository.getBasedir() ).setLogger( logger ); } else { throw new NoLocalRepositoryManagerException( repository ); } } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } public SimpleLocalRepositoryManagerFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, SimpleLocalRepositoryManager.class ); return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public SimpleLocalRepositoryManagerFactory setPriority( float priority ) { this.priority = priority; return this; } } TrackingFileManager.java000066400000000000000000000152031245546356100336040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; import java.util.Map; import java.util.Properties; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.NullLoggerFactory; /** * Manages potentially concurrent accesses to a properties file. */ class TrackingFileManager { private Logger logger = NullLoggerFactory.LOGGER; public TrackingFileManager setLogger( Logger logger ) { this.logger = ( logger != null ) ? logger : NullLoggerFactory.LOGGER; return this; } public Properties read( File file ) { synchronized ( getLock( file ) ) { FileLock lock = null; FileInputStream stream = null; try { if ( !file.exists() ) { return null; } stream = new FileInputStream( file ); lock = lock( stream.getChannel(), Math.max( 1, file.length() ), true ); Properties props = new Properties(); props.load( stream ); return props; } catch ( IOException e ) { logger.warn( "Failed to read tracking file " + file, e ); } finally { release( lock, file ); close( stream, file ); } } return null; } public Properties update( File file, Map updates ) { Properties props = new Properties(); synchronized ( getLock( file ) ) { File directory = file.getParentFile(); if ( !directory.mkdirs() && !directory.exists() ) { logger.warn( "Failed to create parent directories for tracking file " + file ); return props; } RandomAccessFile raf = null; FileLock lock = null; try { raf = new RandomAccessFile( file, "rw" ); lock = lock( raf.getChannel(), Math.max( 1, raf.length() ), false ); if ( file.canRead() ) { byte[] buffer = new byte[(int) raf.length()]; raf.readFully( buffer ); ByteArrayInputStream stream = new ByteArrayInputStream( buffer ); props.load( stream ); } for ( Map.Entry update : updates.entrySet() ) { if ( update.getValue() == null ) { props.remove( update.getKey() ); } else { props.setProperty( update.getKey(), update.getValue() ); } } ByteArrayOutputStream stream = new ByteArrayOutputStream( 1024 * 2 ); logger.debug( "Writing tracking file " + file ); props.store( stream, "NOTE: This is an Aether internal implementation file" + ", its format can be changed without prior notice." ); raf.seek( 0 ); raf.write( stream.toByteArray() ); raf.setLength( raf.getFilePointer() ); } catch ( IOException e ) { logger.warn( "Failed to write tracking file " + file, e ); } finally { release( lock, file ); close( raf, file ); } } return props; } private void release( FileLock lock, File file ) { if ( lock != null ) { try { lock.release(); } catch ( IOException e ) { logger.warn( "Error releasing lock for tracking file " + file, e ); } } } private void close( Closeable closeable, File file ) { if ( closeable != null ) { try { closeable.close(); } catch ( IOException e ) { logger.warn( "Error closing tracking file " + file, e ); } } } private Object getLock( File file ) { /* * NOTE: Locks held by one JVM must not overlap and using the canonical path is our best bet, still another * piece of code might have locked the same file (unlikely though) or the canonical path fails to capture file * identity sufficiently as is the case with Java 1.6 and symlinks on Windows. */ try { return file.getCanonicalPath().intern(); } catch ( IOException e ) { logger.warn( "Failed to canonicalize path " + file + ": " + e.getMessage() ); return file.getAbsolutePath().intern(); } } private FileLock lock( FileChannel channel, long size, boolean shared ) throws IOException { FileLock lock = null; for ( int attempts = 8; attempts >= 0; attempts-- ) { try { lock = channel.lock( 0, size, shared ); break; } catch ( OverlappingFileLockException e ) { if ( attempts <= 0 ) { throw (IOException) new IOException().initCause( e ); } try { Thread.sleep( 50 ); } catch ( InterruptedException e1 ) { Thread.currentThread().interrupt(); } } } if ( lock == null ) { throw new IOException( "Could not lock file" ); } return lock; } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java000066400000000000000000000106251245546356100311310ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.MetadataGenerator; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.OfflineController; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicyRequest; import org.eclipse.aether.transfer.RepositoryOfflineException; /** * Internal utility methods. */ final class Utils { public static PrioritizedComponents sortMetadataGeneratorFactories( RepositorySystemSession session, Collection factories ) { PrioritizedComponents result = new PrioritizedComponents( session ); for ( MetadataGeneratorFactory factory : factories ) { result.add( factory, factory.getPriority() ); } return result; } public static List prepareMetadata( List generators, List artifacts ) { List metadatas = new ArrayList(); for ( MetadataGenerator generator : generators ) { metadatas.addAll( generator.prepare( artifacts ) ); } return metadatas; } public static List finishMetadata( List generators, List artifacts ) { List metadatas = new ArrayList(); for ( MetadataGenerator generator : generators ) { metadatas.addAll( generator.finish( artifacts ) ); } return metadatas; } public static List combine( Collection first, Collection second ) { List result = new ArrayList( first.size() + second.size() ); result.addAll( first ); result.addAll( second ); return result; } public static int getPolicy( RepositorySystemSession session, Artifact artifact, RemoteRepository repository ) { ResolutionErrorPolicy rep = session.getResolutionErrorPolicy(); if ( rep == null ) { return ResolutionErrorPolicy.CACHE_DISABLED; } return rep.getArtifactPolicy( session, new ResolutionErrorPolicyRequest( artifact, repository ) ); } public static int getPolicy( RepositorySystemSession session, Metadata metadata, RemoteRepository repository ) { ResolutionErrorPolicy rep = session.getResolutionErrorPolicy(); if ( rep == null ) { return ResolutionErrorPolicy.CACHE_DISABLED; } return rep.getMetadataPolicy( session, new ResolutionErrorPolicyRequest( metadata, repository ) ); } public static void appendClassLoader( StringBuilder buffer, Object component ) { ClassLoader loader = component.getClass().getClassLoader(); if ( loader != null && !loader.equals( Utils.class.getClassLoader() ) ) { buffer.append( " from " ).append( loader ); } } public static void checkOffline( RepositorySystemSession session, OfflineController offlineController, RemoteRepository repository ) throws RepositoryOfflineException { if ( session.isOffline() ) { offlineController.checkOffline( session, repository ); } } } WarnChecksumPolicy.java000066400000000000000000000027321245546356100335240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; /** * Implements {@link org.eclipse.aether.repository.RepositoryPolicy#CHECKSUM_POLICY_WARN}. */ final class WarnChecksumPolicy extends AbstractChecksumPolicy { public WarnChecksumPolicy( LoggerFactory loggerFactory, TransferResource resource ) { super( loggerFactory, resource ); } public boolean onTransferChecksumFailure( ChecksumFailureException exception ) { String msg = "Could not validate integrity of download from " + resource.getRepositoryUrl() + resource.getResourceName(); if ( logger.isDebugEnabled() ) { logger.warn( msg, exception ); } else { logger.warn( msg + ": " + exception.getMessage() ); } return true; } } aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java000066400000000000000000000012151245546356100323500ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The various sub components that collectively implement the repository system. */ package org.eclipse.aether.internal.impl; aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/000077500000000000000000000000001245546356100302045ustar00rootroot00000000000000Slf4jLoggerFactory.java000066400000000000000000000112551245546356100344460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl.slf4j; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.sisu.Nullable; import org.slf4j.ILoggerFactory; import org.slf4j.spi.LocationAwareLogger; /** * A logger factory that delegates to SLF4J logging. */ @Named( "slf4j" ) public class Slf4jLoggerFactory implements LoggerFactory, Service { private static final boolean AVAILABLE; static { boolean available; try { Slf4jLoggerFactory.class.getClassLoader().loadClass( "org.slf4j.ILoggerFactory" ); available = true; } catch ( Exception e ) { available = false; } catch ( LinkageError e ) { available = false; } AVAILABLE = available; } public static boolean isSlf4jAvailable() { return AVAILABLE; } private ILoggerFactory factory; /** * Creates an instance of this logger factory. */ public Slf4jLoggerFactory() { // enables no-arg constructor } @Inject Slf4jLoggerFactory( @Nullable ILoggerFactory factory ) { setLoggerFactory( factory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( ILoggerFactory.class ) ); } public Slf4jLoggerFactory setLoggerFactory( ILoggerFactory factory ) { this.factory = factory; return this; } public Logger getLogger( String name ) { org.slf4j.Logger logger = getFactory().getLogger( name ); if ( logger instanceof LocationAwareLogger ) { return new Slf4jLoggerEx( (LocationAwareLogger) logger ); } return new Slf4jLogger( logger ); } private ILoggerFactory getFactory() { if ( factory == null ) { factory = org.slf4j.LoggerFactory.getILoggerFactory(); } return factory; } private static final class Slf4jLogger implements Logger { private final org.slf4j.Logger logger; public Slf4jLogger( org.slf4j.Logger logger ) { this.logger = logger; } public boolean isDebugEnabled() { return logger.isDebugEnabled(); } public void debug( String msg ) { logger.debug( msg ); } public void debug( String msg, Throwable error ) { logger.debug( msg, error ); } public boolean isWarnEnabled() { return logger.isWarnEnabled(); } public void warn( String msg ) { logger.warn( msg ); } public void warn( String msg, Throwable error ) { logger.warn( msg, error ); } } private static final class Slf4jLoggerEx implements Logger { private static final String FQCN = Slf4jLoggerEx.class.getName(); private final LocationAwareLogger logger; public Slf4jLoggerEx( LocationAwareLogger logger ) { this.logger = logger; } public boolean isDebugEnabled() { return logger.isDebugEnabled(); } public void debug( String msg ) { logger.log( null, FQCN, LocationAwareLogger.DEBUG_INT, msg, null, null ); } public void debug( String msg, Throwable error ) { logger.log( null, FQCN, LocationAwareLogger.DEBUG_INT, msg, null, error ); } public boolean isWarnEnabled() { return logger.isWarnEnabled(); } public void warn( String msg ) { logger.log( null, FQCN, LocationAwareLogger.WARN_INT, msg, null, null ); } public void warn( String msg, Throwable error ) { logger.log( null, FQCN, LocationAwareLogger.WARN_INT, msg, null, error ); } } } package-info.java000066400000000000000000000012531245546356100333150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The integration with the logging framework SLF4J. */ package org.eclipse.aether.internal.impl.slf4j; aether-1.0.2.v20150114/aether-impl/src/main/resources/000077500000000000000000000000001245546356100220135ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/main/resources/about.html000066400000000000000000000026401245546356100240150ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-impl/src/test/000077500000000000000000000000001245546356100200345ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/000077500000000000000000000000001245546356100207555ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/000077500000000000000000000000001245546356100215445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/000077500000000000000000000000001245546356100231705ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100244405ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/000077500000000000000000000000001245546356100254015ustar00rootroot00000000000000DefaultServiceLocatorTest.java000066400000000000000000000057351245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import static org.junit.Assert.*; import java.util.Arrays; import java.util.List; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.junit.Test; /** */ public class DefaultServiceLocatorTest { @Test public void testGetRepositorySystem() { DefaultServiceLocator locator = new DefaultServiceLocator(); locator.addService( ArtifactDescriptorReader.class, StubArtifactDescriptorReader.class ); locator.addService( VersionResolver.class, StubVersionResolver.class ); locator.addService( VersionRangeResolver.class, StubVersionRangeResolver.class ); RepositorySystem repoSys = locator.getService( RepositorySystem.class ); assertNotNull( repoSys ); } @Test public void testGetServicesUnmodifiable() { DefaultServiceLocator locator = new DefaultServiceLocator(); locator.setServices( String.class, "one", "two" ); List services = locator.getServices( String.class ); assertNotNull( services ); try { services.set( 0, "fail" ); fail( "service list is modifable" ); } catch ( UnsupportedOperationException e ) { // expected } } @Test public void testSetInstancesAddClass() { DefaultServiceLocator locator = new DefaultServiceLocator(); locator.setServices( String.class, "one", "two" ); locator.addService( String.class, String.class ); assertEquals( Arrays.asList( "one", "two", "" ), locator.getServices( String.class ) ); } @Test public void testInitService() { DefaultServiceLocator locator = new DefaultServiceLocator(); locator.setService( DummyService.class, DummyService.class ); DummyService service = locator.getService( DummyService.class ); assertNotNull( service ); assertNotNull( service.locator ); } private static class DummyService implements Service { public ServiceLocator locator; public void initService( ServiceLocator locator ) { this.locator = locator; } } } StubArtifactDescriptorReader.java000066400000000000000000000024241245546356100337440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; public class StubArtifactDescriptorReader implements ArtifactDescriptorReader { public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException { ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); return result; } } StubVersionRangeResolver.java000066400000000000000000000022551245546356100331530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; public class StubVersionRangeResolver implements VersionRangeResolver { public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException { VersionRangeResult result = new VersionRangeResult( request ); return result; } } aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java000066400000000000000000000021611245546356100322510ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; public class StubVersionResolver implements VersionResolver { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { VersionResult result = new VersionResult( request ); return result; } } aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/guice/000077500000000000000000000000001245546356100264755ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java000066400000000000000000000046411245546356100325630ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.impl.guice; import static org.junit.Assert.*; import java.util.Collections; import java.util.Set; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.impl.MetadataGeneratorFactory; import org.eclipse.aether.impl.StubArtifactDescriptorReader; import org.eclipse.aether.impl.StubVersionRangeResolver; import org.eclipse.aether.impl.StubVersionResolver; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.junit.Test; import com.google.inject.AbstractModule; import com.google.inject.Guice; import com.google.inject.Provides; public class AetherModuleTest { @Test public void testModuleCompleteness() { assertNotNull( Guice.createInjector( new SystemModule() ).getInstance( RepositorySystem.class ) ); } static class SystemModule extends AbstractModule { @Override protected void configure() { install( new AetherModule() ); bind( ArtifactDescriptorReader.class ).to( StubArtifactDescriptorReader.class ); bind( VersionRangeResolver.class ).to( StubVersionRangeResolver.class ); bind( VersionResolver.class ).to( StubVersionResolver.class ); } @Provides public Set metadataGeneratorFactories() { return Collections.emptySet(); } @Provides public Set repositoryConnectorFactories() { return Collections.emptySet(); } @Provides public Set transporterFactories() { return Collections.emptySet(); } } } aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/000077500000000000000000000000001245546356100262545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/000077500000000000000000000000001245546356100272155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DataPoolTest.java000066400000000000000000000050371245546356100324300ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.junit.Test; public class DataPoolTest { private DataPool newDataPool() { return new DataPool( new DefaultRepositorySystemSession() ); } @Test public void testArtifactDescriptorCaching() { ArtifactDescriptorRequest request = new ArtifactDescriptorRequest(); request.setArtifact( new DefaultArtifact( "gid:aid:1" ) ); ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); result.setArtifact( new DefaultArtifact( "gid:aid:2" ) ); result.addRelocation( request.getArtifact() ); result.addDependency( new Dependency( new DefaultArtifact( "gid:dep:3" ), "compile" ) ); result.addManagedDependency( new Dependency( new DefaultArtifact( "gid:mdep:3" ), "runtime" ) ); result.addRepository( new RemoteRepository.Builder( "test", "default", "http://localhost" ).build() ); result.addAlias( new DefaultArtifact( "gid:alias:4" ) ); DataPool pool = newDataPool(); Object key = pool.toKey( request ); pool.putDescriptor( key, result ); ArtifactDescriptorResult cached = pool.getDescriptor( key, request ); assertNotNull( cached ); assertEquals( result.getArtifact(), cached.getArtifact() ); assertEquals( result.getRelocations(), cached.getRelocations() ); assertEquals( result.getDependencies(), cached.getDependencies() ); assertEquals( result.getManagedDependencies(), cached.getManagedDependencies() ); assertEquals( result.getRepositories(), cached.getRepositories() ); assertEquals( result.getAliases(), cached.getAliases() ); } } DefaultArtifactResolverTest.java000066400000000000000000000777301245546356100354430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; import org.eclipse.aether.internal.test.util.TestFileProcessor; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLocalRepositoryManager; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.LocalMetadataRequest; import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.repository.WorkspaceRepository; import org.eclipse.aether.resolution.ArtifactRequest; import org.eclipse.aether.resolution.ArtifactResolutionException; import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class DefaultArtifactResolverTest { private DefaultArtifactResolver resolver; private DefaultRepositorySystemSession session; private TestLocalRepositoryManager lrm; private StubRepositoryConnectorProvider repositoryConnectorProvider; private Artifact artifact; private RecordingRepositoryConnector connector; @Before public void setup() throws IOException { UpdateCheckManager updateCheckManager = new StaticUpdateCheckManager( true ); repositoryConnectorProvider = new StubRepositoryConnectorProvider(); VersionResolver versionResolver = new StubVersionResolver(); session = TestUtils.newSession(); lrm = (TestLocalRepositoryManager) session.getLocalRepositoryManager(); resolver = new DefaultArtifactResolver(); resolver.setFileProcessor( new TestFileProcessor() ); resolver.setRepositoryEventDispatcher( new StubRepositoryEventDispatcher() ); resolver.setVersionResolver( versionResolver ); resolver.setUpdateCheckManager( updateCheckManager ); resolver.setRepositoryConnectorProvider( repositoryConnectorProvider ); resolver.setRemoteRepositoryManager( new StubRemoteRepositoryManager() ); resolver.setSyncContextFactory( new StubSyncContextFactory() ); resolver.setOfflineController( new DefaultOfflineController() ); artifact = new DefaultArtifact( "gid", "aid", "", "ext", "ver" ); connector = new RecordingRepositoryConnector(); repositoryConnectorProvider.setConnector( connector ); } @After public void teardown() throws Exception { if ( session.getLocalRepository() != null ) { TestFileUtils.deleteFile( session.getLocalRepository().getBasedir() ); } } @Test public void testResolveLocalArtifactSuccessful() throws IOException, ArtifactResolutionException { File tmpFile = TestFileUtils.createTempFile( "tmp" ); Map properties = new HashMap(); properties.put( ArtifactProperties.LOCAL_PATH, tmpFile.getAbsolutePath() ); artifact = artifact.setProperties( properties ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); } @Test public void testResolveLocalArtifactUnsuccessful() throws IOException, ArtifactResolutionException { File tmpFile = TestFileUtils.createTempFile( "tmp" ); Map properties = new HashMap(); properties.put( ArtifactProperties.LOCAL_PATH, tmpFile.getAbsolutePath() ); artifact = artifact.setProperties( properties ); tmpFile.delete(); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { assertNotNull( e.getResults() ); assertEquals( 1, e.getResults().size() ); ArtifactResult result = e.getResults().get( 0 ); assertSame( request, result.getRequest() ); assertFalse( result.getExceptions().isEmpty() ); assertTrue( result.getExceptions().get( 0 ) instanceof ArtifactNotFoundException ); Artifact resolved = result.getArtifact(); assertNull( resolved ); } } @Test public void testResolveRemoteArtifact() throws IOException, ArtifactResolutionException { connector.setExpectGet( artifact ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); connector.assertSeenExpected(); } @Test public void testResolveRemoteArtifactUnsuccessful() throws IOException, ArtifactResolutionException { RecordingRepositoryConnector connector = new RecordingRepositoryConnector() { @Override public void get( Collection artifactDownloads, Collection metadataDownloads ) { super.get( artifactDownloads, metadataDownloads ); ArtifactDownload download = artifactDownloads.iterator().next(); ArtifactTransferException exception = new ArtifactNotFoundException( download.getArtifact(), null, "not found" ); download.setException( exception ); } }; connector.setExpectGet( artifact ); repositoryConnectorProvider.setConnector( connector ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { connector.assertSeenExpected(); assertNotNull( e.getResults() ); assertEquals( 1, e.getResults().size() ); ArtifactResult result = e.getResults().get( 0 ); assertSame( request, result.getRequest() ); assertFalse( result.getExceptions().isEmpty() ); assertTrue( result.getExceptions().get( 0 ) instanceof ArtifactNotFoundException ); Artifact resolved = result.getArtifact(); assertNull( resolved ); } } @Test public void testArtifactNotFoundCache() throws Exception { RecordingRepositoryConnector connector = new RecordingRepositoryConnector() { @Override public void get( Collection artifactDownloads, Collection metadataDownloads ) { super.get( artifactDownloads, metadataDownloads ); for ( ArtifactDownload download : artifactDownloads ) { download.getFile().delete(); ArtifactTransferException exception = new ArtifactNotFoundException( download.getArtifact(), null, "not found" ); download.setException( exception ); } } }; repositoryConnectorProvider.setConnector( connector ); resolver.setUpdateCheckManager( new DefaultUpdateCheckManager().setUpdatePolicyAnalyzer( new DefaultUpdatePolicyAnalyzer() ) ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); session.setUpdatePolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); RemoteRepository remoteRepo = new RemoteRepository.Builder( "id", "default", "file:///" ).build(); Artifact artifact1 = artifact; Artifact artifact2 = artifact.setVersion( "ver2" ); ArtifactRequest request1 = new ArtifactRequest( artifact1, Arrays.asList( remoteRepo ), "" ); ArtifactRequest request2 = new ArtifactRequest( artifact2, Arrays.asList( remoteRepo ), "" ); connector.setExpectGet( new Artifact[] { artifact1, artifact2 } ); try { resolver.resolveArtifacts( session, Arrays.asList( request1, request2 ) ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { connector.assertSeenExpected(); } TestFileUtils.writeString( new File( lrm.getRepository().getBasedir(), lrm.getPathForLocalArtifact( artifact2 ) ), "artifact" ); lrm.setArtifactAvailability( artifact2, false ); DefaultUpdateCheckManagerTest.resetSessionData( session ); connector.resetActual(); connector.setExpectGet( new Artifact[0] ); try { resolver.resolveArtifacts( session, Arrays.asList( request1, request2 ) ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { connector.assertSeenExpected(); for ( ArtifactResult result : e.getResults() ) { Throwable t = result.getExceptions().get( 0 ); assertEquals( t.toString(), true, t instanceof ArtifactNotFoundException ); assertEquals( t.toString(), true, t.getMessage().contains( "cached" ) ); } } } @Test public void testResolveFromWorkspace() throws IOException, ArtifactResolutionException { WorkspaceReader workspace = new WorkspaceReader() { public WorkspaceRepository getRepository() { return new WorkspaceRepository( "default" ); } public List findVersions( Artifact artifact ) { return Arrays.asList( artifact.getVersion() ); } public File findArtifact( Artifact artifact ) { try { return TestFileUtils.createTempFile( artifact.toString() ); } catch ( IOException e ) { throw new RuntimeException( e.getMessage(), e ); } } }; session.setWorkspaceReader( workspace ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); assertEquals( resolved.toString(), TestFileUtils.readString( resolved.getFile() ) ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); connector.assertSeenExpected(); } @Test public void testResolveFromWorkspaceFallbackToRepository() throws IOException, ArtifactResolutionException { WorkspaceReader workspace = new WorkspaceReader() { public WorkspaceRepository getRepository() { return new WorkspaceRepository( "default" ); } public List findVersions( Artifact artifact ) { return Arrays.asList( artifact.getVersion() ); } public File findArtifact( Artifact artifact ) { return null; } }; session.setWorkspaceReader( workspace ); connector.setExpectGet( artifact ); repositoryConnectorProvider.setConnector( connector ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( "exception on resolveArtifact", result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); connector.assertSeenExpected(); } @Test public void testRepositoryEventsSuccessfulLocal() throws ArtifactResolutionException, IOException { RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); File tmpFile = TestFileUtils.createTempFile( "tmp" ); Map properties = new HashMap(); properties.put( ArtifactProperties.LOCAL_PATH, tmpFile.getAbsolutePath() ); artifact = artifact.setProperties( properties ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); resolver.resolveArtifact( session, request ); List 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 ) ); } @Test public void testRepositoryEventsUnsuccessfulLocal() throws IOException { RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); Map properties = new HashMap(); properties.put( ArtifactProperties.LOCAL_PATH, "doesnotexist" ); artifact = artifact.setProperties( properties ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { } List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVING, event.getType() ); event = events.get( 1 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVED, event.getType() ); assertNotNull( event.getException() ); assertEquals( 1, event.getExceptions().size() ); } @Test public void testRepositoryEventsSuccessfulRemote() throws ArtifactResolutionException { RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); resolver.resolveArtifact( session, request ); List events = listener.getEvents(); assertEquals( events.toString(), 4, 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_DOWNLOADING, event.getType() ); assertNull( event.getException() ); assertEquals( artifact, event.getArtifact().setFile( null ) ); event = events.get( 2 ); assertEquals( EventType.ARTIFACT_DOWNLOADED, event.getType() ); assertNull( event.getException() ); assertEquals( artifact, event.getArtifact().setFile( null ) ); event = events.get( 3 ); assertEquals( EventType.ARTIFACT_RESOLVED, event.getType() ); assertNull( event.getException() ); assertEquals( artifact, event.getArtifact().setFile( null ) ); } @Test public void testRepositoryEventsUnsuccessfulRemote() throws IOException, ArtifactResolutionException { RecordingRepositoryConnector connector = new RecordingRepositoryConnector() { @Override public void get( Collection artifactDownloads, Collection metadataDownloads ) { super.get( artifactDownloads, metadataDownloads ); ArtifactDownload download = artifactDownloads.iterator().next(); ArtifactTransferException exception = new ArtifactNotFoundException( download.getArtifact(), null, "not found" ); download.setException( exception ); } }; repositoryConnectorProvider.setConnector( connector ); RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { } List events = listener.getEvents(); assertEquals( events.toString(), 4, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVING, event.getType() ); event = events.get( 1 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_DOWNLOADING, event.getType() ); event = events.get( 2 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_DOWNLOADED, event.getType() ); assertNotNull( event.getException() ); assertEquals( 1, event.getExceptions().size() ); event = events.get( 3 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVED, event.getType() ); assertNotNull( event.getException() ); assertEquals( 1, event.getExceptions().size() ); } @Test public void testVersionResolverFails() { resolver.setVersionResolver( new VersionResolver() { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { throw new VersionResolutionException( new VersionResult( request ) ); } } ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { connector.assertSeenExpected(); assertNotNull( e.getResults() ); assertEquals( 1, e.getResults().size() ); ArtifactResult result = e.getResults().get( 0 ); assertSame( request, result.getRequest() ); assertFalse( result.getExceptions().isEmpty() ); assertTrue( result.getExceptions().get( 0 ) instanceof VersionResolutionException ); Artifact resolved = result.getArtifact(); assertNull( resolved ); } } @Test public void testRepositoryEventsOnVersionResolverFail() { resolver.setVersionResolver( new VersionResolver() { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { throw new VersionResolutionException( new VersionResult( request ) ); } } ); RecordingRepositoryListener listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); try { resolver.resolveArtifact( session, request ); fail( "expected exception" ); } catch ( ArtifactResolutionException e ) { } List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVING, event.getType() ); event = events.get( 1 ); assertEquals( artifact, event.getArtifact() ); assertEquals( EventType.ARTIFACT_RESOLVED, event.getType() ); assertNotNull( event.getException() ); assertEquals( 1, event.getExceptions().size() ); } @Test public void testLocalArtifactAvailable() throws ArtifactResolutionException { session.setLocalRepositoryManager( new LocalRepositoryManager() { public LocalRepository getRepository() { return null; } public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) { return null; } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return null; } public String getPathForLocalMetadata( Metadata metadata ) { return null; } public String getPathForLocalArtifact( Artifact artifact ) { return null; } public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { LocalArtifactResult result = new LocalArtifactResult( request ); result.setAvailable( true ); try { result.setFile( TestFileUtils.createTempFile( "" ) ); } catch ( IOException e ) { e.printStackTrace(); } return result; } public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { } public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) { LocalMetadataResult result = new LocalMetadataResult( request ); try { result.setFile( TestFileUtils.createTempFile( "" ) ); } catch ( IOException e ) { e.printStackTrace(); } return result; } public void add( RepositorySystemSession session, LocalMetadataRegistration request ) { } } ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); } @Test public void testFindInLocalRepositoryWhenVersionWasFoundInLocalRepository() throws ArtifactResolutionException { session.setLocalRepositoryManager( new LocalRepositoryManager() { public LocalRepository getRepository() { return null; } public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) { return null; } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return null; } public String getPathForLocalMetadata( Metadata metadata ) { return null; } public String getPathForLocalArtifact( Artifact artifact ) { return null; } public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { LocalArtifactResult result = new LocalArtifactResult( request ); result.setAvailable( false ); try { result.setFile( TestFileUtils.createTempFile( "" ) ); } catch ( IOException e ) { e.printStackTrace(); } return result; } public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { } public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) { LocalMetadataResult result = new LocalMetadataResult( request ); return result; } public void add( RepositorySystemSession session, LocalMetadataRegistration request ) { } } ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); request.addRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); resolver.setVersionResolver( new VersionResolver() { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { return new VersionResult( request ).setRepository( new LocalRepository( "id" ) ).setVersion( request.getArtifact().getVersion() ); } } ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); } @Test public void testFindInLocalRepositoryWhenVersionRangeWasResolvedFromLocalRepository() throws ArtifactResolutionException { session.setLocalRepositoryManager( new LocalRepositoryManager() { public LocalRepository getRepository() { return null; } public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) { return null; } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return null; } public String getPathForLocalMetadata( Metadata metadata ) { return null; } public String getPathForLocalArtifact( Artifact artifact ) { return null; } public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { LocalArtifactResult result = new LocalArtifactResult( request ); result.setAvailable( false ); try { result.setFile( TestFileUtils.createTempFile( "" ) ); } catch ( IOException e ) { e.printStackTrace(); } return result; } public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { } public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) { LocalMetadataResult result = new LocalMetadataResult( request ); return result; } public void add( RepositorySystemSession session, LocalMetadataRegistration request ) { } } ); ArtifactRequest request = new ArtifactRequest( artifact, null, "" ); resolver.setVersionResolver( new VersionResolver() { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { return new VersionResult( request ).setVersion( request.getArtifact().getVersion() ); } } ); ArtifactResult result = resolver.resolveArtifact( session, request ); assertTrue( result.getExceptions().isEmpty() ); Artifact resolved = result.getArtifact(); assertNotNull( resolved.getFile() ); resolved = resolved.setFile( null ); assertEquals( artifact, resolved ); } } DefaultChecksumPolicyProviderTest.java000066400000000000000000000120541245546356100366050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.transfer.TransferResource; import org.junit.After; import org.junit.Before; import org.junit.Test; public class DefaultChecksumPolicyProviderTest { private static final String CHECKSUM_POLICY_UNKNOWN = "unknown"; private DefaultRepositorySystemSession session; private DefaultChecksumPolicyProvider provider; private RemoteRepository repository; private TransferResource resource; @Before public void setup() throws Exception { session = TestUtils.newSession(); provider = new DefaultChecksumPolicyProvider(); repository = new RemoteRepository.Builder( "test", "default", "file:/void" ).build(); resource = new TransferResource( repository.getUrl(), "file.txt", null, null ); } @After public void teardown() throws Exception { provider = null; session = null; repository = null; resource = null; } @Test public void testNewChecksumPolicy_Fail() { ChecksumPolicy policy = provider.newChecksumPolicy( session, repository, resource, RepositoryPolicy.CHECKSUM_POLICY_FAIL ); assertNotNull( policy ); assertEquals( FailChecksumPolicy.class, policy.getClass() ); } @Test public void testNewChecksumPolicy_Warn() { ChecksumPolicy policy = provider.newChecksumPolicy( session, repository, resource, RepositoryPolicy.CHECKSUM_POLICY_WARN ); assertNotNull( policy ); assertEquals( WarnChecksumPolicy.class, policy.getClass() ); } @Test public void testNewChecksumPolicy_Ignore() { ChecksumPolicy policy = provider.newChecksumPolicy( session, repository, resource, RepositoryPolicy.CHECKSUM_POLICY_IGNORE ); assertNull( policy ); } @Test public void testNewChecksumPolicy_Unknown() { ChecksumPolicy policy = provider.newChecksumPolicy( session, repository, resource, CHECKSUM_POLICY_UNKNOWN ); assertNotNull( policy ); assertEquals( WarnChecksumPolicy.class, policy.getClass() ); } @Test public void testGetEffectiveChecksumPolicy_EqualPolicies() { String[] policies = { RepositoryPolicy.CHECKSUM_POLICY_FAIL, RepositoryPolicy.CHECKSUM_POLICY_WARN, RepositoryPolicy.CHECKSUM_POLICY_IGNORE, CHECKSUM_POLICY_UNKNOWN }; for ( String policy : policies ) { assertEquals( policy, policy, provider.getEffectiveChecksumPolicy( session, policy, policy ) ); } } @Test public void testGetEffectiveChecksumPolicy_DifferentPolicies() { String[][] testCases = { { RepositoryPolicy.CHECKSUM_POLICY_WARN, RepositoryPolicy.CHECKSUM_POLICY_FAIL }, { RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.CHECKSUM_POLICY_FAIL }, { RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.CHECKSUM_POLICY_WARN } }; for ( String[] testCase : testCases ) { assertEquals( testCase[0] + " vs " + testCase[1], testCase[0], provider.getEffectiveChecksumPolicy( session, testCase[0], testCase[1] ) ); assertEquals( testCase[0] + " vs " + testCase[1], testCase[0], provider.getEffectiveChecksumPolicy( session, testCase[1], testCase[0] ) ); } } @Test public void testGetEffectiveChecksumPolicy_UnknownPolicies() { String[][] testCases = { { RepositoryPolicy.CHECKSUM_POLICY_WARN, RepositoryPolicy.CHECKSUM_POLICY_FAIL }, { RepositoryPolicy.CHECKSUM_POLICY_WARN, RepositoryPolicy.CHECKSUM_POLICY_WARN }, { RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.CHECKSUM_POLICY_IGNORE } }; for ( String[] testCase : testCases ) { assertEquals( "unknown vs " + testCase[1], testCase[0], provider.getEffectiveChecksumPolicy( session, CHECKSUM_POLICY_UNKNOWN, testCase[1] ) ); assertEquals( "unknown vs " + testCase[1], testCase[0], provider.getEffectiveChecksumPolicy( session, testCase[1], CHECKSUM_POLICY_UNKNOWN ) ); } } } DefaultDependencyCollectorTest.java000066400000000000000000000531121245546356100360750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.CollectResult; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyCycle; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.impl.ArtifactDescriptorReader; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.util.artifact.ArtifactIdUtils; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; import org.eclipse.aether.util.graph.version.HighestVersionFilter; import org.junit.Before; import org.junit.Test; /** */ public class DefaultDependencyCollectorTest { private DefaultDependencyCollector collector; private DefaultRepositorySystemSession session; private DependencyGraphParser parser; private RemoteRepository repository; private IniArtifactDescriptorReader newReader( String prefix ) { return new IniArtifactDescriptorReader( "artifact-descriptions/" + prefix ); } private Dependency newDep( String coords ) { return newDep( coords, "" ); } private Dependency newDep( String coords, String scope ) { return new Dependency( new DefaultArtifact( coords ), scope ); } @Before public void setup() throws IOException { session = TestUtils.newSession(); collector = new DefaultDependencyCollector(); collector.setArtifactDescriptorReader( newReader( "" ) ); collector.setVersionRangeResolver( new StubVersionRangeResolver() ); collector.setRemoteRepositoryManager( new StubRemoteRepositoryManager() ); collector.setLoggerFactory( new TestLoggerFactory() ); parser = new DependencyGraphParser( "artifact-descriptions/" ); repository = new RemoteRepository.Builder( "id", "default", "file:///" ).build(); } private static void assertEqualSubtree( DependencyNode expected, DependencyNode actual ) { assertEqualSubtree( expected, actual, new LinkedList() ); } private static void assertEqualSubtree( DependencyNode expected, DependencyNode actual, LinkedList parents ) { assertEquals( "path: " + parents, expected.getDependency(), actual.getDependency() ); if ( actual.getDependency() != null ) { Artifact artifact = actual.getDependency().getArtifact(); for ( DependencyNode parent : parents ) { if ( parent.getDependency() != null && artifact.equals( parent.getDependency().getArtifact() ) ) { return; } } } parents.addLast( expected ); assertEquals( "path: " + parents + ", expected: " + expected.getChildren() + ", actual: " + actual.getChildren(), expected.getChildren().size(), actual.getChildren().size() ); Iterator iterator1 = expected.getChildren().iterator(); Iterator iterator2 = actual.getChildren().iterator(); while ( iterator1.hasNext() ) { assertEqualSubtree( iterator1.next(), iterator2.next(), parents ); } parents.removeLast(); } private Dependency dep( DependencyNode root, int... coords ) { return path( root, coords ).getDependency(); } private DependencyNode path( DependencyNode root, int... coords ) { try { DependencyNode node = root; for ( int coord : coords ) { node = node.getChildren().get( coord ); } return node; } catch ( IndexOutOfBoundsException e ) { throw new IllegalArgumentException( "Illegal coordinates for child", e ); } catch ( NullPointerException e ) { throw new IllegalArgumentException( "Illegal coordinates for child", e ); } } @Test public void testSimpleCollection() throws IOException, DependencyCollectionException { Dependency dependency = newDep( "gid:aid:ext:ver", "compile" ); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 0, result.getExceptions().size() ); DependencyNode root = result.getRoot(); Dependency newDependency = root.getDependency(); assertEquals( dependency, newDependency ); assertEquals( dependency.getArtifact(), newDependency.getArtifact() ); assertEquals( 1, root.getChildren().size() ); Dependency expect = newDep( "gid:aid2:ext:ver", "compile" ); assertEquals( expect, root.getChildren().get( 0 ).getDependency() ); } @Test public void testMissingDependencyDescription() throws IOException { CollectRequest request = new CollectRequest( newDep( "missing:description:ext:ver" ), Arrays.asList( repository ) ); try { collector.collectDependencies( session, request ); fail( "expected exception" ); } catch ( DependencyCollectionException e ) { CollectResult result = e.getResult(); assertSame( request, result.getRequest() ); assertNotNull( result.getExceptions() ); assertEquals( 1, result.getExceptions().size() ); assertTrue( result.getExceptions().get( 0 ) instanceof ArtifactDescriptorException ); assertEquals( request.getRoot(), result.getRoot().getDependency() ); } } @Test public void testDuplicates() throws IOException, DependencyCollectionException { Dependency dependency = newDep( "duplicate:transitive:ext:dependency" ); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 0, result.getExceptions().size() ); DependencyNode root = result.getRoot(); Dependency newDependency = root.getDependency(); assertEquals( dependency, newDependency ); assertEquals( dependency.getArtifact(), newDependency.getArtifact() ); assertEquals( 2, root.getChildren().size() ); Dependency dep = newDep( "gid:aid:ext:ver", "compile" ); assertEquals( dep, dep( root, 0 ) ); dep = newDep( "gid:aid2:ext:ver", "compile" ); assertEquals( dep, dep( root, 1 ) ); assertEquals( dep, dep( root, 0, 0 ) ); assertEquals( dep( root, 1 ), dep( root, 0, 0 ) ); } @Test public void testEqualSubtree() throws IOException, DependencyCollectionException { DependencyNode root = parser.parseResource( "expectedSubtreeComparisonResult.txt" ); Dependency dependency = root.getDependency(); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEqualSubtree( root, result.getRoot() ); } @Test public void testCyclicDependencies() throws Exception { DependencyNode root = parser.parseResource( "cycle.txt" ); CollectRequest request = new CollectRequest( root.getDependency(), Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEqualSubtree( root, result.getRoot() ); } @Test public void testCyclicDependenciesBig() throws Exception { CollectRequest request = new CollectRequest( newDep( "1:2:pom:5.50-SNAPSHOT" ), Arrays.asList( repository ) ); collector.setArtifactDescriptorReader( newReader( "cycle-big/" ) ); CollectResult result = collector.collectDependencies( session, request ); assertNotNull( result.getRoot() ); // we only care about the performance here, this test must not hang or run out of mem } @Test public void testCyclicProjects() throws Exception { CollectRequest request = new CollectRequest( newDep( "test:a:2" ), Arrays.asList( repository ) ); collector.setArtifactDescriptorReader( newReader( "versionless-cycle/" ) ); CollectResult result = collector.collectDependencies( session, request ); DependencyNode root = result.getRoot(); DependencyNode a1 = path( root, 0, 0 ); assertEquals( "a", a1.getArtifact().getArtifactId() ); assertEquals( "1", a1.getArtifact().getVersion() ); for ( DependencyNode child : a1.getChildren() ) { assertFalse( "1".equals( child.getArtifact().getVersion() ) ); } assertEquals( 1, result.getCycles().size() ); DependencyCycle cycle = result.getCycles().get( 0 ); assertEquals( Arrays.asList(), cycle.getPrecedingDependencies() ); assertEquals( Arrays.asList( root.getDependency(), path( root, 0 ).getDependency(), a1.getDependency() ), cycle.getCyclicDependencies() ); } @Test public void testCyclicProjects_ConsiderLabelOfRootlessGraph() throws Exception { Dependency dep = newDep( "gid:aid:ver", "compile" ); CollectRequest request = new CollectRequest().addDependency( dep ).addRepository( repository ).setRootArtifact( dep.getArtifact() ); CollectResult result = collector.collectDependencies( session, request ); DependencyNode root = result.getRoot(); DependencyNode a1 = root.getChildren().get( 0 ); assertEquals( "aid", a1.getArtifact().getArtifactId() ); assertEquals( "ver", a1.getArtifact().getVersion() ); DependencyNode a2 = a1.getChildren().get( 0 ); assertEquals( "aid2", a2.getArtifact().getArtifactId() ); assertEquals( "ver", a2.getArtifact().getVersion() ); assertEquals( 1, result.getCycles().size() ); DependencyCycle cycle = result.getCycles().get( 0 ); assertEquals( Arrays.asList(), cycle.getPrecedingDependencies() ); assertEquals( Arrays.asList( new Dependency( dep.getArtifact(), null ), a1.getDependency() ), cycle.getCyclicDependencies() ); } @Test public void testPartialResultOnError() throws IOException { DependencyNode root = parser.parseResource( "expectedPartialSubtreeOnError.txt" ); Dependency dependency = root.getDependency(); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); CollectResult result; try { result = collector.collectDependencies( session, request ); fail( "expected exception " ); } catch ( DependencyCollectionException e ) { result = e.getResult(); assertSame( request, result.getRequest() ); assertNotNull( result.getExceptions() ); assertEquals( 1, result.getExceptions().size() ); assertTrue( result.getExceptions().get( 0 ) instanceof ArtifactDescriptorException ); assertEqualSubtree( root, result.getRoot() ); } } @Test public void testCollectMultipleDependencies() throws IOException, DependencyCollectionException { Dependency root1 = newDep( "gid:aid:ext:ver", "compile" ); Dependency root2 = newDep( "gid:aid2:ext:ver", "compile" ); List dependencies = Arrays.asList( root1, root2 ); CollectRequest request = new CollectRequest( dependencies, null, Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 0, result.getExceptions().size() ); assertEquals( 2, result.getRoot().getChildren().size() ); assertEquals( root1, dep( result.getRoot(), 0 ) ); assertEquals( 1, path( result.getRoot(), 0 ).getChildren().size() ); assertEquals( root2, dep( result.getRoot(), 0, 0 ) ); assertEquals( 0, path( result.getRoot(), 1 ).getChildren().size() ); assertEquals( root2, dep( result.getRoot(), 1 ) ); } @Test public void testArtifactDescriptorResolutionNotRestrictedToRepoHostingSelectedVersion() throws Exception { RemoteRepository repo2 = new RemoteRepository.Builder( "test", "default", "file:///" ).build(); final List repos = new ArrayList(); collector.setArtifactDescriptorReader( new ArtifactDescriptorReader() { public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException { repos.addAll( request.getRepositories() ); return new ArtifactDescriptorResult( request ); } } ); List dependencies = Arrays.asList( newDep( "verrange:parent:jar:1[1,)", "compile" ) ); CollectRequest request = new CollectRequest( dependencies, null, Arrays.asList( repository, repo2 ) ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 0, result.getExceptions().size() ); assertEquals( 2, repos.size() ); assertEquals( "id", repos.get( 0 ).getId() ); assertEquals( "test", repos.get( 1 ).getId() ); } @Test public void testManagedVersionScope() throws IOException, DependencyCollectionException { Dependency dependency = newDep( "managed:aid:ext:ver" ); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); session.setDependencyManager( new ClassicDependencyManager() ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 0, result.getExceptions().size() ); DependencyNode root = result.getRoot(); assertEquals( dependency, dep( root ) ); assertEquals( dependency.getArtifact(), dep( root ).getArtifact() ); assertEquals( 1, root.getChildren().size() ); Dependency expect = newDep( "gid:aid:ext:ver", "compile" ); assertEquals( expect, dep( root, 0 ) ); assertEquals( 1, path( root, 0 ).getChildren().size() ); expect = newDep( "gid:aid2:ext:managedVersion", "managedScope" ); assertEquals( expect, dep( root, 0, 0 ) ); } @Test public void testDependencyManagement() throws IOException, DependencyCollectionException { collector.setArtifactDescriptorReader( newReader( "managed/" ) ); DependencyNode root = parser.parseResource( "expectedSubtreeComparisonResult.txt" ); TestDependencyManager depMgmt = new TestDependencyManager(); depMgmt.add( dep( root, 0 ), "managed", null, null ); depMgmt.add( dep( root, 0, 1 ), "managed", "managed", null ); depMgmt.add( dep( root, 1 ), null, null, "managed" ); session.setDependencyManager( depMgmt ); // collect result will differ from expectedSubtreeComparisonResult.txt // set localPath -> no dependency traversal CollectRequest request = new CollectRequest( dep( root ), Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); DependencyNode node = result.getRoot(); assertEquals( "managed", dep( node, 0, 1 ).getArtifact().getVersion() ); assertEquals( "managed", dep( node, 0, 1 ).getScope() ); assertEquals( "managed", dep( node, 1 ).getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) ); assertEquals( "managed", dep( node, 0, 0 ).getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) ); } @Test public void testDependencyManagement_VerboseMode() throws Exception { String depId = "gid:aid2:ext"; TestDependencyManager depMgmt = new TestDependencyManager(); depMgmt.version( depId, "managedVersion" ); depMgmt.scope( depId, "managedScope" ); depMgmt.optional( depId, Boolean.TRUE ); depMgmt.path( depId, "managedPath" ); depMgmt.exclusions( depId, new Exclusion( "gid", "aid", "*", "*" ) ); session.setDependencyManager( depMgmt ); session.setConfigProperty( DependencyManagerUtils.CONFIG_PROP_VERBOSE, Boolean.TRUE ); CollectRequest request = new CollectRequest().setRoot( newDep( "gid:aid:ver" ) ); CollectResult result = collector.collectDependencies( session, request ); DependencyNode node = result.getRoot().getChildren().get( 0 ); assertEquals( DependencyNode.MANAGED_VERSION | DependencyNode.MANAGED_SCOPE | DependencyNode.MANAGED_OPTIONAL | DependencyNode.MANAGED_PROPERTIES | DependencyNode.MANAGED_EXCLUSIONS, node.getManagedBits() ); assertEquals( "ver", DependencyManagerUtils.getPremanagedVersion( node ) ); assertEquals( "compile", DependencyManagerUtils.getPremanagedScope( node ) ); assertEquals( Boolean.FALSE, DependencyManagerUtils.getPremanagedOptional( node ) ); } @Test public void testVersionFilter() throws Exception { session.setVersionFilter( new HighestVersionFilter() ); CollectRequest request = new CollectRequest().setRoot( newDep( "gid:aid:1" ) ); CollectResult result = collector.collectDependencies( session, request ); assertEquals( 1, result.getRoot().getChildren().size() ); } static class TestDependencyManager implements DependencyManager { private Map versions = new HashMap(); private Map scopes = new HashMap(); private Map optionals = new HashMap(); private Map paths = new HashMap(); private Map> exclusions = new HashMap>(); public void add( Dependency d, String version, String scope, String localPath ) { String id = toKey( d ); version( id, version ); scope( id, scope ); path( id, localPath ); } public void version( String id, String version ) { versions.put( id, version ); } public void scope( String id, String scope ) { scopes.put( id, scope ); } public void optional( String id, Boolean optional ) { optionals.put( id, optional ); } public void path( String id, String path ) { paths.put( id, path ); } public void exclusions( String id, Exclusion... exclusions ) { this.exclusions.put( id, exclusions != null ? Arrays.asList( exclusions ) : null ); } public DependencyManagement manageDependency( Dependency d ) { String id = toKey( d ); DependencyManagement mgmt = new DependencyManagement(); mgmt.setVersion( versions.get( id ) ); mgmt.setScope( scopes.get( id ) ); mgmt.setOptional( optionals.get( id ) ); String path = paths.get( id ); if ( path != null ) { mgmt.setProperties( Collections.singletonMap( ArtifactProperties.LOCAL_PATH, path ) ); } mgmt.setExclusions( exclusions.get( id ) ); return mgmt; } private String toKey( Dependency dependency ) { return ArtifactIdUtils.toVersionlessId( dependency.getArtifact() ); } public DependencyManager deriveChildManager( DependencyCollectionContext context ) { return this; } } } DefaultDeployerTest.java000066400000000000000000000274631245546356100337450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.internal.impl.DefaultDeployer; import org.eclipse.aether.internal.test.util.TestFileProcessor; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.MergeableMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.metadata.Metadata.Nature; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.ArtifactUpload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.spi.connector.MetadataUpload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.junit.After; import org.junit.Before; import org.junit.Test; public class DefaultDeployerTest { private Artifact artifact; private DefaultMetadata metadata; private DefaultRepositorySystemSession session; private StubRepositoryConnectorProvider connectorProvider; private DefaultDeployer deployer; private DeployRequest request; private RecordingRepositoryConnector connector; private RecordingRepositoryListener listener; @Before public void setup() throws IOException { artifact = new DefaultArtifact( "gid", "aid", "jar", "ver" ); artifact = artifact.setFile( TestFileUtils.createTempFile( "artifact" ) ); metadata = new DefaultMetadata( "gid", "aid", "ver", "type", Nature.RELEASE_OR_SNAPSHOT, TestFileUtils.createTempFile( "metadata" ) ); session = TestUtils.newSession(); connectorProvider = new StubRepositoryConnectorProvider(); deployer = new DefaultDeployer(); deployer.setRepositoryConnectorProvider( connectorProvider ); deployer.setRemoteRepositoryManager( new StubRemoteRepositoryManager() ); deployer.setRepositoryEventDispatcher( new StubRepositoryEventDispatcher() ); deployer.setUpdateCheckManager( new StaticUpdateCheckManager( true ) ); deployer.setFileProcessor( new TestFileProcessor() ); deployer.setSyncContextFactory( new StubSyncContextFactory() ); deployer.setOfflineController( new DefaultOfflineController() ); request = new DeployRequest(); request.setRepository( new RemoteRepository.Builder( "id", "default", "file:///" ).build() ); connector = new RecordingRepositoryConnector( session ); connectorProvider.setConnector( connector ); listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); } @After public void teardown() throws Exception { if ( session.getLocalRepository() != null ) { TestFileUtils.deleteFile( session.getLocalRepository().getBasedir() ); } session = null; listener = null; connector = null; connectorProvider = null; deployer = null; } @Test public void testSuccessfulDeploy() throws DeploymentException { connector.setExpectPut( artifact ); connector.setExpectPut( metadata ); request.addArtifact( artifact ); request.addMetadata( metadata ); deployer.deploy( session, request ); connector.assertSeenExpected(); } @Test( expected = DeploymentException.class ) public void testNullArtifactFile() throws DeploymentException { request.addArtifact( artifact.setFile( null ) ); deployer.deploy( session, request ); } @Test( expected = DeploymentException.class ) public void testNullMetadataFile() throws DeploymentException { request.addArtifact( artifact.setFile( null ) ); deployer.deploy( session, request ); } @Test public void testSuccessfulArtifactEvents() throws DeploymentException { request.addArtifact( artifact ); deployer.deploy( session, request ); List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( EventType.ARTIFACT_DEPLOYING, event.getType() ); assertEquals( artifact, event.getArtifact() ); assertNull( event.getException() ); event = events.get( 1 ); assertEquals( EventType.ARTIFACT_DEPLOYED, event.getType() ); assertEquals( artifact, event.getArtifact() ); assertNull( event.getException() ); } @Test public void testFailingArtifactEvents() { connector.fail = true; request.addArtifact( artifact ); try { deployer.deploy( session, request ); fail( "expected exception" ); } catch ( DeploymentException e ) { List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( EventType.ARTIFACT_DEPLOYING, event.getType() ); assertEquals( artifact, event.getArtifact() ); assertNull( event.getException() ); event = events.get( 1 ); assertEquals( EventType.ARTIFACT_DEPLOYED, event.getType() ); assertEquals( artifact, event.getArtifact() ); assertNotNull( event.getException() ); } } @Test public void testSuccessfulMetadataEvents() throws DeploymentException { request.addMetadata( metadata ); deployer.deploy( session, request ); List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( EventType.METADATA_DEPLOYING, event.getType() ); assertEquals( metadata, event.getMetadata() ); assertNull( event.getException() ); event = events.get( 1 ); assertEquals( EventType.METADATA_DEPLOYED, event.getType() ); assertEquals( metadata, event.getMetadata() ); assertNull( event.getException() ); } @Test public void testFailingMetdataEvents() { connector.fail = true; request.addMetadata( metadata ); try { deployer.deploy( session, request ); fail( "expected exception" ); } catch ( DeploymentException e ) { List events = listener.getEvents(); assertEquals( 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( EventType.METADATA_DEPLOYING, event.getType() ); assertEquals( metadata, event.getMetadata() ); assertNull( event.getException() ); event = events.get( 1 ); assertEquals( EventType.METADATA_DEPLOYED, event.getType() ); assertEquals( metadata, event.getMetadata() ); assertNotNull( event.getException() ); } } @Test public void testStaleLocalMetadataCopyGetsDeletedBeforeMergeWhenMetadataIsNotCurrentlyPresentInRemoteRepo() throws Exception { MergeableMetadata metadata = new MergeableMetadata() { public Metadata setFile( File file ) { return this; } public String getVersion() { return ""; } public String getType() { return "test.properties"; } public Nature getNature() { return Nature.RELEASE; } public String getGroupId() { return "org"; } public File getFile() { return null; } public String getArtifactId() { return "aether"; } public Metadata setProperties( Map properties ) { return this; } public Map getProperties() { return Collections.emptyMap(); } public String getProperty( String key, String defaultValue ) { return defaultValue; } public void merge( File current, File result ) throws RepositoryException { Properties props = new Properties(); try { if ( current.isFile() ) { TestFileUtils.readProps( current, props ); } props.setProperty( "new", "value" ); TestFileUtils.writeProps( result, props ); } catch ( IOException e ) { throw new RepositoryException( e.getMessage(), e ); } } public boolean isMerged() { return false; } }; connectorProvider.setConnector( new RepositoryConnector() { public void put( Collection artifactUploads, Collection metadataUploads ) { } public void get( Collection artifactDownloads, Collection metadataDownloads ) { if ( metadataDownloads != null ) { for ( MetadataDownload download : metadataDownloads ) { download.setException( new MetadataNotFoundException( download.getMetadata(), null, null ) ); } } } public void close() { } } ); request.addMetadata( metadata ); File metadataFile = new File( session.getLocalRepository().getBasedir(), session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, request.getRepository(), "" ) ); Properties props = new Properties(); props.setProperty( "old", "value" ); TestFileUtils.writeProps( metadataFile, props ); deployer.deploy( session, request ); props = new Properties(); TestFileUtils.readProps( metadataFile, props ); assertNull( props.toString(), props.get( "old" ) ); } } DefaultFileProcessorTest.java000066400000000000000000000067311245546356100347340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.spi.io.FileProcessor.ProgressListener; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class DefaultFileProcessorTest { private File targetDir; private DefaultFileProcessor fileProcessor; @Before public void setup() throws IOException { targetDir = TestFileUtils.createTempDir( getClass().getSimpleName() ); fileProcessor = new DefaultFileProcessor(); } @After public void teardown() throws Exception { TestFileUtils.deleteFile( targetDir ); fileProcessor = null; } @Test public void testCopy() throws IOException { String data = "testCopy\nasdf"; File file = TestFileUtils.createTempFile( data ); File target = new File( targetDir, "testCopy.txt" ); fileProcessor.copy( file, target ); assertEquals( data, TestFileUtils.readString( file ) ); file.delete(); } @Test public void testOverwrite() throws IOException { String data = "testCopy\nasdf"; File file = TestFileUtils.createTempFile( data ); for ( int i = 0; i < 5; i++ ) { File target = new File( targetDir, "testCopy.txt" ); fileProcessor.copy( file, target ); assertEquals( data, TestFileUtils.readString( file ) ); } file.delete(); } @Test public void testCopyEmptyFile() throws IOException { File file = TestFileUtils.createTempFile( "" ); File target = new File( targetDir, "testCopyEmptyFile" ); target.delete(); fileProcessor.copy( file, target ); assertTrue( "empty file was not copied", target.exists() && target.length() == 0 ); target.delete(); } @Test public void testProgressingChannel() throws IOException { File file = TestFileUtils.createTempFile( "test" ); File target = new File( targetDir, "testProgressingChannel" ); target.delete(); final AtomicInteger progressed = new AtomicInteger(); ProgressListener listener = new ProgressListener() { public void progressed( ByteBuffer buffer ) throws IOException { progressed.addAndGet( buffer.remaining() ); } }; fileProcessor.copy( file, target, listener ); assertTrue( "file was not created", target.isFile() ); assertEquals( "file was not fully copied", 4, target.length() ); assertEquals( "listener not called", 4, progressed.intValue() ); target.delete(); } } DefaultInstallerTest.java000066400000000000000000000341361245546356100341120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.installation.InstallRequest; import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.impl.DefaultInstaller; import org.eclipse.aether.internal.test.util.TestFileProcessor; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLocalRepositoryManager; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.metadata.Metadata.Nature; import org.junit.After; import org.junit.Before; import org.junit.Test; public class DefaultInstallerTest { private Artifact artifact; private Metadata metadata; private DefaultRepositorySystemSession session; private String localArtifactPath; private String localMetadataPath; private DefaultInstaller installer; private InstallRequest request; private RecordingRepositoryListener listener; private File localArtifactFile; private TestLocalRepositoryManager lrm; @Before public void setup() throws IOException { artifact = new DefaultArtifact( "gid", "aid", "jar", "ver" ); artifact = artifact.setFile( TestFileUtils.createTempFile( "artifact".getBytes(), 1 ) ); metadata = new DefaultMetadata( "gid", "aid", "ver", "type", Nature.RELEASE_OR_SNAPSHOT, TestFileUtils.createTempFile( "metadata".getBytes(), 1 ) ); session = TestUtils.newSession(); localArtifactPath = session.getLocalRepositoryManager().getPathForLocalArtifact( artifact ); localMetadataPath = session.getLocalRepositoryManager().getPathForLocalMetadata( metadata ); localArtifactFile = new File( session.getLocalRepository().getBasedir(), localArtifactPath ); installer = new DefaultInstaller(); installer.setFileProcessor( new TestFileProcessor() ); installer.setRepositoryEventDispatcher( new StubRepositoryEventDispatcher() ); installer.setSyncContextFactory( new StubSyncContextFactory() ); request = new InstallRequest(); listener = new RecordingRepositoryListener(); session.setRepositoryListener( listener ); lrm = (TestLocalRepositoryManager) session.getLocalRepositoryManager(); TestFileUtils.deleteFile( session.getLocalRepository().getBasedir() ); } @After public void teardown() throws Exception { TestFileUtils.deleteFile( session.getLocalRepository().getBasedir() ); } @Test public void testSuccessfulInstall() throws InstallationException, UnsupportedEncodingException, IOException { File artifactFile = new File( session.getLocalRepositoryManager().getRepository().getBasedir(), localArtifactPath ); File metadataFile = new File( session.getLocalRepositoryManager().getRepository().getBasedir(), localMetadataPath ); artifactFile.delete(); metadataFile.delete(); request.addArtifact( artifact ); request.addMetadata( metadata ); InstallResult result = installer.install( session, request ); assertTrue( artifactFile.exists() ); assertEquals( "artifact", TestFileUtils.readString( artifactFile ) ); assertTrue( metadataFile.exists() ); assertEquals( "metadata", TestFileUtils.readString( metadataFile ) ); assertEquals( result.getRequest(), request ); assertEquals( result.getArtifacts().size(), 1 ); assertTrue( result.getArtifacts().contains( artifact ) ); assertEquals( result.getMetadata().size(), 1 ); assertTrue( result.getMetadata().contains( metadata ) ); assertEquals( 1, lrm.getMetadataRegistration().size() ); assertTrue( lrm.getMetadataRegistration().contains( metadata ) ); assertEquals( 1, lrm.getArtifactRegistration().size() ); assertTrue( lrm.getArtifactRegistration().contains( artifact ) ); } @Test( expected = InstallationException.class ) public void testNullArtifactFile() throws InstallationException { InstallRequest request = new InstallRequest(); request.addArtifact( artifact.setFile( null ) ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testNullMetadataFile() throws InstallationException { InstallRequest request = new InstallRequest(); request.addMetadata( metadata.setFile( null ) ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testNonExistentArtifactFile() throws InstallationException { InstallRequest request = new InstallRequest(); request.addArtifact( artifact.setFile( new File( "missing.txt" ) ) ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testNonExistentMetadataFile() throws InstallationException { InstallRequest request = new InstallRequest(); request.addMetadata( metadata.setFile( new File( "missing.xml" ) ) ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testArtifactExistsAsDir() throws InstallationException { String path = session.getLocalRepositoryManager().getPathForLocalArtifact( artifact ); File file = new File( session.getLocalRepository().getBasedir(), path ); assertFalse( file.getAbsolutePath() + " is a file, not directory", file.isFile() ); assertFalse( file.getAbsolutePath() + " already exists", file.exists() ); assertTrue( "failed to setup test: could not create " + file.getAbsolutePath(), file.mkdirs() || file.isDirectory() ); request.addArtifact( artifact ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testMetadataExistsAsDir() throws InstallationException { String path = session.getLocalRepositoryManager().getPathForLocalMetadata( metadata ); assertTrue( "failed to setup test: could not create " + path, new File( session.getLocalRepository().getBasedir(), path ).mkdirs() ); request.addMetadata( metadata ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testArtifactDestinationEqualsSource() throws Exception { String path = session.getLocalRepositoryManager().getPathForLocalArtifact( artifact ); File file = new File( session.getLocalRepository().getBasedir(), path ); artifact = artifact.setFile( file ); TestFileUtils.writeString( file, "test" ); request.addArtifact( artifact ); installer.install( session, request ); } @Test( expected = InstallationException.class ) public void testMetadataDestinationEqualsSource() throws Exception { String path = session.getLocalRepositoryManager().getPathForLocalMetadata( metadata ); File file = new File( session.getLocalRepository().getBasedir(), path ); metadata = metadata.setFile( file ); TestFileUtils.writeString( file, "test" ); request.addMetadata( metadata ); installer.install( session, request ); } @Test public void testSuccessfulArtifactEvents() throws InstallationException { InstallRequest request = new InstallRequest(); request.addArtifact( artifact ); installer.install( session, request ); checkEvents( "Repository Event problem", artifact, false ); } @Test public void testSuccessfulMetadataEvents() throws InstallationException { InstallRequest request = new InstallRequest(); request.addMetadata( metadata ); installer.install( session, request ); checkEvents( "Repository Event problem", metadata, false ); } @Test public void testFailingEventsNullArtifactFile() { checkFailedEvents( "null artifact file", this.artifact.setFile( null ) ); } @Test public void testFailingEventsNullMetadataFile() { checkFailedEvents( "null metadata file", this.metadata.setFile( null ) ); } @Test public void testFailingEventsArtifactExistsAsDir() { String path = session.getLocalRepositoryManager().getPathForLocalArtifact( artifact ); assertTrue( "failed to setup test: could not create " + path, new File( session.getLocalRepository().getBasedir(), path ).mkdirs() ); checkFailedEvents( "target exists as dir", artifact ); } @Test public void testFailingEventsMetadataExistsAsDir() { String path = session.getLocalRepositoryManager().getPathForLocalMetadata( metadata ); assertTrue( "failed to setup test: could not create " + path, new File( session.getLocalRepository().getBasedir(), path ).mkdirs() ); checkFailedEvents( "target exists as dir", metadata ); } private void checkFailedEvents( String msg, Metadata metadata ) { InstallRequest request = new InstallRequest().addMetadata( metadata ); msg = "Repository events problem (case: " + msg + ")"; try { installer.install( session, request ); fail( "expected exception" ); } catch ( InstallationException e ) { checkEvents( msg, metadata, true ); } } private void checkEvents( String msg, Metadata metadata, boolean failed ) { List events = listener.getEvents(); assertEquals( msg, 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( msg, EventType.METADATA_INSTALLING, event.getType() ); assertEquals( msg, metadata, event.getMetadata() ); assertNull( msg, event.getException() ); event = events.get( 1 ); assertEquals( msg, EventType.METADATA_INSTALLED, event.getType() ); assertEquals( msg, metadata, event.getMetadata() ); if ( failed ) { assertNotNull( msg, event.getException() ); } else { assertNull( msg, event.getException() ); } } private void checkFailedEvents( String msg, Artifact artifact ) { InstallRequest request = new InstallRequest().addArtifact( artifact ); msg = "Repository events problem (case: " + msg + ")"; try { installer.install( session, request ); fail( "expected exception" ); } catch ( InstallationException e ) { checkEvents( msg, artifact, true ); } } private void checkEvents( String msg, Artifact artifact, boolean failed ) { List events = listener.getEvents(); assertEquals( msg, 2, events.size() ); RepositoryEvent event = events.get( 0 ); assertEquals( msg, EventType.ARTIFACT_INSTALLING, event.getType() ); assertEquals( msg, artifact, event.getArtifact() ); assertNull( msg, event.getException() ); event = events.get( 1 ); assertEquals( msg, EventType.ARTIFACT_INSTALLED, event.getType() ); assertEquals( msg, artifact, event.getArtifact() ); if ( failed ) { assertNotNull( msg + " > expected exception", event.getException() ); } else { assertNull( msg + " > " + event.getException(), event.getException() ); } } @Test public void testDoNotUpdateUnchangedArtifact() throws InstallationException { request.addArtifact( artifact ); installer.install( session, request ); installer.setFileProcessor( new DefaultFileProcessor() { @Override public long copy( File src, File target, ProgressListener listener ) throws IOException { throw new IOException( "copy called" ); } } ); request = new InstallRequest(); request.addArtifact( artifact ); installer.install( session, request ); } @Test public void testSetArtifactTimestamps() throws InstallationException { artifact.getFile().setLastModified( artifact.getFile().lastModified() - 60000 ); request.addArtifact( artifact ); installer.install( session, request ); assertEquals( "artifact timestamp was not set to src file", artifact.getFile().lastModified(), localArtifactFile.lastModified() ); request = new InstallRequest(); request.addArtifact( artifact ); artifact.getFile().setLastModified( artifact.getFile().lastModified() - 60000 ); installer.install( session, request ); assertEquals( "artifact timestamp was not set to src file", artifact.getFile().lastModified(), localArtifactFile.lastModified() ); } } DefaultMetadataResolverTest.java000066400000000000000000000230321245546356100354100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.net.URI; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Set; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.DefaultMetadataResolver; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLocalRepositoryManager; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.MetadataRequest; import org.eclipse.aether.resolution.MetadataResult; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class DefaultMetadataResolverTest { private DefaultMetadataResolver resolver; private StubRepositoryConnectorProvider connectorProvider; private RemoteRepository repository; private DefaultRepositorySystemSession session; private Metadata metadata; private RecordingRepositoryConnector connector; private TestLocalRepositoryManager lrm; @Before public void setup() throws Exception { session = TestUtils.newSession(); lrm = (TestLocalRepositoryManager) session.getLocalRepositoryManager(); connectorProvider = new StubRepositoryConnectorProvider(); resolver = new DefaultMetadataResolver(); resolver.setUpdateCheckManager( new StaticUpdateCheckManager( true ) ); resolver.setRepositoryEventDispatcher( new StubRepositoryEventDispatcher() ); resolver.setRepositoryConnectorProvider( connectorProvider ); resolver.setRemoteRepositoryManager( new StubRemoteRepositoryManager() ); resolver.setSyncContextFactory( new StubSyncContextFactory() ); resolver.setOfflineController( new DefaultOfflineController() ); repository = new RemoteRepository.Builder( "test-DMRT", "default", TestFileUtils.createTempDir().toURI().toURL().toString() ).build(); metadata = new DefaultMetadata( "gid", "aid", "ver", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); connector = new RecordingRepositoryConnector(); connectorProvider.setConnector( connector ); } @After public void teardown() throws Exception { TestFileUtils.deleteFile( new File( new URI( repository.getUrl() ) ) ); TestFileUtils.deleteFile( session.getLocalRepository().getBasedir() ); } @Test public void testNoRepositoryFailing() { MetadataRequest request = new MetadataRequest( metadata, null, "" ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertSame( request, result.getRequest() ); assertNotNull( "" + ( result.getMetadata() != null ? result.getMetadata().getFile() : result.getMetadata() ), result.getException() ); assertEquals( MetadataNotFoundException.class, result.getException().getClass() ); assertNull( result.getMetadata() ); } @Test public void testResolve() throws IOException { connector.setExpectGet( metadata ); // prepare "download" File file = new File( session.getLocalRepository().getBasedir(), session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, repository, "" ) ); TestFileUtils.writeString( file, file.getAbsolutePath() ); MetadataRequest request = new MetadataRequest( metadata, repository, "" ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertSame( request, result.getRequest() ); assertNull( result.getException() ); assertNotNull( result.getMetadata() ); assertNotNull( result.getMetadata().getFile() ); assertEquals( file, result.getMetadata().getFile() ); assertEquals( metadata, result.getMetadata().setFile( null ) ); connector.assertSeenExpected(); Set metadataRegistration = ( (TestLocalRepositoryManager) session.getLocalRepositoryManager() ).getMetadataRegistration(); assertTrue( metadataRegistration.contains( metadata ) ); assertEquals( 1, metadataRegistration.size() ); } @Test public void testRemoveMetadataIfMissing() throws IOException { connector = new RecordingRepositoryConnector() { @Override public void get( Collection artifactDownloads, Collection metadataDownloads ) { super.get( artifactDownloads, metadataDownloads ); for ( MetadataDownload d : metadataDownloads ) { d.setException( new MetadataNotFoundException( metadata, repository ) ); } } }; connectorProvider.setConnector( connector ); File file = new File( session.getLocalRepository().getBasedir(), session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, repository, "" ) ); TestFileUtils.writeString( file, file.getAbsolutePath() ); metadata.setFile( file ); MetadataRequest request = new MetadataRequest( metadata, repository, "" ); request.setDeleteLocalCopyIfMissing( true ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertNotNull( result.getException() ); assertEquals( false, file.exists() ); } @Test public void testOfflineSessionResolveMetadataMissing() { session.setOffline( true ); MetadataRequest request = new MetadataRequest( metadata, repository, "" ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertSame( request, result.getRequest() ); assertNotNull( result.getException() ); assertNull( result.getMetadata() ); connector.assertSeenExpected(); } @Test public void testOfflineSessionResolveMetadata() throws IOException { session.setOffline( true ); String path = session.getLocalRepositoryManager().getPathForRemoteMetadata( metadata, repository, "" ); File file = new File( session.getLocalRepository().getBasedir(), path ); TestFileUtils.writeString( file, file.getAbsolutePath() ); // set file to use in TestLRM find() metadata = metadata.setFile( file ); MetadataRequest request = new MetadataRequest( metadata, repository, "" ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertSame( request, result.getRequest() ); assertNull( String.valueOf( result.getException() ), result.getException() ); assertNotNull( result.getMetadata() ); assertNotNull( result.getMetadata().getFile() ); assertEquals( file, result.getMetadata().getFile() ); assertEquals( metadata.setFile( null ), result.getMetadata().setFile( null ) ); connector.assertSeenExpected(); } @Test public void testFavorLocal() throws IOException { lrm.add( session, new LocalMetadataRegistration( metadata ) ); String path = session.getLocalRepositoryManager().getPathForLocalMetadata( metadata ); File file = new File( session.getLocalRepository().getBasedir(), path ); TestFileUtils.writeString( file, file.getAbsolutePath() ); MetadataRequest request = new MetadataRequest( metadata, repository, "" ); request.setFavorLocalRepository( true ); resolver.setUpdateCheckManager( new StaticUpdateCheckManager( true, true ) ); List results = resolver.resolveMetadata( session, Arrays.asList( request ) ); assertEquals( 1, results.size() ); MetadataResult result = results.get( 0 ); assertSame( request, result.getRequest() ); assertNull( String.valueOf( result.getException() ), result.getException() ); connector.assertSeenExpected(); } } DefaultOfflineControllerTest.java000066400000000000000000000072151245546356100356010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.RepositoryOfflineException; import org.junit.Before; import org.junit.Test; public class DefaultOfflineControllerTest { private DefaultOfflineController controller; private RepositorySystemSession newSession( boolean offline, String protocols, String hosts ) { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); session.setOffline( offline ); session.setConfigProperty( DefaultOfflineController.CONFIG_PROP_OFFLINE_PROTOCOLS, protocols ); session.setConfigProperty( DefaultOfflineController.CONFIG_PROP_OFFLINE_HOSTS, hosts ); return session; } private RemoteRepository newRepo( String url ) { return new RemoteRepository.Builder( "central", "default", url ).build(); } @Before public void setup() { controller = new DefaultOfflineController(); } @Test( expected = RepositoryOfflineException.class ) public void testCheckOffline_Online() throws Exception { controller.checkOffline( newSession( false, null, null ), newRepo( "http://eclipse.org" ) ); } @Test( expected = RepositoryOfflineException.class ) public void testCheckOffline_Offline() throws Exception { controller.checkOffline( newSession( true, null, null ), newRepo( "http://eclipse.org" ) ); } @Test public void testCheckOffline_Offline_OfflineProtocol() throws Exception { controller.checkOffline( newSession( true, "file", null ), newRepo( "file://repo" ) ); controller.checkOffline( newSession( true, "file", null ), newRepo( "FILE://repo" ) ); controller.checkOffline( newSession( true, " file , classpath ", null ), newRepo( "file://repo" ) ); controller.checkOffline( newSession( true, " file , classpath ", null ), newRepo( "classpath://repo" ) ); } @Test( expected = RepositoryOfflineException.class ) public void testCheckOffline_Offline_OnlineProtocol() throws Exception { controller.checkOffline( newSession( true, "file", null ), newRepo( "http://eclipse.org" ) ); } @Test public void testCheckOffline_Offline_OfflineHost() throws Exception { controller.checkOffline( newSession( true, null, "localhost" ), newRepo( "http://localhost" ) ); controller.checkOffline( newSession( true, null, "localhost" ), newRepo( "http://LOCALHOST" ) ); controller.checkOffline( newSession( true, null, " localhost , 127.0.0.1 " ), newRepo( "http://localhost" ) ); controller.checkOffline( newSession( true, null, " localhost , 127.0.0.1 " ), newRepo( "http://127.0.0.1" ) ); } @Test( expected = RepositoryOfflineException.class ) public void testCheckOffline_Offline_OnlineHost() throws Exception { controller.checkOffline( newSession( true, null, "localhost" ), newRepo( "http://eclipse.org" ) ); } } DefaultRemoteRepositoryManagerTest.java000066400000000000000000000276561245546356100370140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * */ public class DefaultRemoteRepositoryManagerTest { private DefaultRepositorySystemSession session; private DefaultRemoteRepositoryManager manager; @Before public void setup() throws Exception { session = TestUtils.newSession(); session.setChecksumPolicy( null ); session.setUpdatePolicy( null ); manager = new DefaultRemoteRepositoryManager(); manager.setUpdatePolicyAnalyzer( new StubUpdatePolicyAnalyzer() ); manager.setChecksumPolicyProvider( new DefaultChecksumPolicyProvider() ); manager.setLoggerFactory( new TestLoggerFactory() ); } @After public void teardown() throws Exception { manager = null; session = null; } private RemoteRepository.Builder newRepo( String id, String url, boolean enabled, String updates, String checksums ) { RepositoryPolicy policy = new RepositoryPolicy( enabled, updates, checksums ); return new RemoteRepository.Builder( id, "test", url ).setPolicy( policy ); } private void assertEqual( RemoteRepository expected, RemoteRepository actual ) { assertEquals( "id", expected.getId(), actual.getId() ); assertEquals( "url", expected.getUrl(), actual.getUrl() ); assertEquals( "type", expected.getContentType(), actual.getContentType() ); assertEqual( expected.getPolicy( false ), actual.getPolicy( false ) ); assertEqual( expected.getPolicy( true ), actual.getPolicy( true ) ); } private void assertEqual( RepositoryPolicy expected, RepositoryPolicy actual ) { assertEquals( "enabled", expected.isEnabled(), actual.isEnabled() ); assertEquals( "checksums", expected.getChecksumPolicy(), actual.getChecksumPolicy() ); assertEquals( "updates", expected.getUpdatePolicy(), actual.getUpdatePolicy() ); } @Test public void testGetPolicy() { RepositoryPolicy snapshotPolicy = new RepositoryPolicy( true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_IGNORE ); RepositoryPolicy releasePolicy = new RepositoryPolicy( true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_FAIL ); RemoteRepository repo = new RemoteRepository.Builder( "id", "type", "http://localhost" ) // .setSnapshotPolicy( snapshotPolicy ).setReleasePolicy( releasePolicy ).build(); RepositoryPolicy effectivePolicy = manager.getPolicy( session, repo, true, true ); assertEquals( true, effectivePolicy.isEnabled() ); assertEquals( RepositoryPolicy.CHECKSUM_POLICY_IGNORE, effectivePolicy.getChecksumPolicy() ); assertEquals( RepositoryPolicy.UPDATE_POLICY_ALWAYS, effectivePolicy.getUpdatePolicy() ); } @Test public void testAggregateSimpleRepos() { RemoteRepository dominant1 = newRepo( "a", "file://", false, "", "" ).build(); RemoteRepository recessive1 = newRepo( "a", "http://", true, "", "" ).build(); RemoteRepository recessive2 = newRepo( "b", "file://", true, "", "" ).build(); List result = manager.aggregateRepositories( session, Arrays.asList( dominant1 ), Arrays.asList( recessive1, recessive2 ), false ); assertEquals( 2, result.size() ); assertEqual( dominant1, result.get( 0 ) ); assertEqual( recessive2, result.get( 1 ) ); } @Test public void testAggregateSimpleRepos_MustKeepDisabledRecessiveRepo() { RemoteRepository dominant = newRepo( "a", "file://", true, "", "" ).build(); RemoteRepository recessive1 = newRepo( "b", "http://", false, "", "" ).build(); List result = manager.aggregateRepositories( session, Arrays.asList( dominant ), Arrays.asList( recessive1 ), false ); RemoteRepository recessive2 = newRepo( recessive1.getId(), "http://", true, "", "" ).build(); result = manager.aggregateRepositories( session, result, Arrays.asList( recessive2 ), false ); assertEquals( 2, result.size() ); assertEqual( dominant, result.get( 0 ) ); assertEqual( recessive1, result.get( 1 ) ); } @Test public void testAggregateMirrorRepos_DominantMirrorComplete() { RemoteRepository dominant1 = newRepo( "a", "http://", false, "", "" ).build(); RemoteRepository dominantMirror1 = newRepo( "x", "file://", false, "", "" ).addMirroredRepository( dominant1 ).build(); RemoteRepository recessive1 = newRepo( "a", "https://", true, "", "" ).build(); RemoteRepository recessiveMirror1 = newRepo( "x", "http://", true, "", "" ).addMirroredRepository( recessive1 ).build(); List result = manager.aggregateRepositories( session, Arrays.asList( dominantMirror1 ), Arrays.asList( recessiveMirror1 ), false ); assertEquals( 1, result.size() ); assertEqual( dominantMirror1, result.get( 0 ) ); assertEquals( 1, result.get( 0 ).getMirroredRepositories().size() ); assertEquals( dominant1, result.get( 0 ).getMirroredRepositories().get( 0 ) ); } @Test public void testAggregateMirrorRepos_DominantMirrorIncomplete() { RemoteRepository dominant1 = newRepo( "a", "http://", false, "", "" ).build(); RemoteRepository dominantMirror1 = newRepo( "x", "file://", false, "", "" ).addMirroredRepository( dominant1 ).build(); RemoteRepository recessive1 = newRepo( "a", "https://", true, "", "" ).build(); RemoteRepository recessive2 = newRepo( "b", "https://", true, "", "" ).build(); RemoteRepository recessiveMirror1 = newRepo( "x", "http://", true, "", "" ).setMirroredRepositories( Arrays.asList( recessive1, recessive2 ) ).build(); List result = manager.aggregateRepositories( session, Arrays.asList( dominantMirror1 ), Arrays.asList( recessiveMirror1 ), false ); assertEquals( 1, result.size() ); assertEqual( newRepo( "x", "file://", true, "", "" ).build(), result.get( 0 ) ); assertEquals( 2, result.get( 0 ).getMirroredRepositories().size() ); assertEquals( dominant1, result.get( 0 ).getMirroredRepositories().get( 0 ) ); assertEquals( recessive2, result.get( 0 ).getMirroredRepositories().get( 1 ) ); } @Test public void testMirrorAuthentication() { final RemoteRepository repo = newRepo( "a", "http://", true, "", "" ).build(); final RemoteRepository mirror = newRepo( "a", "http://", true, "", "" ).setAuthentication( new AuthenticationBuilder().addUsername( "test" ).build() ).build(); session.setMirrorSelector( new MirrorSelector() { public RemoteRepository getMirror( RemoteRepository repository ) { return mirror; } } ); List result = manager.aggregateRepositories( session, Collections. emptyList(), Arrays.asList( repo ), true ); assertEquals( 1, result.size() ); assertSame( mirror.getAuthentication(), result.get( 0 ).getAuthentication() ); } @Test public void testMirrorProxy() { final RemoteRepository repo = newRepo( "a", "http://", true, "", "" ).build(); final RemoteRepository mirror = newRepo( "a", "http://", true, "", "" ).setProxy( new Proxy( "http", "host", 2011, null ) ).build(); session.setMirrorSelector( new MirrorSelector() { public RemoteRepository getMirror( RemoteRepository repository ) { return mirror; } } ); List result = manager.aggregateRepositories( session, Collections. emptyList(), Arrays.asList( repo ), true ); assertEquals( 1, result.size() ); assertEquals( "http", result.get( 0 ).getProxy().getType() ); assertEquals( "host", result.get( 0 ).getProxy().getHost() ); assertEquals( 2011, result.get( 0 ).getProxy().getPort() ); } @Test public void testProxySelector() { final RemoteRepository repo = newRepo( "a", "http://", true, "", "" ).build(); final Proxy proxy = new Proxy( "http", "host", 2011, null ); session.setProxySelector( new ProxySelector() { public Proxy getProxy( RemoteRepository repository ) { return proxy; } } ); session.setMirrorSelector( new MirrorSelector() { public RemoteRepository getMirror( RemoteRepository repository ) { return null; } } ); List result = manager.aggregateRepositories( session, Collections. emptyList(), Arrays.asList( repo ), true ); assertEquals( 1, result.size() ); assertEquals( "http", result.get( 0 ).getProxy().getType() ); assertEquals( "host", result.get( 0 ).getProxy().getHost() ); assertEquals( 2011, result.get( 0 ).getProxy().getPort() ); } private static class StubUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer { public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } private int ordinalOfUpdatePolicy( String policy ) { if ( RepositoryPolicy.UPDATE_POLICY_DAILY.equals( policy ) ) { return 1440; } else if ( RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy ) ) { return 0; } else if ( policy != null && policy.startsWith( RepositoryPolicy.UPDATE_POLICY_INTERVAL ) ) { String s = policy.substring( RepositoryPolicy.UPDATE_POLICY_INTERVAL.length() + 1 ); return Integer.valueOf( s ); } else { // assume "never" return Integer.MAX_VALUE; } } public boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy ) { return false; } } } DefaultRepositoryEventDispatcherTest.java000066400000000000000000000051711245546356100373420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Locale; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher; import org.eclipse.aether.internal.test.util.TestUtils; import org.junit.Test; /** */ public class DefaultRepositoryEventDispatcherTest { @Test public void testDispatchHandlesAllEventTypes() throws Exception { DefaultRepositoryEventDispatcher dispatcher = new DefaultRepositoryEventDispatcher(); ListenerHandler handler = new ListenerHandler(); RepositoryListener listener = (RepositoryListener) Proxy.newProxyInstance( getClass().getClassLoader(), new Class[] { RepositoryListener.class }, handler ); DefaultRepositorySystemSession session = TestUtils.newSession(); session.setRepositoryListener( listener ); for ( RepositoryEvent.EventType type : RepositoryEvent.EventType.values() ) { RepositoryEvent event = new RepositoryEvent.Builder( session, type ).build(); handler.methodName = null; dispatcher.dispatch( event ); assertNotNull( "not handled: " + type, handler.methodName ); assertEquals( "badly handled: " + type, type.name().replace( "_", "" ).toLowerCase( Locale.ENGLISH ), handler.methodName.toLowerCase( Locale.ENGLISH ) ); } } static class ListenerHandler implements InvocationHandler { public String methodName; public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { if ( args.length == 1 && args[0] instanceof RepositoryEvent ) { methodName = method.getName(); } return null; } } } DefaultRepositorySystemTest.java000066400000000000000000000110231245546356100355270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.util.Arrays; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; import org.eclipse.aether.util.repository.DefaultProxySelector; import org.junit.Before; import org.junit.Test; public class DefaultRepositorySystemTest { private DefaultRepositorySystem system; private DefaultRepositorySystemSession session; @Before public void init() { DefaultRemoteRepositoryManager remoteRepoManager = new DefaultRemoteRepositoryManager(); system = new DefaultRepositorySystem(); system.setRemoteRepositoryManager( remoteRepoManager ); session = TestUtils.newSession(); } @Test public void testNewResolutionRepositories() { Proxy proxy = new Proxy( "http", "localhost", 8080 ); DefaultProxySelector proxySelector = new DefaultProxySelector(); proxySelector.add( proxy, null ); session.setProxySelector( proxySelector ); Authentication auth = new AuthenticationBuilder().addUsername( "user" ).build(); DefaultAuthenticationSelector authSelector = new DefaultAuthenticationSelector(); authSelector.add( "mirror", auth ); authSelector.add( "test-2", auth ); session.setAuthenticationSelector( authSelector ); DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector(); mirrorSelector.add( "mirror", "http:void", "default", false, "test-1", null ); session.setMirrorSelector( mirrorSelector ); RemoteRepository rawRepo1 = new RemoteRepository.Builder( "test-1", "default", "http://void" ).build(); RemoteRepository rawRepo2 = new RemoteRepository.Builder( "test-2", "default", "http://null" ).build(); List resolveRepos = system.newResolutionRepositories( session, Arrays.asList( rawRepo1, rawRepo2 ) ); assertNotNull( resolveRepos ); assertEquals( 2, resolveRepos.size() ); RemoteRepository resolveRepo = resolveRepos.get( 0 ); assertNotNull( resolveRepo ); assertEquals( "mirror", resolveRepo.getId() ); assertSame( proxy, resolveRepo.getProxy() ); assertSame( auth, resolveRepo.getAuthentication() ); resolveRepo = resolveRepos.get( 1 ); assertNotNull( resolveRepo ); assertEquals( "test-2", resolveRepo.getId() ); assertSame( proxy, resolveRepo.getProxy() ); assertSame( auth, resolveRepo.getAuthentication() ); } @Test public void testNewDeploymentRepository() { Proxy proxy = new Proxy( "http", "localhost", 8080 ); DefaultProxySelector proxySelector = new DefaultProxySelector(); proxySelector.add( proxy, null ); session.setProxySelector( proxySelector ); Authentication auth = new AuthenticationBuilder().addUsername( "user" ).build(); DefaultAuthenticationSelector authSelector = new DefaultAuthenticationSelector(); authSelector.add( "test", auth ); session.setAuthenticationSelector( authSelector ); DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector(); mirrorSelector.add( "mirror", "file:void", "default", false, "*", null ); session.setMirrorSelector( mirrorSelector ); RemoteRepository rawRepo = new RemoteRepository.Builder( "test", "default", "http://void" ).build(); RemoteRepository deployRepo = system.newDeploymentRepository( session, rawRepo ); assertNotNull( deployRepo ); assertSame( proxy, deployRepo.getProxy() ); assertSame( auth, deployRepo.getAuthentication() ); } } DefaultUpdateCheckManagerTest.java000066400000000000000000000742751245546356100356400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.net.URI; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class DefaultUpdateCheckManagerTest { private static final int HOUR = 60 * 60 * 1000; private DefaultUpdateCheckManager manager; private DefaultRepositorySystemSession session; private Metadata metadata; private RemoteRepository repository; private Artifact artifact; @Before public void setup() throws Exception { File dir = TestFileUtils.createTempFile( "" ); TestFileUtils.deleteFile( dir ); File metadataFile = new File( dir, "metadata.txt" ); TestFileUtils.writeString( metadataFile, "metadata" ); File artifactFile = new File( dir, "artifact.txt" ); TestFileUtils.writeString( artifactFile, "artifact" ); session = TestUtils.newSession(); repository = new RemoteRepository.Builder( "id", "default", TestFileUtils.createTempDir().toURI().toURL().toString() ).build(); manager = new DefaultUpdateCheckManager().setUpdatePolicyAnalyzer( new DefaultUpdatePolicyAnalyzer() ); metadata = new DefaultMetadata( "gid", "aid", "ver", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT, metadataFile ); artifact = new DefaultArtifact( "gid", "aid", "", "ext", "ver" ).setFile( artifactFile ); } @After public void teardown() throws Exception { new File( metadata.getFile().getParent(), "resolver-status.properties" ).delete(); new File( artifact.getFile().getPath() + ".lastUpdated" ).delete(); metadata.getFile().delete(); artifact.getFile().delete(); TestFileUtils.deleteFile( new File( new URI( repository.getUrl() ) ) ); } static void resetSessionData( RepositorySystemSession session ) { session.getData().set( "updateCheckManager.checks", null ); } private UpdateCheck newMetadataCheck() { UpdateCheck check = new UpdateCheck(); check.setItem( metadata ); check.setFile( metadata.getFile() ); check.setRepository( repository ); check.setAuthoritativeRepository( repository ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":10" ); return check; } private UpdateCheck newArtifactCheck() { UpdateCheck check = new UpdateCheck(); check.setItem( artifact ); check.setFile( artifact.getFile() ); check.setRepository( repository ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":10" ); return check; } @Test( expected = Exception.class ) public void testCheckMetadataFailOnNoFile() throws Exception { UpdateCheck check = newMetadataCheck(); check.setItem( metadata.setFile( null ) ); check.setFile( null ); manager.checkMetadata( session, check ); } @Test public void testCheckMetadataUpdatePolicyRequired() throws Exception { UpdateCheck check = newMetadataCheck(); Calendar cal = Calendar.getInstance(); cal.add( Calendar.DATE, -1 ); check.setLocalLastUpdated( cal.getTimeInMillis() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); manager.checkMetadata( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkMetadata( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":60" ); manager.checkMetadata( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); } @Test public void testCheckMetadataUpdatePolicyNotRequired() throws Exception { UpdateCheck check = newMetadataCheck(); check.setLocalLastUpdated( System.currentTimeMillis() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); manager.checkMetadata( session, check ); assertFalse( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkMetadata( session, check ); assertFalse( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":61" ); manager.checkMetadata( session, check ); assertFalse( check.isRequired() ); check.setPolicy( "no particular policy" ); manager.checkMetadata( session, check ); assertFalse( check.isRequired() ); } @Test public void testCheckMetadata() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); // existing file, never checked before manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); // just checked manager.touchMetadata( session, check ); resetSessionData( session ); check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":60" ); manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); // no local file check.getFile().delete(); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); // (! file.exists && ! repoKey) -> no timestamp } @Test public void testCheckMetadataNoLocalFile() throws Exception { metadata.getFile().delete(); UpdateCheck check = newMetadataCheck(); long lastUpdate = new Date().getTime() - HOUR; check.setLocalLastUpdated( lastUpdate ); // ! file.exists && updateRequired -> check in remote repo check.setLocalLastUpdated( lastUpdate ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataNotFoundInRepoCachingEnabled() throws Exception { metadata.getFile().delete(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); UpdateCheck check = newMetadataCheck(); check.setException( new MetadataNotFoundException( metadata, repository, "" ) ); manager.touchMetadata( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired -> artifact not found in remote repo check = newMetadataCheck().setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); assertTrue( check.getException() instanceof MetadataNotFoundException ); assertTrue( check.getException().isFromCache() ); } @Test public void testCheckMetadataNotFoundInRepoCachingDisabled() throws Exception { metadata.getFile().delete(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, false ) ); UpdateCheck check = newMetadataCheck(); check.setException( new MetadataNotFoundException( metadata, repository, "" ) ); manager.touchMetadata( session, check ); resetSessionData( session ); // ! file.exists && updateRequired -> check in remote repo check = newMetadataCheck().setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); assertNull( check.getException() ); } @Test public void testCheckMetadataErrorFromRepoCachingEnabled() throws Exception { metadata.getFile().delete(); UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); check.setException( new MetadataTransferException( metadata, repository, "some error" ) ); manager.touchMetadata( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired && previousError -> depends on transfer error caching check = newMetadataCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, true ) ); manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); assertTrue( check.getException() instanceof MetadataTransferException ); assertTrue( String.valueOf( check.getException() ), check.getException().getMessage().contains( "some error" ) ); assertTrue( check.getException().isFromCache() ); } @Test public void testCheckMetadataErrorFromRepoCachingDisabled() throws Exception { metadata.getFile().delete(); UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); check.setException( new MetadataTransferException( metadata, repository, "some error" ) ); manager.touchMetadata( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired && previousError -> depends on transfer error caching check = newMetadataCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, false ) ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); assertNull( check.getException() ); } @Test public void testCheckMetadataAtMostOnceDuringSessionEvenIfUpdatePolicyAlways() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); // first check manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); manager.touchMetadata( session, check ); // second check in same session manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); } @Test public void testCheckMetadataSessionStateModes() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); manager.touchMetadata( session, check ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "bypass" ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); resetSessionData( session ); manager.touchMetadata( session, check ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "true" ); manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "false" ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataAtMostOnceDuringSessionEvenIfUpdatePolicyAlways_InvalidFile() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); check.setFileValid( false ); // first check manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); // first touch, without exception manager.touchMetadata( session, check ); // another check in same session manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); // another touch, with exception check.setException( new MetadataNotFoundException( check.getItem(), check.getRepository() ) ); manager.touchMetadata( session, check ); // another check in same session manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); } @Test public void testCheckMetadataAtMostOnceDuringSessionEvenIfUpdatePolicyAlways_DifferentRepoIdSameUrl() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); check.setFileValid( false ); // first check manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); manager.touchMetadata( session, check ); // second check in same session but for repo with different id check.setRepository( new RemoteRepository.Builder( check.getRepository() ).setId( "check" ).build() ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataWhenLocallyMissingEvenIfUpdatePolicyIsNever() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); check.getFile().delete(); assertEquals( check.getFile().getAbsolutePath(), false, check.getFile().exists() ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataWhenLocallyPresentButInvalidEvenIfUpdatePolicyIsNever() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.touchMetadata( session, check ); resetSessionData( session ); check.setFileValid( false ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataWhenLocallyDeletedEvenIfTimestampUpToDate() throws Exception { UpdateCheck check = newMetadataCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.touchMetadata( session, check ); resetSessionData( session ); check.getFile().delete(); assertEquals( check.getFile().getAbsolutePath(), false, check.getFile().exists() ); manager.checkMetadata( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckMetadataNotWhenUpdatePolicyIsNeverAndTimestampIsUnavailable() throws Exception { UpdateCheck check = newMetadataCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.checkMetadata( session, check ); assertEquals( false, check.isRequired() ); } @Test( expected = IllegalArgumentException.class ) public void testCheckArtifactFailOnNoFile() throws Exception { UpdateCheck check = newArtifactCheck(); check.setItem( artifact.setFile( null ) ); check.setFile( null ); manager.checkArtifact( session, check ); assertNotNull( check.getException() ); } @Test public void testCheckArtifactUpdatePolicyRequired() throws Exception { UpdateCheck check = newArtifactCheck(); check.setItem( artifact ); check.setFile( artifact.getFile() ); Calendar cal = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) ); cal.add( Calendar.DATE, -1 ); long lastUpdate = cal.getTimeInMillis(); artifact.getFile().setLastModified( lastUpdate ); check.setLocalLastUpdated( lastUpdate ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); manager.checkArtifact( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkArtifact( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":60" ); manager.checkArtifact( session, check ); assertNull( check.getException() ); assertTrue( check.isRequired() ); } @Test public void testCheckArtifactUpdatePolicyNotRequired() throws Exception { UpdateCheck check = newArtifactCheck(); check.setItem( artifact ); check.setFile( artifact.getFile() ); Calendar cal = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) ); cal.add( Calendar.HOUR_OF_DAY, -1 ); check.setLocalLastUpdated( cal.getTimeInMillis() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); manager.checkArtifact( session, check ); assertFalse( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkArtifact( session, check ); assertFalse( check.isRequired() ); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":61" ); manager.checkArtifact( session, check ); assertFalse( check.isRequired() ); check.setPolicy( "no particular policy" ); manager.checkArtifact( session, check ); assertFalse( check.isRequired() ); } @Test public void testCheckArtifact() throws Exception { UpdateCheck check = newArtifactCheck(); long fifteenMinutes = new Date().getTime() - ( 15 * 60 * 1000 ); check.getFile().setLastModified( fifteenMinutes ); // time is truncated on setLastModfied fifteenMinutes = check.getFile().lastModified(); // never checked before manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); // just checked check.setLocalLastUpdated( 0 ); long lastUpdate = new Date().getTime(); check.getFile().setLastModified( lastUpdate ); lastUpdate = check.getFile().lastModified(); manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); // no local file, no repo timestamp check.setLocalLastUpdated( 0 ); check.getFile().delete(); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactNoLocalFile() throws Exception { artifact.getFile().delete(); UpdateCheck check = newArtifactCheck(); long lastUpdate = new Date().getTime() - HOUR; // ! file.exists && updateRequired -> check in remote repo check.setLocalLastUpdated( lastUpdate ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactNotFoundInRepoCachingEnabled() throws Exception { artifact.getFile().delete(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); UpdateCheck check = newArtifactCheck(); check.setException( new ArtifactNotFoundException( artifact, repository ) ); manager.touchArtifact( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired -> artifact not found in remote repo check = newArtifactCheck().setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); assertTrue( check.getException() instanceof ArtifactNotFoundException ); assertTrue( check.getException().isFromCache() ); } @Test public void testCheckArtifactNotFoundInRepoCachingDisabled() throws Exception { artifact.getFile().delete(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, false ) ); UpdateCheck check = newArtifactCheck(); check.setException( new ArtifactNotFoundException( artifact, repository ) ); manager.touchArtifact( session, check ); resetSessionData( session ); // ! file.exists && updateRequired -> check in remote repo check = newArtifactCheck().setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); assertNull( check.getException() ); } @Test public void testCheckArtifactErrorFromRepoCachingEnabled() throws Exception { artifact.getFile().delete(); UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); check.setException( new ArtifactTransferException( artifact, repository, "some error" ) ); manager.touchArtifact( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired && previousError -> depends on transfer error caching check = newArtifactCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, true ) ); manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); assertTrue( check.getException() instanceof ArtifactTransferException ); assertTrue( check.getException().isFromCache() ); } @Test public void testCheckArtifactErrorFromRepoCachingDisabled() throws Exception { artifact.getFile().delete(); UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_DAILY ); check.setException( new ArtifactTransferException( artifact, repository, "some error" ) ); manager.touchArtifact( session, check ); resetSessionData( session ); // ! file.exists && ! updateRequired && previousError -> depends on transfer error caching check = newArtifactCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( false, false ) ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); assertNull( check.getException() ); } @Test public void testCheckArtifactAtMostOnceDuringSessionEvenIfUpdatePolicyAlways() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); // first check manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); manager.touchArtifact( session, check ); // second check in same session manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); } @Test public void testCheckArtifactSessionStateModes() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); manager.touchArtifact( session, check ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "bypass" ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); resetSessionData( session ); manager.touchArtifact( session, check ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "true" ); manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); session.setConfigProperty( DefaultUpdateCheckManager.CONFIG_PROP_SESSION_STATE, "false" ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactAtMostOnceDuringSessionEvenIfUpdatePolicyAlways_InvalidFile() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); check.setFileValid( false ); // first check manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); // first touch, without exception manager.touchArtifact( session, check ); // another check in same session manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); // another touch, with exception check.setException( new ArtifactNotFoundException( check.getItem(), check.getRepository() ) ); manager.touchArtifact( session, check ); // another check in same session manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); } @Test public void testCheckArtifactAtMostOnceDuringSessionEvenIfUpdatePolicyAlways_DifferentRepoIdSameUrl() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); // first check manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); manager.touchArtifact( session, check ); // second check in same session but for repo with different id check.setRepository( new RemoteRepository.Builder( check.getRepository() ).setId( "check" ).build() ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactWhenLocallyMissingEvenIfUpdatePolicyIsNever() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); check.getFile().delete(); assertEquals( check.getFile().getAbsolutePath(), false, check.getFile().exists() ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactWhenLocallyPresentButInvalidEvenIfUpdatePolicyIsNever() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.touchArtifact( session, check ); resetSessionData( session ); check.setFileValid( false ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactWhenLocallyDeletedEvenIfTimestampUpToDate() throws Exception { UpdateCheck check = newArtifactCheck(); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.touchArtifact( session, check ); resetSessionData( session ); check.getFile().delete(); assertEquals( check.getFile().getAbsolutePath(), false, check.getFile().exists() ); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); } @Test public void testCheckArtifactNotWhenUpdatePolicyIsNeverAndTimestampIsUnavailable() throws Exception { UpdateCheck check = newArtifactCheck(); check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( true, false ) ); manager.checkArtifact( session, check ); assertEquals( false, check.isRequired() ); } } DefaultUpdatePolicyAnalyzerTest.java000066400000000000000000000122521245546356100362600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.eclipse.aether.repository.RepositoryPolicy.*; import static org.junit.Assert.*; import java.util.Calendar; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.RepositoryPolicy; import org.junit.Before; import org.junit.Test; /** */ public class DefaultUpdatePolicyAnalyzerTest { private DefaultUpdatePolicyAnalyzer analyzer; private DefaultRepositorySystemSession session; @Before public void setup() throws Exception { analyzer = new DefaultUpdatePolicyAnalyzer(); session = TestUtils.newSession(); } private long now() { return System.currentTimeMillis(); } @Test public void testIsUpdateRequired_PolicyNever() throws Exception { String policy = RepositoryPolicy.UPDATE_POLICY_NEVER; assertEquals( false, analyzer.isUpdatedRequired( session, Long.MIN_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, Long.MAX_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, 0, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, 1, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, now() - 604800000, policy ) ); } @Test public void testIsUpdateRequired_PolicyAlways() throws Exception { String policy = RepositoryPolicy.UPDATE_POLICY_ALWAYS; assertEquals( true, analyzer.isUpdatedRequired( session, Long.MIN_VALUE, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, Long.MAX_VALUE, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, 0, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, 1, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, now() - 1000, policy ) ); } @Test public void testIsUpdateRequired_PolicyDaily() throws Exception { Calendar cal = Calendar.getInstance(); cal.set( Calendar.HOUR_OF_DAY, 0 ); cal.set( Calendar.MINUTE, 0 ); cal.set( Calendar.SECOND, 0 ); cal.set( Calendar.MILLISECOND, 0 ); long localMidnight = cal.getTimeInMillis(); String policy = RepositoryPolicy.UPDATE_POLICY_DAILY; assertEquals( true, analyzer.isUpdatedRequired( session, Long.MIN_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, Long.MAX_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, localMidnight + 0, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, localMidnight + 1, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, localMidnight - 1, policy ) ); } @Test public void testIsUpdateRequired_PolicyInterval() throws Exception { String policy = RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":5"; assertEquals( true, analyzer.isUpdatedRequired( session, Long.MIN_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, Long.MAX_VALUE, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, now(), policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, now() - 5 - 1, policy ) ); assertEquals( false, analyzer.isUpdatedRequired( session, now() - 1000 * 5 - 1, policy ) ); assertEquals( true, analyzer.isUpdatedRequired( session, now() - 1000 * 60 * 5 - 1, policy ) ); policy = RepositoryPolicy.UPDATE_POLICY_INTERVAL + ":invalid"; assertEquals( false, analyzer.isUpdatedRequired( session, now(), policy ) ); } @Test public void testEffectivePolicy() { assertEquals( UPDATE_POLICY_ALWAYS, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_ALWAYS, UPDATE_POLICY_DAILY ) ); assertEquals( UPDATE_POLICY_ALWAYS, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_ALWAYS, UPDATE_POLICY_NEVER ) ); assertEquals( UPDATE_POLICY_DAILY, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_DAILY, UPDATE_POLICY_NEVER ) ); assertEquals( UPDATE_POLICY_INTERVAL + ":60", analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_DAILY, UPDATE_POLICY_INTERVAL + ":60" ) ); assertEquals( UPDATE_POLICY_INTERVAL + ":60", analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_INTERVAL + ":100", UPDATE_POLICY_INTERVAL + ":60" ) ); } } DependencyGraphDumper.java000066400000000000000000000124471245546356100342260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.io.PrintWriter; import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; /** * A helper to visualize dependency graphs. */ public class DependencyGraphDumper { public static void dump( PrintWriter writer, DependencyNode node ) { Context context = new Context(); dump( context, node, 0, true ); LinkedList indents = new LinkedList(); for ( Line line : context.lines ) { if ( line.depth > indents.size() ) { if ( !indents.isEmpty() ) { if ( indents.getLast() == Indent.CHILD ) { indents.removeLast(); indents.addLast( Indent.CHILDREN ); } else if ( indents.getLast() == Indent.LAST_CHILD ) { indents.removeLast(); indents.addLast( Indent.NO_CHILDREN ); } } indents.addLast( line.last ? Indent.LAST_CHILD : Indent.CHILD ); } else if ( line.depth < indents.size() ) { while ( line.depth <= indents.size() ) { indents.removeLast(); } indents.addLast( line.last ? Indent.LAST_CHILD : Indent.CHILD ); } else if ( line.last && !indents.isEmpty() ) { indents.removeLast(); indents.addLast( Indent.LAST_CHILD ); } for ( Indent indent : indents ) { writer.print( indent ); } line.print( writer ); } writer.flush(); } private static void dump( Context context, DependencyNode node, int depth, boolean last ) { Line line = context.nodes.get( node ); if ( line != null ) { if ( line.id <= 0 ) { line.id = ++context.ids; } context.lines.add( new Line( null, line.id, depth, last ) ); return; } Dependency dependency = node.getDependency(); if ( dependency == null ) { line = new Line( null, 0, depth, last ); } else { line = new Line( dependency, 0, depth, last ); } context.lines.add( line ); context.nodes.put( node, line ); depth++; for ( Iterator it = node.getChildren().iterator(); it.hasNext(); ) { DependencyNode child = it.next(); dump( context, child, depth, !it.hasNext() ); } } static enum Indent { NO_CHILDREN( " " ), CHILDREN( "| " ), CHILD( "+- " ), LAST_CHILD( "\\- " ); private final String chars; Indent( String chars ) { this.chars = chars; } @Override public String toString() { return chars; } } static class Context { int ids; List lines; Map nodes; Context() { this.lines = new ArrayList(); this.nodes = new IdentityHashMap( 1024 ); } } static class Line { Dependency dependency; int id; int depth; boolean last; Line( Dependency dependency, int id, int depth, boolean last ) { this.dependency = dependency; this.id = id; this.depth = depth; this.last = last; } void print( PrintWriter writer ) { if ( dependency == null ) { if ( id > 0 ) { writer.print( "^" ); writer.print( id ); } else { writer.print( "(null)" ); } } else { if ( id > 0 ) { writer.print( "(" ); writer.print( id ); writer.print( ")" ); } writer.print( dependency.getArtifact() ); if ( dependency.getScope().length() > 0 ) { writer.print( ":" ); writer.print( dependency.getScope() ); } } writer.println(); } } } EnhancedLocalRepositoryManagerTest.java000066400000000000000000000273221245546356100367220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.net.URI; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.metadata.Metadata.Nature; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.LocalMetadataRequest; import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.RemoteRepository; import org.junit.After; import org.junit.Before; import org.junit.Test; public class EnhancedLocalRepositoryManagerTest { private Artifact artifact; private Artifact snapshot; private File basedir; private EnhancedLocalRepositoryManager manager; private File artifactFile; private RemoteRepository repository; private String testContext = "project/compile"; private RepositorySystemSession session; private Metadata metadata; private Metadata noVerMetadata; @Before public void setup() throws Exception { String url = TestFileUtils.createTempDir( "enhanced-remote-repo" ).toURI().toURL().toString(); repository = new RemoteRepository.Builder( "enhanced-remote-repo", "default", url ).setRepositoryManager( true ).build(); artifact = new DefaultArtifact( "gid", "aid", "", "jar", "1-test", Collections. emptyMap(), TestFileUtils.createTempFile( "artifact" ) ); snapshot = new DefaultArtifact( "gid", "aid", "", "jar", "1.0-20120710.231549-9", Collections. emptyMap(), TestFileUtils.createTempFile( "artifact" ) ); metadata = new DefaultMetadata( "gid", "aid", "1-test", "maven-metadata.xml", Nature.RELEASE, TestFileUtils.createTempFile( "metadata" ) ); noVerMetadata = new DefaultMetadata( "gid", "aid", null, "maven-metadata.xml", Nature.RELEASE, TestFileUtils.createTempFile( "metadata" ) ); basedir = TestFileUtils.createTempDir( "enhanced-repo" ); session = TestUtils.newSession(); manager = new EnhancedLocalRepositoryManager( basedir, session ); artifactFile = new File( basedir, manager.getPathForLocalArtifact( artifact ) ); } @After public void tearDown() throws Exception { TestFileUtils.deleteFile( basedir ); TestFileUtils.deleteFile( new File( new URI( repository.getUrl() ) ) ); session = null; manager = null; repository = null; artifact = null; } private long addLocalArtifact( Artifact artifact ) throws IOException { manager.add( session, new LocalArtifactRegistration( artifact ) ); String path = manager.getPathForLocalArtifact( artifact ); return copy( artifact, path ); } private long addRemoteArtifact( Artifact artifact ) throws IOException { Collection contexts = Arrays.asList( testContext ); manager.add( session, new LocalArtifactRegistration( artifact, repository, contexts ) ); String path = manager.getPathForRemoteArtifact( artifact, repository, testContext ); return copy( artifact, path ); } private long copy( Metadata metadata, String path ) throws IOException { if ( metadata.getFile() == null ) { return -1; } return TestFileUtils.copyFile( metadata.getFile(), new File( basedir, path ) ); } private long copy( Artifact artifact, String path ) throws IOException { if ( artifact.getFile() == null ) { return -1; } File artifactFile = new File( basedir, path ); return TestFileUtils.copyFile( artifact.getFile(), artifactFile ); } @Test public void testGetPathForLocalArtifact() { Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForLocalArtifact( artifact ) ); artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-20110329.221805-4" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForLocalArtifact( artifact ) ); } @Test public void testGetPathForRemoteArtifact() { RemoteRepository remoteRepo = new RemoteRepository.Builder( "repo", "default", "ram:/void" ).build(); Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForRemoteArtifact( artifact, remoteRepo, "" ) ); artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-20110329.221805-4" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-20110329.221805-4.jar", manager.getPathForRemoteArtifact( artifact, remoteRepo, "" ) ); } @Test public void testFindLocalArtifact() throws Exception { addLocalArtifact( artifact ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, null, null ); LocalArtifactResult result = manager.find( session, request ); assertTrue( result.isAvailable() ); assertEquals( null, result.getRepository() ); snapshot = snapshot.setVersion( snapshot.getBaseVersion() ); addLocalArtifact( snapshot ); request = new LocalArtifactRequest( snapshot, null, null ); result = manager.find( session, request ); assertTrue( result.isAvailable() ); assertEquals( null, result.getRepository() ); } @Test public void testFindRemoteArtifact() throws Exception { addRemoteArtifact( artifact ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, Arrays.asList( repository ), testContext ); LocalArtifactResult result = manager.find( session, request ); assertTrue( result.isAvailable() ); assertEquals( repository, result.getRepository() ); addRemoteArtifact( snapshot ); request = new LocalArtifactRequest( snapshot, Arrays.asList( repository ), testContext ); result = manager.find( session, request ); assertTrue( result.isAvailable() ); assertEquals( repository, result.getRepository() ); } @Test public void testDoNotFindDifferentContext() throws Exception { addRemoteArtifact( artifact ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, Arrays.asList( repository ), "different" ); LocalArtifactResult result = manager.find( session, request ); assertFalse( result.isAvailable() ); } @Test public void testDoNotFindNullFile() throws Exception { artifact = artifact.setFile( null ); addLocalArtifact( artifact ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, Arrays.asList( repository ), testContext ); LocalArtifactResult result = manager.find( session, request ); assertFalse( result.isAvailable() ); } @Test public void testDoNotFindDeletedFile() throws Exception { addLocalArtifact( artifact ); assertTrue( "could not delete artifact file", artifactFile.delete() ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, Arrays.asList( repository ), testContext ); LocalArtifactResult result = manager.find( session, request ); assertFalse( result.isAvailable() ); } @Test public void testFindUntrackedFile() throws Exception { copy( artifact, manager.getPathForLocalArtifact( artifact ) ); LocalArtifactRequest request = new LocalArtifactRequest( artifact, Arrays.asList( repository ), testContext ); LocalArtifactResult result = manager.find( session, request ); assertTrue( result.isAvailable() ); } private long addMetadata( Metadata metadata, RemoteRepository repo ) throws IOException { String path; if ( repo == null ) { path = manager.getPathForLocalMetadata( metadata ); } else { path = manager.getPathForRemoteMetadata( metadata, repo, testContext ); } System.err.println( path ); return copy( metadata, path ); } @Test public void testFindLocalMetadata() throws Exception { addMetadata( metadata, null ); LocalMetadataRequest request = new LocalMetadataRequest( metadata, null, testContext ); LocalMetadataResult result = manager.find( session, request ); assertNotNull( result.getFile() ); } @Test public void testFindLocalMetadataNoVersion() throws Exception { addMetadata( noVerMetadata, null ); LocalMetadataRequest request = new LocalMetadataRequest( noVerMetadata, null, testContext ); LocalMetadataResult result = manager.find( session, request ); assertNotNull( result.getFile() ); } @Test public void testDoNotFindRemoteMetadataDifferentContext() throws Exception { addMetadata( noVerMetadata, repository ); addMetadata( metadata, repository ); LocalMetadataRequest request = new LocalMetadataRequest( noVerMetadata, repository, "different" ); LocalMetadataResult result = manager.find( session, request ); assertNull( result.getFile() ); request = new LocalMetadataRequest( metadata, repository, "different" ); result = manager.find( session, request ); assertNull( result.getFile() ); } @Test public void testFindArtifactUsesTimestampedVersion() throws Exception { Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); File file = new File( basedir, manager.getPathForLocalArtifact( artifact ) ); TestFileUtils.writeString( file, "test" ); addLocalArtifact( artifact ); artifact = artifact.setVersion( "1.0-20110329.221805-4" ); LocalArtifactRequest request = new LocalArtifactRequest(); request.setArtifact( artifact ); LocalArtifactResult result = manager.find( session, request ); assertNull( result.toString(), result.getFile() ); assertFalse( result.toString(), result.isAvailable() ); } } FailChecksumPolicyTest.java000066400000000000000000000045441245546356100343660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; import org.junit.Before; import org.junit.Test; public class FailChecksumPolicyTest { private FailChecksumPolicy policy; private ChecksumFailureException exception; @Before public void setup() { policy = new FailChecksumPolicy( null, new TransferResource( "file:/dev/null", "file.txt", null, null ) ); exception = new ChecksumFailureException( "test" ); } @Test public void testOnTransferChecksumFailure() { assertFalse( policy.onTransferChecksumFailure( exception ) ); } @Test public void testOnChecksumMatch() { assertTrue( policy.onChecksumMatch( "SHA-1", 0 ) ); assertTrue( policy.onChecksumMatch( "SHA-1", ChecksumPolicy.KIND_UNOFFICIAL ) ); } @Test public void testOnChecksumMismatch() throws Exception { try { policy.onChecksumMismatch( "SHA-1", 0, exception ); fail( "No exception" ); } catch ( ChecksumFailureException e ) { assertSame( exception, e ); } policy.onChecksumMismatch( "SHA-1", ChecksumPolicy.KIND_UNOFFICIAL, exception ); } @Test public void testOnChecksumError() throws Exception { policy.onChecksumError( "SHA-1", 0, exception ); } @Test public void testOnNoMoreChecksums() { try { policy.onNoMoreChecksums(); fail( "No exception" ); } catch ( ChecksumFailureException e ) { assertTrue( e.getMessage().contains( "no checksums available" ) ); } } } IniArtifactDescriptorReader.java000066400000000000000000000017141245546356100353630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.impl.ArtifactDescriptorReader; /** */ public class IniArtifactDescriptorReader extends org.eclipse.aether.internal.test.util.IniArtifactDescriptorReader implements ArtifactDescriptorReader { /** * Use the given prefix to load the artifact descriptions. */ public IniArtifactDescriptorReader( String prefix ) { super( prefix ); } } Maven2RepositoryLayoutFactoryTest.java000066400000000000000000000237301245546356100366240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.net.URI; import java.util.List; import java.util.Locale; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.metadata.DefaultMetadata; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.layout.RepositoryLayout; import org.eclipse.aether.spi.connector.layout.RepositoryLayout.Checksum; import org.eclipse.aether.transfer.NoRepositoryLayoutException; import org.junit.Before; import org.junit.Test; public class Maven2RepositoryLayoutFactoryTest { private DefaultRepositorySystemSession session; private Maven2RepositoryLayoutFactory factory; private RepositoryLayout layout; private RemoteRepository newRepo( String type ) { return new RemoteRepository.Builder( "test", type, "classpath:/nil" ).build(); } private void assertChecksum( Checksum actual, String expectedUri, String expectedAlgo ) { assertEquals( expectedUri, actual.getLocation().toString() ); assertEquals( expectedAlgo, actual.getAlgorithm() ); } private void assertChecksums( List actual, String baseUri, String... algos ) { assertEquals( algos.length, actual.size() ); for ( int i = 0; i < algos.length; i++ ) { String uri = baseUri + '.' + algos[i].replace( "-", "" ).toLowerCase( Locale.ENGLISH ); assertChecksum( actual.get( i ), uri, algos[i] ); } } @Before public void setUp() throws Exception { session = TestUtils.newSession(); factory = new Maven2RepositoryLayoutFactory(); layout = factory.newInstance( session, newRepo( "default" ) ); } @Test( expected = NoRepositoryLayoutException.class ) public void testBadLayout() throws Exception { factory.newInstance( session, newRepo( "DEFAULT" ) ); } @Test public void testArtifactLocation_Release() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "ext", "1.0" ); URI uri = layout.getLocation( artifact, false ); assertEquals( "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext", uri.toString() ); uri = layout.getLocation( artifact, true ); assertEquals( "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext", uri.toString() ); } @Test public void testArtifactLocation_Snapshot() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "ext", "1.0-20110329.221805-4" ); URI uri = layout.getLocation( artifact, false ); assertEquals( "g/i/d/a-i.d/1.0-SNAPSHOT/a-i.d-1.0-20110329.221805-4-cls.ext", uri.toString() ); uri = layout.getLocation( artifact, true ); assertEquals( "g/i/d/a-i.d/1.0-SNAPSHOT/a-i.d-1.0-20110329.221805-4-cls.ext", uri.toString() ); } @Test public void testMetadataLocation_RootLevel() { DefaultMetadata metadata = new DefaultMetadata( "archetype-catalog.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, false ); assertEquals( "archetype-catalog.xml", uri.toString() ); uri = layout.getLocation( metadata, true ); assertEquals( "archetype-catalog.xml", uri.toString() ); } @Test public void testMetadataLocation_GroupLevel() { DefaultMetadata metadata = new DefaultMetadata( "org.apache.maven.plugins", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, false ); assertEquals( "org/apache/maven/plugins/maven-metadata.xml", uri.toString() ); uri = layout.getLocation( metadata, true ); assertEquals( "org/apache/maven/plugins/maven-metadata.xml", uri.toString() ); } @Test public void testMetadataLocation_ArtifactLevel() { DefaultMetadata metadata = new DefaultMetadata( "org.apache.maven.plugins", "maven-jar-plugin", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, false ); assertEquals( "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml", uri.toString() ); uri = layout.getLocation( metadata, true ); assertEquals( "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml", uri.toString() ); } @Test public void testMetadataLocation_VersionLevel() { DefaultMetadata metadata = new DefaultMetadata( "org.apache.maven.plugins", "maven-jar-plugin", "1.0-SNAPSHOT", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, false ); assertEquals( "org/apache/maven/plugins/maven-jar-plugin/1.0-SNAPSHOT/maven-metadata.xml", uri.toString() ); uri = layout.getLocation( metadata, true ); assertEquals( "org/apache/maven/plugins/maven-jar-plugin/1.0-SNAPSHOT/maven-metadata.xml", uri.toString() ); } @Test public void testArtifactChecksums_Download() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "ext", "1.0" ); URI uri = layout.getLocation( artifact, false ); List checksums = layout.getChecksums( artifact, false, uri ); assertEquals( 2, checksums.size() ); assertChecksum( checksums.get( 0 ), "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext.sha1", "SHA-1" ); assertChecksum( checksums.get( 1 ), "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext.md5", "MD5" ); } @Test public void testArtifactChecksums_Upload() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "ext", "1.0" ); URI uri = layout.getLocation( artifact, true ); List checksums = layout.getChecksums( artifact, true, uri ); assertEquals( 2, checksums.size() ); assertChecksum( checksums.get( 0 ), "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext.sha1", "SHA-1" ); assertChecksum( checksums.get( 1 ), "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.ext.md5", "MD5" ); } @Test public void testMetadataChecksums_Download() { DefaultMetadata metadata = new DefaultMetadata( "org.apache.maven.plugins", "maven-jar-plugin", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, false ); List checksums = layout.getChecksums( metadata, false, uri ); assertEquals( 2, checksums.size() ); assertChecksum( checksums.get( 0 ), "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml.sha1", "SHA-1" ); assertChecksum( checksums.get( 1 ), "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml.md5", "MD5" ); } @Test public void testMetadataChecksums_Upload() { DefaultMetadata metadata = new DefaultMetadata( "org.apache.maven.plugins", "maven-jar-plugin", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT ); URI uri = layout.getLocation( metadata, true ); List checksums = layout.getChecksums( metadata, true, uri ); assertEquals( 2, checksums.size() ); assertChecksum( checksums.get( 0 ), "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml.sha1", "SHA-1" ); assertChecksum( checksums.get( 1 ), "org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml.md5", "MD5" ); } @Test public void testSignatureChecksums_Download() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "asc", "1.0" ); URI uri = layout.getLocation( artifact, false ); List checksums = layout.getChecksums( artifact, false, uri ); assertChecksums( checksums, "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.asc", "SHA-1", "MD5" ); artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "jar.asc", "1.0" ); uri = layout.getLocation( artifact, false ); checksums = layout.getChecksums( artifact, false, uri ); assertEquals( 0, checksums.size() ); } @Test public void testSignatureChecksums_Upload() { DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "asc", "1.0" ); URI uri = layout.getLocation( artifact, true ); List checksums = layout.getChecksums( artifact, true, uri ); assertChecksums( checksums, "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.asc", "SHA-1", "MD5" ); artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "jar.asc", "1.0" ); uri = layout.getLocation( artifact, true ); checksums = layout.getChecksums( artifact, true, uri ); assertEquals( 0, checksums.size() ); } @Test public void testSignatureChecksums_Force() throws Exception { session.setConfigProperty( Maven2RepositoryLayoutFactory.CONFIG_PROP_SIGNATURE_CHECKSUMS, "true" ); layout = factory.newInstance( session, newRepo( "default" ) ); DefaultArtifact artifact = new DefaultArtifact( "g.i.d", "a-i.d", "cls", "jar.asc", "1.0" ); URI uri = layout.getLocation( artifact, true ); List checksums = layout.getChecksums( artifact, true, uri ); assertChecksums( checksums, "g/i/d/a-i.d/1.0/a-i.d-1.0-cls.jar.asc", "SHA-1", "MD5" ); } } PrioritizedComponentTest.java000066400000000000000000000047701245546356100350400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import org.junit.Test; public class PrioritizedComponentTest { @Test public void testIsDisabled() { assertTrue( new PrioritizedComponent( "", String.class, Float.NaN, 0 ).isDisabled() ); assertFalse( new PrioritizedComponent( "", String.class, 0, 0 ).isDisabled() ); assertFalse( new PrioritizedComponent( "", String.class, 1, 0 ).isDisabled() ); assertFalse( new PrioritizedComponent( "", String.class, -1, 0 ).isDisabled() ); } @Test public void testCompareTo() { assertCompare( 0, Float.NaN, Float.NaN ); assertCompare( 0, 0, 0 ); assertCompare( 1, 0, 1 ); assertCompare( 1, 2, Float.POSITIVE_INFINITY ); assertCompare( 1, Float.NEGATIVE_INFINITY, -3 ); assertCompare( 1, Float.NaN, 0 ); assertCompare( 1, Float.NaN, -1 ); assertCompare( 1, Float.NaN, Float.NEGATIVE_INFINITY ); assertCompare( 1, Float.NaN, Float.POSITIVE_INFINITY ); assertCompare( -1, Float.NaN, 0, 1 ); assertCompare( -1, 10, 0, 1 ); } private void assertCompare( int expected, float priority1, float priority2 ) { PrioritizedComponent one = new PrioritizedComponent( "", String.class, priority1, 0 ); PrioritizedComponent two = new PrioritizedComponent( "", String.class, priority2, 0 ); assertEquals( expected, one.compareTo( two ) ); assertEquals( -expected, two.compareTo( one ) ); } private void assertCompare( int expected, float priority, int index1, int index2 ) { PrioritizedComponent one = new PrioritizedComponent( "", String.class, priority, index1 ); PrioritizedComponent two = new PrioritizedComponent( "", String.class, priority, index2 ); assertEquals( expected, one.compareTo( two ) ); assertEquals( -expected, two.compareTo( one ) ); } } PrioritizedComponentsTest.java000066400000000000000000000106201245546356100352120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ThreadFactory; import org.eclipse.aether.ConfigurationProperties; import org.junit.Test; public class PrioritizedComponentsTest { @Test public void testGetConfigKeys() { String[] keys = { ConfigurationProperties.PREFIX_PRIORITY + "java.lang.String", ConfigurationProperties.PREFIX_PRIORITY + "String" }; assertArrayEquals( keys, PrioritizedComponents.getConfigKeys( String.class ) ); keys = new String[] { ConfigurationProperties.PREFIX_PRIORITY + "java.util.concurrent.ThreadFactory", ConfigurationProperties.PREFIX_PRIORITY + "ThreadFactory", ConfigurationProperties.PREFIX_PRIORITY + "Thread" }; assertArrayEquals( keys, PrioritizedComponents.getConfigKeys( ThreadFactory.class ) ); } @Test public void testAdd_PriorityOverride() { Exception comp1 = new IllegalArgumentException(); Exception comp2 = new NullPointerException(); Map config = new HashMap(); config.put( ConfigurationProperties.PREFIX_PRIORITY + comp1.getClass().getName(), 6 ); config.put( ConfigurationProperties.PREFIX_PRIORITY + comp2.getClass().getName(), 7 ); PrioritizedComponents components = new PrioritizedComponents( config ); components.add( comp1, 1 ); components.add( comp2, 0 ); List> sorted = components.getEnabled(); assertEquals( 2, sorted.size() ); assertSame( comp2, sorted.get( 0 ).getComponent() ); assertEquals( 7, sorted.get( 0 ).getPriority(), 0.1f ); assertSame( comp1, sorted.get( 1 ).getComponent() ); assertEquals( 6, sorted.get( 1 ).getPriority(), 0.1f ); } @Test public void testAdd_ImplicitPriority() { Exception comp1 = new IllegalArgumentException(); Exception comp2 = new NullPointerException(); Map config = new HashMap(); config.put( ConfigurationProperties.IMPLICIT_PRIORITIES, true ); PrioritizedComponents components = new PrioritizedComponents( config ); components.add( comp1, 1 ); components.add( comp2, 2 ); List> sorted = components.getEnabled(); assertEquals( 2, sorted.size() ); assertSame( comp1, sorted.get( 0 ).getComponent() ); assertSame( comp2, sorted.get( 1 ).getComponent() ); } @Test public void testAdd_Disabled() { Exception comp1 = new IllegalArgumentException(); Exception comp2 = new NullPointerException(); Map config = new HashMap(); PrioritizedComponents components = new PrioritizedComponents( config ); components.add( new UnsupportedOperationException(), Float.NaN ); List> sorted = components.getEnabled(); assertEquals( 0, sorted.size() ); components.add( comp1, 1 ); sorted = components.getEnabled(); assertEquals( 1, sorted.size() ); assertSame( comp1, sorted.get( 0 ).getComponent() ); components.add( new Exception(), Float.NaN ); sorted = components.getEnabled(); assertEquals( 1, sorted.size() ); assertSame( comp1, sorted.get( 0 ).getComponent() ); components.add( comp2, 0 ); sorted = components.getEnabled(); assertEquals( 2, sorted.size() ); assertSame( comp1, sorted.get( 0 ).getComponent() ); assertSame( comp2, sorted.get( 1 ).getComponent() ); } } RecordingRepositoryConnector.java000066400000000000000000000225551245546356100357010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.spi.connector.ArtifactDownload; import org.eclipse.aether.spi.connector.ArtifactUpload; import org.eclipse.aether.spi.connector.MetadataDownload; import org.eclipse.aether.spi.connector.MetadataUpload; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.spi.connector.Transfer; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferListener; import org.eclipse.aether.transfer.TransferResource; /** * A repository connector recording all get/put-requests and faking the results. */ class RecordingRepositoryConnector implements RepositoryConnector { RepositorySystemSession session; boolean fail; private Artifact[] expectGet; private Artifact[] expectPut; private Metadata[] expectGetMD; private Metadata[] expectPutMD; private List actualGet = new ArrayList(); private List actualGetMD = new ArrayList(); private List actualPut = new ArrayList(); private List actualPutMD = new ArrayList(); public RecordingRepositoryConnector( RepositorySystemSession session, Artifact[] expectGet, Artifact[] expectPut, Metadata[] expectGetMD, Metadata[] expectPutMD ) { this.session = session; this.expectGet = expectGet; this.expectPut = expectPut; this.expectGetMD = expectGetMD; this.expectPutMD = expectPutMD; } public RecordingRepositoryConnector( RepositorySystemSession session ) { this.session = session; } public RecordingRepositoryConnector() { } public void get( Collection artifactDownloads, Collection metadataDownloads ) { try { if ( artifactDownloads != null ) { for ( ArtifactDownload download : artifactDownloads ) { fireInitiated( download ); Artifact artifact = download.getArtifact(); this.actualGet.add( artifact ); if ( fail ) { download.setException( new ArtifactTransferException( artifact, null, "forced failure" ) ); } else { TestFileUtils.writeString( download.getFile(), artifact.toString() ); } fireDone( download ); } } if ( metadataDownloads != null ) { for ( MetadataDownload download : metadataDownloads ) { fireInitiated( download ); Metadata metadata = download.getMetadata(); this.actualGetMD.add( metadata ); if ( fail ) { download.setException( new MetadataTransferException( metadata, null, "forced failure" ) ); } else { TestFileUtils.writeString( download.getFile(), metadata.toString() ); } fireDone( download ); } } } catch ( Exception e ) { throw new IllegalStateException( e ); } } public void put( Collection artifactUploads, Collection metadataUploads ) { try { if ( artifactUploads != null ) { for ( ArtifactUpload upload : artifactUploads ) { // mimic "real" connector fireInitiated( upload ); if ( upload.getFile() == null ) { upload.setException( new ArtifactTransferException( upload.getArtifact(), null, "no file" ) ); } else if ( fail ) { upload.setException( new ArtifactTransferException( upload.getArtifact(), null, "forced failure" ) ); } this.actualPut.add( upload.getArtifact() ); fireDone( upload ); } } if ( metadataUploads != null ) { for ( MetadataUpload upload : metadataUploads ) { // mimic "real" connector fireInitiated( upload ); if ( upload.getFile() == null ) { upload.setException( new MetadataTransferException( upload.getMetadata(), null, "no file" ) ); } else if ( fail ) { upload.setException( new MetadataTransferException( upload.getMetadata(), null, "forced failure" ) ); } this.actualPutMD.add( upload.getMetadata() ); fireDone( upload ); } } } catch ( Exception e ) { throw new IllegalStateException( e ); } } private void fireInitiated( Transfer transfer ) throws Exception { TransferListener listener = transfer.getListener(); if ( listener == null ) { return; } TransferEvent.Builder event = new TransferEvent.Builder( session, new TransferResource( null, null, null, transfer.getTrace() ) ); event.setType( TransferEvent.EventType.INITIATED ); listener.transferInitiated( event.build() ); } private void fireDone( Transfer transfer ) throws Exception { TransferListener listener = transfer.getListener(); if ( listener == null ) { return; } TransferEvent.Builder event = new TransferEvent.Builder( session, new TransferResource( null, null, null, transfer.getTrace() ) ); event.setException( transfer.getException() ); if ( transfer.getException() != null ) { listener.transferFailed( event.setType( TransferEvent.EventType.FAILED ).build() ); } else { listener.transferSucceeded( event.setType( TransferEvent.EventType.SUCCEEDED ).build() ); } } public void close() { } public void assertSeenExpected() { assertSeenExpected( actualGet, expectGet ); assertSeenExpected( actualGetMD, expectGetMD ); assertSeenExpected( actualPut, expectPut ); assertSeenExpected( actualPutMD, expectPutMD ); } private void assertSeenExpected( List actual, Object[] expected ) { if ( expected == null ) { expected = new Object[0]; } assertEquals( "different number of expected and actual elements:\n", expected.length, actual.size() ); int idx = 0; for ( Object actualObject : actual ) { assertEquals( "seen object differs", expected[idx++], actualObject ); } } public List getActualArtifactGetRequests() { return actualGet; } public List getActualMetadataGetRequests() { return actualGetMD; } public List getActualArtifactPutRequests() { return actualPut; } public List getActualMetadataPutRequests() { return actualPutMD; } public void setExpectGet( Artifact... expectGet ) { this.expectGet = expectGet; } public void setExpectPut( Artifact... expectPut ) { this.expectPut = expectPut; } public void setExpectGet( Metadata... expectGetMD ) { this.expectGetMD = expectGetMD; } public void setExpectPut( Metadata... expectPutMD ) { this.expectPutMD = expectPutMD; } public void resetActual() { this.actualGet = new ArrayList(); this.actualGetMD = new ArrayList(); this.actualPut = new ArrayList(); this.actualPutMD = new ArrayList(); } } RecordingRepositoryListener.java000066400000000000000000000060001245546356100355170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; /** * Collects observed repository events for later inspection. */ class RecordingRepositoryListener implements RepositoryListener { private List events = Collections.synchronizedList( new ArrayList() ); public List getEvents() { return events; } public void clear() { events.clear(); } public void artifactDescriptorInvalid( RepositoryEvent event ) { events.add( event ); } public void artifactDescriptorMissing( RepositoryEvent event ) { events.add( event ); } public void metadataInvalid( RepositoryEvent event ) { events.add( event ); } public void artifactResolving( RepositoryEvent event ) { events.add( event ); } public void artifactResolved( RepositoryEvent event ) { events.add( event ); } public void artifactDownloading( RepositoryEvent event ) { events.add( event ); } public void artifactDownloaded( RepositoryEvent event ) { events.add( event ); } public void metadataDownloaded( RepositoryEvent event ) { events.add( event ); } public void metadataDownloading( RepositoryEvent event ) { events.add( event ); } public void metadataResolving( RepositoryEvent event ) { events.add( event ); } public void metadataResolved( RepositoryEvent event ) { events.add( event ); } public void artifactInstalling( RepositoryEvent event ) { events.add( event ); } public void artifactInstalled( RepositoryEvent event ) { events.add( event ); } public void metadataInstalling( RepositoryEvent event ) { events.add( event ); } public void metadataInstalled( RepositoryEvent event ) { events.add( event ); } public void artifactDeploying( RepositoryEvent event ) { events.add( event ); } public void artifactDeployed( RepositoryEvent event ) { events.add( event ); } public void metadataDeploying( RepositoryEvent event ) { events.add( event ); } public void metadataDeployed( RepositoryEvent event ) { events.add( event ); } } SafeTransferListenerTest.java000066400000000000000000000021041245546356100347270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.eclipse.aether.transfer.TransferListener; import org.junit.Test; /** */ public class SafeTransferListenerTest { @Test public void testAllEventTypesHandled() throws Exception { Class type = SafeTransferListener.class; for ( Method method : TransferListener.class.getMethods() ) { assertNotNull( type.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); } } } SimpleLocalRepositoryManagerTest.java000066400000000000000000000101171245546356100364400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManager; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.RemoteRepository; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class SimpleLocalRepositoryManagerTest { private File basedir; private SimpleLocalRepositoryManager manager; private RepositorySystemSession session; @Before public void setup() throws IOException { basedir = TestFileUtils.createTempDir( "simple-repo" ); manager = new SimpleLocalRepositoryManager( basedir ); session = TestUtils.newSession(); } @After public void tearDown() throws Exception { TestFileUtils.deleteFile( basedir ); manager = null; session = null; } @Test public void testGetPathForLocalArtifact() throws Exception { Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForLocalArtifact( artifact ) ); artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-20110329.221805-4" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForLocalArtifact( artifact ) ); artifact = new DefaultArtifact( "g.i.d", "a.i.d", "", "", "1.0-SNAPSHOT" ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT", manager.getPathForLocalArtifact( artifact ) ); } @Test public void testGetPathForRemoteArtifact() throws Exception { RemoteRepository remoteRepo = new RemoteRepository.Builder( "repo", "default", "ram:/void" ).build(); Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-SNAPSHOT.jar", manager.getPathForRemoteArtifact( artifact, remoteRepo, "" ) ); artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-20110329.221805-4" ); assertEquals( "1.0-SNAPSHOT", artifact.getBaseVersion() ); assertEquals( "g/i/d/a.i.d/1.0-SNAPSHOT/a.i.d-1.0-20110329.221805-4.jar", manager.getPathForRemoteArtifact( artifact, remoteRepo, "" ) ); } @Test public void testFindArtifactUsesTimestampedVersion() throws Exception { Artifact artifact = new DefaultArtifact( "g.i.d:a.i.d:1.0-SNAPSHOT" ); File file = new File( basedir, manager.getPathForLocalArtifact( artifact ) ); TestFileUtils.writeString( file, "test" ); artifact = artifact.setVersion( "1.0-20110329.221805-4" ); LocalArtifactRequest request = new LocalArtifactRequest(); request.setArtifact( artifact ); LocalArtifactResult result = manager.find( session, request ); assertNull( result.toString(), result.getFile() ); assertFalse( result.toString(), result.isAvailable() ); } } StaticUpdateCheckManager.java000066400000000000000000000053101245546356100346230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.UpdateCheck; import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.transfer.ArtifactNotFoundException; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.MetadataNotFoundException; import org.eclipse.aether.transfer.MetadataTransferException; class StaticUpdateCheckManager implements UpdateCheckManager { private boolean checkRequired; private boolean localUpToDate; public StaticUpdateCheckManager( boolean checkRequired ) { this( checkRequired, !checkRequired ); } public StaticUpdateCheckManager( boolean checkRequired, boolean localUpToDate ) { this.checkRequired = checkRequired; this.localUpToDate = localUpToDate; } public void touchMetadata( RepositorySystemSession session, UpdateCheck check ) { } public void touchArtifact( RepositorySystemSession session, UpdateCheck check ) { } public void checkMetadata( RepositorySystemSession session, UpdateCheck check ) { check.setRequired( checkRequired ); if ( check.getLocalLastUpdated() != 0 && localUpToDate ) { check.setRequired( false ); } if ( !check.isRequired() && !check.getFile().isFile() ) { check.setException( new MetadataNotFoundException( check.getItem(), check.getRepository() ) ); } } public void checkArtifact( RepositorySystemSession session, UpdateCheck check ) { check.setRequired( checkRequired ); if ( check.getLocalLastUpdated() != 0 && localUpToDate ) { check.setRequired( false ); } if ( !check.isRequired() && !check.getFile().isFile() ) { check.setException( new ArtifactNotFoundException( check.getItem(), check.getRepository() ) ); } } } StubRemoteRepositoryManager.java000066400000000000000000000041131245546356100354640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.util.StringUtils; class StubRemoteRepositoryManager implements RemoteRepositoryManager { public StubRemoteRepositoryManager() { } public List aggregateRepositories( RepositorySystemSession session, List dominantRepositories, List recessiveRepositories, boolean recessiveIsRaw ) { return dominantRepositories; } public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy = repository.getPolicy( snapshots ); String checksums = session.getChecksumPolicy(); if ( StringUtils.isEmpty( checksums ) ) { checksums = policy.getChecksumPolicy(); } String updates = session.getUpdatePolicy(); if ( StringUtils.isEmpty( updates ) ) { updates = policy.getUpdatePolicy(); } policy = new RepositoryPolicy( policy.isEnabled(), updates, checksums ); return policy; } } StubRepositoryConnectorProvider.java000066400000000000000000000027141245546356100364100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.RepositoryConnectorProvider; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnector; import org.eclipse.aether.transfer.NoRepositoryConnectorException; class StubRepositoryConnectorProvider implements RepositoryConnectorProvider { public StubRepositoryConnectorProvider( RepositoryConnector connector ) { setConnector( connector ); } public StubRepositoryConnectorProvider() { } private RepositoryConnector connector; public void setConnector( RepositoryConnector connector ) { this.connector = connector; } public RepositoryConnector newRepositoryConnector( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryConnectorException { return connector; } } StubRepositoryEventDispatcher.java000066400000000000000000000065041245546356100360340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.impl.RepositoryEventDispatcher; /** */ public class StubRepositoryEventDispatcher implements RepositoryEventDispatcher { public void dispatch( RepositoryEvent event ) { RepositoryListener listener = event.getSession().getRepositoryListener(); if ( listener == null ) { return; } switch ( event.getType() ) { case ARTIFACT_DEPLOYED: listener.artifactDeployed( event ); break; case ARTIFACT_DEPLOYING: listener.artifactDeploying( event ); break; case ARTIFACT_DESCRIPTOR_INVALID: listener.artifactDescriptorInvalid( event ); break; case ARTIFACT_DESCRIPTOR_MISSING: listener.artifactDescriptorMissing( event ); break; case ARTIFACT_DOWNLOADED: listener.artifactDownloaded( event ); break; case ARTIFACT_DOWNLOADING: listener.artifactDownloading( event ); break; case ARTIFACT_INSTALLED: listener.artifactInstalled( event ); break; case ARTIFACT_INSTALLING: listener.artifactInstalling( event ); break; case ARTIFACT_RESOLVED: listener.artifactResolved( event ); break; case ARTIFACT_RESOLVING: listener.artifactResolving( event ); break; case METADATA_DEPLOYED: listener.metadataDeployed( event ); break; case METADATA_DEPLOYING: listener.metadataDeploying( event ); break; case METADATA_DOWNLOADED: listener.metadataDownloaded( event ); break; case METADATA_DOWNLOADING: listener.metadataDownloading( event ); break; case METADATA_INSTALLED: listener.metadataInstalled( event ); break; case METADATA_INSTALLING: listener.metadataInstalling( event ); break; case METADATA_INVALID: listener.metadataInvalid( event ); break; case METADATA_RESOLVED: listener.metadataResolved( event ); break; case METADATA_RESOLVING: listener.metadataResolving( event ); break; default: throw new IllegalStateException( "unknown repository event type " + event.getType() ); } } } StubSyncContextFactory.java000066400000000000000000000023761245546356100344600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import java.util.Collection; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.SyncContext; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.metadata.Metadata; /** * */ public class StubSyncContextFactory implements SyncContextFactory { public SyncContext newInstance( RepositorySystemSession session, boolean shared ) { return new SyncContext() { public void close() { } public void acquire( Collection artifacts, Collection metadatas ) { } }; } } StubVersionRangeResolver.java000066400000000000000000000051661245546356100347730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResolutionException; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionScheme; /** */ public class StubVersionRangeResolver implements VersionRangeResolver { private final VersionScheme versionScheme = new GenericVersionScheme(); public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) throws VersionRangeResolutionException { VersionRangeResult result = new VersionRangeResult( request ); try { VersionConstraint constraint = versionScheme.parseVersionConstraint( request.getArtifact().getVersion() ); result.setVersionConstraint( constraint ); if ( constraint.getRange() == null ) { result.addVersion( constraint.getVersion() ); } else { for ( int i = 1; i < 10; i++ ) { Version ver = versionScheme.parseVersion( Integer.toString( i ) ); if ( constraint.containsVersion( ver ) ) { result.addVersion( ver ); if ( !request.getRepositories().isEmpty() ) { result.setRepository( ver, request.getRepositories().get( 0 ) ); } } } } } catch ( InvalidVersionSpecificationException e ) { result.addException( e ); throw new VersionRangeResolutionException( result ); } return result; } } StubVersionResolver.java000066400000000000000000000025071245546356100340120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.resolution.VersionRequest; import org.eclipse.aether.resolution.VersionResolutionException; import org.eclipse.aether.resolution.VersionResult; /* * */ class StubVersionResolver implements VersionResolver { public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { VersionResult result = new VersionResult( request ).setVersion( request.getArtifact().getVersion() ); if ( request.getRepositories().size() > 0 ) { result = result.setRepository( request.getRepositories().get( 0 ) ); } return result; } } TrackingFileManagerTest.java000066400000000000000000000114301245546356100344750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; import org.eclipse.aether.internal.impl.TrackingFileManager; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.junit.Test; /** */ public class TrackingFileManagerTest { @Test public void testRead() throws Exception { TrackingFileManager tfm = new TrackingFileManager(); File propFile = TestFileUtils.createTempFile( "#COMMENT\nkey1=value1\nkey2 : value2" ); Properties props = tfm.read( propFile ); assertNotNull( props ); assertEquals( String.valueOf( props ), 2, props.size() ); assertEquals( "value1", props.get( "key1" ) ); assertEquals( "value2", props.get( "key2" ) ); assertTrue( "Leaked file: " + propFile, propFile.delete() ); props = tfm.read( propFile ); assertNull( String.valueOf( props ), props ); } @Test public void testReadNoFileLeak() throws Exception { TrackingFileManager tfm = new TrackingFileManager(); for ( int i = 0; i < 1000; i++ ) { File propFile = TestFileUtils.createTempFile( "#COMMENT\nkey1=value1\nkey2 : value2" ); assertNotNull( tfm.read( propFile ) ); assertTrue( "Leaked file: " + propFile, propFile.delete() ); } } @Test public void testUpdate() throws Exception { TrackingFileManager tfm = new TrackingFileManager(); // NOTE: The excessive repetitions are to check the update properly truncates the file File propFile = TestFileUtils.createTempFile( "key1=value1\nkey2 : value2\n".getBytes( "UTF-8" ), 1000 ); Map updates = new HashMap(); updates.put( "key1", "v" ); updates.put( "key2", null ); tfm.update( propFile, updates ); Properties props = tfm.read( propFile ); assertNotNull( props ); assertEquals( String.valueOf( props ), 1, props.size() ); assertEquals( "v", props.get( "key1" ) ); assertNull( String.valueOf( props.get( "key2" ) ), props.get( "key2" ) ); } @Test public void testUpdateNoFileLeak() throws Exception { TrackingFileManager tfm = new TrackingFileManager(); Map updates = new HashMap(); updates.put( "k", "v" ); for ( int i = 0; i < 1000; i++ ) { File propFile = TestFileUtils.createTempFile( "#COMMENT\nkey1=value1\nkey2 : value2" ); assertNotNull( tfm.update( propFile, updates ) ); assertTrue( "Leaked file: " + propFile, propFile.delete() ); } } @Test public void testLockingOnCanonicalPath() throws Exception { final TrackingFileManager tfm = new TrackingFileManager(); final File propFile = TestFileUtils.createTempFile( "#COMMENT\nkey1=value1\nkey2 : value2" ); final List errors = Collections.synchronizedList( new ArrayList() ); Thread[] threads = new Thread[4]; for ( int i = 0; i < threads.length; i++ ) { String path = propFile.getParent(); for ( int j = 0; j < i; j++ ) { path += "/."; } path += "/" + propFile.getName(); final File file = new File( path ); threads[i] = new Thread() { public void run() { try { for ( int i = 0; i < 1000; i++ ) { assertNotNull( tfm.read( file ) ); } } catch ( Throwable e ) { errors.add( e ); } } }; } for ( Thread thread1 : threads ) { thread1.start(); } for ( Thread thread : threads ) { thread.join(); } assertEquals( Collections.emptyList(), errors ); } } WarnChecksumPolicyTest.java000066400000000000000000000045431245546356100344210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/java/org/eclipse/aether/internal/impl/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.impl; import static org.junit.Assert.*; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; import org.junit.Before; import org.junit.Test; public class WarnChecksumPolicyTest { private WarnChecksumPolicy policy; private ChecksumFailureException exception; @Before public void setup() { policy = new WarnChecksumPolicy( null, new TransferResource( "file:/dev/null", "file.txt", null, null ) ); exception = new ChecksumFailureException( "test" ); } @Test public void testOnTransferChecksumFailure() { assertTrue( policy.onTransferChecksumFailure( exception ) ); } @Test public void testOnChecksumMatch() { assertTrue( policy.onChecksumMatch( "SHA-1", 0 ) ); assertTrue( policy.onChecksumMatch( "SHA-1", ChecksumPolicy.KIND_UNOFFICIAL ) ); } @Test public void testOnChecksumMismatch() throws Exception { try { policy.onChecksumMismatch( "SHA-1", 0, exception ); fail( "No exception" ); } catch ( ChecksumFailureException e ) { assertSame( exception, e ); } policy.onChecksumMismatch( "SHA-1", ChecksumPolicy.KIND_UNOFFICIAL, exception ); } @Test public void testOnChecksumError() throws Exception { policy.onChecksumError( "SHA-1", 0, exception ); } @Test public void testOnNoMoreChecksums() { try { policy.onNoMoreChecksums(); fail( "No exception" ); } catch ( ChecksumFailureException e ) { assertTrue( e.getMessage().contains( "no checksums available" ) ); } } } aether-1.0.2.v20150114/aether-impl/src/test/resources/000077500000000000000000000000001245546356100220465ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/000077500000000000000000000000001245546356100263475ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big/000077500000000000000000000000001245546356100302055ustar00rootroot0000000000000010_117_4.0-SNAPSHOT.ini000066400000000000000000000024311245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:86:pom:7.13.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:349:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_117_4.1-SNAPSHOT.ini000066400000000000000000000025131245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:86:pom:7.13.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:349:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_11_4.0-SNAPSHOT.ini000066400000000000000000000003421245546356100331650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:12:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:208:pom:10.0-SNAPSHOT 1:264:pom:6.2-SNAPSHOT 1:371:pom:822-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 10_11_4.1-SNAPSHOT.ini000066400000000000000000000003421245546356100331660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:12:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:208:pom:10.0-SNAPSHOT 1:264:pom:6.2-SNAPSHOT 1:371:pom:822-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 10_121_3.0-SNAPSHOT.ini000066400000000000000000000027561245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:122:pom:3.1.1-SNAPSHOT 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:124:pom:2.2-SNAPSHOT 1:125:pom:8.1-SNAPSHOT 1:125:pom:9.1-SNAPSHOT 1:125:pom:9.5-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:126:pom:2.81-SNAPSHOT 1:126:pom:2.90-SNAPSHOT 1:126:pom:3.50-SNAPSHOT 1:127:pom:6.20-SNAPSHOT 1:127:pom:6.30-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:128:pom:2006-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:129:pom:10.1-SNAPSHOT 1:130:pom:10.1-SNAPSHOT 1:130:pom:10.2-SNAPSHOT 1:130:pom:11.1-SNAPSHOT 1:130:pom:9.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:131:pom:5.0-SNAPSHOT 1:131:pom:5.3-SNAPSHOT 1:131:pom:6.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:132:pom:7.7-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:133:pom:12.5-SNAPSHOT 1:133:pom:15.0-SNAPSHOT 1:134:pom:12.6-SNAPSHOT 1:134:pom:12.7-SNAPSHOT 1:135:pom:10.0-SNAPSHOT 1:135:pom:11.0-SNAPSHOT 1:136:pom:3.04-SNAPSHOT 1:136:pom:3.06-SNAPSHOT 1:137:pom:2.2.12-SNAPSHOT 1:138:pom:7.7.06-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:33:pom:711-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:163:pom:4.0-SNAPSHOT 10:164:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 1:32:pom:720-SNAPSHOT 10_121_3.1-SNAPSHOT.ini000066400000000000000000000034011245546356100332460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:122:pom:3.1.1-SNAPSHOT 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:124:pom:2.2-SNAPSHOT 1:125:pom:8.1-SNAPSHOT 1:125:pom:9.1-SNAPSHOT 1:125:pom:9.5-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:126:pom:2.81-SNAPSHOT 1:126:pom:2.90-SNAPSHOT 1:126:pom:3.50-SNAPSHOT 1:127:pom:6.20-SNAPSHOT 1:127:pom:6.30-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:128:pom:2006-SNAPSHOT 1:196:pom:1.2.12-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:129:pom:10.1-SNAPSHOT 1:130:pom:10.1-SNAPSHOT 1:130:pom:10.2-SNAPSHOT 1:130:pom:11.1-SNAPSHOT 1:130:pom:9.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:131:pom:5.0-SNAPSHOT 1:131:pom:5.3-SNAPSHOT 1:131:pom:6.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:132:pom:7.7-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:133:pom:12.5-SNAPSHOT 1:133:pom:15.0-SNAPSHOT 1:133:pom:15.5-SNAPSHOT 1:134:pom:12.6-SNAPSHOT 1:134:pom:12.7-SNAPSHOT 1:135:pom:10.0-SNAPSHOT 1:135:pom:11.0-SNAPSHOT 1:136:pom:3.04-SNAPSHOT 1:136:pom:3.06-SNAPSHOT 1:137:pom:2.2.12-SNAPSHOT 1:138:pom:7.7.06-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:33:pom:711-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:164:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:159:pom:2.1_03-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:311:pom:2.3.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10_12_4.0-SNAPSHOT.ini000066400000000000000000000013431245546356100331700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:35:pom:1.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:7:pom:5.8.9-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:263:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10_12_4.1-SNAPSHOT.ini000066400000000000000000000013721245546356100331730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:34:pom:1.13-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:35:pom:1.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:7:pom:5.8.9-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:263:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10_139_3.0-SNAPSHOT.ini000066400000000000000000000014451245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 10_139_3.1-SNAPSHOT.ini000066400000000000000000000013351245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:4.2.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 10_141_4.0-SNAPSHOT.ini000066400000000000000000000013421245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:142:pom:9.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:138:pom:7.7.06-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:144:pom:15.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:150:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_141_4.1-SNAPSHOT.ini000066400000000000000000000013451245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:142:pom:9.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:138:pom:7.7.06-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:144:pom:15.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:150:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_145_4.0-SNAPSHOT.ini000066400000000000000000000006641245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_145_4.1-SNAPSHOT.ini000066400000000000000000000006671245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_146_4.0-SNAPSHOT.ini000066400000000000000000000004441245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_146_4.1-SNAPSHOT.ini000066400000000000000000000004471245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_147_4.0-SNAPSHOT.ini000066400000000000000000000007621245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:144:pom:15.0-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10_147_4.1-SNAPSHOT.ini000066400000000000000000000007651245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:144:pom:15.0-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10_148_4.0-SNAPSHOT.ini000066400000000000000000000003661245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_148_4.1-SNAPSHOT.ini000066400000000000000000000003661245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_149_4.0-SNAPSHOT.ini000066400000000000000000000007751245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10_149_4.1-SNAPSHOT.ini000066400000000000000000000010001245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10_150_4.0-SNAPSHOT.ini000066400000000000000000000020561245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:49:pom:6.0.5.25-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:35:pom:1.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:151:pom:3.7.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:162:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_150_4.1-SNAPSHOT.ini000066400000000000000000000020351245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:49:pom:6.0.5.25-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:35:pom:1.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:151:pom:3.7.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:162:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_152_4.0-SNAPSHOT.ini000066400000000000000000000013501245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:155:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 10_152_4.1-SNAPSHOT.ini000066400000000000000000000014371245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:155:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 10:363:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10_155_4.0-SNAPSHOT.ini000066400000000000000000000003371245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10_155_4.1-SNAPSHOT.ini000066400000000000000000000003371245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10_156_4.0-SNAPSHOT.ini000066400000000000000000000014621245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:30:pom:0.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:157:pom:0.0.356_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:159:pom:2.1_03-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_156_4.1-SNAPSHOT.ini000066400000000000000000000014361245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:30:pom:0.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:157:pom:0.0.356_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:159:pom:2.1_03-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_160_4.0-SNAPSHOT.ini000066400000000000000000000001221245546356100332460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_160_4.1-SNAPSHOT.ini000066400000000000000000000001221245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_161_4.0-SNAPSHOT.ini000066400000000000000000000004741245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:162:pom:4.0-SNAPSHOT 10_161_4.1-SNAPSHOT.ini000066400000000000000000000004461245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:162:pom:4.1-SNAPSHOT 10_162_4.0-SNAPSHOT.ini000066400000000000000000000003421245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_162_4.1-SNAPSHOT.ini000066400000000000000000000003421245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_163_4.0-SNAPSHOT.ini000066400000000000000000000006371245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.1.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:101:pom:1.0_sap.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_163_4.1-SNAPSHOT.ini000066400000000000000000000006421245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.1.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:101:pom:1.0_sap.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_164_4.0-SNAPSHOT.ini000066400000000000000000000010461245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:165:pom:11.1-SNAPSHOT 1:165:pom:7.0-SNAPSHOT 1:165:pom:7.1-SNAPSHOT 1:165:pom:9.3-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:166:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:103:pom:6403-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_164_4.1-SNAPSHOT.ini000066400000000000000000000010461245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:165:pom:11.1-SNAPSHOT 1:165:pom:7.0-SNAPSHOT 1:165:pom:7.1-SNAPSHOT 1:165:pom:9.3-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:166:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:103:pom:6403-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_167_4.0-SNAPSHOT.ini000066400000000000000000000031041245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:168:pom:6.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:169:pom:4.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:142:pom:9.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:6.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:170:pom:10.0-SNAPSHOT 1:95:pom:7.0-SNAPSHOT 1:97:pom:3.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:11.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:171:pom:8.45-SNAPSHOT 1:171:pom:8.46-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:100:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:163:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:225:pom:4.0-SNAPSHOT 10:224:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:266:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_167_4.1-SNAPSHOT.ini000066400000000000000000000031071245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:168:pom:6.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:169:pom:4.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:142:pom:9.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:6.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:170:pom:10.0-SNAPSHOT 1:95:pom:7.0-SNAPSHOT 1:97:pom:3.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:11.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:171:pom:8.45-SNAPSHOT 1:171:pom:8.46-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:100:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:163:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:225:pom:4.1-SNAPSHOT 10:224:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:266:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_172_4.0-SNAPSHOT.ini000066400000000000000000000020241245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:164:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:39:pom:0.9.8l-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10_172_4.1-SNAPSHOT.ini000066400000000000000000000020541245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:164:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:39:pom:0.9.8l-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10_173_4.0-SNAPSHOT.ini000066400000000000000000000001501245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_173_4.1-SNAPSHOT.ini000066400000000000000000000001501245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_174_4.0-SNAPSHOT.ini000066400000000000000000000035771245546356100332740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:30:pom:0.7.0-SNAPSHOT 10:175:pom:2.0-SNAPSHOT 10:173:pom:4.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:189:pom:4.0-SNAPSHOT 10:202:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:203:pom:4.0-SNAPSHOT 10:176:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:345:pom:4.0-SNAPSHOT 10:178:pom:4.0-SNAPSHOT 10:179:pom:4.0-SNAPSHOT 10:346:pom:4.0-SNAPSHOT 10:347:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:348:pom:3.8.0-SNAPSHOT 1:195:pom:3.2-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:342:pom:1.2-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:320:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 10_174_4.1-SNAPSHOT.ini000066400000000000000000000037671245546356100332760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:30:pom:0.7.0-SNAPSHOT 10:175:pom:2.1-SNAPSHOT 10:173:pom:4.1-SNAPSHOT 10:360:pom:1.0-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:202:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:203:pom:4.1-SNAPSHOT 10:176:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:345:pom:4.1-SNAPSHOT 10:178:pom:4.1-SNAPSHOT 10:179:pom:4.1-SNAPSHOT 10:346:pom:4.1-SNAPSHOT 10:347:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:348:pom:3.8.0-SNAPSHOT 1:370:pom:6.0-SNAPSHOT 1:195:pom:3.2-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:342:pom:1.2-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:320:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 10_175_2.0-SNAPSHOT.ini000066400000000000000000000010131245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 10:176:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:178:pom:4.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:75:pom:25-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:47:pom:2.9.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 10_175_2.1-SNAPSHOT.ini000066400000000000000000000007341245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:47:pom:2.9.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10_176_4.0-SNAPSHOT.ini000066400000000000000000000003421245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_176_4.1-SNAPSHOT.ini000066400000000000000000000003421245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_177_4.0-SNAPSHOT.ini000066400000000000000000000003031245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_177_4.1-SNAPSHOT.ini000066400000000000000000000003031245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_178_4.0-SNAPSHOT.ini000066400000000000000000000005271245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:179:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_178_4.1-SNAPSHOT.ini000066400000000000000000000005271245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:179:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_179_4.0-SNAPSHOT.ini000066400000000000000000000003701245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_179_4.1-SNAPSHOT.ini000066400000000000000000000003701245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_180_3.1-SNAPSHOT.ini000066400000000000000000000012721245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:181:pom:1.0-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:183:pom:0.9-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:186:pom:4.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:187:pom:4.3-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10_180_3.2-SNAPSHOT.ini000066400000000000000000000013241245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:181:pom:1.0-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:183:pom:0.9-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:186:pom:4.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:187:pom:4.3-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10_189_4.0-SNAPSHOT.ini000066400000000000000000000020211245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:190:pom:2.0.8-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:191:pom:3.2-SNAPSHOT 1:192:pom:1.8.0.7-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:193:pom:0.8.1-SNAPSHOT 1:194:pom:2.3.0-SNAPSHOT 1:195:pom:3.2-SNAPSHOT 1:196:pom:1.2.12-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:198:pom:9.1.3-SNAPSHOT 1:199:pom:2.2-SNAPSHOT 1:187:pom:4.3-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:200:pom:3.1.12-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10_189_4.1-SNAPSHOT.ini000066400000000000000000000021031245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:123:pom:3.1.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:190:pom:2.0.8-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:191:pom:3.2-SNAPSHOT 1:192:pom:1.8.0.7-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:193:pom:0.8.1-SNAPSHOT 1:194:pom:2.3.0-SNAPSHOT 1:195:pom:3.2-SNAPSHOT 1:196:pom:1.2.12-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:198:pom:9.1.3-SNAPSHOT 1:199:pom:2.2-SNAPSHOT 1:187:pom:4.3-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:200:pom:3.1.12-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10_202_4.0-SNAPSHOT.ini000066400000000000000000000012031245546356100332440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:189:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_202_4.1-SNAPSHOT.ini000066400000000000000000000012351245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_203_4.0-SNAPSHOT.ini000066400000000000000000000011751245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:275:pom:4.0-SNAPSHOT 10:276:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:284:pom:2.0-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 10_203_4.1-SNAPSHOT.ini000066400000000000000000000011751245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:275:pom:4.1-SNAPSHOT 10:276:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:284:pom:2.1-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 10_205_4.0-SNAPSHOT.ini000066400000000000000000000044711245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:121:pom:3.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:206:pom:4.0-SNAPSHOT 10:216:pom:4.0-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:287:pom:1.1.2.1-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:87:pom:6b-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:338:pom:2.8-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:339:pom:8.0.1p5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:283:pom:1.0-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:340:pom:2.9-SNAPSHOT 1:341:pom:0.9-SNAPSHOT 1:114:pom:2.50.28_sap.1-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:342:pom:1.2-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:343:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:240:pom:720-SNAPSHOT 10:320:pom:4.0-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 10:305:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 1:151:pom:3.7.1-SNAPSHOT 1:344:pom:1.6.0-SNAPSHOT 10_205_4.1-SNAPSHOT.ini000066400000000000000000000046671245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:206:pom:4.1-SNAPSHOT 10:216:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:287:pom:1.1.2.1-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:87:pom:6b-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:338:pom:3.0-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:143:pom:6.0-SNAPSHOT 1:368:pom:4.7.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:339:pom:8.0.1p5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:369:pom:2.4.5-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:283:pom:1.0-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:340:pom:2.11-SNAPSHOT 1:341:pom:1.3-SNAPSHOT 1:114:pom:2.50.28_sap.1-SNAPSHOT 1:120:pom:1.0-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:342:pom:1.2-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:343:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:240:pom:720-SNAPSHOT 10:320:pom:4.1-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 10:305:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 1:151:pom:3.7.1-SNAPSHOT 1:344:pom:1.6.0-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 10_206_4.0-SNAPSHOT.ini000066400000000000000000000004261245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:207:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:214:pom:4.0-SNAPSHOT 10:215:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10_206_4.1-SNAPSHOT.ini000066400000000000000000000004261245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:207:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:214:pom:4.1-SNAPSHOT 10:215:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10_207_4.0-SNAPSHOT.ini000066400000000000000000000012401245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:208:pom:10.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:95:pom:7.1-SNAPSHOT 1:95:pom:8.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:209:pom:3.51-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:210:pom:4.0-SNAPSHOT 10:213:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10_207_4.1-SNAPSHOT.ini000066400000000000000000000012431245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:208:pom:10.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:95:pom:7.1-SNAPSHOT 1:95:pom:8.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:209:pom:3.51-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:210:pom:4.1-SNAPSHOT 10:213:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10_210_4.0-SNAPSHOT.ini000066400000000000000000000006001245546356100332430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_210_4.1-SNAPSHOT.ini000066400000000000000000000006001245546356100332440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_212_4.0-SNAPSHOT.ini000066400000000000000000000006371245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_212_4.1-SNAPSHOT.ini000066400000000000000000000006421245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_213_4.0-SNAPSHOT.ini000066400000000000000000000003441245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:210:pom:4.0-SNAPSHOT 10:207:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10_213_4.1-SNAPSHOT.ini000066400000000000000000000003441245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:210:pom:4.1-SNAPSHOT 10:207:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10_214_4.0-SNAPSHOT.ini000066400000000000000000000003141245546356100332510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:210:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10_214_4.1-SNAPSHOT.ini000066400000000000000000000003141245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:210:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10_215_4.0-SNAPSHOT.ini000066400000000000000000000003431245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:214:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10_215_4.1-SNAPSHOT.ini000066400000000000000000000003431245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:214:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10_216_4.0-SNAPSHOT.ini000066400000000000000000000021561245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:285:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:298:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:263:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:337:pom:4.0-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_216_4.1-SNAPSHOT.ini000066400000000000000000000021561245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:285:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:298:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:263:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:337:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_220_4.0-SNAPSHOT.ini000066400000000000000000000023451245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:221:pom:8.9-SNAPSHOT 1:222:pom:1.1.1-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:223:pom:7.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:224:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:229:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:262:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_220_4.1-SNAPSHOT.ini000066400000000000000000000023751245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:221:pom:8.9-SNAPSHOT 1:222:pom:1.1.1-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:223:pom:7.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:224:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:229:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:262:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_224_4.0-SNAPSHOT.ini000066400000000000000000000007321245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:221:pom:8.9-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:223:pom:7.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:225:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_224_4.1-SNAPSHOT.ini000066400000000000000000000007321245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:221:pom:8.9-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:223:pom:7.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:225:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_225_4.0-SNAPSHOT.ini000066400000000000000000000010731245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:163:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_225_4.1-SNAPSHOT.ini000066400000000000000000000010731245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:163:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_226_4.0-SNAPSHOT.ini000066400000000000000000000014651245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:227:pom:7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_226_4.1-SNAPSHOT.ini000066400000000000000000000015151245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:227:pom:7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_228_1.0-SNAPSHOT.ini000066400000000000000000000002021245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:139:pom:3.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_229_4.0-SNAPSHOT.ini000066400000000000000000000013251245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:230:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_229_4.1-SNAPSHOT.ini000066400000000000000000000013251245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:230:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_22_4.0-SNAPSHOT.ini000066400000000000000000000010241245546356100331650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10_22_4.1-SNAPSHOT.ini000066400000000000000000000010541245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10_230_4.0-SNAPSHOT.ini000066400000000000000000000017041245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:227:pom:7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:216:pom:4.0-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:337:pom:4.0-SNAPSHOT 10_230_4.1-SNAPSHOT.ini000066400000000000000000000017041245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:227:pom:7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:216:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:337:pom:4.1-SNAPSHOT 10_231_4.0-SNAPSHOT.ini000066400000000000000000000006031245546356100332510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_231_4.1-SNAPSHOT.ini000066400000000000000000000006031245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_232_4.0-SNAPSHOT.ini000066400000000000000000000012121245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:263:pom:4.0-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_232_4.1-SNAPSHOT.ini000066400000000000000000000012121245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:263:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_233_4.0-SNAPSHOT.ini000066400000000000000000000011611245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:79:pom:0.7.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:234:pom:1.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10_233_4.1-SNAPSHOT.ini000066400000000000000000000011611245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:79:pom:0.7.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:234:pom:1.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10_235_4.0-SNAPSHOT.ini000066400000000000000000000015071245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:155:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:150:pom:4.0-SNAPSHOT 10:236:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_235_4.1-SNAPSHOT.ini000066400000000000000000000014641245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:155:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:150:pom:4.1-SNAPSHOT 10:236:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_236_4.0-SNAPSHOT.ini000066400000000000000000000007111245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:237:pom:4.0-SNAPSHOT 10:150:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:162:pom:4.0-SNAPSHOT 10_236_4.1-SNAPSHOT.ini000066400000000000000000000007111245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:237:pom:4.1-SNAPSHOT 10:150:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:162:pom:4.1-SNAPSHOT 10_237_4.0-SNAPSHOT.ini000066400000000000000000000006331245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_237_4.1-SNAPSHOT.ini000066400000000000000000000006361245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_238_4.0-SNAPSHOT.ini000066400000000000000000000016211245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:240:pom:720-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:241:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:155:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:150:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:298:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:317:pom:4.0-SNAPSHOT 10_238_4.1-SNAPSHOT.ini000066400000000000000000000016231245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:240:pom:720-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:241:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:155:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:150:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:298:pom:4.1-SNAPSHOT 10:363:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:317:pom:4.1-SNAPSHOT 10_241_4.0-SNAPSHOT.ini000066400000000000000000000006051245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10_241_4.1-SNAPSHOT.ini000066400000000000000000000006051245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10_242_4.0-SNAPSHOT.ini000066400000000000000000000013221245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:150:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:262:pom:4.0-SNAPSHOT 10_242_4.1-SNAPSHOT.ini000066400000000000000000000012741245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:150:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:262:pom:4.1-SNAPSHOT 10_243_4.0-SNAPSHOT.ini000066400000000000000000000012641245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:244:pom:1.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:245:pom:1.0.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_243_4.1-SNAPSHOT.ini000066400000000000000000000014301245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:358:pom:1.1.2-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:244:pom:1.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:245:pom:1.0.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:363:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:364:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_246_4.0-SNAPSHOT.ini000066400000000000000000000005241245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_246_4.1-SNAPSHOT.ini000066400000000000000000000005261245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_247_4.0-SNAPSHOT.ini000066400000000000000000000023571245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:244:pom:1.2-SNAPSHOT 1:248:pom:5.5-SNAPSHOT 1:249:pom:9.2.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:200:pom:5.1-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_247_4.1-SNAPSHOT.ini000066400000000000000000000024111245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:244:pom:1.2-SNAPSHOT 1:248:pom:5.5-SNAPSHOT 1:249:pom:9.2.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:200:pom:5.1-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_251_4.0-SNAPSHOT.ini000066400000000000000000000010321245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:252:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_251_4.1-SNAPSHOT.ini000066400000000000000000000011141245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:358:pom:1.1.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:252:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_252_4.0-SNAPSHOT.ini000066400000000000000000000012071245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:253:pom:1.3.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:254:pom:4.0-SNAPSHOT 10:255:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_252_4.1-SNAPSHOT.ini000066400000000000000000000012371245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:253:pom:1.3.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:361:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:254:pom:4.1-SNAPSHOT 10:255:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_254_4.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_254_4.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_255_4.0-SNAPSHOT.ini000066400000000000000000000002271245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:181:pom:1.0-SNAPSHOT 1:256:pom:3.2-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_255_4.1-SNAPSHOT.ini000066400000000000000000000002271245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:181:pom:1.0-SNAPSHOT 1:256:pom:3.2-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_257_4.0-SNAPSHOT.ini000066400000000000000000000013171245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:258:pom:4.0-SNAPSHOT 1:259:pom:2.0-SNAPSHOT 1:260:pom:2.2.5-SNAPSHOT 10_257_4.1-SNAPSHOT.ini000066400000000000000000000013211245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:258:pom:4.1-SNAPSHOT 1:259:pom:2.0-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 10_258_4.0-SNAPSHOT.ini000066400000000000000000000000761245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:212:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10_258_4.1-SNAPSHOT.ini000066400000000000000000000000761245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:212:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10_261_4.0-SNAPSHOT.ini000066400000000000000000000011051245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10_261_4.1-SNAPSHOT.ini000066400000000000000000000011051245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10_262_4.0-SNAPSHOT.ini000066400000000000000000000020131245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:42:pom:4.0-SNAPSHOT 10:263:pom:4.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:7:pom:5.8.9-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:264:pom:6.2-SNAPSHOT 1:166:pom:720-SNAPSHOT 10:265:pom:4.0-SNAPSHOT 1:267:pom:3.0-SNAPSHOT 10:268:pom:4.0-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:270:pom:1.6.5-SNAPSHOT 10:225:pom:4.0-SNAPSHOT 10:271:pom:4.0-SNAPSHOT 10:297:pom:4.0-SNAPSHOT 10_262_4.1-SNAPSHOT.ini000066400000000000000000000020431245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:42:pom:4.1-SNAPSHOT 10:263:pom:4.1-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:7:pom:5.8.9-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:264:pom:6.2-SNAPSHOT 1:166:pom:720-SNAPSHOT 10:265:pom:4.1-SNAPSHOT 1:267:pom:3.0-SNAPSHOT 10:268:pom:4.1-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:270:pom:1.6.5-SNAPSHOT 10:225:pom:4.1-SNAPSHOT 10:271:pom:4.1-SNAPSHOT 10:297:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10_263_4.0-SNAPSHOT.ini000066400000000000000000000006271245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_263_4.1-SNAPSHOT.ini000066400000000000000000000006271245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_265_4.0-SNAPSHOT.ini000066400000000000000000000010041245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:165:pom:7.0-SNAPSHOT 1:165:pom:7.1-SNAPSHOT 1:165:pom:9.3-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:114:pom:2.50.16.busObj.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:266:pom:4.0-SNAPSHOT 10_265_4.1-SNAPSHOT.ini000066400000000000000000000010041245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:165:pom:7.0-SNAPSHOT 1:165:pom:7.1-SNAPSHOT 1:165:pom:9.3-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:114:pom:2.50.16.busObj.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:266:pom:4.1-SNAPSHOT 10_266_4.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_266_4.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_268_4.0-SNAPSHOT.ini000066400000000000000000000006031245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:269:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_268_4.1-SNAPSHOT.ini000066400000000000000000000006031245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:269:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_269_4.0-SNAPSHOT.ini000066400000000000000000000005561245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_269_4.1-SNAPSHOT.ini000066400000000000000000000005561245546356100332740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_271_4.0-SNAPSHOT.ini000066400000000000000000000026761245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:174:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:203:pom:4.0-SNAPSHOT 10:272:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:285:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:286:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:290:pom:8.0.2.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:189:pom:4.0-SNAPSHOT 10:202:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10:291:pom:4.0-SNAPSHOT 10:292:pom:4.0-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:296:pom:1.0-SNAPSHOT 10_271_4.1-SNAPSHOT.ini000066400000000000000000000030041245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:174:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:203:pom:4.1-SNAPSHOT 10:272:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:285:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:286:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:290:pom:8.0.2.0-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:202:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10:291:pom:4.1-SNAPSHOT 10:292:pom:4.1-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:296:pom:1.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10_272_4.0-SNAPSHOT.ini000066400000000000000000000017161245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:273:pom:1.0.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:274:pom:1.0.0-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:275:pom:4.0-SNAPSHOT 10:203:pom:4.0-SNAPSHOT 10:276:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:216:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_272_4.1-SNAPSHOT.ini000066400000000000000000000017201245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:273:pom:1.0.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:274:pom:1.0.0-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:275:pom:4.1-SNAPSHOT 10:203:pom:4.1-SNAPSHOT 10:276:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:216:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_275_4.0-SNAPSHOT.ini000066400000000000000000000006221245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:276:pom:4.0-SNAPSHOT 10:216:pom:4.0-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:284:pom:2.0-SNAPSHOT 10_275_4.1-SNAPSHOT.ini000066400000000000000000000007021245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:276:pom:4.1-SNAPSHOT 10:216:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:284:pom:2.1-SNAPSHOT 10_276_4.0-SNAPSHOT.ini000066400000000000000000000013241245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:175:pom:2.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:175:pom:2.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:277:pom:4.0-SNAPSHOT 10:280:pom:4.0-SNAPSHOT 10:281:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10_276_4.1-SNAPSHOT.ini000066400000000000000000000011641245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:175:pom:2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10_277_4.0-SNAPSHOT.ini000066400000000000000000000006101245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:278:pom:1.8.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:279:pom:4.0-SNAPSHOT 10:280:pom:4.0-SNAPSHOT 10:281:pom:4.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10_279_4.0-SNAPSHOT.ini000066400000000000000000000001521245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_280_4.0-SNAPSHOT.ini000066400000000000000000000007441245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 10:279:pom:4.0-SNAPSHOT 10:281:pom:4.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:278:pom:1.8.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:282:pom:2.0-SNAPSHOT 1:283:pom:1.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:279:pom:4.0-SNAPSHOT 10:277:pom:4.0-SNAPSHOT 10:281:pom:4.0-SNAPSHOT 10_281_4.0-SNAPSHOT.ini000066400000000000000000000004311245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 10:279:pom:4.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:279:pom:4.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 10_284_2.0-SNAPSHOT.ini000066400000000000000000000006351245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:204:pom:1.6.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.18-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10_284_2.1-SNAPSHOT.ini000066400000000000000000000003331245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10_285_4.0-SNAPSHOT.ini000066400000000000000000000007351245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10_285_4.1-SNAPSHOT.ini000066400000000000000000000007071245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_286_4.0-SNAPSHOT.ini000066400000000000000000000020501245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:287:pom:1.1.2.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:288:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 10_286_4.1-SNAPSHOT.ini000066400000000000000000000020501245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:287:pom:1.1.2.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:288:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 10_288_4.0-SNAPSHOT.ini000066400000000000000000000011021245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10_288_4.1-SNAPSHOT.ini000066400000000000000000000011021245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10_291_4.0-SNAPSHOT.ini000066400000000000000000000031261245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:181:pom:1.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10_291_4.1-SNAPSHOT.ini000066400000000000000000000033211245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:242:pom:4.1-SNAPSHOT 1:181:pom:1.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:365:pom:3.4.1-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 1:365:pom:3.4.1-SNAPSHOT 10:366:pom:4.1-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 10_292_4.0-SNAPSHOT.ini000066400000000000000000000021261245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:182:pom:3.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:293:pom:0.2.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:294:pom:4.0-SNAPSHOT 10:295:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 10_292_4.1-SNAPSHOT.ini000066400000000000000000000021541245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:182:pom:3.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:197:pom:5.1.3-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.4.C-SNAPSHOT 1:293:pom:0.2.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:294:pom:4.1-SNAPSHOT 10:295:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:32:pom:720-SNAPSHOT 10_294_4.0-SNAPSHOT.ini000066400000000000000000000011361245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:295:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 10_294_4.1-SNAPSHOT.ini000066400000000000000000000011731245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:295:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 10_295_4.0-SNAPSHOT.ini000066400000000000000000000004531245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_295_4.1-SNAPSHOT.ini000066400000000000000000000004531245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_297_4.0-SNAPSHOT.ini000066400000000000000000000014051245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 10:220:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:298:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 1:299:pom:7.20-SNAPSHOT 1:300:pom:7.1.8-SNAPSHOT 10:301:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:306:pom:4.0-SNAPSHOT 10:307:pom:4.0-SNAPSHOT 10:203:pom:4.0-SNAPSHOT 10:316:pom:4.0-SNAPSHOT 10_297_4.1-SNAPSHOT.ini000066400000000000000000000013541245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:298:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 1:299:pom:7.20-SNAPSHOT 10:301:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:306:pom:4.1-SNAPSHOT 10:307:pom:4.1-SNAPSHOT 10:203:pom:4.1-SNAPSHOT 10:316:pom:4.1-SNAPSHOT 10_298_4.0-SNAPSHOT.ini000066400000000000000000000014011245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:288:pom:4.0-SNAPSHOT 10_298_4.1-SNAPSHOT.ini000066400000000000000000000014031245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:288:pom:4.1-SNAPSHOT 10_301_4.0-SNAPSHOT.ini000066400000000000000000000021121245546356100332440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:302:pom:1.015-SNAPSHOT 1:73:pom:2.3.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:181:pom:1.0-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 10:303:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:189:pom:4.0-SNAPSHOT 10:202:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:305:pom:4.0-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_301_4.1-SNAPSHOT.ini000066400000000000000000000021721245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:302:pom:1.015-SNAPSHOT 1:73:pom:2.3.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:153:pom:1.1.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:61:pom:1.2.12-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:181:pom:1.0-SNAPSHOT 1:182:pom:3.2-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 10:303:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:202:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:305:pom:4.1-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_303_4.0-SNAPSHOT.ini000066400000000000000000000001231245546356100332460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:304:pom:9.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_303_4.1-SNAPSHOT.ini000066400000000000000000000001231245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:304:pom:9.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_305_4.0-SNAPSHOT.ini000066400000000000000000000017171245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.4-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:287:pom:1.3-SNAPSHOT 1:222:pom:1.1.1-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_305_4.1-SNAPSHOT.ini000066400000000000000000000017511245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.4-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:287:pom:1.3-SNAPSHOT 1:222:pom:1.1.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_306_4.0-SNAPSHOT.ini000066400000000000000000000015121245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:230:pom:4.0-SNAPSHOT 10:226:pom:4.0-SNAPSHOT 10:231:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:285:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_306_4.1-SNAPSHOT.ini000066400000000000000000000015121245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:230:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:285:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_307_4.0-SNAPSHOT.ini000066400000000000000000000027151245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:308:pom:1.8-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:309:pom:1.15.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:310:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:311:pom:2.3.0-SNAPSHOT 1:312:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:313:pom:2.2-SNAPSHOT 1:314:pom:6.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 10:305:pom:4.0-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10_307_4.1-SNAPSHOT.ini000066400000000000000000000027451245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:308:pom:1.8-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:309:pom:1.15.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:310:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:188:pom:1.9-SNAPSHOT 1:311:pom:2.3.0-SNAPSHOT 1:312:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:313:pom:2.2-SNAPSHOT 1:314:pom:6.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 10:305:pom:4.1-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10_315_4.0-SNAPSHOT.ini000066400000000000000000000014671245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:202:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:203:pom:4.0-SNAPSHOT 10_315_4.1-SNAPSHOT.ini000066400000000000000000000015761245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:211:pom:1.0-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:202:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:203:pom:4.1-SNAPSHOT 1:367:pom:8.0-SNAPSHOT 10_316_4.0-SNAPSHOT.ini000066400000000000000000000005771245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:232:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10_316_4.1-SNAPSHOT.ini000066400000000000000000000005771245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_317_4.0-SNAPSHOT.ini000066400000000000000000000007211245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:321:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:118:pom:10.5.3.0-SNAPSHOT 10_317_4.1-SNAPSHOT.ini000066400000000000000000000007231245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:321:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:118:pom:10.5.3.0-SNAPSHOT 10_318_4.0-SNAPSHOT.ini000066400000000000000000000007441245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10_318_4.1-SNAPSHOT.ini000066400000000000000000000007721245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10_319_4.0-SNAPSHOT.ini000066400000000000000000000006671245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:320:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10_319_4.1-SNAPSHOT.ini000066400000000000000000000006671245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:173:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:320:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10_320_4.0-SNAPSHOT.ini000066400000000000000000000006411245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:173:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_320_4.1-SNAPSHOT.ini000066400000000000000000000006411245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:173:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 1:201:pom:3.5.2-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10_321_4.0-SNAPSHOT.ini000066400000000000000000000002401245546356100332460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:15:pom:1.36.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:322:pom:4.0-SNAPSHOT 10_321_4.1-SNAPSHOT.ini000066400000000000000000000002401245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:15:pom:1.36.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:322:pom:4.1-SNAPSHOT 10_322_4.0-SNAPSHOT.ini000066400000000000000000000013221245546356100332510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:82:pom:9.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:85:pom:6.4-SNAPSHOT 1:85:pom:9.1-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:26:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:324:pom:5.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:32:pom:720-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:225:pom:4.0-SNAPSHOT 10:325:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:335:pom:4.0-SNAPSHOT 10:336:pom:4.0-SNAPSHOT 10_322_4.1-SNAPSHOT.ini000066400000000000000000000013221245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:82:pom:9.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:85:pom:6.4-SNAPSHOT 1:85:pom:9.1-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:26:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:324:pom:5.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:32:pom:720-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:225:pom:4.1-SNAPSHOT 10:325:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:335:pom:4.1-SNAPSHOT 10:336:pom:4.1-SNAPSHOT 10_325_4.0-SNAPSHOT.ini000066400000000000000000000014061245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:326:pom:0.9.7-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:240:pom:720-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:207:pom:4.0-SNAPSHOT 10:327:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:329:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:331:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:332:pom:4.0-SNAPSHOT 10:330:pom:4.0-SNAPSHOT 10:333:pom:4.0-SNAPSHOT 10:334:pom:4.0-SNAPSHOT 10_325_4.1-SNAPSHOT.ini000066400000000000000000000014061245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:326:pom:0.9.7-SNAPSHOT 1:24:pom:1.2.10-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:240:pom:720-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:207:pom:4.1-SNAPSHOT 10:327:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:329:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:331:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:332:pom:4.1-SNAPSHOT 10:330:pom:4.1-SNAPSHOT 10:333:pom:4.1-SNAPSHOT 10:334:pom:4.1-SNAPSHOT 10_327_4.0-SNAPSHOT.ini000066400000000000000000000007601245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:328:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10_327_4.1-SNAPSHOT.ini000066400000000000000000000007601245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:328:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10_328_4.0-SNAPSHOT.ini000066400000000000000000000023361245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:291:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:288:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:286:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10_328_4.1-SNAPSHOT.ini000066400000000000000000000023401245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:291:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:288:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:286:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10_329_4.0-SNAPSHOT.ini000066400000000000000000000003751245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:212:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:330:pom:4.0-SNAPSHOT 10_329_4.1-SNAPSHOT.ini000066400000000000000000000003751245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:24:pom:1.2.10-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:212:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:330:pom:4.1-SNAPSHOT 10_330_4.0-SNAPSHOT.ini000066400000000000000000000001021245546356100332430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10_330_4.1-SNAPSHOT.ini000066400000000000000000000001021245546356100332440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10_331_4.0-SNAPSHOT.ini000066400000000000000000000010651245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:288:pom:4.0-SNAPSHOT 10_331_4.1-SNAPSHOT.ini000066400000000000000000000010651245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:288:pom:4.1-SNAPSHOT 10_332_4.0-SNAPSHOT.ini000066400000000000000000000002721245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:238:pom:4.0-SNAPSHOT 10:331:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10:330:pom:4.0-SNAPSHOT 10:333:pom:4.0-SNAPSHOT 10:334:pom:4.0-SNAPSHOT 10_332_4.1-SNAPSHOT.ini000066400000000000000000000002721245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:238:pom:4.1-SNAPSHOT 10:331:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10:330:pom:4.1-SNAPSHOT 10:333:pom:4.1-SNAPSHOT 10:334:pom:4.1-SNAPSHOT 10_333_4.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_333_4.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10_334_4.0-SNAPSHOT.ini000066400000000000000000000010651245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:238:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:331:pom:4.0-SNAPSHOT 10:288:pom:4.0-SNAPSHOT 10:286:pom:4.0-SNAPSHOT 10_334_4.1-SNAPSHOT.ini000066400000000000000000000010651245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:118:pom:10.2.2.0-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:239:pom:3.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:154:pom:3.3-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:331:pom:4.1-SNAPSHOT 10:288:pom:4.1-SNAPSHOT 10:286:pom:4.1-SNAPSHOT 10_335_4.0-SNAPSHOT.ini000066400000000000000000000006021245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 10_335_4.1-SNAPSHOT.ini000066400000000000000000000006021245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 1:16:pom:1.8.0-SNAPSHOT 10_336_4.0-SNAPSHOT.ini000066400000000000000000000005731245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:326:pom:0.9.7-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:26:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:102:pom:1.busObj.1-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:322:pom:4.0-SNAPSHOT 10_336_4.1-SNAPSHOT.ini000066400000000000000000000005731245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:326:pom:0.9.7-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:26:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:94:pom:4.0-SNAPSHOT 1:323:pom:11.0-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:102:pom:1.busObj.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:322:pom:4.1-SNAPSHOT 10_337_4.0-SNAPSHOT.ini000066400000000000000000000000741245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_337_4.1-SNAPSHOT.ini000066400000000000000000000000741245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_343_4.0-SNAPSHOT.ini000066400000000000000000000000761245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:212:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10_343_4.1-SNAPSHOT.ini000066400000000000000000000000761245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:212:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10_345_4.0-SNAPSHOT.ini000066400000000000000000000006671245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:278:pom:1.8.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:176:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:179:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:175:pom:2.0-SNAPSHOT 10_345_4.1-SNAPSHOT.ini000066400000000000000000000006671245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:3.8.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:278:pom:1.8.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:176:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:179:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:175:pom:2.1-SNAPSHOT 10_346_4.0-SNAPSHOT.ini000066400000000000000000000004771245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:178:pom:4.0-SNAPSHOT 10:179:pom:4.0-SNAPSHOT 10:347:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_346_4.1-SNAPSHOT.ini000066400000000000000000000004771245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:178:pom:4.1-SNAPSHOT 10:179:pom:4.1-SNAPSHOT 10:347:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_347_4.0-SNAPSHOT.ini000066400000000000000000000005241245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:177:pom:4.0-SNAPSHOT 10:178:pom:4.0-SNAPSHOT 10:179:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10_347_4.1-SNAPSHOT.ini000066400000000000000000000005241245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:177:pom:4.1-SNAPSHOT 10:178:pom:4.1-SNAPSHOT 10:179:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10_349_4.0-SNAPSHOT.ini000066400000000000000000000017531245546356100332720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:338:pom:2.8-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:350:pom:4.0-SNAPSHOT 10:205:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:261:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_349_4.1-SNAPSHOT.ini000066400000000000000000000020031245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:338:pom:3.0-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:350:pom:4.1-SNAPSHOT 10:205:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:261:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_350_4.0-SNAPSHOT.ini000066400000000000000000000011401245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:339:pom:8.0.1p5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:172:pom:4.0-SNAPSHOT 10:349:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 10_350_4.1-SNAPSHOT.ini000066400000000000000000000012201245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:339:pom:8.0.1p5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:172:pom:4.1-SNAPSHOT 10:349:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 10_351_4.0-SNAPSHOT.ini000066400000000000000000000020701245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:352:pom:6.1-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:353:pom:1.2.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:248:pom:5.5-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:354:pom:1.6.2-SNAPSHOT 1:355:pom:3.0.5-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:267:pom:3.0-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:344:pom:1.6.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 10:173:pom:4.0-SNAPSHOT 10:189:pom:4.0-SNAPSHOT 10:202:pom:4.0-SNAPSHOT 10:174:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:331:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10_351_4.1-SNAPSHOT.ini000066400000000000000000000022321245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:352:pom:6.1-SNAPSHOT 1:358:pom:1.1.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:353:pom:1.2.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:248:pom:5.5-SNAPSHOT 1:50:pom:3.4.1-SNAPSHOT 1:354:pom:1.6.2-SNAPSHOT 1:355:pom:3.0.5-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:267:pom:3.0-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 1:344:pom:1.6.0-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:75:pom:26-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:289:pom:2.2.0-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 10:173:pom:4.1-SNAPSHOT 10:189:pom:4.1-SNAPSHOT 10:202:pom:4.1-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:331:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:363:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10_356_4.0-SNAPSHOT.ini000066400000000000000000000001301245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_356_4.1-SNAPSHOT.ini000066400000000000000000000001301245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_357_4.1-SNAPSHOT.ini000066400000000000000000000014751245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:4:pom:2.5.4-SNAPSHOT 1:3:pom:1.28-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:4.2.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:33:pom:711-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10_359_4.1-SNAPSHOT.ini000066400000000000000000000012351245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:119:pom:1.0-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:357:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:163:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 1:32:pom:720-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:51:pom:1.6.2-SNAPSHOT 1:151:pom:3.7.1-SNAPSHOT 10_360_1.0-SNAPSHOT.ini000066400000000000000000000003451245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:184:pom:20080807-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:30:pom:0.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10_361_4.1-SNAPSHOT.ini000066400000000000000000000026601245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:248:pom:5.5-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:222:pom:beta8-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:72:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:224:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:362:pom:4.1-SNAPSHOT 10:252:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:216:pom:4.1-SNAPSHOT 10:230:pom:4.1-SNAPSHOT 10:220:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10_362_4.1-SNAPSHOT.ini000066400000000000000000000013101245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:245:pom:1.0.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:254:pom:4.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:245:pom:1.0.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:250:pom:1.0_sap.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:361:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10_363_4.1-SNAPSHOT.ini000066400000000000000000000003421245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:358:pom:1.1.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:40:pom:6.1-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10_364_4.1-SNAPSHOT.ini000066400000000000000000000006021245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:152:pom:4.1-SNAPSHOT 1:358:pom:1.1.2-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 10_366_4.1-SNAPSHOT.ini000066400000000000000000000016301245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:46:pom:1.0.2-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:185:pom:1.0_sap.2-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:218:pom:2.2.1-SNAPSHOT 1:219:pom:2.3.4-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:316:pom:4.1-SNAPSHOT 10:226:pom:4.1-SNAPSHOT 10:231:pom:4.1-SNAPSHOT 10:232:pom:4.1-SNAPSHOT 10:285:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:238:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:228:pom:1.0-SNAPSHOT 10_42_4.0-SNAPSHOT.ini000066400000000000000000000004441245546356100331740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10_42_4.1-SNAPSHOT.ini000066400000000000000000000004441245546356100331750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10_43_4.0-SNAPSHOT.ini000066400000000000000000000014731245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:49:pom:6.0.5.25-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:52:pom:1.8-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:54:pom:0.1.36-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:60:pom:0.2.9-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:162:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:356:pom:4.0-SNAPSHOT 10_43_4.1-SNAPSHOT.ini000066400000000000000000000014771245546356100332050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:48:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:49:pom:6.0.5.25-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:53:pom:2.3.0.677-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:54:pom:0.1.36-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:56:pom:1.2-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:59:pom:1.0.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:60:pom:0.2.9-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:162:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:356:pom:4.1-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 10_62_4.0-SNAPSHOT.ini000066400000000000000000000020601245546356100331720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:11.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:72:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:242:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 10:155:pom:4.0-SNAPSHOT 10:121:pom:3.0-SNAPSHOT 10_62_4.1-SNAPSHOT.ini000066400000000000000000000022521245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:358:pom:1.1.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:260:pom:2.3.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:69:pom:11.1.0-SNAPSHOT 1:69:pom:8.1.7-SNAPSHOT 1:69:pom:9.0.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:72:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:242:pom:4.1-SNAPSHOT 10:364:pom:4.1-SNAPSHOT 10:363:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 10:155:pom:4.1-SNAPSHOT 10:121:pom:3.1-SNAPSHOT 10:359:pom:4.1-SNAPSHOT 10_72_4.0-SNAPSHOT.ini000066400000000000000000000030611245546356100331750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:55:pom:4.4-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:79:pom:0.7.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:80:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:251:pom:4.0-SNAPSHOT 10:180:pom:3.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:156:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:233:pom:4.0-SNAPSHOT 10:257:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:160:pom:4.0-SNAPSHOT 10:43:pom:4.0-SNAPSHOT 10:161:pom:4.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10:318:pom:4.0-SNAPSHOT 10:320:pom:4.0-SNAPSHOT 10:319:pom:4.0-SNAPSHOT 10_72_4.1-SNAPSHOT.ini000066400000000000000000000032651245546356100332040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:63:pom:1.1-SNAPSHOT 1:63:pom:1.3-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:73:pom:2.4.1-SNAPSHOT 1:64:pom:1.3-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:65:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:47:pom:2.6.2-SNAPSHOT 1:76:pom:1.0-SNAPSHOT 1:66:pom:0.11-SNAPSHOT 1:67:pom:1.6.5-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:158:pom:3.5-SNAPSHOT 1:52:pom:2.5-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:68:pom:3.8.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:77:pom:1.45-SNAPSHOT 1:217:pom:1.0_sap.1-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:78:pom:2.6-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:69:pom:10.1.0-SNAPSHOT 1:79:pom:0.7.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:70:pom:9.0-SNAPSHOT 1:29:pom:3.0.5-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:61:pom:1.1-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:80:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:251:pom:4.1-SNAPSHOT 10:180:pom:3.2-SNAPSHOT 10:174:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:156:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:233:pom:4.1-SNAPSHOT 10:257:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:160:pom:4.1-SNAPSHOT 10:43:pom:4.1-SNAPSHOT 10:161:pom:4.1-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 10:318:pom:4.1-SNAPSHOT 10:320:pom:4.1-SNAPSHOT 10:319:pom:4.1-SNAPSHOT 10_80_4.0-SNAPSHOT.ini000066400000000000000000000006641245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:81:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:235:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10_80_4.1-SNAPSHOT.ini000066400000000000000000000006671245546356100332060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:81:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:235:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10_81_4.0-SNAPSHOT.ini000066400000000000000000000034741245546356100332050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:82:pom:9.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:85:pom:6.4-SNAPSHOT 1:85:pom:9.53.busObj.CR.1-SNAPSHOT 1:86:pom:7.13.2-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:87:pom:6b-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1-SNAPSHOT 1:88:pom:3.5-SNAPSHOT 1:91:pom:1.5-SNAPSHOT 1:92:pom:1.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:94:pom:6.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:95:pom:7.0-SNAPSHOT 1:95:pom:7.1-SNAPSHOT 1:95:pom:8.0-SNAPSHOT 1:96:pom:8.0-SNAPSHOT 1:97:pom:3.0-SNAPSHOT 1:98:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:99:pom:1.0-SNAPSHOT 1:100:pom:4.1-SNAPSHOT 1:101:pom:1.0_sap.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:102:pom:1.busObj.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:106:pom:3.5.5-SNAPSHOT 1:107:pom:1.0-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:110:pom:4.0-SNAPSHOT 1:111:pom:1.0-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 1:113:pom:2.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:114:pom:2.50.16.busObj.1-SNAPSHOT 1:114:pom:2.50.28_sap.1-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.0-SNAPSHOT 10:117:pom:4.0-SNAPSHOT 10:139:pom:3.0-SNAPSHOT 10:62:pom:4.0-SNAPSHOT 10:163:pom:4.0-SNAPSHOT 10:246:pom:4.0-SNAPSHOT 10:167:pom:4.0-SNAPSHOT 10:351:pom:4.0-SNAPSHOT 10:247:pom:4.0-SNAPSHOT 10:225:pom:4.0-SNAPSHOT 10:207:pom:4.0-SNAPSHOT 10:243:pom:4.0-SNAPSHOT 10:252:pom:4.0-SNAPSHOT 10:266:pom:4.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:141:pom:4.0-SNAPSHOT 10:145:pom:4.0-SNAPSHOT 10:152:pom:4.0-SNAPSHOT 10:315:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 10:146:pom:4.0-SNAPSHOT 10:147:pom:4.0-SNAPSHOT 10:148:pom:4.0-SNAPSHOT 10:149:pom:4.0-SNAPSHOT 10:162:pom:4.0-SNAPSHOT 10_81_4.1-SNAPSHOT.ini000066400000000000000000000034771245546356100332110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:82:pom:9.0-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:44:pom:1.3-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:83:pom:1.10.0-SNAPSHOT 1:8:pom:2.1.0-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:85:pom:6.4-SNAPSHOT 1:85:pom:9.53.busObj.CR.1-SNAPSHOT 1:86:pom:7.13.2-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:87:pom:6b-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:88:pom:3.5-SNAPSHOT 1:91:pom:1.5-SNAPSHOT 1:92:pom:1.0-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:93:pom:10.0-SNAPSHOT 1:94:pom:6.0-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:95:pom:7.0-SNAPSHOT 1:95:pom:7.1-SNAPSHOT 1:95:pom:8.0-SNAPSHOT 1:96:pom:8.0-SNAPSHOT 1:97:pom:3.0-SNAPSHOT 1:98:pom:6.0-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:99:pom:1.0-SNAPSHOT 1:100:pom:4.1-SNAPSHOT 1:101:pom:1.0_sap.1-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:102:pom:1.busObj.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:103:pom:6403-SNAPSHOT 1:104:pom:70-SNAPSHOT 1:105:pom:70-SNAPSHOT 1:106:pom:3.5.5-SNAPSHOT 1:107:pom:1.0-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:110:pom:4.0-SNAPSHOT 1:111:pom:1.0-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 1:113:pom:2.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:114:pom:2.50.16.busObj.1-SNAPSHOT 1:114:pom:2.50.28_sap.1-SNAPSHOT 1:116:pom:4.0-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:117:pom:4.1-SNAPSHOT 10:139:pom:3.1-SNAPSHOT 10:62:pom:4.1-SNAPSHOT 10:163:pom:4.1-SNAPSHOT 10:246:pom:4.1-SNAPSHOT 10:167:pom:4.1-SNAPSHOT 10:351:pom:4.1-SNAPSHOT 10:247:pom:4.1-SNAPSHOT 10:225:pom:4.1-SNAPSHOT 10:207:pom:4.1-SNAPSHOT 10:243:pom:4.1-SNAPSHOT 10:252:pom:4.1-SNAPSHOT 10:266:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 10:141:pom:4.1-SNAPSHOT 10:145:pom:4.1-SNAPSHOT 10:152:pom:4.1-SNAPSHOT 10:315:pom:4.1-SNAPSHOT 10:12:pom:4.1-SNAPSHOT 10:146:pom:4.1-SNAPSHOT 10:147:pom:4.1-SNAPSHOT 10:148:pom:4.1-SNAPSHOT 10:149:pom:4.1-SNAPSHOT 10:162:pom:4.1-SNAPSHOT 10_90_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_100_4.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_101_1.0_sap.1-SNAPSHOT.ini000066400000000000000000000000171245546356100341630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_102_1.busObj.1-SNAPSHOT.ini000066400000000000000000000000171245546356100344060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_103_6403-SNAPSHOT.ini000066400000000000000000000000171245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_104_70-SNAPSHOT.ini000066400000000000000000000001521245546356100331140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_105_70-SNAPSHOT.ini000066400000000000000000000001241245546356100331140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_106_3.5.5-SNAPSHOT.ini000066400000000000000000000000171245546356100333400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_107_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_108_4.0-SNAPSHOT.ini000066400000000000000000000003121245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:109:pom:6.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_109_6.0.5-SNAPSHOT.ini000066400000000000000000000001771245546356100333500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_110_4.0-SNAPSHOT.ini000066400000000000000000000002331245546356100331640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:27:pom:6.0-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_111_1.0-SNAPSHOT.ini000066400000000000000000000001011245546356100331540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:18:pom:5.1.1.41-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 1_112_1.0.30-SNAPSHOT.ini000066400000000000000000000002621245546356100334060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_113_2.0-SNAPSHOT.ini000066400000000000000000000003721245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:87:pom:6b-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:106:pom:3.5.5-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_114_2.50.16.busObj.1-SNAPSHOT.ini000066400000000000000000000004211245546356100350610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:108:pom:4.0-SNAPSHOT 1:110:pom:4.0-SNAPSHOT 1:112:pom:1.0.30-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_114_2.50.28_sap.1-SNAPSHOT.ini000066400000000000000000000002741245546356100345120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:115:pom:4.2.1-SNAPSHOT 1:114:pom:2.50.16.busObj.1-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_115_4.2.1-SNAPSHOT.ini000066400000000000000000000001771245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_116_4.0-SNAPSHOT.ini000066400000000000000000000000521245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:18:pom:5.1.1.41-SNAPSHOT 1_118_10.2.2.0-SNAPSHOT.ini000066400000000000000000000002101245546356100335440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_118_10.5.3.0-SNAPSHOT.ini000066400000000000000000000000171245546356100335550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_119_1.0-SNAPSHOT.ini000066400000000000000000000000461245546356100331740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:7:pom:5.8.8-SNAPSHOT 1_120_1.0-SNAPSHOT.ini000066400000000000000000000003021245546356100331570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_122_3.1.1-SNAPSHOT.ini000066400000000000000000000000171245546356100333260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_123_3.1.1-SNAPSHOT.ini000066400000000000000000000001771245546356100333360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_124_2.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_125_8.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_125_9.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_125_9.5-SNAPSHOT.ini000066400000000000000000000000171245546356100332040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_126_2.81-SNAPSHOT.ini000066400000000000000000000000171245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_126_2.90-SNAPSHOT.ini000066400000000000000000000000171245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_126_3.50-SNAPSHOT.ini000066400000000000000000000000171245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_127_6.20-SNAPSHOT.ini000066400000000000000000000000171245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_127_6.30-SNAPSHOT.ini000066400000000000000000000000171245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_128_2006-SNAPSHOT.ini000066400000000000000000000000171245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_129_10.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_130_10.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_130_10.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_130_11.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_130_9.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_131_5.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_131_5.3-SNAPSHOT.ini000066400000000000000000000000171245546356100331730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_131_6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_132_7.7-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_133_12.5-SNAPSHOT.ini000066400000000000000000000000171245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_133_15.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_133_15.5-SNAPSHOT.ini000066400000000000000000000000171245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_134_12.6-SNAPSHOT.ini000066400000000000000000000000171245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_134_12.7-SNAPSHOT.ini000066400000000000000000000000171245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_135_10.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_135_11.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_136_3.04-SNAPSHOT.ini000066400000000000000000000000171245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_136_3.06-SNAPSHOT.ini000066400000000000000000000000171245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_137_2.2.12-SNAPSHOT.ini000066400000000000000000000000171245546356100334160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_138_7.7.06-SNAPSHOT.ini000066400000000000000000000001771245546356100334430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_13_1.7.0-SNAPSHOT.ini000066400000000000000000000001521245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_140_5.5.28-SNAPSHOT.ini000066400000000000000000000000741245546356100334300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1_140_6.0.18-SNAPSHOT.ini000066400000000000000000000004721245546356100334250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.5-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 1_140_6.0.24-SNAPSHOT.ini000066400000000000000000000004721245546356100334220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:14:pom:2.5.2-SNAPSHOT 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 1_142_9.1-SNAPSHOT.ini000066400000000000000000000000461245546356100332010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:77:pom:1.45-SNAPSHOT 1_143_6.0-SNAPSHOT.ini000066400000000000000000000001771245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_144_15.0-SNAPSHOT.ini000066400000000000000000000000471245546356100332600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:69:pom:8.1.7-SNAPSHOT 1_14_2.5.2-SNAPSHOT.ini000066400000000000000000000001771245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_151_3.7.1-SNAPSHOT.ini000066400000000000000000000001511245546356100333350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1_153_1.1.1-SNAPSHOT.ini000066400000000000000000000001771245546356100333370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_154_3.3-SNAPSHOT.ini000066400000000000000000000000171245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_157_0.0.356_sap.1-SNAPSHOT.ini000066400000000000000000000001771245546356100345200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_158_3.5-SNAPSHOT.ini000066400000000000000000000001771245546356100332130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_159_2.1_03-SNAPSHOT.ini000066400000000000000000000002241245546356100335020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_15_1.36.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_165_11.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_165_7.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_165_7.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_165_9.3-SNAPSHOT.ini000066400000000000000000000000171245546356100332060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_166_720-SNAPSHOT.ini000066400000000000000000000000461245546356100332100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 1_168_6.0-SNAPSHOT.ini000066400000000000000000000001771245546356100332120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_169_4.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_16_1.8.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_170_10.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_171_8.45-SNAPSHOT.ini000066400000000000000000000000171245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_171_8.46-SNAPSHOT.ini000066400000000000000000000000171245546356100332710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_17_1.2.3-SNAPSHOT.ini000066400000000000000000000002601245546356100332520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_181_1.0-SNAPSHOT.ini000066400000000000000000000001511245546356100331700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:182:pom:3.2-SNAPSHOT 1:13:pom:1.7.0-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1_182_3.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_183_0.9-SNAPSHOT.ini000066400000000000000000000000171245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_184_20080807-SNAPSHOT.ini000066400000000000000000000000741245546356100336110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1_185_1.0_sap.1-SNAPSHOT.ini000066400000000000000000000005261245546356100342040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:140:pom:5.5.28-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_185_1.0_sap.2-SNAPSHOT.ini000066400000000000000000000005261245546356100342050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:45:pom:3.1-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:140:pom:6.0.24-SNAPSHOT 1:140:pom:5.5.28-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.5-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1_186_4.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_187_4.3-SNAPSHOT.ini000066400000000000000000000000171245546356100332050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_188_1.9-SNAPSHOT.ini000066400000000000000000000000171245546356100332110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_18_5.1.1-SNAPSHOT.ini000066400000000000000000000001521245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_18_5.1.1.41-SNAPSHOT.ini000066400000000000000000000001521245546356100334770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_190_2.0.8-SNAPSHOT.ini000066400000000000000000000000171245546356100333400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_191_3.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_192_1.8.0.7-SNAPSHOT.ini000066400000000000000000000000171245546356100335060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_193_0.8.1-SNAPSHOT.ini000066400000000000000000000000171245546356100333420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_194_2.3.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_195_3.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_196_1.2.12-SNAPSHOT.ini000066400000000000000000000000171245546356100334220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_197_5.1.3-SNAPSHOT.ini000066400000000000000000000000171245546356100333460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_198_9.1.3-SNAPSHOT.ini000066400000000000000000000000171245546356100333530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_199_2.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_19_6.3-SNAPSHOT.ini000066400000000000000000000002271245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_200_3.1.12-SNAPSHOT.ini000066400000000000000000000000171245546356100334050ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_200_5.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_201_3.5.2-SNAPSHOT.ini000066400000000000000000000000171245546356100333310ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_204_1.6.1-SNAPSHOT.ini000066400000000000000000000000171245546356100333320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_208_10.0-SNAPSHOT.ini000066400000000000000000000001241245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_209_3.51-SNAPSHOT.ini000066400000000000000000000000171245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_20_3.3.2-SNAPSHOT.ini000066400000000000000000000003131245546356100332450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:18:pom:5.1.1.41-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:21:pom:3.2.1.2-SNAPSHOT 10:22:pom:4.1-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1_211_1.0-SNAPSHOT.ini000066400000000000000000000002641245546356100331670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:25:pom:0.86-beta1-SNAPSHOT 1:20:pom:3.3.2-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:19:pom:6.3-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_217_1.0_sap.1-SNAPSHOT.ini000066400000000000000000000003021245546356100341700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_218_2.2.1-SNAPSHOT.ini000066400000000000000000000000471245546356100333370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:68:pom:3.8.1-SNAPSHOT 1_219_2.3.4-SNAPSHOT.ini000066400000000000000000000000171245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_21_3.2.1.2-SNAPSHOT.ini000066400000000000000000000001771245546356100334140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_221_8.9-SNAPSHOT.ini000066400000000000000000000000171245546356100332040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_222_1.1.1-SNAPSHOT.ini000066400000000000000000000000441245546356100333250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_222_beta8-SNAPSHOT.ini000066400000000000000000000000441245546356100336720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_223_7.5-SNAPSHOT.ini000066400000000000000000000000171245546356100332010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_227_7.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_234_1.0-SNAPSHOT.ini000066400000000000000000000001771245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_239_3.0-SNAPSHOT.ini000066400000000000000000000000441245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.5-SNAPSHOT 1_23_1.2.6_sap.1-SNAPSHOT.ini000066400000000000000000000002021245546356100342500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_240_720-SNAPSHOT.ini000066400000000000000000000000171245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_244_1.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_245_1.0.2-SNAPSHOT.ini000066400000000000000000000000171245546356100333320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_248_5.5-SNAPSHOT.ini000066400000000000000000000001771245546356100332150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_249_9.2.2-SNAPSHOT.ini000066400000000000000000000000171245546356100333500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_24_1.2.10-SNAPSHOT.ini000066400000000000000000000001611245546356100333260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:25:pom:0.86-beta1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_250_1.0_sap.1-SNAPSHOT.ini000066400000000000000000000003701245546356100341720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:23:pom:1.2.6_sap.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:55:pom:4.8.2-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_253_1.3.1-SNAPSHOT.ini000066400000000000000000000000171245546356100333330ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_256_3.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_259_2.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_25_0.86-beta1-SNAPSHOT.ini000066400000000000000000000000171245546356100341750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_260_2.2.5-SNAPSHOT.ini000066400000000000000000000000171245546356100333350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_260_2.3.3-SNAPSHOT.ini000066400000000000000000000002561245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:42:pom:4.1-SNAPSHOT 1_264_6.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_267_3.0-SNAPSHOT.ini000066400000000000000000000001511245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_26_3.0.1-SNAPSHOT.ini000066400000000000000000000002271245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_26_3.8.1-SNAPSHOT.ini000066400000000000000000000000471245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:26:pom:3.0.1-SNAPSHOT 1_26_4.2.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_270_1.6.5-SNAPSHOT.ini000066400000000000000000000001771245546356100333500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_273_1.0.3-SNAPSHOT.ini000066400000000000000000000000171245546356100333340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_274_1.0.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_278_1.8.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_27_6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_282_2.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_283_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_287_1.1.2.1-SNAPSHOT.ini000066400000000000000000000000171245546356100335000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_287_1.3-SNAPSHOT.ini000066400000000000000000000000171245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_289_2.2.0-SNAPSHOT.ini000066400000000000000000000002251245546356100333440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_28_4.1-SNAPSHOT.ini000066400000000000000000000001771245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_290_8.0.2.0-SNAPSHOT.ini000066400000000000000000000000171245546356100334770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_293_0.2.5-SNAPSHOT.ini000066400000000000000000000000171245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_296_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_299_7.20-SNAPSHOT.ini000066400000000000000000000000171245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_29_3.0.5-SNAPSHOT.ini000066400000000000000000000001771245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_2_5.50-SNAPSHOT.ini000066400000000000000000000001521245546356100331120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:3:pom:1.28-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_300_7.1.8-SNAPSHOT.ini000066400000000000000000000000171245546356100333370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_302_1.015-SNAPSHOT.ini000066400000000000000000000000171245546356100333320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_304_9.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_308_1.8-SNAPSHOT.ini000066400000000000000000000000171245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_309_1.15.1-SNAPSHOT.ini000066400000000000000000000000171245546356100334200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_30_0.7.0-SNAPSHOT.ini000066400000000000000000000001771245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_310_4.2.1-SNAPSHOT.ini000066400000000000000000000000171245546356100333270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_311_2.3.0-SNAPSHOT.ini000066400000000000000000000001511245546356100333250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_312_4.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_313_2.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_314_6.0-SNAPSHOT.ini000066400000000000000000000003021245546356100331710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_31_2.2-SNAPSHOT.ini000066400000000000000000000000471245546356100331110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1_323_11.0-SNAPSHOT.ini000066400000000000000000000000171245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_324_5.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_326_0.9.7-SNAPSHOT.ini000066400000000000000000000000171245546356100333470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_32_720-SNAPSHOT.ini000066400000000000000000000002251245546356100331170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:33:pom:711-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_338_2.8-SNAPSHOT.ini000066400000000000000000000002541245546356100332110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_338_3.0-SNAPSHOT.ini000066400000000000000000000002541245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1_339_8.0.1p5-SNAPSHOT.ini000066400000000000000000000001771245546356100336200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_33_711-SNAPSHOT.ini000066400000000000000000000001511245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_340_2.11-SNAPSHOT.ini000066400000000000000000000002541245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_340_2.9-SNAPSHOT.ini000066400000000000000000000002541245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_341_0.9-SNAPSHOT.ini000066400000000000000000000002541245546356100332020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_341_1.3-SNAPSHOT.ini000066400000000000000000000002541245546356100331750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_342_1.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_344_1.6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_348_3.8.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_34_1.13-SNAPSHOT.ini000066400000000000000000000000171245546356100331720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_352_6.1-SNAPSHOT.ini000066400000000000000000000000441245546356100331770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_353_1.2.3-SNAPSHOT.ini000066400000000000000000000002241245546356100333350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_354_1.6.2-SNAPSHOT.ini000066400000000000000000000000171245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_355_3.0.5-SNAPSHOT.ini000066400000000000000000000000171245546356100333410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_358_1.1.2-SNAPSHOT.ini000066400000000000000000000002271245546356100333430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_35_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_365_3.4.1-SNAPSHOT.ini000066400000000000000000000000451245546356100333430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1_367_8.0-SNAPSHOT.ini000066400000000000000000000000461245546356100332100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 1_368_4.7.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_369_2.4.5-SNAPSHOT.ini000066400000000000000000000000501245546356100333460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:368:pom:4.7.0-SNAPSHOT 1_36_2.0-SNAPSHOT.ini000066400000000000000000000001521245546356100331110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_370_6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_371_822-SNAPSHOT.ini000066400000000000000000000001771245546356100332160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_37_5.5-SNAPSHOT.ini000066400000000000000000000000171245546356100331220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_38_1.3.5-SNAPSHOT.ini000066400000000000000000000001771245546356100332670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_38_1.3.6-SNAPSHOT.ini000066400000000000000000000000501245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:39:pom:0.9.8l-SNAPSHOT 1_39_0.9.8l-SNAPSHOT.ini000066400000000000000000000000171245546356100334450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_3_1.28-SNAPSHOT.ini000066400000000000000000000000461245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:4:pom:2.5.4-SNAPSHOT 1_40_6.1-SNAPSHOT.ini000066400000000000000000000001511245546356100331100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_41_5.0-SNAPSHOT.ini000066400000000000000000000003651245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:15:pom:1.36.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:38:pom:1.3.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 10:42:pom:4.0-SNAPSHOT 10:12:pom:4.0-SNAPSHOT 1_44_1.3-SNAPSHOT.ini000066400000000000000000000002241245546356100331120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_44_1.4-SNAPSHOT.ini000066400000000000000000000000441245546356100331130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_45_3.1-SNAPSHOT.ini000066400000000000000000000002541245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:46:pom:1.0.2-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_46_1.0.2-SNAPSHOT.ini000066400000000000000000000000471245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:47:pom:2.6.2-SNAPSHOT 1_47_2.6.2-SNAPSHOT.ini000066400000000000000000000002241245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_47_2.9.1-SNAPSHOT.ini000066400000000000000000000002241245546356100332630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_48_1.3-SNAPSHOT.ini000066400000000000000000000000171245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_49_6.0.5.25-SNAPSHOT.ini000066400000000000000000000000171245546356100335110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_4_2.5.4-SNAPSHOT.ini000066400000000000000000000000441245546356100331730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_50_3.3-SNAPSHOT.ini000066400000000000000000000002551245546356100331150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:51:pom:1.6.2-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_50_3.4-SNAPSHOT.ini000066400000000000000000000000451245546356100331130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1_50_3.4.1-SNAPSHOT.ini000066400000000000000000000000731245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1_50_3.5-SNAPSHOT.ini000066400000000000000000000002251245546356100331140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_51_1.6.2-SNAPSHOT.ini000066400000000000000000000001771245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_52_1.8-SNAPSHOT.ini000066400000000000000000000000171245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_52_2.5-SNAPSHOT.ini000066400000000000000000000000171245546356100331140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_53_2.3.0.677-SNAPSHOT.ini000066400000000000000000000000171245546356100335730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_54_0.1.36-SNAPSHOT.ini000066400000000000000000000000171245546356100333370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_55_3.8.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_55_4.4-SNAPSHOT.ini000066400000000000000000000000171245546356100331200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_55_4.8.2-SNAPSHOT.ini000066400000000000000000000000171245546356100332640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_56_1.2-SNAPSHOT.ini000066400000000000000000000000171245546356100331140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_57_4.0.5-SNAPSHOT.ini000066400000000000000000000003601245546356100332620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:58:pom:2.4.7-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:28:pom:4.1-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.1-SNAPSHOT 1_58_2.4.7-SNAPSHOT.ini000066400000000000000000000000171245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_59_1.0.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_5_1.5-SNAPSHOT.ini000066400000000000000000000001521245546356100330310ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_5_1.6-SNAPSHOT.ini000066400000000000000000000001521245546356100330320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_60_0.2.9-SNAPSHOT.ini000066400000000000000000000000171245546356100332550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_61_1.1-SNAPSHOT.ini000066400000000000000000000002241245546356100331070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_61_1.2.12-SNAPSHOT.ini000066400000000000000000000000171245546356100333310ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_63_1.1-SNAPSHOT.ini000066400000000000000000000000441245546356100331110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:5:pom:1.6-SNAPSHOT 1_63_1.3-SNAPSHOT.ini000066400000000000000000000001771245546356100331220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_64_1.3-SNAPSHOT.ini000066400000000000000000000001771245546356100331230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_65_2.1.0-SNAPSHOT.ini000066400000000000000000000001771245546356100332610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_66_0.11-SNAPSHOT.ini000066400000000000000000000001771245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_67_1.6.5-SNAPSHOT.ini000066400000000000000000000002541245546356100332700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_68_3.8.1-SNAPSHOT.ini000066400000000000000000000001771245546356100332750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_69_10.1.0-SNAPSHOT.ini000066400000000000000000000002001245546356100333270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:41:pom:5.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_69_11.1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100333360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_69_8.1.7-SNAPSHOT.ini000066400000000000000000000000171245546356100332730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_69_9.0.1-SNAPSHOT.ini000066400000000000000000000000171245546356100332650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_6_1.5.8-SNAPSHOT.ini000066400000000000000000000000171245546356100332000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_70_9.0-SNAPSHOT.ini000066400000000000000000000001771245546356100331250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_71_1.1.3.8-SNAPSHOT.ini000066400000000000000000000004331245546356100334210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_71_1.1.4.C-SNAPSHOT.ini000066400000000000000000000004331245546356100334350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:57:pom:4.0.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_73_2.3.1-SNAPSHOT.ini000066400000000000000000000004331245546356100332560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:74:pom:3.2.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_73_2.4.1-SNAPSHOT.ini000066400000000000000000000004331245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:74:pom:3.5.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:31:pom:2.2-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:5:pom:1.6-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_74_3.2.0-SNAPSHOT.ini000066400000000000000000000003011245546356100332500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:25-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_74_3.5.0-SNAPSHOT.ini000066400000000000000000000003011245546356100332530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:75:pom:26-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_75_25-SNAPSHOT.ini000066400000000000000000000003621245546356100330460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_75_26-SNAPSHOT.ini000066400000000000000000000003621245546356100330470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:13:pom:1.7.0-SNAPSHOT 1:50:pom:3.3-SNAPSHOT 1:50:pom:3.4-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:5:pom:1.5-SNAPSHOT 1:71:pom:1.1.3.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_76_1.0-SNAPSHOT.ini000066400000000000000000000001771245546356100331230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_77_1.45-SNAPSHOT.ini000066400000000000000000000002251245546356100332070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:45:pom:3.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_78_2.6-SNAPSHOT.ini000066400000000000000000000001771245546356100331340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_79_0.7.2-SNAPSHOT.ini000066400000000000000000000001771245546356100332740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_7_5.8.8-SNAPSHOT.ini000066400000000000000000000002561245546356100332150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:37:pom:5.5-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_7_5.8.9-SNAPSHOT.ini000066400000000000000000000003051245546356100332110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:17:pom:1.2.3-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:36:pom:2.0-SNAPSHOT 1:37:pom:5.5-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_82_9.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_83_1.10.0-SNAPSHOT.ini000066400000000000000000000003111245546356100333260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:8:pom:2.7.0-SNAPSHOT 1:26:pom:3.0.1-SNAPSHOT 1:2:pom:5.50-SNAPSHOT 1:84:pom:2.2.0036-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_84_2.2.0036-SNAPSHOT.ini000066400000000000000000000000461245546356100335070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:6:pom:1.5.8-SNAPSHOT 1_85_6.4-SNAPSHOT.ini000066400000000000000000000001521245546356100331250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:45:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_85_9.1-SNAPSHOT.ini000066400000000000000000000000461245546356100331270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 10:11:pom:4.0-SNAPSHOT 1_85_9.53.busObj.CR.1-SNAPSHOT.ini000066400000000000000000000000171245546356100351010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_86_7.13.2-SNAPSHOT.ini000066400000000000000000000001771245546356100333560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_87_6b-SNAPSHOT.ini000066400000000000000000000001771245546356100331360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_88_3.5-SNAPSHOT.ini000066400000000000000000000002261245546356100331300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 1:89:pom:2.3-SNAPSHOT 10:90:pom:1.0-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_89_2.3-SNAPSHOT.ini000066400000000000000000000000171245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_8_2.1.0-SNAPSHOT.ini000066400000000000000000000001771245546356100331760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_8_2.7.0-SNAPSHOT.ini000066400000000000000000000001771245546356100332040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_91_1.5-SNAPSHOT.ini000066400000000000000000000000171245546356100331160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_92_1.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_93_10.0-SNAPSHOT.ini000066400000000000000000000001511245546356100331720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_94_4.0-SNAPSHOT.ini000066400000000000000000000000451245546356100331200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:94:pom:6.0-SNAPSHOT 1_94_6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_95_7.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_95_7.1-SNAPSHOT.ini000066400000000000000000000000171245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_95_8.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_96_8.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_97_3.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_98_6.0-SNAPSHOT.ini000066400000000000000000000000171245546356100331250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1_99_1.0-SNAPSHOT.ini000066400000000000000000000001771245546356100331300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:2:pom:5.50-SNAPSHOT 1:9:pom:3.1-SNAPSHOT 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT 1_9_3.1-SNAPSHOT.ini000066400000000000000000000001241245546356100330320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle-big[dependencies] 1:6:pom:1.5.8-SNAPSHOT 1:7:pom:5.8.8-SNAPSHOT 10:11:pom:4.0-SNAPSHOT aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle.txt000066400000000000000000000003611245546356100302070ustar00rootroot00000000000000cycle:root:jar:1 +- cycle:a:jar:1 compile (a) | \- cycle:b:jar:1 compile | \- cycle:c:jar:1 compile | \- ^a \- cycle:b:jar:1 compile (b) \- cycle:c:jar:1 compile \- cycle:a:jar:1 compile \- ^b aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle_a_1.ini000066400000000000000000000000351245546356100306650ustar00rootroot00000000000000[dependencies] cycle:b:jar:1 aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle_b_1.ini000066400000000000000000000000351245546356100306660ustar00rootroot00000000000000[dependencies] cycle:c:jar:1 aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle_c_1.ini000066400000000000000000000000351245546356100306670ustar00rootroot00000000000000[dependencies] cycle:a:jar:1 aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/cycle_root_1.ini000066400000000000000000000000531245546356100314300ustar00rootroot00000000000000[dependencies] cycle:a:jar:1 cycle:b:jar:1 duplicate_transitive_dependency.ini000066400000000000000000000000571245546356100354130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions[dependencies] gid:aid:ext:ver gid:aid2:ext:verexpectedPartialSubtreeOnError.txt000066400000000000000000000003061245546356100350070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptionssubtree:comparison:ext:error +- duplicate:transitive:ext:dependency compile | +- gid:aid:ext:ver compile | | \- gid:aid2:ext:ver compile | \- gid:aid2:ext:ver compile \- git:aid:ext:ver compile expectedSubtreeComparisonResult.txt000066400000000000000000000003431245546356100354160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptionssubtree:comparison:ext:ver +- duplicate:transitive:ext:dependency compile | +- gid:aid:ext:ver compile | | \- gid:aid2:ext:ver compile | \- gid:aid2:ext:ver compile \- gid:aid:ext:ver compile \- gid:aid2:ext:ver compile aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/gid_aid2_9.ini000066400000000000000000000000171245546356100307400ustar00rootroot00000000000000[dependencies] gid_aid2_managedVersion.ini000066400000000000000000000000171245546356100334530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions[dependencies] aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/gid_aid2_ver.ini000066400000000000000000000000171245546356100313640ustar00rootroot00000000000000[dependencies] aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/gid_aid_1.ini000066400000000000000000000000421245546356100306440ustar00rootroot00000000000000[dependencies] gid:aid2:ext:[1,9] aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/gid_aid_ver.ini000066400000000000000000000000401245546356100312760ustar00rootroot00000000000000[dependencies] gid:aid2:ext:ver aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed/000077500000000000000000000000001245546356100277435ustar00rootroot00000000000000duplicate_transitive_managed.ini000066400000000000000000000000571245546356100362650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed[dependencies] gid:aid:ext:ver gid:aid2:ext:vergid_aid2_managed.ini000066400000000000000000000000171245546356100335010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed[dependencies] aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed/gid_aid_ver.ini000066400000000000000000000000401245546356100326720ustar00rootroot00000000000000[dependencies] gid:aid2:ext:ver subtree_comparison_ver.ini000066400000000000000000000001031245546356100351360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed[dependencies] duplicate:transitive:ext:dependency gid:aid:ext:ver aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/managed_aid_ver.ini000066400000000000000000000001361245546356100321350ustar00rootroot00000000000000[dependencies] gid:aid:ext:ver [manageddependencies] gid:aid2:ext:managedVersion:managedScopemissing_description_ver.ini000066400000000000000000000000611245546356100337160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions[dependencies] missing:artifact:file:description subtree_comparison_error.ini000066400000000000000000000001031245546356100340770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions[dependencies] duplicate:transitive:ext:dependency git:aid:ext:ver subtree_comparison_ver.ini000066400000000000000000000001031245546356100335420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions[dependencies] duplicate:transitive:ext:dependency gid:aid:ext:ver aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/000077500000000000000000000000001245546356100320205ustar00rootroot00000000000000test_a_1.ini000066400000000000000000000000341245546356100341360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle[dependencies] test:b:jar:1 test_a_2.ini000066400000000000000000000000341245546356100341370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle[dependencies] test:b:jar:2 test_b_2.ini000066400000000000000000000000341245546356100341400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle[dependencies] test:a:jar:1 aether-1.0.2.v20150114/aether-spi/000077500000000000000000000000001245546356100161205ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/pom.xml000066400000000000000000000037011245546356100174360ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-spi Aether SPI The service provider interface for repository system implementations and repository connectors. org.eclipse.aether.spi org.eclipse.aether aether-api junit junit test org.hamcrest hamcrest-library test org.codehaus.mojo animal-sniffer-maven-plugin org.codehaus.mojo clirr-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-spi/src/000077500000000000000000000000001245546356100167075ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/000077500000000000000000000000001245546356100176335ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/000077500000000000000000000000001245546356100205545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/000077500000000000000000000000001245546356100213435ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/000077500000000000000000000000001245546356100227675ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100242375ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/000077500000000000000000000000001245546356100250325ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/000077500000000000000000000000001245546356100270245ustar00rootroot00000000000000ArtifactDownload.java000066400000000000000000000202261245546356100330370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import java.util.Collection; import java.util.Collections; import java.util.List; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.TransferListener; /** * A download of an artifact from a remote repository. A repository connector processing this download has to use * {@link #setException(ArtifactTransferException)} and {@link #setSupportedContexts(Collection)} (if applicable) to * report the results of the transfer. */ public final class ArtifactDownload extends ArtifactTransfer { private boolean existenceCheck; private String checksumPolicy = ""; private String context = ""; private Collection contexts; private List repositories = Collections.emptyList(); /** * Creates a new uninitialized download. */ public ArtifactDownload() { // enables default constructor } /** * Creates a new download with the specified properties. * * @param artifact The artifact to download, may be {@code null}. * @param context The context in which this download is performed, may be {@code null}. * @param file The local file to download the artifact to, may be {@code null}. * @param checksumPolicy The checksum policy, may be {@code null}. */ public ArtifactDownload( Artifact artifact, String context, File file, String checksumPolicy ) { setArtifact( artifact ); setRequestContext( context ); setFile( file ); setChecksumPolicy( checksumPolicy ); } @Override public ArtifactDownload setArtifact( Artifact artifact ) { super.setArtifact( artifact ); return this; } /** * {@inheritDoc} Note: In case of {@link #isExistenceCheck()}, this method may return {@code null}. */ @Override public File getFile() { return super.getFile(); } @Override public ArtifactDownload setFile( File file ) { super.setFile( file ); return this; } /** * Indicates whether this transfer shall only verify the existence of the artifact in the remote repository rather * than actually downloading the file. Just like with an actual transfer, a connector is expected to signal the * non-existence of the artifact by associating an {@link org.eclipse.aether.transfer.ArtifactNotFoundException * ArtifactNotFoundException} with this download. Note: If an existence check is requested, * {@link #getFile()} may be {@code null}, i.e. the connector must not try to access the local file. * * @return {@code true} if only the artifact existence shall be verified, {@code false} to actually download the * artifact. */ public boolean isExistenceCheck() { return existenceCheck; } /** * Controls whether this transfer shall only verify the existence of the artifact in the remote repository rather * than actually downloading the file. * * @param existenceCheck {@code true} if only the artifact existence shall be verified, {@code false} to actually * download the artifact. * @return This transfer for chaining, never {@code null}. */ public ArtifactDownload setExistenceCheck( boolean existenceCheck ) { this.existenceCheck = existenceCheck; return this; } /** * Gets the checksum policy for this transfer. * * @return The checksum policy, never {@code null}. */ public String getChecksumPolicy() { return checksumPolicy; } /** * Sets the checksum policy for this transfer. * * @param checksumPolicy The checksum policy, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactDownload setChecksumPolicy( String checksumPolicy ) { this.checksumPolicy = ( checksumPolicy != null ) ? checksumPolicy : ""; return this; } /** * Gets the context of this transfer. * * @return The context id, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the context of this transfer. * * @param context The context id, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactDownload setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the set of request contexts in which the artifact is generally available. Repository managers can indicate * that an artifact is available in more than the requested context to avoid future remote trips for the same * artifact in a different context. * * @return The set of requests context in which the artifact is available, never {@code null}. */ public Collection getSupportedContexts() { return ( contexts != null ) ? contexts : Collections.singleton( context ); } /** * Sets the set of request contexts in which the artifact is generally available. Repository managers can indicate * that an artifact is available in more than the requested context to avoid future remote trips for the same * artifact in a different context. The set of supported contexts defaults to the original request context if not * overridden by the repository connector. * * @param contexts The set of requests context in which the artifact is available, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactDownload setSupportedContexts( Collection contexts ) { if ( contexts == null || contexts.isEmpty() ) { this.contexts = Collections.singleton( context ); } else { this.contexts = contexts; } return this; } /** * Gets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a * repository manager). * * @return The remote repositories being aggregated, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a * repository manager). * * @param repositories The remote repositories being aggregated, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactDownload setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } @Override public ArtifactDownload setException( ArtifactTransferException exception ) { super.setException( exception ); return this; } @Override public ArtifactDownload setListener( TransferListener listener ) { super.setListener( listener ); return this; } @Override public ArtifactDownload setTrace( RequestTrace trace ) { super.setTrace( trace ); return this; } @Override public String toString() { return getArtifact() + " - " + ( isExistenceCheck() ? "?" : "" ) + getFile(); } } ArtifactTransfer.java000066400000000000000000000057131245546356100330600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.transfer.ArtifactTransferException; /** * A download/upload of an artifact. * * @noextend This class is not intended to be extended by clients. */ public abstract class ArtifactTransfer extends Transfer { private Artifact artifact; private File file; private ArtifactTransferException exception; ArtifactTransfer() { // hide } /** * Gets the artifact being transferred. * * @return The artifact being transferred or {@code null} if not set. */ public Artifact getArtifact() { return artifact; } /** * Sets the artifact to transfer. * * @param artifact The artifact, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactTransfer setArtifact( Artifact artifact ) { this.artifact = artifact; return this; } /** * Gets the local file the artifact is downloaded to or uploaded from. In case of a download, a connector should * first transfer the bytes to a temporary file and only overwrite the target file once the entire download is * completed such that an interrupted/failed download does not corrupt the current file contents. * * @return The local file or {@code null} if not set. */ public File getFile() { return file; } /** * Sets the local file the artifact is downloaded to or uploaded from. * * @param file The local file, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public ArtifactTransfer setFile( File file ) { this.file = file; return this; } /** * Gets the exception that occurred during the transfer (if any). * * @return The exception or {@code null} if the transfer was successful. */ public ArtifactTransferException getException() { return exception; } /** * Sets the exception that occurred during the transfer. * * @param exception The exception, may be {@code null} to denote a successful transfer. * @return This transfer for chaining, never {@code null}. */ public ArtifactTransfer setException( ArtifactTransferException exception ) { this.exception = exception; return this; } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java000066400000000000000000000045501245546356100325750ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.transfer.ArtifactTransferException; import org.eclipse.aether.transfer.TransferListener; /** * An upload of an artifact to a remote repository. A repository connector processing this upload has to use * {@link #setException(ArtifactTransferException)} to report the results of the transfer. */ public final class ArtifactUpload extends ArtifactTransfer { /** * Creates a new uninitialized upload. */ public ArtifactUpload() { // enables default constructor } /** * Creates a new upload with the specified properties. * * @param artifact The artifact to upload, may be {@code null}. * @param file The local file to upload the artifact from, may be {@code null}. */ public ArtifactUpload( Artifact artifact, File file ) { setArtifact( artifact ); setFile( file ); } @Override public ArtifactUpload setArtifact( Artifact artifact ) { super.setArtifact( artifact ); return this; } @Override public ArtifactUpload setFile( File file ) { super.setFile( file ); return this; } @Override public ArtifactUpload setException( ArtifactTransferException exception ) { super.setException( exception ); return this; } @Override public ArtifactUpload setListener( TransferListener listener ) { super.setListener( listener ); return this; } @Override public ArtifactUpload setTrace( RequestTrace trace ) { super.setTrace( trace ); return this; } @Override public String toString() { return getArtifact() + " - " + getFile(); } } MetadataDownload.java000066400000000000000000000117511245546356100330250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import java.util.Collections; import java.util.List; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.TransferListener; /** * A download of metadata from a remote repository. A repository connector processing this download has to use * {@link #setException(MetadataTransferException)} to report the results of the transfer. */ public final class MetadataDownload extends MetadataTransfer { private String checksumPolicy = ""; private String context = ""; private List repositories = Collections.emptyList(); /** * Creates a new uninitialized download. */ public MetadataDownload() { // enables default constructor } /** * Creates a new download with the specified properties. * * @param metadata The metadata to download, may be {@code null}. * @param context The context in which this download is performed, may be {@code null}. * @param file The local file to download the metadata to, may be {@code null}. * @param checksumPolicy The checksum policy, may be {@code null}. */ public MetadataDownload( Metadata metadata, String context, File file, String checksumPolicy ) { setMetadata( metadata ); setFile( file ); setChecksumPolicy( checksumPolicy ); setRequestContext( context ); } @Override public MetadataDownload setMetadata( Metadata metadata ) { super.setMetadata( metadata ); return this; } @Override public MetadataDownload setFile( File file ) { super.setFile( file ); return this; } /** * Gets the checksum policy for this transfer. * * @return The checksum policy, never {@code null}. */ public String getChecksumPolicy() { return checksumPolicy; } /** * Sets the checksum policy for this transfer. * * @param checksumPolicy The checksum policy, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public MetadataDownload setChecksumPolicy( String checksumPolicy ) { this.checksumPolicy = ( checksumPolicy != null ) ? checksumPolicy : ""; return this; } /** * Gets the context of this transfer. * * @return The context id, never {@code null}. */ public String getRequestContext() { return context; } /** * Sets the request context of this transfer. * * @param context The context id, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public MetadataDownload setRequestContext( String context ) { this.context = ( context != null ) ? context : ""; return this; } /** * Gets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a * repository manager). * * @return The remote repositories being aggregated, never {@code null}. */ public List getRepositories() { return repositories; } /** * Sets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a * repository manager). * * @param repositories The remote repositories being aggregated, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public MetadataDownload setRepositories( List repositories ) { if ( repositories == null ) { this.repositories = Collections.emptyList(); } else { this.repositories = repositories; } return this; } @Override public MetadataDownload setException( MetadataTransferException exception ) { super.setException( exception ); return this; } @Override public MetadataDownload setListener( TransferListener listener ) { super.setListener( listener ); return this; } @Override public MetadataDownload setTrace( RequestTrace trace ) { super.setTrace( trace ); return this; } @Override public String toString() { return getMetadata() + " - " + getFile(); } } MetadataTransfer.java000066400000000000000000000057101245546356100330400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.transfer.MetadataTransferException; /** * A download/upload of metadata. * * @noextend This class is not intended to be extended by clients. */ public abstract class MetadataTransfer extends Transfer { private Metadata metadata; private File file; private MetadataTransferException exception; MetadataTransfer() { // hide } /** * Gets the metadata being transferred. * * @return The metadata being transferred or {@code null} if not set. */ public Metadata getMetadata() { return metadata; } /** * Sets the metadata to transfer. * * @param metadata The metadata, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public MetadataTransfer setMetadata( Metadata metadata ) { this.metadata = metadata; return this; } /** * Gets the local file the metadata is downloaded to or uploaded from. In case of a download, a connector should * first transfer the bytes to a temporary file and only overwrite the target file once the entire download is * completed such that an interrupted/failed download does not corrupt the current file contents. * * @return The local file or {@code null} if not set. */ public File getFile() { return file; } /** * Sets the local file the metadata is downloaded to or uploaded from. * * @param file The local file, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ public MetadataTransfer setFile( File file ) { this.file = file; return this; } /** * Gets the exception that occurred during the transfer (if any). * * @return The exception or {@code null} if the transfer was successful. */ public MetadataTransferException getException() { return exception; } /** * Sets the exception that occurred during the transfer. * * @param exception The exception, may be {@code null} to denote a successful transfer. * @return This transfer for chaining, never {@code null}. */ public MetadataTransfer setException( MetadataTransferException exception ) { this.exception = exception; return this; } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java000066400000000000000000000045451245546356100325640ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.File; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.transfer.MetadataTransferException; import org.eclipse.aether.transfer.TransferListener; /** * An upload of metadata to a remote repository. A repository connector processing this upload has to use * {@link #setException(MetadataTransferException)} to report the results of the transfer. */ public final class MetadataUpload extends MetadataTransfer { /** * Creates a new uninitialized upload. */ public MetadataUpload() { // enables default constructor } /** * Creates a new upload with the specified properties. * * @param metadata The metadata to upload, may be {@code null}. * @param file The local file to upload the metadata from, may be {@code null}. */ public MetadataUpload( Metadata metadata, File file ) { setMetadata( metadata ); setFile( file ); } @Override public MetadataUpload setMetadata( Metadata metadata ) { super.setMetadata( metadata ); return this; } @Override public MetadataUpload setFile( File file ) { super.setFile( file ); return this; } @Override public MetadataUpload setException( MetadataTransferException exception ) { super.setException( exception ); return this; } @Override public MetadataUpload setListener( TransferListener listener ) { super.setListener( listener ); return this; } @Override public MetadataUpload setTrace( RequestTrace trace ) { super.setTrace( trace ); return this; } @Override public String toString() { return getMetadata() + " - " + getFile(); } } RepositoryConnector.java000066400000000000000000000071431245546356100336470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import java.io.Closeable; import java.util.Collection; /** * A connector for a remote repository. The connector is responsible for downloading/uploading of artifacts and metadata * from/to a remote repository. *

* If applicable, a connector should obey connect/request timeouts and other relevant settings from the * {@link org.eclipse.aether.RepositorySystemSession#getConfigProperties() configuration properties} of the repository * session it has been obtained for. However, a connector must not emit any events to the transfer listener configured * for the session. Instead, transfer events must be emitted only to the listener (if any) specified for a given * download/upload request. *

* Note: While a connector itself can use multiple threads internally to performs the transfers, * clients must not call a connector concurrently, i.e. connectors are generally not thread-safe. * * @see org.eclipse.aether.spi.connector.transport.TransporterProvider * @see org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider * @see org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider */ public interface RepositoryConnector extends Closeable { /** * Performs the specified downloads. If a download fails, the connector stores the underlying exception in the * download object such that callers can inspect the result via {@link ArtifactDownload#getException()} and * {@link MetadataDownload#getException()}, respectively. If reasonable, a connector should continue to process the * remaining downloads after an error to retrieve as many items as possible. The connector may perform the transfers * concurrently and in any order. * * @param artifactDownloads The artifact downloads to perform, may be {@code null} or empty. * @param metadataDownloads The metadata downloads to perform, may be {@code null} or empty. */ void get( Collection artifactDownloads, Collection metadataDownloads ); /** * Performs the specified uploads. If an upload fails, the connector stores the underlying exception in the upload * object such that callers can inspect the result via {@link ArtifactUpload#getException()} and * {@link MetadataUpload#getException()}, respectively. The connector may perform the transfers concurrently and in * any order. * * @param artifactUploads The artifact uploads to perform, may be {@code null} or empty. * @param metadataUploads The metadata uploads to perform, may be {@code null} or empty. */ void put( Collection artifactUploads, Collection metadataUploads ); /** * Closes this connector and frees any network resources associated with it. Once closed, a connector must not be * used for further transfers, any attempt to do so would yield a {@link IllegalStateException} or similar. Closing * an already closed connector is harmless and has no effect. */ void close(); } RepositoryConnectorFactory.java000066400000000000000000000051171245546356100351760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryConnectorException; /** * A factory to create repository connectors. A repository connector is responsible for uploads/downloads to/from a * certain kind of remote repository. When the repository system needs a repository connector for a given remote * repository, it iterates the registered factories in descending order of their priority and calls * {@link #newInstance(RepositorySystemSession, RemoteRepository)} on them. The first connector returned by a factory * will then be used for the transfer. */ public interface RepositoryConnectorFactory { /** * Tries to create a repository connector for the specified remote repository. Typically, a factory will inspect * {@link RemoteRepository#getProtocol()} and {@link RemoteRepository#getContentType()} to determine whether it can * handle a repository. * * @param session The repository system session from which to configure the connector, must not be {@code null}. In * particular, a connector must notify any {@link RepositorySystemSession#getTransferListener()} set for * the session and should obey the timeouts configured for the session. * @param repository The remote repository to create a connector for, must not be {@code null}. * @return The connector for the given repository, never {@code null}. * @throws NoRepositoryConnectorException If the factory cannot create a connector for the specified remote * repository. */ RepositoryConnector newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryConnectorException; /** * The priority of this factory. When multiple factories can handle a given repository, factories with higher * priority are preferred over those with lower priority. * * @return The priority of this factory. */ float getPriority(); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java000066400000000000000000000046501245546356100314600ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.transfer.TransferListener; /** * An artifact/metadata transfer. * * @noextend This class is not intended to be extended by clients. */ public abstract class Transfer { private TransferListener listener; private RequestTrace trace; Transfer() { // hide from public } /** * Gets the exception that occurred during the transfer (if any). * * @return The exception or {@code null} if the transfer was successful. */ public abstract Exception getException(); /** * Gets the listener that is to be notified during the transfer. * * @return The transfer listener or {@code null} if none. */ public TransferListener getListener() { return listener; } /** * Sets the listener that is to be notified during the transfer. * * @param listener The transfer listener to notify, may be {@code null} if none. * @return This transfer for chaining, never {@code null}. */ Transfer setListener( TransferListener listener ) { this.listener = listener; return this; } /** * Gets the trace information that describes the higher level request/operation in which this transfer is issued. * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() { return trace; } /** * Sets the trace information that describes the higher level request/operation in which this transfer is issued. * * @param trace The trace information about the higher level operation, may be {@code null}. * @return This transfer for chaining, never {@code null}. */ Transfer setTrace( RequestTrace trace ) { this.trace = trace; return this; } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/000077500000000000000000000000001245546356100306265ustar00rootroot00000000000000ChecksumPolicy.java000066400000000000000000000137311245546356100343410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.checksum; import org.eclipse.aether.transfer.ChecksumFailureException; /** * A checksum policy gets employed by repository connectors to validate the integrity of a downloaded file. For each * downloaded file, a checksum policy instance is obtained and presented with the available checksums to conclude * whether the download is valid or not. The following pseudo-code illustrates the usage of a checksum policy by a * repository connector in some more detail (the retry logic has been omitted for the sake of brevity): * *

 * void validateChecksums() throws ChecksumFailureException {
 *   for (checksum : checksums) {
 *     switch (checksum.state) {
 *       case MATCH:
 *         if (policy.onChecksumMatch(...)) {
 *           return;
 *         }
 *         break;
 *       case MISMATCH:
 *         policy.onChecksumMismatch(...);
 *         break;
 *       case ERROR:
 *         policy.onChecksumError(...);
 *         break;
 *     }
 *   }
 *   policy.onNoMoreChecksums();
 * }
 * 
 * void downloadFile() throws Exception {
 *   ...
 *   policy = newChecksumPolicy();
 *   try {
 *     validateChecksums();
 *   } catch (ChecksumFailureException e) {
 *     if (!policy.onTransferChecksumFailure(...)) {
 *       throw e;
 *     }
 *   }
 * }
 * 
* * Checksum policies might be stateful and are generally not thread-safe. */ public interface ChecksumPolicy { /** * Bit flag indicating a checksum which is not part of the official repository layout/structure. */ static final int KIND_UNOFFICIAL = 0x01; /** * Signals a match between the locally computed checksum value and the checksum value declared by the remote * repository. * * @param algorithm The name of the checksum algorithm being used, must not be {@code null}. * @param kind A bit field providing further details about the checksum. See the {@code KIND_*} constants in this * interface for possible bit flags. * @return {@code true} to accept the download as valid and stop further validation, {@code false} to continue * validation with the next checksum. */ boolean onChecksumMatch( String algorithm, int kind ); /** * Signals a mismatch between the locally computed checksum value and the checksum value declared by the remote * repository. A simple policy would just rethrow the provided exception. More sophisticated policies could update * their internal state and defer a conclusion until all available checksums have been processed. * * @param algorithm The name of the checksum algorithm being used, must not be {@code null}. * @param kind A bit field providing further details about the checksum. See the {@code KIND_*} constants in this * interface for possible bit flags. * @param exception The exception describing the checksum mismatch, must not be {@code null}. * @throws ChecksumFailureException If the checksum validation is to be failed. If the method returns normally, * validation continues with the next checksum. */ void onChecksumMismatch( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException; /** * Signals an error while computing the local checksum value or retrieving the checksum value from the remote * repository. * * @param algorithm The name of the checksum algorithm being used, must not be {@code null}. * @param kind A bit field providing further details about the checksum. See the {@code KIND_*} constants in this * interface for possible bit flags. * @param exception The exception describing the checksum error, must not be {@code null}. * @throws ChecksumFailureException If the checksum validation is to be failed. If the method returns normally, * validation continues with the next checksum. */ void onChecksumError( String algorithm, int kind, ChecksumFailureException exception ) throws ChecksumFailureException; /** * Signals that all available checksums have been processed. * * @throws ChecksumFailureException If the checksum validation is to be failed. If the method returns normally, the * download is assumed to be valid. */ void onNoMoreChecksums() throws ChecksumFailureException; /** * Signals that the download is being retried after a previously thrown {@link ChecksumFailureException} that is * {@link ChecksumFailureException#isRetryWorthy() retry-worthy}. Policies that maintain internal state will usually * have to reset some of this state at this point to prepare for a new round of validation. */ void onTransferRetry(); /** * Signals that (even after a potential retry) checksum validation has failed. A policy could opt to merely log this * issue or insist on rejecting the downloaded file as unusable. * * @param exception The exception that was thrown from a prior call to * {@link #onChecksumMismatch(String, int, ChecksumFailureException)}, * {@link #onChecksumError(String, int, ChecksumFailureException)} or {@link #onNoMoreChecksums()}. * @return {@code true} to accept the download nevertheless and let artifact resolution succeed, {@code false} to * reject the transferred file as unusable. */ boolean onTransferChecksumFailure( ChecksumFailureException exception ); } ChecksumPolicyProvider.java000066400000000000000000000047011245546356100360510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.checksum; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.TransferResource; /** * Assists repository connectors in applying checksum policies to downloaded resources. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface ChecksumPolicyProvider { /** * Retrieves the checksum policy with the specified identifier for use on the given remote resource. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param repository The repository hosting the resource being transferred, must not be {@code null}. * @param resource The transfer resource on which the policy will be applied, must not be {@code null}. * @param policy The identifier of the policy to apply, must not be {@code null}. * @return The policy to apply or {@code null} if checksums should be ignored. */ ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ); /** * Returns the least strict policy. A checksum policy is said to be less strict than another policy if it would * accept a downloaded resource in all cases where the other policy would reject the resource. * * @param session The repository system session during which the request is made, must not be {@code null}. * @param policy1 A policy to compare, must not be {@code null}. * @param policy2 A policy to compare, must not be {@code null}. * @return The least strict policy among the two input policies. */ String getEffectiveChecksumPolicy( RepositorySystemSession session, String policy1, String policy2 ); } package-info.java000066400000000000000000000013171245546356100337400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The support infrastructure for repository connectors to apply checksum policies when validating the integrity of * downloaded files. */ package org.eclipse.aether.spi.connector.checksum; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/000077500000000000000000000000001245546356100303415ustar00rootroot00000000000000RepositoryLayout.java000066400000000000000000000167311245546356100345120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.layout; import java.net.URI; import java.util.List; import java.util.Locale; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; /** * The layout for a remote repository whose artifacts/metadata can be addressed via URIs. *

* Note: Implementations must be stateless. */ public interface RepositoryLayout { /** * A descriptor for a checksum file. This descriptor simply associates the location of a checksum file with the * underlying algorithm used to calculate/verify it. Checksum algorithms are denoted by names as used with * {@link java.security.MessageDigest#getInstance(String)}, e.g. {@code "SHA-1"} or {@code "MD5"}. */ static final class Checksum { private final String algorithm; private final URI location; /** * Creates a new checksum file descriptor with the specified algorithm and location. The method * {@link #forLocation(URI, String)} is usually more convenient though. * * @param algorithm The algorithm used to calculate the checksum, must not be {@code null}. * @param location The relative URI to the checksum file within a repository, must not be {@code null}. */ public Checksum( String algorithm, URI location ) { verify( algorithm, location ); this.algorithm = algorithm; this.location = location; } /** * Creates a checksum file descriptor for the specified artifact/metadata location and algorithm. The location * of the checksum file itself is derived from the supplied resource URI by appending the file extension * corresponding to the algorithm. The file extension in turn is derived from the algorithm name by stripping * out any hyphen ('-') characters and lower-casing the name, e.g. "SHA-1" is mapped to ".sha1". * * @param location The relative URI to the artifact/metadata whose checksum file is being obtained, must not be * {@code null} and must not have a query or fragment part. * @param algorithm The algorithm used to calculate the checksum, must not be {@code null}. * @return The checksum file descriptor, never {@code null}. */ public static Checksum forLocation( URI location, String algorithm ) { verify( algorithm, location ); if ( location.getRawQuery() != null ) { throw new IllegalArgumentException( "resource location must not have query parameters: " + location ); } if ( location.getRawFragment() != null ) { throw new IllegalArgumentException( "resource location must not have a fragment: " + location ); } String extension = '.' + algorithm.replace( "-", "" ).toLowerCase( Locale.ENGLISH ); return new Checksum( algorithm, URI.create( location.toString() + extension ) ); } private static void verify( String algorithm, URI location ) { if ( algorithm == null || algorithm.length() <= 0 ) { throw new IllegalArgumentException( "checksum algorithm has not been specified" ); } if ( location == null ) { throw new IllegalArgumentException( "checksum location has not been specified" ); } if ( location.isAbsolute() ) { throw new IllegalArgumentException( "checksum location must be relative" ); } } /** * Gets the name of the algorithm that is used to calculate the checksum. * * @return The algorithm name, never {@code null}. * @see java.security.MessageDigest#getInstance(String) */ public String getAlgorithm() { return algorithm; } /** * Gets the location of the checksum file with a remote repository. The URI is relative to the root directory of * the repository. * * @return The relative URI to the checksum file, never {@code null}. */ public URI getLocation() { return location; } @Override public String toString() { return location + " (" + algorithm + ")"; } } /** * Gets the location within a remote repository where the specified artifact resides. The URI is relative to the * root directory of the repository. * * @param artifact The artifact to get the URI for, must not be {@code null}. * @param upload {@code false} if the artifact is being downloaded, {@code true} if the artifact is being uploaded. * @return The relative URI to the artifact, never {@code null}. */ URI getLocation( Artifact artifact, boolean upload ); /** * Gets the location within a remote repository where the specified metadata resides. The URI is relative to the * root directory of the repository. * * @param metadata The metadata to get the URI for, must not be {@code null}. * @param upload {@code false} if the metadata is being downloaded, {@code true} if the metadata is being uploaded. * @return The relative URI to the metadata, never {@code null}. */ URI getLocation( Metadata metadata, boolean upload ); /** * Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the * specified artifact. * * @param artifact The artifact to get the checksum files for, must not be {@code null}. * @param upload {@code false} if the checksums are being downloaded/verified, {@code true} if the checksums are * being uploaded/created. * @param location The relative URI to the artifact within the repository as previously obtained from * {@link #getLocation(Artifact, boolean)}, must not be {@code null}. * @return The checksum files for the given artifact, possibly empty but never {@code null}. */ List getChecksums( Artifact artifact, boolean upload, URI location ); /** * Gets the checksums files that a remote repository keeps to help detect data corruption during transfers of the * specified metadata. * * @param metadata The metadata to get the checksum files for, must not be {@code null}. * @param upload {@code false} if the checksums are being downloaded/verified, {@code true} if the checksums are * being uploaded/created. * @param location The relative URI to the metadata within the repository as previously obtained from * {@link #getLocation(Metadata, boolean)}, must not be {@code null}. * @return The checksum files for the given metadata, possibly empty but never {@code null}. */ List getChecksums( Metadata metadata, boolean upload, URI location ); } RepositoryLayoutFactory.java000066400000000000000000000045301245546356100360340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.layout; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryLayoutException; /** * A factory to obtain repository layouts. A repository layout is responsible to map an artifact or some metadata to a * URI relative to the repository root where the resource resides. When the repository system needs to access a given * remote repository, it iterates the registered factories in descending order of their priority and calls * {@link #newInstance(RepositorySystemSession, RemoteRepository)} on them. The first layout returned by a factory will * then be used for transferring artifacts/metadata. */ public interface RepositoryLayoutFactory { /** * Tries to create a repository layout for the specified remote repository. Typically, a factory will inspect * {@link RemoteRepository#getContentType()} to determine whether it can handle a repository. * * @param session The repository system session from which to configure the layout, must not be {@code null}. * @param repository The remote repository to create a layout for, must not be {@code null}. * @return The layout for the given repository, never {@code null}. * @throws NoRepositoryLayoutException If the factory cannot create a repository layout for the specified remote * repository. */ RepositoryLayout newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryLayoutException; /** * The priority of this factory. When multiple factories can handle a given repository, factories with higher * priority are preferred over those with lower priority. * * @return The priority of this factory. */ float getPriority(); } RepositoryLayoutProvider.java000066400000000000000000000033021245546356100362130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.layout; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryLayoutException; /** * Retrieves a repository layout from the installed layout factories. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface RepositoryLayoutProvider { /** * Tries to retrieve a repository layout for the specified remote repository. * * @param session The repository system session from which to configure the layout, must not be {@code null}. * @param repository The remote repository to create a layout for, must not be {@code null}. * @return The layout for the given repository, never {@code null}. * @throws NoRepositoryLayoutException If none of the installed layout factories can provide a repository layout for * the specified remote repository. */ RepositoryLayout newRepositoryLayout( RepositorySystemSession session, RemoteRepository repository ) throws NoRepositoryLayoutException; } package-info.java000066400000000000000000000015731245546356100334570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The contract to locate URI-based resources using custom repository layouts. By implementing a * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} and registering it with the repository * system, an application enables access to remote repositories that use new content types/layouts. */ package org.eclipse.aether.spi.connector.layout; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java000066400000000000000000000022471245546356100322200ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The contract to access artifacts/metadata in remote repositories. By implementing a * {@link org.eclipse.aether.spi.connector.RepositoryConnectorFactory} and registering it with the repository system, * an application can enable access to arbitrary remote repositories. It should be noted that a repository connector is * powerful yet burdensome to implement. In many cases, implementing a * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} or * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} will be sufficient and easier to access a * custom remote repository. */ package org.eclipse.aether.spi.connector; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/000077500000000000000000000000001245546356100310605ustar00rootroot00000000000000AbstractTransporter.java000066400000000000000000000157261245546356100356660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.aether.transfer.TransferCancelledException; /** * A skeleton implementation for custom transporters. */ public abstract class AbstractTransporter implements Transporter { private final AtomicBoolean closed; /** * Enables subclassing. */ protected AbstractTransporter() { closed = new AtomicBoolean(); } public void peek( PeekTask task ) throws Exception { failIfClosed( task ); implPeek( task ); } /** * Implements {@link #peek(PeekTask)}, gets only called if the transporter has not been closed. * * @param task The existence check to perform, must not be {@code null}. * @throws Exception If the existence of the specified resource could not be confirmed. */ protected abstract void implPeek( PeekTask task ) throws Exception; public void get( GetTask task ) throws Exception { failIfClosed( task ); implGet( task ); } /** * Implements {@link #get(GetTask)}, gets only called if the transporter has not been closed. * * @param task The download to perform, must not be {@code null}. * @throws Exception If the transfer failed. */ protected abstract void implGet( GetTask task ) throws Exception; /** * Performs stream-based I/O for the specified download task and notifies the configured transport listener. * Subclasses might want to invoke this utility method from within their {@link #implGet(GetTask)} to avoid * boilerplate I/O code. * * @param task The download to perform, must not be {@code null}. * @param is The input stream to download the data from, must not be {@code null}. * @param close {@code true} if the supplied input stream should be automatically closed, {@code false} to leave the * stream open. * @param length The size in bytes of the downloaded resource or {@code -1} if unknown, not to be confused with the * length of the supplied input stream which might be smaller if the download is resumed. * @param resume {@code true} if the download resumes from {@link GetTask#getResumeOffset()}, {@code false} if the * download starts at the first byte of the resource. * @throws IOException If the transfer encountered an I/O error. * @throws TransferCancelledException If the transfer was cancelled. */ protected void utilGet( GetTask task, InputStream is, boolean close, long length, boolean resume ) throws IOException, TransferCancelledException { try { task.getListener().transportStarted( resume ? task.getResumeOffset() : 0, length ); OutputStream os = task.newOutputStream( resume ); try { copy( os, is, task.getListener() ); os.close(); } finally { close( os ); } } finally { if ( close ) { close( is ); } } } public void put( PutTask task ) throws Exception { failIfClosed( task ); implPut( task ); } /** * Implements {@link #put(PutTask)}, gets only called if the transporter has not been closed. * * @param task The upload to perform, must not be {@code null}. * @throws Exception If the transfer failed. */ protected abstract void implPut( PutTask task ) throws Exception; /** * Performs stream-based I/O for the specified upload task and notifies the configured transport listener. * Subclasses might want to invoke this utility method from within their {@link #implPut(PutTask)} to avoid * boilerplate I/O code. * * @param task The upload to perform, must not be {@code null}. * @param os The output stream to upload the data to, must not be {@code null}. * @param close {@code true} if the supplied output stream should be automatically closed, {@code false} to leave * the stream open. * @throws IOException If the transfer encountered an I/O error. * @throws TransferCancelledException If the transfer was cancelled. */ protected void utilPut( PutTask task, OutputStream os, boolean close ) throws IOException, TransferCancelledException { try { task.getListener().transportStarted( 0, task.getDataLength() ); InputStream is = task.newInputStream(); try { copy( os, is, task.getListener() ); } finally { close( is ); } if ( close ) { os.close(); } else { os.flush(); } } finally { if ( close ) { close( os ); } } } public void close() { if ( closed.compareAndSet( false, true ) ) { implClose(); } } /** * Implements {@link #close()}, gets only called if the transporter has not already been closed. */ protected abstract void implClose(); private void failIfClosed( TransportTask task ) { if ( closed.get() ) { throw new IllegalStateException( "transporter closed, cannot execute task " + task ); } } private static void copy( OutputStream os, InputStream is, TransportListener listener ) throws IOException, TransferCancelledException { ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); byte[] array = buffer.array(); for ( int read = is.read( array ); read >= 0; read = is.read( array ) ) { os.write( array, 0, read ); buffer.rewind(); buffer.limit( read ); listener.transportProgressed( buffer ); } } private static void close( Closeable file ) { if ( file != null ) { try { file.close(); } catch ( IOException e ) { // irrelevant } } } } GetTask.java000066400000000000000000000217561245546356100332210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * A task to download a resource from the remote repository. * * @see Transporter#get(GetTask) */ public final class GetTask extends TransportTask { private File dataFile; private boolean resume; private ByteArrayOutputStream dataBytes; private Map checksums; /** * Creates a new task for the specified remote resource. * * @param location The relative location of the resource in the remote repository, must not be {@code null}. */ public GetTask( URI location ) { checksums = Collections.emptyMap(); setLocation( location ); } /** * Opens an output stream to store the downloaded data. Depending on {@link #getDataFile()}, this stream writes * either to a file on disk or a growable buffer in memory. It's the responsibility of the caller to close the * provided stream. * * @return The output stream for the data, never {@code null}. The stream is unbuffered. * @throws IOException If the stream could not be opened. */ public OutputStream newOutputStream() throws IOException { return newOutputStream( false ); } /** * Opens an output stream to store the downloaded data. Depending on {@link #getDataFile()}, this stream writes * either to a file on disk or a growable buffer in memory. It's the responsibility of the caller to close the * provided stream. * * @param resume {@code true} if the download resumes from the byte offset given by {@link #getResumeOffset()}, * {@code false} if the download starts at the first byte of the resource. * @return The output stream for the data, never {@code null}. The stream is unbuffered. * @throws IOException If the stream could not be opened. */ public OutputStream newOutputStream( boolean resume ) throws IOException { if ( dataFile != null ) { return new FileOutputStream( dataFile, this.resume && resume ); } if ( dataBytes == null ) { dataBytes = new ByteArrayOutputStream( 1024 ); } else if ( !resume ) { dataBytes.reset(); } return dataBytes; } /** * Gets the file (if any) where the downloaded data should be stored. If the specified file already exists, it will * be overwritten. * * @return The data file or {@code null} if the data will be buffered in memory. */ public File getDataFile() { return dataFile; } /** * Sets the file where the downloaded data should be stored. If the specified file already exists, it will be * overwritten. Unless the caller can reasonably expect the resource to be small, use of a data file is strongly * recommended to avoid exhausting heap memory during the download. * * @param dataFile The file to store the downloaded data, may be {@code null} to store the data in memory. * @return This task for chaining, never {@code null}. */ public GetTask setDataFile( File dataFile ) { return setDataFile( dataFile, false ); } /** * Sets the file where the downloaded data should be stored. If the specified file already exists, it will be * overwritten or appended to, depending on the {@code resume} argument and the capabilities of the transporter. * Unless the caller can reasonably expect the resource to be small, use of a data file is strongly recommended to * avoid exhausting heap memory during the download. * * @param dataFile The file to store the downloaded data, may be {@code null} to store the data in memory. * @param resume {@code true} to request resuming a previous download attempt, starting from the current length of * the data file, {@code false} to download the resource from its beginning. * @return This task for chaining, never {@code null}. */ public GetTask setDataFile( File dataFile, boolean resume ) { this.dataFile = dataFile; this.resume = resume; return this; } /** * Gets the byte offset within the resource from which the download should resume if supported. * * @return The zero-based index of the first byte to download or {@code 0} for a full download from the start of the * resource, never negative. */ public long getResumeOffset() { if ( resume ) { if ( dataFile != null ) { return dataFile.length(); } if ( dataBytes != null ) { return dataBytes.size(); } } return 0; } /** * Gets the data that was downloaded into memory. Note: This method may only be called if * {@link #getDataFile()} is {@code null} as otherwise the downloaded data has been written directly to disk. * * @return The possibly empty data bytes, never {@code null}. */ public byte[] getDataBytes() { if ( dataFile != null || dataBytes == null ) { return EMPTY; } return dataBytes.toByteArray(); } /** * Gets the data that was downloaded into memory as a string. The downloaded data is assumed to be encoded using * UTF-8. Note: This method may only be called if {@link #getDataFile()} is {@code null} as * otherwise the downloaded data has been written directly to disk. * * @return The possibly empty data string, never {@code null}. */ public String getDataString() { if ( dataFile != null || dataBytes == null ) { return ""; } try { return dataBytes.toString( "UTF-8" ); } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException( e ); } } /** * Sets the listener that is to be notified during the transfer. * * @param listener The listener to notify of progress, may be {@code null}. * @return This task for chaining, never {@code null}. */ public GetTask setListener( TransportListener listener ) { super.setListener( listener ); return this; } /** * Gets the checksums which the remote repository advertises for the resource. The map is keyed by algorithm name * (cf. {@link java.security.MessageDigest#getInstance(String)}) and the values are hexadecimal representations of * the corresponding value. Note: This is optional data that a transporter may return if the underlying * transport protocol provides metadata (e.g. HTTP headers) along with the actual resource data. * * @return The (read-only) checksums advertised for the downloaded resource, possibly empty but never {@code null}. */ public Map getChecksums() { return checksums; } /** * Sets a checksum which the remote repository advertises for the resource. Note: Transporters should only * use this method to record checksum information which is readily available while performing the actual download, * they should not perform additional transfers to gather this data. * * @param algorithm The name of the checksum algorithm (e.g. {@code "SHA-1"}, cf. * {@link java.security.MessageDigest#getInstance(String)} ), may be {@code null}. * @param value The hexadecimal representation of the checksum, may be {@code null}. * @return This task for chaining, never {@code null}. */ public GetTask setChecksum( String algorithm, String value ) { if ( algorithm != null ) { if ( checksums.isEmpty() ) { checksums = new HashMap(); } if ( value != null && value.length() > 0 ) { checksums.put( algorithm, value ); } else { checksums.remove( algorithm ); } } return this; } @Override public String toString() { return "<< " + getLocation(); } } PeekTask.java000066400000000000000000000024341245546356100333560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.net.URI; /** * A task to check the existence of a resource in the remote repository. Note: The listener returned from * {@link #getListener()} is always a noop given that none of its event methods are relevant in context of this task. * * @see Transporter#peek(PeekTask) */ public final class PeekTask extends TransportTask { /** * Creates a new task for the specified remote resource. * * @param location The relative location of the resource in the remote repository, must not be {@code null}. */ public PeekTask( URI location ) { setLocation( location ); } @Override public String toString() { return "?? " + getLocation(); } } PutTask.java000066400000000000000000000103161245546356100332400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URI; /** * A task to upload a resource to the remote repository. * * @see Transporter#put(PutTask) */ public final class PutTask extends TransportTask { private File dataFile; private byte[] dataBytes = EMPTY; /** * Creates a new task for the specified remote resource. * * @param location The relative location of the resource in the remote repository, must not be {@code null}. */ public PutTask( URI location ) { setLocation( location ); } /** * Opens an input stream for the data to be uploaded. The length of the stream can be queried via * {@link #getDataLength()}. It's the responsibility of the caller to close the provided stream. * * @return The input stream for the data, never {@code null}. The stream is unbuffered. * @throws IOException If the stream could not be opened. */ public InputStream newInputStream() throws IOException { if ( dataFile != null ) { return new FileInputStream( dataFile ); } return new ByteArrayInputStream( dataBytes ); } /** * Gets the total number of bytes to be uploaded. * * @return The total number of bytes to be uploaded. */ public long getDataLength() { if ( dataFile != null ) { return dataFile.length(); } return dataBytes.length; } /** * Gets the file (if any) with the data to be uploaded. * * @return The data file or {@code null} if the data resides in memory. */ public File getDataFile() { return dataFile; } /** * Sets the file with the data to be uploaded. To upload some data residing already in memory, use * {@link #setDataString(String)} or {@link #setDataBytes(byte[])}. * * @param dataFile The data file, may be {@code null} if the resource data is provided directly from memory. * @return This task for chaining, never {@code null}. */ public PutTask setDataFile( File dataFile ) { this.dataFile = dataFile; dataBytes = EMPTY; return this; } /** * Sets the binary data to be uploaded. * * @param bytes The binary data, may be {@code null}. * @return This task for chaining, never {@code null}. */ public PutTask setDataBytes( byte[] bytes ) { this.dataBytes = ( bytes != null ) ? bytes : EMPTY; dataFile = null; return this; } /** * Sets the textual data to be uploaded. The text is encoded using UTF-8 before transmission. * * @param str The textual data, may be {@code null}. * @return This task for chaining, never {@code null}. */ public PutTask setDataString( String str ) { try { return setDataBytes( ( str != null ) ? str.getBytes( "UTF-8" ) : null ); } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException( e ); } } /** * Sets the listener that is to be notified during the transfer. * * @param listener The listener to notify of progress, may be {@code null}. * @return This task for chaining, never {@code null}. */ public PutTask setListener( TransportListener listener ) { super.setListener( listener ); return this; } @Override public String toString() { return ">> " + getLocation(); } } TransportListener.java000066400000000000000000000043001245546356100353430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.nio.ByteBuffer; import org.eclipse.aether.transfer.TransferCancelledException; /** * A skeleton class for listeners used to monitor transport operations. Reusing common regular expression syntax, the * sequence of events is generally as follows: * *

 * ( STARTED PROGRESSED* )*
 * 
* * The methods in this class do nothing. */ public abstract class TransportListener { /** * Enables subclassing. */ protected TransportListener() { } /** * Notifies the listener about the start of the data transfer. This event may arise more than once if the transfer * needs to be restarted (e.g. after an authentication failure). * * @param dataOffset The byte offset in the resource at which the transfer starts, must not be negative. * @param dataLength The total number of bytes in the resource or {@code -1} if the length is unknown. * @throws TransferCancelledException If the transfer should be aborted. */ public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { } /** * Notifies the listener about some progress in the data transfer. This event may even be fired if actually zero * bytes have been transferred since the last event, for instance to enable cancellation. * * @param data The (read-only) buffer holding the bytes that have just been tranferred, must not be {@code null}. * @throws TransferCancelledException If the transfer should be aborted. */ public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { } } TransportTask.java000066400000000000000000000041121245546356100344610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.net.URI; /** * A transport task. * * @noextend This class is not intended to be extended by clients. */ public abstract class TransportTask { static final TransportListener NOOP = new TransportListener() { }; static final byte[] EMPTY = {}; private URI location; private TransportListener listener = NOOP; TransportTask() { // hide } /** * Gets the relative location of the affected resource in the remote repository. * * @return The relative location of the resource, never {@code null}. */ public URI getLocation() { return location; } TransportTask setLocation( URI location ) { if ( location == null ) { throw new IllegalArgumentException( "resource location has not been specified" ); } this.location = location; return this; } /** * Gets the listener that is to be notified during the transfer. * * @return The listener to notify of progress, never {@code null}. */ public TransportListener getListener() { return listener; } /** * Sets the listener that is to be notified during the transfer. * * @param listener The listener to notify of progress, may be {@code null}. * @return This task for chaining, never {@code null}. */ TransportTask setListener( TransportListener listener ) { this.listener = ( listener != null ) ? listener : NOOP; return this; } } Transporter.java000066400000000000000000000101421245546356100341650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import java.io.Closeable; /** * A transporter for a remote repository. A transporter is responsible for transferring resources between the remote * repository and the local system. During its operation, the transporter must provide progress feedback via the * {@link TransportListener} configured on the underlying task. *

* If applicable, a transporter should obey connect/request timeouts and other relevant settings from the * {@link org.eclipse.aether.RepositorySystemSession#getConfigProperties() configuration properties} of the repository * system session. *

* Note: Implementations must be thread-safe such that a given transporter instance can safely be used * for concurrent requests. */ public interface Transporter extends Closeable { /** * Classification for exceptions that denote connectivity or authentication issues and any other kind of error that * is not mapped to another classification code. * * @see #classify(Throwable) */ public static final int ERROR_OTHER = 0; /** * Classification for exceptions that denote a requested resource does not exist in the remote repository. Note that * cases where a remote repository is completely inaccessible should be classified as {@link #ERROR_OTHER}. * * @see #classify(Throwable) */ public static final int ERROR_NOT_FOUND = 1; /** * Classifies the type of exception that has been thrown from a previous request to the transporter. The exception * types employed by a transporter are generally unknown to its caller. Where a caller needs to distinguish between * certain error cases, it employs this method to detect which error case corresponds to the exception. * * @param error The exception to classify, must not be {@code null}. * @return The classification of the error, either {@link #ERROR_NOT_FOUND} or {@link #ERROR_OTHER}. */ int classify( Throwable error ); /** * Checks the existence of a resource in the repository. If the remote repository can be contacted successfully but * indicates the resource specified in the request does not exist, an exception is thrown such that invoking * {@link #classify(Throwable)} with that exception yields {@link #ERROR_NOT_FOUND}. * * @param task The existence check to perform, must not be {@code null}. * @throws Exception If the existence of the specified resource could not be confirmed. */ void peek( PeekTask task ) throws Exception; /** * Downloads a resource from the repository. If the resource is downloaded to a file as given by * {@link GetTask#getDataFile()} and the operation fails midway, the transporter should not delete the partial file * but leave its management to the caller. * * @param task The download to perform, must not be {@code null}. * @throws Exception If the transfer failed. */ void get( GetTask task ) throws Exception; /** * Uploads a resource to the repository. * * @param task The upload to perform, must not be {@code null}. * @throws Exception If the transfer failed. */ void put( PutTask task ) throws Exception; /** * Closes this transporter and frees any network resources associated with it. Once closed, a transporter must not * be used for further transfers, any attempt to do so would yield a {@link IllegalStateException} or similar. * Closing an already closed transporter is harmless and has no effect. */ void close(); } TransporterFactory.java000066400000000000000000000045611245546356100355250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoTransporterException; /** * A factory to create transporters. A transporter is responsible for uploads/downloads to/from a remote repository * using a particular transport protocol. When the repository system needs a transporter for a given remote repository, * it iterates the registered factories in descending order of their priority and calls * {@link #newInstance(RepositorySystemSession, RemoteRepository)} on them. The first transporter returned by a factory * will then be used for the transfer. */ public interface TransporterFactory { /** * Tries to create a transporter for the specified remote repository. Typically, a factory will inspect * {@link RemoteRepository#getProtocol()} to determine whether it can handle a repository. * * @param session The repository system session from which to configure the transporter, must not be {@code null}. * In particular, a transporter should obey the timeouts configured for the session. * @param repository The remote repository to create a transporter for, must not be {@code null}. * @return The transporter for the given repository, never {@code null}. * @throws NoTransporterException If the factory cannot create a transporter for the specified remote repository. */ Transporter newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException; /** * The priority of this factory. When multiple factories can handle a given repository, factories with higher * priority are preferred over those with lower priority. * * @return The priority of this factory. */ float getPriority(); } TransporterProvider.java000066400000000000000000000032541245546356100357060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoTransporterException; /** * Retrieves a transporter from the installed transporter factories. * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ public interface TransporterProvider { /** * Tries to create a transporter for the specified remote repository. * * @param session The repository system session from which to configure the transporter, must not be {@code null}. * @param repository The remote repository to create a transporter for, must not be {@code null}. * @return The transporter for the given repository, never {@code null}. * @throws NoTransporterException If none of the installed transporter factories can provide a transporter for the * specified remote repository. */ Transporter newTransporter( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException; } package-info.java000066400000000000000000000015741245546356100341770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The contract to download/upload URI-based resources using custom transport protocols. By implementing a * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} and registering it with the repository system, * an application enables access to remote repositories that use new URI schemes. */ package org.eclipse.aether.spi.connector.transport; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/io/000077500000000000000000000000001245546356100254415ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java000066400000000000000000000103721245546356100310660ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.io; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; /** * A utility component to perform file-based operations. */ public interface FileProcessor { /** * Creates the directory named by the given abstract pathname, including any necessary but nonexistent parent * directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent * directories. * * @param directory The directory to create, may be {@code null}. * @return {@code true} if and only if the directory was created, along with all necessary parent directories; * {@code false} otherwise */ boolean mkdirs( File directory ); /** * Writes the given data to a file. UTF-8 is assumed as encoding for the data. Creates the necessary directories for * the target file. In case of an error, the created directories will be left on the file system. * * @param target The file to write to, must not be {@code null}. This file will be overwritten. * @param data The data to write, may be {@code null}. * @throws IOException If an I/O error occurs. */ void write( File target, String data ) throws IOException; /** * Writes the given stream to a file. Creates the necessary directories for the target file. In case of an error, * the created directories will be left on the file system. * * @param target The file to write to, must not be {@code null}. This file will be overwritten. * @param source The stream to write to the file, must not be {@code null}. * @throws IOException If an I/O error occurs. */ void write( File target, InputStream source ) throws IOException; /** * Moves the specified source file to the given target file. If the target file already exists, it is overwritten. * Creates the necessary directories for the target file. In case of an error, the created directories will be left * on the file system. * * @param source The file to move from, must not be {@code null}. * @param target The file to move to, must not be {@code null}. * @throws IOException If an I/O error occurs. */ void move( File source, File target ) throws IOException; /** * Copies the specified source file to the given target file. Creates the necessary directories for the target file. * In case of an error, the created directories will be left on the file system. * * @param source The file to copy from, must not be {@code null}. * @param target The file to copy to, must not be {@code null}. * @throws IOException If an I/O error occurs. */ void copy( File source, File target ) throws IOException; /** * Copies the specified source file to the given target file. Creates the necessary directories for the target file. * In case of an error, the created directories will be left on the file system. * * @param source The file to copy from, must not be {@code null}. * @param target The file to copy to, must not be {@code null}. * @param listener The listener to notify about the copy progress, may be {@code null}. * @return The number of copied bytes. * @throws IOException If an I/O error occurs. */ long copy( File source, File target, ProgressListener listener ) throws IOException; /** * A listener object that is notified for every progress made while copying files. * * @see FileProcessor#copy(File, File, ProgressListener) */ public interface ProgressListener { void progressed( ByteBuffer buffer ) throws IOException; } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java000066400000000000000000000011531245546356100306300ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * I/O related support infrastructure for components. */ package org.eclipse.aether.spi.io; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/000077500000000000000000000000001245546356100270125ustar00rootroot00000000000000LocalRepositoryManagerFactory.java000066400000000000000000000045721245546356100355630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.localrepo; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; /** * A factory to create managers for the local repository. A local repository manager needs to keep track of artifacts * and metadata and manage access. When the repository system needs a repository manager for a given local repository, * it iterates the registered factories in descending order of their priority and calls * {@link #newInstance(RepositorySystemSession, LocalRepository)} on them. The first manager returned by a factory will * then be used for the local repository. */ public interface LocalRepositoryManagerFactory { /** * Tries to create a repository manager for the specified local repository. The distinguishing property of a local * repository is its {@link LocalRepository#getContentType() type}, which may for example denote the used directory * structure. * * @param session The repository system session from which to configure the manager, must not be {@code null}. * @param repository The local repository to create a manager for, must not be {@code null}. * @return The manager for the given repository, never {@code null}. * @throws NoLocalRepositoryManagerException If the factory cannot create a manager for the specified local * repository. */ LocalRepositoryManager newInstance( RepositorySystemSession session, LocalRepository repository ) throws NoLocalRepositoryManagerException; /** * The priority of this factory. Factories with higher priority are preferred over those with lower priority. * * @return The priority of this factory. */ float getPriority(); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java000066400000000000000000000011711245546356100322010ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * The contract for custom local repository implementations. */ package org.eclipse.aether.spi.localrepo; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/locator/000077500000000000000000000000001245546356100264755ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java000066400000000000000000000022651245546356100307450ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.locator; /** * A stateless component of the repository system. The primary purpose of this interface is to provide a convenient * means to programmatically wire the several components of the repository system together when it is used outside of an * IoC container. */ public interface Service { /** * Provides the opportunity to initialize this service and to acquire other services for its operation from the * locator. A service must not save the reference to the provided service locator. * * @param locator The service locator, must not be {@code null}. */ void initService( ServiceLocator locator ); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java000066400000000000000000000035631245546356100322730ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.locator; import java.util.List; /** * A simple infrastructure to programmatically wire the various components of the repository system together when it is * used outside of an IoC container. Once a concrete implementation of a service locator has been setup, clients could * use * *

 * RepositorySystem repoSystem = serviceLocator.getService( RepositorySystem.class );
 * 
* * to acquire the repository system. Components that implement {@link Service} will be given an opportunity to acquire * further components from the locator, thereby allowing to create the complete object graph of the repository system. */ public interface ServiceLocator { /** * Gets an instance of the specified service. * * @param The service type. * @param type The interface describing the service, must not be {@code null}. * @return The service instance or {@code null} if the service could not be located/initialized. */ T getService( Class type ); /** * Gets all available instances of the specified service. * * @param The service type. * @param type The interface describing the service, must not be {@code null}. * @return The (read-only) list of available service instances, never {@code null}. */ List getServices( Class type ); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java000066400000000000000000000025721245546356100316720ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * A lightweight service locator infrastructure to help components acquire dependent components. The implementation of * the repository system is decomposed into many sub components that interact with each other via interfaces, allowing * an application to customize the system by swapping in different implementation classes for these interfaces. The * service locator defined by this package is one means for components to get hold of the proper implementation for its * dependencies. While not the most popular approach to component wiring, this service locator enables applications * that do not wish to pull in more sophisticated solutions like dependency injection containers to have a small * footprint. Therefore, all components should implement {@link org.eclipse.aether.spi.locator.Service} to support this * goal. */ package org.eclipse.aether.spi.locator; aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/000077500000000000000000000000001245546356100256135ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java000066400000000000000000000040751245546356100277030ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.log; /** * A simple logger to facilitate emission of diagnostic messages. In general, unrecoverable errors should be reported * via exceptions and informational notifications should be reported via events, hence this logger interface focuses on * support for tracing. */ public interface Logger { /** * Indicates whether debug logging is enabled. * * @return {@code true} if debug logging is enabled, {@code false} otherwise. */ boolean isDebugEnabled(); /** * Emits the specified message. * * @param msg The message to log, must not be {@code null}. */ void debug( String msg ); /** * Emits the specified message along with a stack trace of the given exception. * * @param msg The message to log, must not be {@code null}. * @param error The exception to log, may be {@code null}. */ void debug( String msg, Throwable error ); /** * Indicates whether warn logging is enabled. * * @return {@code true} if warn logging is enabled, {@code false} otherwise. */ boolean isWarnEnabled(); /** * Emits the specified message. * * @param msg The message to log, must not be {@code null}. */ void warn( String msg ); /** * Emits the specified message along with a stack trace of the given exception. * * @param msg The message to log, must not be {@code null}. * @param error The exception to log, may be {@code null}. */ void warn( String msg, Throwable error ); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java000066400000000000000000000016021245546356100312240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.log; /** * A factory to create loggers. */ public interface LoggerFactory { /** * Gets a logger for a class with the specified name. * * @param name The name of the class requesting a logger, must not be {@code null}. * @return The requested logger, never {@code null}. */ Logger getLogger( String name ); } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java000066400000000000000000000020051245546356100305250ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.log; /** * A logger that disables any logging. */ final class NullLogger implements Logger { public boolean isDebugEnabled() { return false; } public void debug( String msg ) { } public void debug( String msg, Throwable error ) { } public boolean isWarnEnabled() { return false; } public void warn( String msg ) { } public void warn( String msg, Throwable error ) { } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java000066400000000000000000000035541245546356100320670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.log; /** * A logger factory that disables any logging. */ public final class NullLoggerFactory implements LoggerFactory { /** * The singleton instance of this factory. */ public static final LoggerFactory INSTANCE = new NullLoggerFactory(); /** * The singleton logger used by this factory. */ public static final Logger LOGGER = new NullLogger(); public Logger getLogger( String name ) { return LOGGER; } private NullLoggerFactory() { // hide constructor } /** * Gets a logger from the specified factory for the given class, falling back to a logger from this factory if the * specified factory is {@code null} or fails to provide a logger. * * @param loggerFactory The logger factory from which to get the logger, may be {@code null}. * @param type The class for which to get the logger, must not be {@code null}. * @return The requested logger, never {@code null}. */ public static Logger getSafeLogger( LoggerFactory loggerFactory, Class type ) { if ( loggerFactory == null ) { return LOGGER; } Logger logger = loggerFactory.getLogger( type.getName() ); if ( logger == null ) { return LOGGER; } return logger; } } aether-1.0.2.v20150114/aether-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java000066400000000000000000000020231245546356100307770ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * A simple logging infrastructure for diagnostic messages. The primary purpose of the * {@link org.eclipse.aether.spi.log.LoggerFactory} defined here is to avoid a mandatory dependency on a 3rd party * logging system/facade. Some applications might find the events fired by the repository system sufficient and prefer * a small footprint. Components that do not share this concern are free to ignore this package and directly employ * whatever logging system they desire. */ package org.eclipse.aether.spi.log; aether-1.0.2.v20150114/aether-spi/src/main/resources/000077500000000000000000000000001245546356100216455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/main/resources/about.html000066400000000000000000000026401245546356100236470ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-spi/src/test/000077500000000000000000000000001245546356100176665ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/000077500000000000000000000000001245546356100206075ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/000077500000000000000000000000001245546356100213765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/000077500000000000000000000000001245546356100230225ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100242725ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/aether/spi/000077500000000000000000000000001245546356100250655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/aether/spi/connector/000077500000000000000000000000001245546356100270575ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/aether/spi/connector/layout/000077500000000000000000000000001245546356100303745ustar00rootroot00000000000000ChecksumTest.java000066400000000000000000000031601245546356100335620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-spi/src/test/java/org/eclipse/aether/spi/connector/layout/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.spi.connector.layout; import static org.junit.Assert.*; import java.net.URI; import org.junit.Test; import org.eclipse.aether.spi.connector.layout.RepositoryLayout.Checksum; public class ChecksumTest { @Test public void testForLocation() { Checksum cs = Checksum.forLocation( URI.create( "dir/sub%20dir/file.txt" ), "SHA-1" ); assertEquals( "SHA-1", cs.getAlgorithm() ); assertEquals( "dir/sub%20dir/file.txt.sha1", cs.getLocation().toString() ); cs = Checksum.forLocation( URI.create( "dir/sub%20dir/file.txt" ), "MD5" ); assertEquals( "MD5", cs.getAlgorithm() ); assertEquals( "dir/sub%20dir/file.txt.md5", cs.getLocation().toString() ); } @Test( expected = IllegalArgumentException.class ) public void testForLocation_WithQueryParams() { Checksum.forLocation( URI.create( "file.php?param=1" ), "SHA-1" ); } @Test( expected = IllegalArgumentException.class ) public void testForLocation_WithFragment() { Checksum.forLocation( URI.create( "file.html#fragment" ), "SHA-1" ); } } aether-1.0.2.v20150114/aether-test-util/000077500000000000000000000000001245546356100172575ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/pom.xml000066400000000000000000000036731245546356100206050ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-test-util Aether Test Utilities A collection of utility classes to ease testing of the repository system. org.eclipse.aether.test-util org.eclipse.aether aether-api org.eclipse.aether aether-spi junit junit test org.hamcrest hamcrest-library test org.codehaus.mojo animal-sniffer-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-test-util/src/000077500000000000000000000000001245546356100200465ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/000077500000000000000000000000001245546356100207725ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/000077500000000000000000000000001245546356100217135ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/000077500000000000000000000000001245546356100225025ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/000077500000000000000000000000001245546356100241265ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100253765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/000077500000000000000000000000001245546356100272125ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/000077500000000000000000000000001245546356100301715ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/000077500000000000000000000000001245546356100311465ustar00rootroot00000000000000ArtifactDefinition.java000066400000000000000000000054561245546356100355120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; class ArtifactDefinition { private String groupId; private String artifactId; private String extension; private String version; private String scope = ""; private String definition; private String id; private String reference; private Boolean optional; public ArtifactDefinition( String def ) { this.definition = def.trim(); if ( definition.startsWith( "(" ) ) { int idx = definition.indexOf( ')' ); this.id = definition.substring( 1, idx ); this.definition = definition.substring( idx + 1 ); } else if ( definition.startsWith( "^" ) ) { this.reference = definition.substring( 1 ); return; } String[] split = definition.split( ":" ); if ( split.length < 4 ) { throw new IllegalArgumentException( "Need definition like 'gid:aid:ext:ver[:scope]', but was: " + definition ); } groupId = split[0]; artifactId = split[1]; extension = split[2]; version = split[3]; if ( split.length > 4 ) { scope = split[4]; } if ( split.length > 5 ) { if ( "optional".equalsIgnoreCase( split[5] ) ) { optional = true; } else if ( "!optional".equalsIgnoreCase( split[5] ) ) { optional = false; } } } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getExtension() { return extension; } public String getVersion() { return version; } public String getScope() { return scope; } @Override public String toString() { return definition; } public String getId() { return id; } public String getReference() { return reference; } public boolean isReference() { return reference != null; } public boolean hasId() { return id != null; } public Boolean getOptional() { return optional; } } ArtifactDescription.java000066400000000000000000000032321245546356100356730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.RemoteRepository; /** */ class ArtifactDescription { private List repositories; private List managedDependencies; private List dependencies; private Artifact relocation; ArtifactDescription( Artifact relocation, List dependencies, List managedDependencies, List repositories ) { this.relocation = relocation; this.dependencies = dependencies; this.managedDependencies = managedDependencies; this.repositories = repositories; } public Artifact getRelocation() { return relocation; } public List getRepositories() { return repositories; } public List getManagedDependencies() { return managedDependencies; } public List getDependencies() { return dependencies; } } DependencyGraphParser.java000066400000000000000000000377271245546356100361670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.VersionScheme; /** * Creates a dependency graph from a text description.

Definition

Each (non-empty) line in the input defines * one node of the resulting graph: * *
 * line      ::= (indent? ("(null)" | node | reference))? comment?
 * comment   ::= "#" rest-of-line
 * indent    ::= "|  "*  ("+" | "\\") "- "
 * reference ::= "^" id
 * node      ::= coords (range)? space (scope("<" premanagedScope)?)? space "optional"? space ("relocations=" coords ("," coords)*)? ("(" id ")")?
 * coords    ::= groupId ":" artifactId (":" extension (":" classifier)?)? ":" version
 * 
* * The special token {@code (null)} may be used to indicate an "empty" root node with no dependency. *

* If {@code indent} is empty, the line defines the root node. Only one root node may be defined. The level is * calculated by the distance from the beginning of the line. One level is three characters of indentation. *

* The {@code ^id} syntax allows to reuse a previously built node to share common sub graphs among different parent * nodes. *

Example

* *
 * gid:aid:ver
 * +- gid:aid2:ver scope
 * |  \- gid:aid3:ver        (id1)    # assign id for reference below
 * +- gid:aid4:ext:ver scope
 * \- ^id1                            # reuse previous node
 * 
* *

Multiple definitions in one resource

*

* By using {@link #parseMultiResource(String)}, definitions divided by a line beginning with "---" can be read from the * same resource. The rest of the line is ignored. *

Substitutions

*

* You may define substitutions (see {@link #setSubstitutions(String...)}, * {@link #DependencyGraphParser(String, Collection)}). Every '%s' in the definition will be substituted by the next * String in the defined substitutions. *

Example

* *
 * parser.setSubstitutions( "foo", "bar" );
 * String def = "gid:%s:ext:ver\n" + "+- gid:%s:ext:ver";
 * 
* * The first node will have "foo" as its artifact id, the second node (child to the first) will have "bar" as its * artifact id. */ public class DependencyGraphParser { private final VersionScheme versionScheme; private final String prefix; private Collection substitutions; /** * Create a parser with the given prefix and the given substitution strings. * * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix, Collection substitutions ) { this.prefix = prefix; this.substitutions = substitutions; versionScheme = new TestVersionScheme(); } /** * Create a parser with the given prefix. * * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix ) { this( prefix, Collections. emptyList() ); } /** * Create a parser with an empty prefix. */ public DependencyGraphParser() { this( "" ); } /** * Parse the given graph definition. */ public DependencyNode parseLiteral( String dependencyGraph ) throws IOException { BufferedReader reader = new BufferedReader( new StringReader( dependencyGraph ) ); DependencyNode node = parse( reader ); reader.close(); return node; } /** * Parse the graph definition read from the given classpath resource. If a prefix is set, this method will load the * resource from 'prefix + resource'. */ public DependencyNode parseResource( String resource ) throws IOException { URL res = this.getClass().getClassLoader().getResource( prefix + resource ); if ( res == null ) { throw new IOException( "Could not find classpath resource " + prefix + resource ); } return parse( res ); } /** * Parse multiple graphs in one resource, divided by "---". */ public List parseMultiResource( String resource ) throws IOException { URL res = this.getClass().getClassLoader().getResource( prefix + resource ); if ( res == null ) { throw new IOException( "Could not find classpath resource " + prefix + resource ); } BufferedReader reader = new BufferedReader( new InputStreamReader( res.openStream(), "UTF-8" ) ); List ret = new ArrayList(); DependencyNode root = null; while ( ( root = parse( reader ) ) != null ) { ret.add( root ); } return ret; } /** * Parse the graph definition read from the given URL. */ public DependencyNode parse( URL resource ) throws IOException { InputStream stream = null; try { stream = resource.openStream(); return parse( new BufferedReader( new InputStreamReader( stream, "UTF-8" ) ) ); } finally { if ( stream != null ) { stream.close(); } } } private DependencyNode parse( BufferedReader in ) throws IOException { Iterator substitutionIterator = ( substitutions != null ) ? substitutions.iterator() : null; String line = null; DependencyNode root = null; DependencyNode node = null; int prevLevel = 0; Map nodes = new HashMap(); LinkedList stack = new LinkedList(); boolean isRootNode = true; while ( ( line = in.readLine() ) != null ) { line = cutComment( line ); if ( isEmpty( line ) ) { // skip empty line continue; } if ( isEOFMarker( line ) ) { // stop parsing break; } while ( line.contains( "%s" ) ) { if ( !substitutionIterator.hasNext() ) { throw new IllegalArgumentException( "not enough substitutions to fill placeholders" ); } line = line.replaceFirst( "%s", substitutionIterator.next() ); } LineContext ctx = createContext( line ); if ( prevLevel < ctx.getLevel() ) { // previous node is new parent stack.add( node ); } // get to real parent while ( prevLevel > ctx.getLevel() ) { stack.removeLast(); prevLevel -= 1; } prevLevel = ctx.getLevel(); if ( ctx.getDefinition() != null && ctx.getDefinition().reference != null ) { String reference = ctx.getDefinition().reference; DependencyNode child = nodes.get( reference ); if ( child == null ) { throw new IllegalArgumentException( "undefined reference " + reference ); } node.getChildren().add( child ); } else { node = build( isRootNode ? null : stack.getLast(), ctx, isRootNode ); if ( isRootNode ) { root = node; isRootNode = false; } if ( ctx.getDefinition() != null && ctx.getDefinition().id != null ) { nodes.put( ctx.getDefinition().id, node ); } } } return root; } private boolean isEOFMarker( String line ) { return line.startsWith( "---" ); } private static boolean isEmpty( String line ) { return line == null || line.length() == 0; } private static String cutComment( String line ) { int idx = line.indexOf( '#' ); if ( idx != -1 ) { line = line.substring( 0, idx ); } return line; } private DependencyNode build( DependencyNode parent, LineContext ctx, boolean isRoot ) { NodeDefinition def = ctx.getDefinition(); if ( !isRoot && parent == null ) { throw new IllegalArgumentException( "dangling node: " + def ); } else if ( ctx.getLevel() == 0 && parent != null ) { throw new IllegalArgumentException( "inconsistent leveling (parent for level 0?): " + def ); } DefaultDependencyNode node; if ( def != null ) { DefaultArtifact artifact = new DefaultArtifact( def.coords, def.properties ); Dependency dependency = new Dependency( artifact, def.scope, def.optional ); node = new DefaultDependencyNode( dependency ); int managedBits = 0; if ( def.premanagedScope != null ) { managedBits |= DependencyNode.MANAGED_SCOPE; node.setData( "premanaged.scope", def.premanagedScope ); } if ( def.premanagedVersion != null ) { managedBits |= DependencyNode.MANAGED_VERSION; node.setData( "premanaged.version", def.premanagedVersion ); } node.setManagedBits( managedBits ); if ( def.relocations != null ) { List relocations = new ArrayList(); for ( String relocation : def.relocations ) { relocations.add( new DefaultArtifact( relocation ) ); } node.setRelocations( relocations ); } try { node.setVersion( versionScheme.parseVersion( artifact.getVersion() ) ); node.setVersionConstraint( versionScheme.parseVersionConstraint( def.range != null ? def.range : artifact.getVersion() ) ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( "bad version: " + e.getMessage(), e ); } } else { node = new DefaultDependencyNode( (Dependency) null ); } if ( parent != null ) { parent.getChildren().add( node ); } return node; } public String dump( DependencyNode root ) { StringBuilder ret = new StringBuilder(); List entries = new ArrayList(); addNode( root, 0, entries ); for ( NodeEntry nodeEntry : entries ) { char[] level = new char[( nodeEntry.getLevel() * 3 )]; Arrays.fill( level, ' ' ); if ( level.length != 0 ) { level[level.length - 3] = '+'; level[level.length - 2] = '-'; } String definition = nodeEntry.getDefinition(); ret.append( level ).append( definition ).append( "\n" ); } return ret.toString(); } private void addNode( DependencyNode root, int level, List entries ) { NodeEntry entry = new NodeEntry(); Dependency dependency = root.getDependency(); StringBuilder defBuilder = new StringBuilder(); if ( dependency == null ) { defBuilder.append( "(null)" ); } else { Artifact artifact = dependency.getArtifact(); defBuilder.append( artifact.getGroupId() ).append( ":" ).append( artifact.getArtifactId() ).append( ":" ).append( artifact.getExtension() ).append( ":" ).append( artifact.getVersion() ); if ( dependency.getScope() != null && ( !"".equals( dependency.getScope() ) ) ) { defBuilder.append( ":" ).append( dependency.getScope() ); } Map properties = artifact.getProperties(); if ( !( properties == null || properties.isEmpty() ) ) { for ( Map.Entry prop : properties.entrySet() ) { defBuilder.append( ";" ).append( prop.getKey() ).append( "=" ).append( prop.getValue() ); } } } entry.setDefinition( defBuilder.toString() ); entry.setLevel( level++ ); entries.add( entry ); for ( DependencyNode node : root.getChildren() ) { addNode( node, level, entries ); } } class NodeEntry { int level; String definition; Map properties; public int getLevel() { return level; } public void setLevel( int level ) { this.level = level; } public String getDefinition() { return definition; } public void setDefinition( String definition ) { this.definition = definition; } public Map getProperties() { return properties; } public void setProperties( Map properties ) { this.properties = properties; } } private static LineContext createContext( String line ) { LineContext ctx = new LineContext(); String definition; String[] split = line.split( "- " ); if ( split.length == 1 ) // root { ctx.setLevel( 0 ); definition = split[0]; } else { ctx.setLevel( (int) Math.ceil( (double) split[0].length() / (double) 3 ) ); definition = split[1]; } if ( "(null)".equalsIgnoreCase( definition ) ) { return ctx; } ctx.setDefinition( new NodeDefinition( definition ) ); return ctx; } static class LineContext { NodeDefinition definition; int level; public NodeDefinition getDefinition() { return definition; } public void setDefinition( NodeDefinition definition ) { this.definition = definition; } public int getLevel() { return level; } public void setLevel( int level ) { this.level = level; } } public Collection getSubstitutions() { return substitutions; } public void setSubstitutions( Collection substitutions ) { this.substitutions = substitutions; } public void setSubstitutions( String... substitutions ) { setSubstitutions( Arrays.asList( substitutions ) ); } } IniArtifactDataReader.java000066400000000000000000000240331245546356100360460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.repository.RemoteRepository; /** * @see IniArtifactDescriptorReader */ class IniArtifactDataReader { private String prefix = ""; /** * Constructs a data reader with the prefix {@code ""}. */ public IniArtifactDataReader() { this( "" ); } /** * Constructs a data reader with the given prefix. * * @param prefix the prefix to use for loading resources from the classpath. */ public IniArtifactDataReader( String prefix ) { this.prefix = prefix; } /** * Load an artifact description from the classpath and parse it. */ public ArtifactDescription parse( String resource ) throws IOException { URL res = this.getClass().getClassLoader().getResource( prefix + resource ); if ( res == null ) { throw new IOException( "cannot find resource: " + resource ); } return parse( res ); } /** * Open the given URL and parse ist. */ public ArtifactDescription parse( URL res ) throws IOException { return parse( new InputStreamReader( res.openStream(), "UTF-8" ) ); } /** * Parse the given String. */ public ArtifactDescription parseLiteral( String description ) throws IOException { StringReader reader = new StringReader( description ); return parse( reader ); } private enum State { NONE, RELOCATION, DEPENDENCIES, MANAGEDDEPENDENCIES, REPOSITORIES } private ArtifactDescription parse( Reader reader ) throws IOException { String line = null; State state = State.NONE; Map> sections = new HashMap>(); BufferedReader in = new BufferedReader( reader ); try { while ( ( line = in.readLine() ) != null ) { line = cutComment( line ); if ( isEmpty( line ) ) { continue; } if ( line.startsWith( "[" ) ) { try { String name = line.substring( 1, line.length() - 1 ); name = name.replace( "-", "" ).toUpperCase( Locale.ENGLISH ); state = State.valueOf( name ); sections.put( state, new ArrayList() ); } catch ( IllegalArgumentException e ) { throw new IOException( "unknown section: " + line ); } } else { List lines = sections.get( state ); if ( lines == null ) { throw new IOException( "missing section: " + line ); } lines.add( line.trim() ); } } } finally { in.close(); } Artifact relocation = relocation( sections.get( State.RELOCATION ) ); List dependencies = dependencies( sections.get( State.DEPENDENCIES ), false ); List managedDependencies = dependencies( sections.get( State.MANAGEDDEPENDENCIES ), true ); List repositories = repositories( sections.get( State.REPOSITORIES ) ); ArtifactDescription description = new ArtifactDescription( relocation, dependencies, managedDependencies, repositories ); return description; } private List repositories( List list ) { ArrayList ret = new ArrayList(); if ( list == null ) { return ret; } for ( String coords : list ) { String[] split = coords.split( ":", 3 ); String id = split[0]; String type = split[1]; String url = split[2]; ret.add( new RemoteRepository.Builder( id, type, url ).build() ); } return ret; } private List dependencies( List list, boolean managed ) { List ret = new ArrayList(); if ( list == null ) { return ret; } Collection exclusions = new ArrayList(); Boolean optional = null; Artifact artifact = null; String scope = null; for ( String coords : list ) { if ( coords.startsWith( "-" ) ) { coords = coords.substring( 1 ); String[] split = coords.split( ":" ); exclusions.add( new Exclusion( split[0], split[1], "*", "*" ) ); } else { if ( artifact != null ) { // commit dependency Dependency dep = new Dependency( artifact, scope, optional, exclusions ); ret.add( dep ); exclusions = new ArrayList(); } ArtifactDefinition def = new ArtifactDefinition( coords ); optional = managed ? def.getOptional() : Boolean.valueOf( Boolean.TRUE.equals( def.getOptional() ) ); scope = "".equals( def.getScope() ) && !managed ? "compile" : def.getScope(); artifact = new DefaultArtifact( def.getGroupId(), def.getArtifactId(), "", def.getExtension(), def.getVersion() ); } } if ( artifact != null ) { // commit dependency Dependency dep = new Dependency( artifact, scope, optional, exclusions ); ret.add( dep ); } return ret; } private Artifact relocation( List list ) { if ( list == null || list.isEmpty() ) { return null; } String coords = list.get( 0 ); ArtifactDefinition def = new ArtifactDefinition( coords ); return new DefaultArtifact( def.getGroupId(), def.getArtifactId(), "", def.getExtension(), def.getVersion() ); } private static boolean isEmpty( String line ) { return line == null || line.length() == 0; } private static String cutComment( String line ) { int idx = line.indexOf( '#' ); if ( idx != -1 ) { line = line.substring( 0, idx ); } return line; } static class Definition { private String groupId; private String artifactId; private String extension; private String version; private String scope = ""; private String definition; private String id = null; private String reference = null; private boolean optional = false; public Definition( String def ) { this.definition = def.trim(); if ( definition.startsWith( "(" ) ) { int idx = definition.indexOf( ')' ); this.id = definition.substring( 1, idx ); this.definition = definition.substring( idx + 1 ); } else if ( definition.startsWith( "^" ) ) { this.reference = definition.substring( 1 ); return; } String[] split = definition.split( ":" ); if ( split.length < 4 ) { throw new IllegalArgumentException( "Need definition like 'gid:aid:ext:ver[:scope]', but was: " + definition ); } groupId = split[0]; artifactId = split[1]; extension = split[2]; version = split[3]; if ( split.length > 4 ) { scope = split[4]; } if ( split.length > 5 && "true".equalsIgnoreCase( split[5] ) ) { optional = true; } } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getType() { return extension; } public String getVersion() { return version; } public String getScope() { return scope; } @Override public String toString() { return definition; } public String getId() { return id; } public String getReference() { return reference; } public boolean isReference() { return reference != null; } public boolean hasId() { return id != null; } public boolean isOptional() { return optional; } } } IniArtifactDescriptorReader.java000066400000000000000000000073501245546356100373160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; /** * An artifact descriptor reader that gets data from a simple text file on the classpath. The data file for an artifact * with the coordinates {@code gid:aid:ext:ver} is expected to be named {@code gid_aid_ver.ini} and can optionally have * some prefix. The data file can have the following sections: *
    *
  • relocation
  • *
  • dependencies
  • *
  • managedDependencies
  • *
  • repositories
  • *
* The relocation and dependency sections contain artifact coordinates of the form: * *
 * gid:aid:ext:ver[:scope][:optional]
 * 
* * The dependency sections may also specify exclusions: * *
 * -gid:aid
 * 
* * A repository definition is of the form: * *
 * id:type:url
 * 
* *

Example

* *
 * [relocation]
 * gid:aid:ext:ver
 * 
 * [dependencies]
 * gid:aid:ext:ver:scope
 * -exclusion:aid
 * gid:aid2:ext:ver:scope:optional
 * 
 * [managed-dependencies]
 * gid:aid2:ext:ver2:scope
 * -gid:aid
 * -gid:aid
 * 
 * [repositories]
 * id:type:file:///test-repo
 * 
*/ public class IniArtifactDescriptorReader { private IniArtifactDataReader reader; /** * Use the given prefix to load the artifact descriptions from the classpath. */ public IniArtifactDescriptorReader( String prefix ) { reader = new IniArtifactDataReader( prefix ); } /** * Parses the resource {@code $prefix/gid_aid_ver.ini} from the request artifact as an artifact description and * wraps it into an ArtifactDescriptorResult. */ public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, ArtifactDescriptorRequest request ) throws ArtifactDescriptorException { ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); for ( Artifact artifact = request.getArtifact();; ) { String resourceName = String.format( "%s_%s_%s.ini", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); try { ArtifactDescription data = reader.parse( resourceName ); if ( data.getRelocation() != null ) { result.addRelocation( artifact ); artifact = data.getRelocation(); } else { result.setArtifact( artifact ); result.setDependencies( data.getDependencies() ); result.setManagedDependencies( data.getManagedDependencies() ); result.setRepositories( data.getRepositories() ); return result; } } catch ( Exception e ) { throw new ArtifactDescriptorException( result, e.getMessage(), e ); } } } } NodeBuilder.java000066400000000000000000000104541245546356100341320ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.VersionScheme; /** * A builder to create dependency nodes for unit testing. */ public class NodeBuilder { private String groupId = "test"; private String artifactId = ""; private String version = "0.1"; private String range; private String ext = "jar"; private String classifier = ""; private String scope = "compile"; private boolean optional = false; private String context; private List relocations = new ArrayList(); private VersionScheme versionScheme = new TestVersionScheme(); private Map properties = new HashMap( 0 ); public NodeBuilder artifactId( String artifactId ) { this.artifactId = artifactId; return this; } public NodeBuilder groupId( String groupId ) { this.groupId = groupId; return this; } public NodeBuilder ext( String ext ) { this.ext = ext; return this; } public NodeBuilder version( String version ) { this.version = version; this.range = null; return this; } public NodeBuilder range( String range ) { this.range = range; return this; } public NodeBuilder scope( String scope ) { this.scope = scope; return this; } public NodeBuilder optional( boolean optional ) { this.optional = optional; return this; } public NodeBuilder context( String context ) { this.context = context; return this; } public NodeBuilder reloc( String artifactId ) { Artifact relocation = new DefaultArtifact( groupId, artifactId, classifier, ext, version ); relocations.add( relocation ); return this; } public NodeBuilder reloc( String groupId, String artifactId, String version ) { Artifact relocation = new DefaultArtifact( groupId, artifactId, classifier, ext, version ); relocations.add( relocation ); return this; } public NodeBuilder properties( Map properties ) { this.properties = properties != null ? properties : Collections. emptyMap(); return this; } public DependencyNode build() { Dependency dependency = null; if ( artifactId != null && artifactId.length() > 0 ) { Artifact artifact = new DefaultArtifact( groupId, artifactId, classifier, ext, version, properties, (File) null ); dependency = new Dependency( artifact, scope, optional ); } DefaultDependencyNode node = new DefaultDependencyNode( dependency ); if ( artifactId != null && artifactId.length() > 0 ) { try { node.setVersion( versionScheme.parseVersion( version ) ); node.setVersionConstraint( versionScheme.parseVersionConstraint( range != null ? range : version ) ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( "bad version: " + e.getMessage(), e ); } } node.setRequestContext( context ); node.setRelocations( relocations ); return node; } } NodeDefinition.java000066400000000000000000000075111245546356100346340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A definition of a dependency node via a single line of text. * * @see DependencyGraphParser */ class NodeDefinition { static final String ID = "\\(([-_a-zA-Z0-9]+)\\)"; static final String IDREF = "\\^([-_a-zA-Z0-9]+)"; static final String COORDS = "([^: \\(]+):([^: ]+)(?::([^: ]*)(?::([^: ]+))?)?:([^: \\[\\(<]+)"; private static final String COORDS_NC = NodeDefinition.COORDS.replaceAll( "\\((?=\\[)", "(?:" ); private static final String RANGE_NC = "[\\(\\[][^\\(\\)\\[\\]]+[\\)\\]]"; static final String RANGE = "(" + RANGE_NC + ")"; static final String SCOPE = "(?:scope\\s*=\\s*)?((?!optional)[-_a-zA-Z0-9]+)(?:<([-_a-zA-Z0-9]+))?"; static final String OPTIONAL = "(!?optional)"; static final String RELOCATIONS = "relocations\\s*=\\s*(" + COORDS_NC + "(?:\\s*,\\s*" + COORDS_NC + ")*)"; static final String KEY_VAL = "(?:[-_a-zA-Z0-9]+)\\s*:\\s*(?:[-_a-zA-Z0-9]*)"; static final String PROPS = "props\\s*=\\s*(" + KEY_VAL + "(?:\\s*,\\s*" + KEY_VAL + ")*)"; static final String COORDSX = "(" + COORDS_NC + ")" + RANGE + "?(?:<((?:" + RANGE_NC + ")|\\S+))?"; static final String NODE = COORDSX + "(?:\\s+" + PROPS + ")?" + "(?:\\s+" + SCOPE + ")?" + "(?:\\s+" + OPTIONAL + ")?" + "(?:\\s+" + RELOCATIONS + ")?" + "(?:\\s+" + ID + ")?"; static final String LINE = "(?:" + IDREF + ")|(?:" + NODE + ")"; private static final Pattern PATTERN = Pattern.compile( LINE ); private final String def; String coords; Map properties; String range; String premanagedVersion; String scope; String premanagedScope; Boolean optional; List relocations; String id; String reference; public NodeDefinition( String definition ) { def = definition.trim(); Matcher m = PATTERN.matcher( def ); if ( !m.matches() ) { throw new IllegalArgumentException( "bad syntax: " + def ); } reference = m.group( 1 ); if ( reference != null ) { return; } coords = m.group( 2 ); range = m.group( 3 ); premanagedVersion = m.group( 4 ); String props = m.group( 5 ); if ( props != null ) { properties = new LinkedHashMap(); for ( String prop : props.split( "\\s*,\\s*" ) ) { int sep = prop.indexOf( ':' ); String key = prop.substring( 0, sep ); String val = prop.substring( sep + 1 ); properties.put( key, val ); } } scope = m.group( 6 ); premanagedScope = m.group( 7 ); optional = ( m.group( 8 ) != null ) ? !m.group( 8 ).startsWith( "!" ) : Boolean.FALSE; String relocs = m.group( 9 ); if ( relocs != null ) { relocations = new ArrayList(); Collections.addAll( relocations, relocs.split( "\\s*,\\s*" ) ); } id = m.group( 10 ); } @Override public String toString() { return def; } } TestDependencyCollectionContext.java000066400000000000000000000036461245546356100402420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.graph.Dependency; /** */ final class TestDependencyCollectionContext implements DependencyCollectionContext { private final RepositorySystemSession session; private final Artifact artifact; private final Dependency dependency; private final List managedDependencies; public TestDependencyCollectionContext( RepositorySystemSession session, Artifact artifact, Dependency dependency, List managedDependencies ) { this.session = session; this.artifact = ( dependency != null ) ? dependency.getArtifact() : artifact; this.dependency = dependency; this.managedDependencies = managedDependencies; } public RepositorySystemSession getSession() { return session; } public Artifact getArtifact() { return artifact; } public Dependency getDependency() { return dependency; } public List getManagedDependencies() { return managedDependencies; } @Override public String toString() { return String.valueOf( getDependency() ); } } TestDependencyGraphTransformationContext.java000066400000000000000000000035121245546356100421270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformationContext; /** */ class TestDependencyGraphTransformationContext implements DependencyGraphTransformationContext { private final RepositorySystemSession session; private final Map map; public TestDependencyGraphTransformationContext( RepositorySystemSession session ) { this.session = session; this.map = new HashMap(); } public RepositorySystemSession getSession() { return session; } public Object get( Object key ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } return map.get( key ); } public Object put( Object key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "key must not be null" ); } if ( value != null ) { return map.put( key, value ); } else { return map.remove( key ); } } @Override public String toString() { return String.valueOf( map ); } } TestFileProcessor.java000066400000000000000000000116041245546356100353530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.BufferedOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; import org.eclipse.aether.spi.io.FileProcessor; /** * A simple file processor implementation to help satisfy component requirements during tests. */ public class TestFileProcessor implements FileProcessor { private static void close( Closeable closeable ) { if ( closeable != null ) { try { closeable.close(); } catch ( IOException e ) { // too bad but who cares } } } public boolean mkdirs( File directory ) { if ( directory == null ) { return false; } if ( directory.exists() ) { return false; } if ( directory.mkdir() ) { return true; } File canonDir = null; try { canonDir = directory.getCanonicalFile(); } catch ( IOException e ) { return false; } File parentDir = canonDir.getParentFile(); return ( parentDir != null && ( mkdirs( parentDir ) || parentDir.exists() ) && canonDir.mkdir() ); } public void write( File file, String data ) throws IOException { mkdirs( file.getParentFile() ); FileOutputStream fos = null; try { fos = new FileOutputStream( file ); if ( data != null ) { fos.write( data.getBytes( "UTF-8" ) ); } // allow output to report any flush/close errors fos.close(); } finally { close( fos ); } } public void write( File target, InputStream source ) throws IOException { mkdirs( target.getAbsoluteFile().getParentFile() ); OutputStream fos = null; try { fos = new BufferedOutputStream( new FileOutputStream( target ) ); copy( fos, source, null ); // allow output to report any flush/close errors fos.close(); } finally { close( fos ); } } public void copy( File source, File target ) throws IOException { copy( source, target, null ); } public long copy( File source, File target, ProgressListener listener ) throws IOException { long total = 0; InputStream fis = null; OutputStream fos = null; try { fis = new FileInputStream( source ); mkdirs( target.getAbsoluteFile().getParentFile() ); fos = new BufferedOutputStream( new FileOutputStream( target ) ); total = copy( fos, fis, listener ); // allow output to report any flush/close errors fos.close(); } finally { close( fis ); close( fos ); } return total; } private long copy( OutputStream os, InputStream is, ProgressListener listener ) throws IOException { long total = 0; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); byte[] array = buffer.array(); while ( true ) { int bytes = is.read( array ); if ( bytes < 0 ) { break; } os.write( array, 0, bytes ); total += bytes; if ( listener != null && bytes > 0 ) { try { buffer.rewind(); buffer.limit( bytes ); listener.progressed( buffer ); } catch ( Exception e ) { // too bad } } } return total; } public void move( File source, File target ) throws IOException { target.delete(); if ( !source.renameTo( target ) ) { copy( source, target ); target.setLastModified( source.lastModified() ); source.delete(); } } } TestFileUtils.java000066400000000000000000000163531245546356100345020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.BufferedOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.Collection; import java.util.Properties; import java.util.UUID; /** * Provides utility methods to read and write (temporary) files. */ public class TestFileUtils { private static final File TMP = new File( System.getProperty( "java.io.tmpdir" ), "aether-" + UUID.randomUUID().toString().substring( 0, 8 ) ); static { Runtime.getRuntime().addShutdownHook( new Thread() { @Override public void run() { try { deleteFile( TMP ); } catch ( IOException e ) { e.printStackTrace(); } } } ); } private TestFileUtils() { // hide constructor } public static void deleteTempFiles() throws IOException { deleteFile( TMP ); } public static void deleteFile( File file ) throws IOException { if ( file == null ) { return; } Collection undeletables = new ArrayList(); delete( file, undeletables ); if ( !undeletables.isEmpty() ) { throw new IOException( "Failed to delete " + undeletables ); } } private static void delete( File file, Collection undeletables ) { String[] children = file.list(); if ( children != null ) { for ( String child : children ) { delete( new File( file, child ), undeletables ); } } if ( !del( file ) ) { undeletables.add( file.getAbsoluteFile() ); } } private static boolean del( File file ) { for ( int i = 0; i < 10; i++ ) { if ( file.delete() || !file.exists() ) { return true; } } return false; } public static boolean mkdirs( File directory ) { if ( directory == null ) { return false; } if ( directory.exists() ) { return false; } if ( directory.mkdir() ) { return true; } File canonDir = null; try { canonDir = directory.getCanonicalFile(); } catch ( IOException e ) { return false; } File parentDir = canonDir.getParentFile(); return ( parentDir != null && ( mkdirs( parentDir ) || parentDir.exists() ) && canonDir.mkdir() ); } public static File createTempFile( String contents ) throws IOException { return createTempFile( contents.getBytes( "UTF-8" ), 1 ); } public static File createTempFile( byte[] pattern, int repeat ) throws IOException { mkdirs( TMP ); File tmpFile = File.createTempFile( "tmpfile-", ".data", TMP ); writeBytes( tmpFile, pattern, repeat ); return tmpFile; } public static File createTempDir() throws IOException { return createTempDir( "" ); } public static File createTempDir( String suffix ) throws IOException { mkdirs( TMP ); File tmpFile = File.createTempFile( "tmpdir-", suffix, TMP ); deleteFile( tmpFile ); mkdirs( tmpFile ); return tmpFile; } private static void close( Closeable c ) throws IOException { if ( c != null ) { try { c.close(); } catch ( IOException e ) { // ignore } } } public static long copyFile( File source, File target ) throws IOException { long total = 0; FileInputStream fis = null; OutputStream fos = null; try { fis = new FileInputStream( source ); mkdirs( target.getParentFile() ); fos = new BufferedOutputStream( new FileOutputStream( target ) ); for ( byte[] buffer = new byte[1024 * 32];; ) { int bytes = fis.read( buffer ); if ( bytes < 0 ) { break; } fos.write( buffer, 0, bytes ); total += bytes; } fos.close(); } finally { close( fis ); close( fos ); } return total; } public static byte[] readBytes( File file ) throws IOException { RandomAccessFile in = null; try { in = new RandomAccessFile( file, "r" ); byte[] actual = new byte[(int) in.length()]; in.readFully( actual ); return actual; } finally { close( in ); } } public static void writeBytes( File file, byte[] pattern, int repeat ) throws IOException { file.deleteOnExit(); file.getParentFile().mkdirs(); OutputStream out = null; try { out = new BufferedOutputStream( new FileOutputStream( file ) ); for ( int i = 0; i < repeat; i++ ) { out.write( pattern ); } out.close(); } finally { close( out ); } } public static String readString( File file ) throws IOException { byte[] content = readBytes( file ); return new String( content, "UTF-8" ); } public static void writeString( File file, String content ) throws IOException { writeBytes( file, content.getBytes( "UTF-8" ), 1 ); } public static void readProps( File file, Properties props ) throws IOException { FileInputStream fis = null; try { fis = new FileInputStream( file ); props.load( fis ); } finally { close( fis ); } } public static void writeProps( File file, Properties props ) throws IOException { file.getParentFile().mkdirs(); FileOutputStream fos = null; try { fos = new FileOutputStream( file ); props.store( fos, "aether-test" ); fos.close(); } finally { close( fos ); } } } TestLocalRepositoryManager.java000066400000000000000000000120111245546356100372120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.Set; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalArtifactRegistration; import org.eclipse.aether.repository.LocalArtifactRequest; import org.eclipse.aether.repository.LocalArtifactResult; import org.eclipse.aether.repository.LocalMetadataRegistration; import org.eclipse.aether.repository.LocalMetadataRequest; import org.eclipse.aether.repository.LocalMetadataResult; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; import org.eclipse.aether.repository.RemoteRepository; /** * A simplistic local repository manager that uses a temporary base directory. */ public class TestLocalRepositoryManager implements LocalRepositoryManager { private LocalRepository localRepository; private Set unavailableArtifacts = new HashSet(); private Set artifactRegistrations = new HashSet(); private Set metadataRegistrations = new HashSet(); public TestLocalRepositoryManager() { try { localRepository = new LocalRepository( TestFileUtils.createTempDir( "test-local-repo" ) ); } catch ( IOException e ) { throw new IllegalStateException( e ); } } public LocalRepository getRepository() { return localRepository; } public String getPathForLocalArtifact( Artifact artifact ) { String artifactId = artifact.getArtifactId(); String groupId = artifact.getGroupId(); String extension = artifact.getExtension(); String version = artifact.getVersion(); String classifier = artifact.getClassifier(); String path = String.format( "%s/%s/%s/%s-%s-%s%s.%s", groupId, artifactId, version, groupId, artifactId, version, classifier, extension ); return path; } public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return getPathForLocalArtifact( artifact ); } public String getPathForLocalMetadata( Metadata metadata ) { String artifactId = metadata.getArtifactId(); String groupId = metadata.getGroupId(); String version = metadata.getVersion(); return String.format( "%s/%s/%s/%s-%s-%s.xml", groupId, artifactId, version, groupId, artifactId, version ); } public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) { return getPathForLocalMetadata( metadata ); } public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) { Artifact artifact = request.getArtifact(); LocalArtifactResult result = new LocalArtifactResult( request ); File file = new File( localRepository.getBasedir(), getPathForLocalArtifact( artifact ) ); result.setFile( file.isFile() ? file : null ); result.setAvailable( file.isFile() && !unavailableArtifacts.contains( artifact ) ); return result; } public void add( RepositorySystemSession session, LocalArtifactRegistration request ) { artifactRegistrations.add( request.getArtifact() ); } public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) { Metadata metadata = request.getMetadata(); LocalMetadataResult result = new LocalMetadataResult( request ); File file = new File( localRepository.getBasedir(), getPathForLocalMetadata( metadata ) ); result.setFile( file.isFile() ? file : null ); return result; } public void add( RepositorySystemSession session, LocalMetadataRegistration request ) { metadataRegistrations.add( request.getMetadata() ); } public Set getArtifactRegistration() { return artifactRegistrations; } public Set getMetadataRegistration() { return metadataRegistrations; } public void setArtifactAvailability( Artifact artifact, boolean available ) { if ( available ) { unavailableArtifacts.remove( artifact ); } else { unavailableArtifacts.add( artifact ); } } } TestLoggerFactory.java000066400000000000000000000044651245546356100353520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.io.PrintStream; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; /** * A logger factory that writes to some {@link PrintStream}. */ public final class TestLoggerFactory implements LoggerFactory { private final Logger logger; /** * Creates a new logger factory that writes to {@link System#out}. */ public TestLoggerFactory() { this( null ); } /** * Creates a new logger factory that writes to the specified print stream. */ public TestLoggerFactory( PrintStream out ) { logger = new TestLogger( out ); } public Logger getLogger( String name ) { return logger; } private static final class TestLogger implements Logger { private final PrintStream out; public TestLogger( PrintStream out ) { this.out = ( out != null ) ? out : System.out; } public boolean isWarnEnabled() { return true; } public void warn( String msg, Throwable error ) { out.println( "[WARN] " + msg ); if ( error != null ) { error.printStackTrace( out ); } } public void warn( String msg ) { warn( msg, null ); } public boolean isDebugEnabled() { return true; } public void debug( String msg, Throwable error ) { out.println( "[DEBUG] " + msg ); if ( error != null ) { error.printStackTrace( out ); } } public void debug( String msg ) { debug( msg, null ); } } } TestUtils.java000066400000000000000000000063371245546356100337030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.resolution.VersionRangeResult; /** * Utility methods to help unit testing. */ public class TestUtils { private TestUtils() { // hide constructor } /** * Creates a new repository session whose local repository manager is initialized with an instance of * {@link TestLocalRepositoryManager}. */ public static DefaultRepositorySystemSession newSession() { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); session.setLocalRepositoryManager( new TestLocalRepositoryManager() ); return session; } /** * Creates a new dependency collection context. */ public static DependencyCollectionContext newCollectionContext( RepositorySystemSession session, Dependency dependency, List managedDependencies ) { return new TestDependencyCollectionContext( session, null, dependency, managedDependencies ); } /** * Creates a new dependency collection context. */ public static DependencyCollectionContext newCollectionContext( RepositorySystemSession session, Artifact artifact, Dependency dependency, List managedDependencies ) { return new TestDependencyCollectionContext( session, artifact, dependency, managedDependencies ); } /** * Creates a new dependency graph transformation context. */ public static DependencyGraphTransformationContext newTransformationContext( RepositorySystemSession session ) { return new TestDependencyGraphTransformationContext( session ); } /** * Creates a new version filter context from the specified session and version range result. */ public static VersionFilter.VersionFilterContext newVersionFilterContext( RepositorySystemSession session, VersionRangeResult rangeResult ) { return new TestVersionFilterContext( session, rangeResult ); } } TestVersion.java000066400000000000000000000033751245546356100342270ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import org.eclipse.aether.version.Version; /** * Version ordering by {@link String#compareToIgnoreCase(String)}. */ final class TestVersion implements Version { private String version; public TestVersion( String version ) { this.version = version == null ? "" : version; } public int compareTo( Version o ) { return version.compareTo( o.toString() ); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( version == null ) ? 0 : version.hashCode() ); return result; } @Override public boolean equals( Object obj ) { if ( this == obj ) return true; if ( obj == null ) return false; if ( getClass() != obj.getClass() ) return false; TestVersion other = (TestVersion) obj; if ( version == null ) { if ( other.version != null ) return false; } else if ( !version.equals( other.version ) ) return false; return true; } @Override public String toString() { return version; } } TestVersionConstraint.java000066400000000000000000000057531245546356100362760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; /** * A constraint on versions for a dependency. */ final class TestVersionConstraint implements VersionConstraint { private final VersionRange range; private final Version version; /** * Creates a version constraint from the specified version range. * * @param range The version range, must not be {@code null}. */ public TestVersionConstraint( VersionRange range ) { if ( range == null ) { throw new IllegalArgumentException( "version range missing" ); } this.range = range; this.version = null; } /** * Creates a version constraint from the specified version. * * @param version The version, must not be {@code null}. */ public TestVersionConstraint( Version version ) { if ( version == null ) { throw new IllegalArgumentException( "version missing" ); } this.version = version; this.range = null; } public VersionRange getRange() { return range; } public Version getVersion() { return version; } public boolean containsVersion( Version version ) { if ( range == null ) { return version.equals( this.version ); } else { return range.containsVersion( version ); } } @Override public String toString() { return String.valueOf( ( range == null ) ? version : range ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } TestVersionConstraint that = (TestVersionConstraint) obj; return eq( range, that.range ) && eq( version, that.getVersion() ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( getRange() ); hash = hash * 31 + hash( getVersion() ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } } TestVersionFilterContext.java000066400000000000000000000045321245546356100367360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.repository.ArtifactRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** */ class TestVersionFilterContext implements VersionFilter.VersionFilterContext { private final RepositorySystemSession session; private final Dependency dependency; private final VersionRangeResult result; private final List versions; public TestVersionFilterContext( RepositorySystemSession session, VersionRangeResult result ) { this.session = session; this.result = result; dependency = new Dependency( result.getRequest().getArtifact(), "" ); versions = new ArrayList( result.getVersions() ); } public RepositorySystemSession getSession() { return session; } public Dependency getDependency() { return dependency; } public int getCount() { return versions.size(); } public Iterator iterator() { return versions.iterator(); } public VersionConstraint getVersionConstraint() { return result.getVersionConstraint(); } public ArtifactRepository getRepository( Version version ) { return result.getRepository( version ); } public List getRepositories() { return Collections.unmodifiableList( result.getRequest().getRepositories() ); } } TestVersionRange.java000066400000000000000000000154641245546356100352060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; /** * A version range inspired by mathematical range syntax. For example, "[1.0,2.0)", "[1.0,)" or "[1.0]". */ final class TestVersionRange implements VersionRange { private final Version lowerBound; private final boolean lowerBoundInclusive; private final Version upperBound; private final boolean upperBoundInclusive; /** * Creates a version range from the specified range specification. * * @param range The range specification to parse, must not be {@code null}. * @throws InvalidVersionSpecificationException If the range could not be parsed. */ public TestVersionRange( String range ) throws InvalidVersionSpecificationException { String process = range; if ( range.startsWith( "[" ) ) { lowerBoundInclusive = true; } else if ( range.startsWith( "(" ) ) { lowerBoundInclusive = false; } else { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", a range must start with either [ or (" ); } if ( range.endsWith( "]" ) ) { upperBoundInclusive = true; } else if ( range.endsWith( ")" ) ) { upperBoundInclusive = false; } else { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", a range must end with either [ or (" ); } process = process.substring( 1, process.length() - 1 ); int index = process.indexOf( "," ); if ( index < 0 ) { if ( !lowerBoundInclusive || !upperBoundInclusive ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", single version must be surrounded by []" ); } lowerBound = upperBound = new TestVersion( process.trim() ); } else { String parsedLowerBound = process.substring( 0, index ).trim(); String parsedUpperBound = process.substring( index + 1 ).trim(); // more than two bounds, e.g. (1,2,3) if ( parsedUpperBound.contains( "," ) ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", bounds may not contain additional ','" ); } lowerBound = parsedLowerBound.length() > 0 ? new TestVersion( parsedLowerBound ) : null; upperBound = parsedUpperBound.length() > 0 ? new TestVersion( parsedUpperBound ) : null; if ( upperBound != null && lowerBound != null ) { if ( upperBound.compareTo( lowerBound ) < 0 ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", lower bound must not be greater than upper bound" ); } } } } public Bound getLowerBound() { return new Bound( lowerBound, lowerBoundInclusive ); } public Bound getUpperBound() { return new Bound( upperBound, upperBoundInclusive ); } public boolean acceptsSnapshots() { return isSnapshot( lowerBound ) || isSnapshot( upperBound ); } public boolean containsVersion( Version version ) { boolean snapshot = isSnapshot( version ); if ( lowerBound != null ) { int comparison = lowerBound.compareTo( version ); if ( snapshot && comparison == 0 ) { return true; } if ( comparison == 0 && !lowerBoundInclusive ) { return false; } if ( comparison > 0 ) { return false; } } if ( upperBound != null ) { int comparison = upperBound.compareTo( version ); if ( snapshot && comparison == 0 ) { return true; } if ( comparison == 0 && !upperBoundInclusive ) { return false; } if ( comparison < 0 ) { return false; } } if ( lowerBound != null || upperBound != null ) { return !snapshot; } return true; } private boolean isSnapshot( Version version ) { return version != null && version.toString().endsWith( "SNAPSHOT" ); } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } TestVersionRange that = (TestVersionRange) obj; return upperBoundInclusive == that.upperBoundInclusive && lowerBoundInclusive == that.lowerBoundInclusive && eq( upperBound, that.upperBound ) && eq( lowerBound, that.lowerBound ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( upperBound ); hash = hash * 31 + ( upperBoundInclusive ? 1 : 0 ); hash = hash * 31 + hash( lowerBound ); hash = hash * 31 + ( lowerBoundInclusive ? 1 : 0 ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); buffer.append( lowerBoundInclusive ? '[' : '(' ); if ( lowerBound != null ) { buffer.append( lowerBound ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound ); } buffer.append( upperBoundInclusive ? ']' : ')' ); return buffer.toString(); } } TestVersionScheme.java000066400000000000000000000064101245546356100353450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import java.util.ArrayList; import java.util.Collection; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; import org.eclipse.aether.version.VersionScheme; /** * A version scheme using a generic version syntax. */ final class TestVersionScheme implements VersionScheme { public Version parseVersion( final String version ) throws InvalidVersionSpecificationException { return new TestVersion( version ); } public VersionRange parseVersionRange( final String range ) throws InvalidVersionSpecificationException { return new TestVersionRange( range ); } public VersionConstraint parseVersionConstraint( final String constraint ) throws InvalidVersionSpecificationException { Collection ranges = new ArrayList(); String process = constraint; while ( process.startsWith( "[" ) || process.startsWith( "(" ) ) { int index1 = process.indexOf( ')' ); int index2 = process.indexOf( ']' ); int index = index2; if ( index2 < 0 || ( index1 >= 0 && index1 < index2 ) ) { index = index1; } if ( index < 0 ) { throw new InvalidVersionSpecificationException( constraint, "Unbounded version range " + constraint ); } VersionRange range = parseVersionRange( process.substring( 0, index + 1 ) ); ranges.add( range ); process = process.substring( index + 1 ).trim(); if ( process.length() > 0 && process.startsWith( "," ) ) { process = process.substring( 1 ).trim(); } } if ( process.length() > 0 && !ranges.isEmpty() ) { throw new InvalidVersionSpecificationException( constraint, "Invalid version range " + constraint + ", expected [ or ( but got " + process ); } VersionConstraint result; if ( ranges.isEmpty() ) { result = new TestVersionConstraint( parseVersion( constraint ) ); } else { result = new TestVersionConstraint( ranges.iterator().next() ); } return result; } @Override public boolean equals( final Object obj ) { if ( this == obj ) { return true; } return obj != null && getClass().equals( obj.getClass() ); } @Override public int hashCode() { return getClass().hashCode(); } } package-info.java000066400000000000000000000015561245546356100342650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Utility classes to ease unit testing. This package supports the needs of Aether's own codebase but implementors of * extensions might find some of these classes useful, too, as long as they understand that these classes do not denote * a stable API and are subject to change without prior notice. */ package org.eclipse.aether.internal.test.util; aether-1.0.2.v20150114/aether-test-util/src/main/resources/000077500000000000000000000000001245546356100230045ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/main/resources/about.html000066400000000000000000000026401245546356100250060ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-test-util/src/test/000077500000000000000000000000001245546356100210255ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/000077500000000000000000000000001245546356100217465ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/000077500000000000000000000000001245546356100225355ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/000077500000000000000000000000001245546356100241615ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100254315ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/000077500000000000000000000000001245546356100272455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/000077500000000000000000000000001245546356100302245ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/000077500000000000000000000000001245546356100312015ustar00rootroot00000000000000DependencyGraphParserTest.java000066400000000000000000000216071245546356100370500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import static org.junit.Assert.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.List; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Before; import org.junit.Test; /** */ public class DependencyGraphParserTest { private DependencyGraphParser parser; @Before public void setup() { this.parser = new DependencyGraphParser(); } @Test public void testOnlyRoot() throws IOException { String def = "gid:aid:jar:1 scope"; DependencyNode node = parser.parseLiteral( def ); assertNotNull( node ); assertEquals( 0, node.getChildren().size() ); Dependency dependency = node.getDependency(); assertNotNull( dependency ); assertEquals( "scope", dependency.getScope() ); Artifact artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "jar", artifact.getExtension() ); assertEquals( "1", artifact.getVersion() ); } @Test public void testOptionalScope() throws IOException { String def = "gid:aid:jar:1"; DependencyNode node = parser.parseLiteral( def ); assertNotNull( node ); assertEquals( 0, node.getChildren().size() ); Dependency dependency = node.getDependency(); assertNotNull( dependency ); assertEquals( "", dependency.getScope() ); } @Test public void testWithChildren() throws IOException { String def = "gid1:aid1:ext1:ver1 scope1\n" + "+- gid2:aid2:ext2:ver2 scope2\n" + "\\- gid3:aid3:ext3:ver3 scope3\n"; DependencyNode node = parser.parseLiteral( def ); assertNotNull( node ); int idx = 1; assertNodeProperties( node, idx++ ); List children = node.getChildren(); assertEquals( 2, children.size() ); for ( DependencyNode child : children ) { assertNodeProperties( child, idx++ ); } } @Test public void testDeepChildren() throws IOException { String def = "gid1:aid1:ext1:ver1\n" + "+- gid2:aid2:ext2:ver2 scope2\n" + "| \\- gid3:aid3:ext3:ver3\n" + "\\- gid4:aid4:ext4:ver4 scope4"; DependencyNode node = parser.parseLiteral( def ); assertNodeProperties( node, 1 ); assertEquals( 2, node.getChildren().size() ); assertNodeProperties( node.getChildren().get( 1 ), 4 ); DependencyNode lvl1Node = node.getChildren().get( 0 ); assertNodeProperties( lvl1Node, 2 ); assertEquals( 1, lvl1Node.getChildren().size() ); assertNodeProperties( lvl1Node.getChildren().get( 0 ), 3 ); } private void assertNodeProperties( DependencyNode node, int idx ) { assertNodeProperties( node, String.valueOf( idx ) ); } private void assertNodeProperties( DependencyNode node, String suffix ) { assertNotNull( node ); Dependency dependency = node.getDependency(); assertNotNull( dependency ); if ( !"".equals( dependency.getScope() ) ) { assertEquals( "scope" + suffix, dependency.getScope() ); } Artifact artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "gid" + suffix, artifact.getGroupId() ); assertEquals( "aid" + suffix, artifact.getArtifactId() ); assertEquals( "ext" + suffix, artifact.getExtension() ); assertEquals( "ver" + suffix, artifact.getVersion() ); } @Test public void testComments() throws IOException { String def = "# first line\n#second line\ngid:aid:ext:ver # root artifact asdf:qwer:zcxv:uip"; DependencyNode node = parser.parseLiteral( def ); assertNodeProperties( node, "" ); } @Test public void testId() throws IOException { String def = "gid:aid:ext:ver (id)\n\\- ^id"; DependencyNode node = parser.parseLiteral( def ); assertNodeProperties( node, "" ); assertNotNull( node.getChildren() ); assertEquals( 1, node.getChildren().size() ); assertSame( node, node.getChildren().get( 0 ) ); } @Test public void testResourceLoading() throws UnsupportedEncodingException, IOException { String prefix = "org/eclipse/aether/internal/test/util/"; String name = "testResourceLoading.txt"; DependencyNode node = parser.parseResource( prefix + name ); assertEquals( 0, node.getChildren().size() ); assertNodeProperties( node, "" ); } @Test public void testResourceLoadingWithPrefix() throws UnsupportedEncodingException, IOException { String prefix = "org/eclipse/aether/internal/test/util/"; parser = new DependencyGraphParser( prefix ); String name = "testResourceLoading.txt"; DependencyNode node = parser.parseResource( name ); assertEquals( 0, node.getChildren().size() ); assertNodeProperties( node, "" ); } @Test public void testProperties() throws IOException { String def = "gid:aid:ext:ver props=test:foo,test2:fizzle"; DependencyNode node = parser.parseLiteral( def ); assertNodeProperties( node, "" ); Map properties = node.getDependency().getArtifact().getProperties(); assertNotNull( properties ); assertEquals( 2, properties.size() ); assertTrue( properties.containsKey( "test" ) ); assertEquals( "foo", properties.get( "test" ) ); assertTrue( properties.containsKey( "test2" ) ); assertEquals( "fizzle", properties.get( "test2" ) ); } @Test public void testSubstitutions() throws IOException { parser.setSubstitutions( Arrays.asList( "subst1", "subst2" ) ); String def = "%s:%s:ext:ver"; DependencyNode root = parser.parseLiteral( def ); Artifact artifact = root.getDependency().getArtifact(); assertEquals( "subst2", artifact.getArtifactId() ); assertEquals( "subst1", artifact.getGroupId() ); def = "%s:aid:ext:ver\n\\- %s:aid:ext:ver"; root = parser.parseLiteral( def ); assertEquals( "subst1", root.getDependency().getArtifact().getGroupId() ); assertEquals( "subst2", root.getChildren().get( 0 ).getDependency().getArtifact().getGroupId() ); } @Test public void testMultiple() throws IOException { String prefix = "org/eclipse/aether/internal/test/util/"; String name = "testResourceLoading.txt"; List nodes = parser.parseMultiResource( prefix + name ); assertEquals( 2, nodes.size() ); assertEquals( "aid", nodes.get( 0 ).getDependency().getArtifact().getArtifactId() ); assertEquals( "aid2", nodes.get( 1 ).getDependency().getArtifact().getArtifactId() ); } @Test public void testRootNullDependency() throws IOException { String literal = "(null)\n+- gid:aid:ext:ver"; DependencyNode root = parser.parseLiteral( literal ); assertNull( root.getDependency() ); assertEquals( 1, root.getChildren().size() ); } @Test public void testChildNullDependency() throws IOException { String literal = "gid:aid:ext:ver\n+- (null)"; DependencyNode root = parser.parseLiteral( literal ); assertNotNull( root.getDependency() ); assertEquals( 1, root.getChildren().size() ); assertNull( root.getChildren().get( 0 ).getDependency() ); } @Test public void testOptional() throws IOException { String def = "gid:aid:jar:1 compile optional"; DependencyNode node = parser.parseLiteral( def ); assertNotNull( node ); assertEquals( 0, node.getChildren().size() ); Dependency dependency = node.getDependency(); assertNotNull( dependency ); assertEquals( "compile", dependency.getScope() ); assertEquals( true, dependency.isOptional() ); } } IniArtifactDataReaderTest.java000066400000000000000000000201621245546356100367400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import static org.junit.Assert.*; import java.io.IOException; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.internal.test.util.ArtifactDescription; import org.eclipse.aether.internal.test.util.IniArtifactDataReader; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Before; import org.junit.Test; /** */ public class IniArtifactDataReaderTest { private IniArtifactDataReader parser; @Before public void setup() throws Exception { this.parser = new IniArtifactDataReader( "org/eclipse/aether/internal/test/util/" ); } @Test public void testRelocation() throws IOException { String def = "[relocation]\ngid:aid:ext:ver"; ArtifactDescription description = parser.parseLiteral( def ); Artifact artifact = description.getRelocation(); assertNotNull( artifact ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "ver", artifact.getVersion() ); assertEquals( "ext", artifact.getExtension() ); } @Test public void testDependencies() throws IOException { String def = "[dependencies]\ngid:aid:ext:ver\n-exclusion:aid\ngid2:aid2:ext2:ver2"; ArtifactDescription description = parser.parseLiteral( def ); List dependencies = description.getDependencies(); assertNotNull( dependencies ); assertEquals( 2, dependencies.size() ); Dependency dependency = dependencies.get( 0 ); assertEquals( "compile", dependency.getScope() ); Artifact artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "ver", artifact.getVersion() ); assertEquals( "ext", artifact.getExtension() ); Collection exclusions = dependency.getExclusions(); assertNotNull( exclusions ); assertEquals( 1, exclusions.size() ); Exclusion exclusion = exclusions.iterator().next(); assertEquals( "exclusion", exclusion.getGroupId() ); assertEquals( "aid", exclusion.getArtifactId() ); assertEquals( "*", exclusion.getClassifier() ); assertEquals( "*", exclusion.getExtension() ); dependency = dependencies.get( 1 ); artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "aid2", artifact.getArtifactId() ); assertEquals( "gid2", artifact.getGroupId() ); assertEquals( "ver2", artifact.getVersion() ); assertEquals( "ext2", artifact.getExtension() ); } @Test public void testManagedDependencies() throws IOException { String def = "[managed-dependencies]\ngid:aid:ext:ver\n-exclusion:aid\ngid2:aid2:ext2:ver2:runtime"; ArtifactDescription description = parser.parseLiteral( def ); List dependencies = description.getManagedDependencies(); assertNotNull( dependencies ); assertEquals( 2, dependencies.size() ); Dependency dependency = dependencies.get( 0 ); assertEquals( "", dependency.getScope() ); Artifact artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "ver", artifact.getVersion() ); assertEquals( "ext", artifact.getExtension() ); Collection exclusions = dependency.getExclusions(); assertNotNull( exclusions ); assertEquals( 1, exclusions.size() ); Exclusion exclusion = exclusions.iterator().next(); assertEquals( "exclusion", exclusion.getGroupId() ); assertEquals( "aid", exclusion.getArtifactId() ); assertEquals( "*", exclusion.getClassifier() ); assertEquals( "*", exclusion.getExtension() ); dependency = dependencies.get( 1 ); assertEquals( "runtime", dependency.getScope() ); artifact = dependency.getArtifact(); assertNotNull( artifact ); assertEquals( "aid2", artifact.getArtifactId() ); assertEquals( "gid2", artifact.getGroupId() ); assertEquals( "ver2", artifact.getVersion() ); assertEquals( "ext2", artifact.getExtension() ); assertEquals( 0, dependency.getExclusions().size() ); } @Test public void testResource() throws IOException { ArtifactDescription description = parser.parse( "ArtifactDataReaderTest.ini" ); Artifact artifact = description.getRelocation(); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "ver", artifact.getVersion() ); assertEquals( "ext", artifact.getExtension() ); assertEquals( 1, description.getRepositories().size() ); RemoteRepository repo = description.getRepositories().get( 0 ); assertEquals( "id", repo.getId() ); assertEquals( "type", repo.getContentType() ); assertEquals( "protocol://some/url?for=testing", repo.getUrl() ); assertDependencies( description.getDependencies() ); assertDependencies( description.getManagedDependencies() ); } private void assertDependencies( List deps ) { assertEquals( 4, deps.size() ); Dependency dep = deps.get( 0 ); assertEquals( "scope", dep.getScope() ); assertEquals( false, dep.isOptional() ); assertEquals( 2, dep.getExclusions().size() ); Iterator it = dep.getExclusions().iterator(); Exclusion excl = it.next(); assertEquals( "gid3", excl.getGroupId() ); assertEquals( "aid", excl.getArtifactId() ); excl = it.next(); assertEquals( "gid2", excl.getGroupId() ); assertEquals( "aid2", excl.getArtifactId() ); Artifact art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 1 ); assertEquals( "scope", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid2", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 2 ); assertEquals( "scope", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver3", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 3 ); assertEquals( "scope5", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid1", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); } } IniArtifactDescriptorReaderTest.java000066400000000000000000000125171245546356100402120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import static org.junit.Assert.*; import java.io.IOException; import java.util.Iterator; import java.util.List; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.internal.test.util.IniArtifactDescriptorReader; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorException; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.junit.Before; import org.junit.Test; /** */ public class IniArtifactDescriptorReaderTest { private IniArtifactDescriptorReader reader; private RepositorySystemSession session; @Before public void setup() throws IOException { reader = new IniArtifactDescriptorReader( "org/eclipse/aether/internal/test/util/" ); session = TestUtils.newSession(); } @Test( expected = ArtifactDescriptorException.class ) public void testMissingDescriptor() throws ArtifactDescriptorException { Artifact art = new DefaultArtifact( "missing:aid:ver:ext" ); ArtifactDescriptorRequest request = new ArtifactDescriptorRequest( art, null, "" ); reader.readArtifactDescriptor( session, request ); } @Test public void testLookup() throws ArtifactDescriptorException { Artifact art = new DefaultArtifact( "gid:aid:ext:ver" ); ArtifactDescriptorRequest request = new ArtifactDescriptorRequest( art, null, "" ); ArtifactDescriptorResult description = reader.readArtifactDescriptor( session, request ); assertEquals( request, description.getRequest() ); assertEquals( art.setVersion( "1" ), description.getArtifact() ); assertEquals( 1, description.getRelocations().size() ); Artifact artifact = description.getRelocations().get( 0 ); assertEquals( "gid", artifact.getGroupId() ); assertEquals( "aid", artifact.getArtifactId() ); assertEquals( "ver", artifact.getVersion() ); assertEquals( "ext", artifact.getExtension() ); assertEquals( 1, description.getRepositories().size() ); RemoteRepository repo = description.getRepositories().get( 0 ); assertEquals( "id", repo.getId() ); assertEquals( "type", repo.getContentType() ); assertEquals( "protocol://some/url?for=testing", repo.getUrl() ); assertDependencies( description.getDependencies() ); assertDependencies( description.getManagedDependencies() ); } private void assertDependencies( List deps ) { assertEquals( 4, deps.size() ); Dependency dep = deps.get( 0 ); assertEquals( "scope", dep.getScope() ); assertEquals( false, dep.isOptional() ); assertEquals( 2, dep.getExclusions().size() ); Iterator it = dep.getExclusions().iterator(); Exclusion excl = it.next(); assertEquals( "gid3", excl.getGroupId() ); assertEquals( "aid", excl.getArtifactId() ); excl = it.next(); assertEquals( "gid2", excl.getGroupId() ); assertEquals( "aid2", excl.getArtifactId() ); Artifact art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 1 ); assertEquals( "scope", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid2", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 2 ); assertEquals( "scope", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver3", art.getVersion() ); assertEquals( "ext", art.getExtension() ); dep = deps.get( 3 ); assertEquals( "scope5", dep.getScope() ); assertEquals( true, dep.isOptional() ); assertEquals( 0, dep.getExclusions().size() ); art = dep.getArtifact(); assertEquals( "gid1", art.getGroupId() ); assertEquals( "aid", art.getArtifactId() ); assertEquals( "ver", art.getVersion() ); assertEquals( "ext", art.getExtension() ); } } NodeDefinitionTest.java000066400000000000000000000146011245546356100355250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.test.util; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collections; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Test; public class NodeDefinitionTest { private void assertMatch( String text, String regex, String... groups ) { Pattern pattern = Pattern.compile( regex ); Matcher matcher = pattern.matcher( text ); assertEquals( true, matcher.matches() ); assertTrue( groups.length + " vs " + matcher.groupCount(), groups.length <= matcher.groupCount() ); for ( int i = 1; i <= groups.length; i++ ) { assertEquals( "Mismatch for group " + i, groups[i - 1], matcher.group( i ) ); } } private void assertNoMatch( String text, String regex ) { Pattern pattern = Pattern.compile( regex ); Matcher matcher = pattern.matcher( text ); assertEquals( false, matcher.matches() ); } @Test public void testPatterns() { assertMatch( "(Example-ID_0123456789)", NodeDefinition.ID, "Example-ID_0123456789" ); assertMatch( "^Example-ID_0123456789", NodeDefinition.IDREF, "Example-ID_0123456789" ); assertMatch( "gid:aid:1", NodeDefinition.COORDS, "gid", "aid", null, null, "1" ); assertMatch( "gid:aid:jar:1", NodeDefinition.COORDS, "gid", "aid", "jar", null, "1" ); assertMatch( "gid:aid:jar:cls:1", NodeDefinition.COORDS, "gid", "aid", "jar", "cls", "1" ); assertMatch( "[1]", NodeDefinition.RANGE, "[1]" ); assertMatch( "[1,)", NodeDefinition.RANGE, "[1,)" ); assertMatch( "(1,2)", NodeDefinition.RANGE, "(1,2)" ); assertMatch( "scope = compile", NodeDefinition.SCOPE, "compile", null ); assertMatch( "scope=compile 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-transport-classpath Aether Transport Classpath A transport implementation for repositories using classpath:// URLs. org.eclipse.aether.transport.classpath org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util javax.inject javax.inject provided true org.sonatype.sisu sisu-guice no_aop test junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.codehaus.mojo animal-sniffer-maven-plugin org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-transport-classpath/src/000077500000000000000000000000001245546356100221305ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/000077500000000000000000000000001245546356100230545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/000077500000000000000000000000001245546356100237755ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/000077500000000000000000000000001245546356100245645ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/000077500000000000000000000000001245546356100262105ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100274605ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100315145ustar00rootroot00000000000000classpath/000077500000000000000000000000001245546356100334175ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transportClasspathTransporter.java000066400000000000000000000101041245546356100404440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.classpath; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.AbstractTransporter; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.TransportTask; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.util.ConfigUtils; /** * A transporter reading from the classpath. */ final class ClasspathTransporter extends AbstractTransporter { private final String resourceBase; private final ClassLoader classLoader; public ClasspathTransporter( RepositorySystemSession session, RemoteRepository repository, Logger logger ) throws NoTransporterException { if ( !"classpath".equalsIgnoreCase( repository.getProtocol() ) ) { throw new NoTransporterException( repository ); } String base; try { URI uri = new URI( repository.getUrl() ); String ssp = uri.getSchemeSpecificPart(); if ( ssp.startsWith( "/" ) ) { base = uri.getPath(); if ( base == null ) { base = ""; } else if ( base.startsWith( "/" ) ) { base = base.substring( 1 ); } } else { base = ssp; } if ( base.length() > 0 && !base.endsWith( "/" ) ) { base += '/'; } } catch ( URISyntaxException e ) { throw new NoTransporterException( repository, e ); } resourceBase = base; Object cl = ConfigUtils.getObject( session, null, ClasspathTransporterFactory.CONFIG_PROP_CLASS_LOADER ); if ( cl instanceof ClassLoader ) { classLoader = (ClassLoader) cl; } else { classLoader = Thread.currentThread().getContextClassLoader(); } } private URL getResource( TransportTask task ) throws Exception { String resource = resourceBase + task.getLocation().getPath(); URL url = classLoader.getResource( resource ); if ( url == null ) { throw new ResourceNotFoundException( "Could not locate " + resource ); } return url; } public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } @Override protected void implPeek( PeekTask task ) throws Exception { getResource( task ); } @Override protected void implGet( GetTask task ) throws Exception { URL url = getResource( task ); URLConnection conn = url.openConnection(); utilGet( task, conn.getInputStream(), true, conn.getContentLength(), false ); } @Override protected void implPut( PutTask task ) throws Exception { throw new UnsupportedOperationException( "Uploading to a classpath: repository is not supported" ); } @Override protected void implClose() { } } ClasspathTransporterFactory.java000066400000000000000000000077611245546356100420130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.classpath; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoTransporterException; /** * A transporter factory for repositories using the {@code classpath:} protocol. As example, getting an item named * {@code some/file.txt} from a repository with the URL {@code classpath:/base/dir} results in retrieving the resource * {@code base/dir/some/file.txt} from the classpath. The classpath to load the resources from is given via a * {@link ClassLoader} that can be configured via the configuration property {@link #CONFIG_PROP_CLASS_LOADER}. *

* Note: Such repositories are read-only and uploads to them are generally not supported. */ @Named( "classpath" ) public final class ClasspathTransporterFactory implements TransporterFactory, Service { /** * The key in the repository session's {@link RepositorySystemSession#getConfigProperties() configuration * properties} used to store a {@link ClassLoader} from which resources should be retrieved. If unspecified, the * {@link Thread#getContextClassLoader() context class loader} of the current thread will be used. */ public static final String CONFIG_PROP_CLASS_LOADER = "aether.connector.classpath.loader"; private Logger logger = NullLoggerFactory.LOGGER; private float priority; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation * by clients, the new factory needs to be configured via its various mutators before first use or runtime errors * will occur. */ public ClasspathTransporterFactory() { // enables default constructor } @Inject ClasspathTransporterFactory( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } /** * Sets the logger factory to use for this component. * * @param loggerFactory The logger factory to use, may be {@code null} to disable logging. * @return This component for chaining, never {@code null}. */ public ClasspathTransporterFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, ClasspathTransporter.class ); return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public ClasspathTransporterFactory setPriority( float priority ) { this.priority = priority; return this; } public Transporter newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException { return new ClasspathTransporter( session, repository, logger ); } } ResourceNotFoundException.java000066400000000000000000000016131245546356100414060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.classpath; import java.io.IOException; /** * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated * to the remote resource. */ class ResourceNotFoundException extends IOException { public ResourceNotFoundException( String message ) { super( message ); } } package-info.java000066400000000000000000000012121245546356100366020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Support for downloads that utilize the classpath as "remote" storage. */ package org.eclipse.aether.transport.classpath; aether-1.0.2.v20150114/aether-transport-classpath/src/main/resources/000077500000000000000000000000001245546356100250665ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/main/resources/about.html000066400000000000000000000026401245546356100270700ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-transport-classpath/src/test/000077500000000000000000000000001245546356100231075ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/000077500000000000000000000000001245546356100240305ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/000077500000000000000000000000001245546356100246175ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/000077500000000000000000000000001245546356100262435ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100275135ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100315475ustar00rootroot00000000000000classpath/000077500000000000000000000000001245546356100334525ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/aether/transportClasspathTransporterTest.java000066400000000000000000000270171245546356100413520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.classpath; import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; import java.net.URI; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferCancelledException; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class ClasspathTransporterTest { private DefaultRepositorySystemSession session; private TransporterFactory factory; private Transporter transporter; private RemoteRepository newRepo( String url ) { return new RemoteRepository.Builder( "test", "default", url ).build(); } private void newTransporter( String url ) throws Exception { if ( transporter != null ) { transporter.close(); transporter = null; } transporter = factory.newInstance( session, newRepo( url ) ); } @Before public void setUp() throws Exception { session = TestUtils.newSession(); factory = new ClasspathTransporterFactory( new TestLoggerFactory() ); newTransporter( "classpath:/repository" ); } @After public void tearDown() { if ( transporter != null ) { transporter.close(); transporter = null; } factory = null; session = null; } @Test public void testClassify() throws Exception { assertEquals( Transporter.ERROR_OTHER, transporter.classify( new FileNotFoundException() ) ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( new ResourceNotFoundException( "test" ) ) ); } @Test public void testPeek() throws Exception { transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testPeek_NotFound() throws Exception { try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceNotFoundException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testPeek_Closed() throws Exception { transporter.close(); try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_ToMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ToFile() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "test", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EmptyResource() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EncodedResourcePath() throws Exception { GetTask task = new GetTask( URI.create( "some%20space.txt" ) ); transporter.get( task ); assertEquals( "space", task.getDataString() ); } @Test public void testGet_Fragment() throws Exception { GetTask task = new GetTask( URI.create( "file.txt#ignored" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } @Test public void testGet_Query() throws Exception { GetTask task = new GetTask( URI.create( "file.txt?ignored" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } @Test public void testGet_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File file = TestFileUtils.createTempFile( "failure" ); transporter.get( new GetTask( URI.create( "file.txt" ) ).setDataFile( file ) ); assertTrue( i + ", " + file.getAbsolutePath(), file.delete() ); } } @Test public void testGet_NotFound() throws Exception { try { transporter.get( new GetTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceNotFoundException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testGet_Closed() throws Exception { transporter.close(); try { transporter.get( new GetTask( URI.create( "file.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testGet_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test public void testPut() throws Exception { try { transporter.put( new PutTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( UnsupportedOperationException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPut_Closed() throws Exception { transporter.close(); try { transporter.put( new PutTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test( expected = NoTransporterException.class ) public void testInit_BadProtocol() throws Exception { newTransporter( "bad:/void" ); } @Test public void testInit_CaseInsensitiveProtocol() throws Exception { newTransporter( "classpath:/void" ); newTransporter( "CLASSPATH:/void" ); newTransporter( "ClassPath:/void" ); } @Test public void testInit_OpaqueUrl() throws Exception { testInit( "classpath:repository" ); } @Test public void testInit_OpaqueUrlTrailingSlash() throws Exception { testInit( "classpath:repository/" ); } @Test public void testInit_OpaqueUrlSpaces() throws Exception { testInit( "classpath:repo%20space" ); } @Test public void testInit_HierarchicalUrl() throws Exception { testInit( "classpath:/repository" ); } @Test public void testInit_HierarchicalUrlTrailingSlash() throws Exception { testInit( "classpath:/repository/" ); } @Test public void testInit_HierarchicalUrlSpaces() throws Exception { testInit( "classpath:/repo%20space" ); } @Test public void testInit_HierarchicalUrlRoot() throws Exception { testInit( "classpath:/" ); } @Test public void testInit_HierarchicalUrlNoPath() throws Exception { testInit( "classpath://reserved" ); } private void testInit( String base ) throws Exception { newTransporter( base ); GetTask task = new GetTask( URI.create( "file.txt" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } } RecordingTransportListener.java000066400000000000000000000034621245546356100416610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.classpath; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; class RecordingTransportListener extends TransportListener { public final ByteArrayOutputStream baos = new ByteArrayOutputStream( 1024 ); public long dataOffset; public long dataLength; public int startedCount; public int progressedCount; public boolean cancelStart; public boolean cancelProgress; @Override public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { startedCount++; progressedCount = 0; this.dataLength = dataLength; this.dataOffset = dataOffset; baos.reset(); if ( cancelStart ) { throw new TransferCancelledException(); } } @Override public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { progressedCount++; baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() ); if ( cancelProgress ) { throw new TransferCancelledException(); } } } aether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/000077500000000000000000000000001245546356100251215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/file.txt000066400000000000000000000000041245546356100265730ustar00rootroot00000000000000testaether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repo space/000077500000000000000000000000001245546356100271425ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repo space/file.txt000066400000000000000000000000041245546356100306140ustar00rootroot00000000000000testaether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repository/000077500000000000000000000000001245546356100273405ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repository/empty.txt000066400000000000000000000000001245546356100312250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repository/file.txt000066400000000000000000000000041245546356100310120ustar00rootroot00000000000000testaether-1.0.2.v20150114/aether-transport-classpath/src/test/resources/repository/some space.txt000066400000000000000000000000051245546356100321130ustar00rootroot00000000000000spaceaether-1.0.2.v20150114/aether-transport-file/000077500000000000000000000000001245546356100202765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/pom.xml000066400000000000000000000052711245546356100216200ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-transport-file Aether Transport File A transport implementation for repositories using file:// URLs. org.eclipse.aether.transport.file org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util javax.inject javax.inject provided true org.sonatype.sisu sisu-guice no_aop test junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.codehaus.mojo animal-sniffer-maven-plugin org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-transport-file/src/000077500000000000000000000000001245546356100210655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/000077500000000000000000000000001245546356100220115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/000077500000000000000000000000001245546356100227325ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/000077500000000000000000000000001245546356100235215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/000077500000000000000000000000001245546356100251455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100264155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100304515ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/000077500000000000000000000000001245546356100313705ustar00rootroot00000000000000FileTransporter.java000066400000000000000000000064461245546356100353110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.AbstractTransporter; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.TransportTask; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.NoTransporterException; /** * A transporter using {@link java.io.File}. */ final class FileTransporter extends AbstractTransporter { private final Logger logger; private final File basedir; public FileTransporter( RemoteRepository repository, Logger logger ) throws NoTransporterException { if ( !"file".equalsIgnoreCase( repository.getProtocol() ) ) { throw new NoTransporterException( repository ); } this.logger = logger; basedir = new File( PathUtils.basedir( repository.getUrl() ) ).getAbsoluteFile(); } File getBasedir() { return basedir; } public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } @Override protected void implPeek( PeekTask task ) throws Exception { getFile( task, true ); } @Override protected void implGet( GetTask task ) throws Exception { File file = getFile( task, true ); utilGet( task, new FileInputStream( file ), true, file.length(), false ); } @Override protected void implPut( PutTask task ) throws Exception { File file = getFile( task, false ); file.getParentFile().mkdirs(); try { utilPut( task, new FileOutputStream( file ), true ); } catch ( Exception e ) { if ( !file.delete() && file.exists() ) { logger.debug( "Could not delete partial file " + file ); } throw e; } } private File getFile( TransportTask task, boolean required ) throws Exception { String path = task.getLocation().getPath(); if ( path.contains( "../" ) ) { throw new IllegalArgumentException( "Illegal resource path: " + path ); } File file = new File( basedir, path ); if ( required && !file.exists() ) { throw new ResourceNotFoundException( "Could not locate " + file ); } return file; } @Override protected void implClose() { } } FileTransporterFactory.java000066400000000000000000000060331245546356100366310ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoTransporterException; /** * A transporter factory for repositories using the {@code file:} protocol. */ @Named( "file" ) public final class FileTransporterFactory implements TransporterFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private float priority; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation * by clients, the new factory needs to be configured via its various mutators before first use or runtime errors * will occur. */ public FileTransporterFactory() { // enables default constructor } @Inject FileTransporterFactory( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } /** * Sets the logger factory to use for this component. * * @param loggerFactory The logger factory to use, may be {@code null} to disable logging. * @return This component for chaining, never {@code null}. */ public FileTransporterFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, FileTransporter.class ); return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public FileTransporterFactory setPriority( float priority ) { this.priority = priority; return this; } public Transporter newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException { return new FileTransporter( repository, logger ); } } PathUtils.java000066400000000000000000000101621245546356100340710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; /** * URL handling for file URLs. Based on org.apache.maven.wagon.PathUtils. */ final class PathUtils { private PathUtils() { } /** * Return the protocol name.
* E.g: for input http://www.codehause.org this method will return http * * @param url the url * @return the host name */ public static String protocol( final String url ) { final int pos = url.indexOf( ":" ); if ( pos == -1 ) { return ""; } return url.substring( 0, pos ).trim(); } /** * Derive the path portion of the given URL. * * @param url the file-repository URL * @return the basedir of the repository */ public static String basedir( String url ) { String protocol = PathUtils.protocol( url ); String retValue = null; if ( protocol.length() > 0 ) { retValue = url.substring( protocol.length() + 1 ); } else { retValue = url; } retValue = decode( retValue ); // special case: if omitted // on protocol, keep path as is if ( retValue.startsWith( "//" ) ) { retValue = retValue.substring( 2 ); if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) { // special case: if there is a windows drive letter, then keep the original return value retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); } else { // Now we expect the host int index = retValue.indexOf( "/" ); if ( index >= 0 ) { retValue = retValue.substring( index + 1 ); } // special case: if there is a windows drive letter, then keep the original return value if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) { retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); } else if ( index >= 0 ) { // leading / was previously stripped retValue = "/" + retValue; } } } // special case: if there is a windows drive letter using |, switch to : if ( retValue.length() >= 2 && retValue.charAt( 1 ) == '|' ) { retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); } return retValue.trim(); } /** * Decodes the specified (portion of a) URL. Note: This decoder assumes that ISO-8859-1 is used to * convert URL-encoded octets to characters. * * @param url The URL to decode, may be null. * @return The decoded URL or null if the input was null. */ static String decode( String url ) { String decoded = url; if ( url != null ) { int pos = -1; while ( ( pos = decoded.indexOf( '%', pos + 1 ) ) >= 0 ) { if ( pos + 2 < decoded.length() ) { String hexStr = decoded.substring( pos + 1, pos + 3 ); char ch = (char) Integer.parseInt( hexStr, 16 ); decoded = decoded.substring( 0, pos ) + ch + decoded.substring( pos + 3 ); } } } return decoded; } } ResourceNotFoundException.java000066400000000000000000000016061245546356100373020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; import java.io.IOException; /** * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated * to the remote resource. */ class ResourceNotFoundException extends IOException { public ResourceNotFoundException( String message ) { super( message ); } } package-info.java000066400000000000000000000012151245546356100344770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Support for downloads/uploads using the local filesystem as "remote" storage. */ package org.eclipse.aether.transport.file; aether-1.0.2.v20150114/aether-transport-file/src/main/resources/000077500000000000000000000000001245546356100240235ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/main/resources/about.html000066400000000000000000000026401245546356100260250ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-transport-file/src/test/000077500000000000000000000000001245546356100220445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/000077500000000000000000000000001245546356100227655ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/000077500000000000000000000000001245546356100235545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/000077500000000000000000000000001245546356100252005ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100264505ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100305045ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/000077500000000000000000000000001245546356100314235ustar00rootroot00000000000000FileTransporterTest.java000066400000000000000000000424201245546356100361740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; import java.net.URI; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferCancelledException; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public class FileTransporterTest { private DefaultRepositorySystemSession session; private TransporterFactory factory; private Transporter transporter; private File repoDir; private RemoteRepository newRepo( String url ) { return new RemoteRepository.Builder( "test", "default", url ).build(); } private void newTransporter( String url ) throws Exception { if ( transporter != null ) { transporter.close(); transporter = null; } transporter = factory.newInstance( session, newRepo( url ) ); } @Before public void setUp() throws Exception { session = TestUtils.newSession(); factory = new FileTransporterFactory( new TestLoggerFactory() ); repoDir = TestFileUtils.createTempDir(); TestFileUtils.writeString( new File( repoDir, "file.txt" ), "test" ); TestFileUtils.writeString( new File( repoDir, "empty.txt" ), "" ); TestFileUtils.writeString( new File( repoDir, "some space.txt" ), "space" ); newTransporter( repoDir.toURI().toString() ); } @After public void tearDown() { if ( transporter != null ) { transporter.close(); transporter = null; } factory = null; session = null; } @Test public void testClassify() throws Exception { assertEquals( Transporter.ERROR_OTHER, transporter.classify( new FileNotFoundException() ) ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( new ResourceNotFoundException( "test" ) ) ); } @Test public void testPeek() throws Exception { transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testPeek_NotFound() throws Exception { try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceNotFoundException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testPeek_Closed() throws Exception { transporter.close(); try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_ToMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ToFile() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "test", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EmptyResource() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EncodedResourcePath() throws Exception { GetTask task = new GetTask( URI.create( "some%20space.txt" ) ); transporter.get( task ); assertEquals( "space", task.getDataString() ); } @Test public void testGet_Fragment() throws Exception { GetTask task = new GetTask( URI.create( "file.txt#ignored" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } @Test public void testGet_Query() throws Exception { GetTask task = new GetTask( URI.create( "file.txt?ignored" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } @Test public void testGet_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File file = TestFileUtils.createTempFile( "failure" ); transporter.get( new GetTask( URI.create( "file.txt" ) ).setDataFile( file ) ); assertTrue( i + ", " + file.getAbsolutePath(), file.delete() ); } } @Test public void testGet_NotFound() throws Exception { try { transporter.get( new GetTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceNotFoundException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testGet_Closed() throws Exception { transporter.close(); try { transporter.get( new GetTask( URI.create( "file.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testGet_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test public void testPut_FromMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_FromFile() throws Exception { File file = TestFileUtils.createTempFile( "upload" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_EmptyResource() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_NonExistentParentDir() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "dir/sub/dir/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir/sub/dir/file.txt" ) ) ); } @Test public void testPut_EncodedResourcePath() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 2, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", TestFileUtils.readString( new File( repoDir, "some space.txt" ) ) ); } @Test public void testPut_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File src = TestFileUtils.createTempFile( "upload" ); File dst = new File( repoDir, "file.txt" ); transporter.put( new PutTask( URI.create( "file.txt" ) ).setDataFile( src ) ); assertTrue( i + ", " + src.getAbsolutePath(), src.delete() ); assertTrue( i + ", " + dst.getAbsolutePath(), dst.delete() ); } } @Test public void testPut_Closed() throws Exception { transporter.close(); try { transporter.put( new PutTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPut_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertFalse( new File( repoDir, "file.txt" ).exists() ); } @Test public void testPut_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); assertFalse( new File( repoDir, "file.txt" ).exists() ); } @Test( expected = NoTransporterException.class ) public void testInit_BadProtocol() throws Exception { newTransporter( "bad:/void" ); } @Test public void testInit_CaseInsensitiveProtocol() throws Exception { newTransporter( "file:/void" ); newTransporter( "FILE:/void" ); newTransporter( "File:/void" ); } @Test public void testInit_OpaqueUrl() throws Exception { testInit( "file:repository", "repository" ); } @Test public void testInit_OpaqueUrlTrailingSlash() throws Exception { testInit( "file:repository/", "repository" ); } @Test public void testInit_OpaqueUrlSpaces() throws Exception { testInit( "file:repo%20space", "repo space" ); } @Test public void testInit_OpaqueUrlSpacesDecoded() throws Exception { testInit( "file:repo space", "repo space" ); } @Test public void testInit_HierarchicalUrl() throws Exception { testInit( "file:/repository", "/repository" ); } @Test public void testInit_HierarchicalUrlTrailingSlash() throws Exception { testInit( "file:/repository/", "/repository" ); } @Test public void testInit_HierarchicalUrlSpaces() throws Exception { testInit( "file:/repo%20space", "/repo space" ); } @Test public void testInit_HierarchicalUrlSpacesDecoded() throws Exception { testInit( "file:/repo space", "/repo space" ); } @Test public void testInit_HierarchicalUrlRoot() throws Exception { testInit( "file:/", "/" ); } @Test public void testInit_HierarchicalUrlHostNoPath() throws Exception { testInit( "file://host/", "/" ); } @Test public void testInit_HierarchicalUrlHostPath() throws Exception { testInit( "file://host/dir", "/dir" ); } private void testInit( String base, String expected ) throws Exception { newTransporter( base ); File exp = new File( expected ).getAbsoluteFile(); assertEquals( exp, ( (FileTransporter) transporter ).getBasedir() ); } } RecordingTransportListener.java000066400000000000000000000034551245546356100375550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.file; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; class RecordingTransportListener extends TransportListener { public final ByteArrayOutputStream baos = new ByteArrayOutputStream( 1024 ); public long dataOffset; public long dataLength; public int startedCount; public int progressedCount; public boolean cancelStart; public boolean cancelProgress; @Override public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { startedCount++; progressedCount = 0; this.dataLength = dataLength; this.dataOffset = dataOffset; baos.reset(); if ( cancelStart ) { throw new TransferCancelledException(); } } @Override public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { progressedCount++; baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() ); if ( cancelProgress ) { throw new TransferCancelledException(); } } } aether-1.0.2.v20150114/aether-transport-http/000077500000000000000000000000001245546356100203365ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/pom.xml000066400000000000000000000074041245546356100216600ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-transport-http Aether Transport HTTP A transport implementation for repositories using http:// and https:// URLs. org.eclipse.aether.transport.http org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util org.apache.httpcomponents httpclient 4.2.6 commons-logging commons-logging org.slf4j jcl-over-slf4j 1.6.2 javax.inject javax.inject provided true org.sonatype.sisu sisu-guice no_aop test junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.eclipse.jetty jetty-server 7.6.14.v20131031 test ch.qos.logback logback-classic 1.0.7 test org.codehaus.mojo animal-sniffer-maven-plugin org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin org.apache.http.*;version="[4.2.1,4.4)",* aether-1.0.2.v20150114/aether-transport-http/src/000077500000000000000000000000001245546356100211255ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/000077500000000000000000000000001245546356100220515ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/000077500000000000000000000000001245546356100227725ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/000077500000000000000000000000001245546356100235615ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/000077500000000000000000000000001245546356100252055ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100264555ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100305115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/000077500000000000000000000000001245546356100314705ustar00rootroot00000000000000AuthSchemePool.java000066400000000000000000000032701245546356100351360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.util.LinkedList; import org.apache.http.auth.AuthScheme; import org.apache.http.client.params.AuthPolicy; import org.apache.http.impl.auth.BasicScheme; /** * Pool of (equivalent) auth schemes for a single host. */ final class AuthSchemePool { private final LinkedList authSchemes; private String schemeName; public AuthSchemePool() { authSchemes = new LinkedList(); } public synchronized AuthScheme get() { AuthScheme authScheme = null; if ( !authSchemes.isEmpty() ) { authScheme = authSchemes.removeLast(); } else if ( AuthPolicy.BASIC.equalsIgnoreCase( schemeName ) ) { authScheme = new BasicScheme(); } return authScheme; } public synchronized void put( AuthScheme authScheme ) { if ( authScheme == null ) { return; } if ( !authScheme.getSchemeName().equals( schemeName ) ) { schemeName = authScheme.getSchemeName(); authSchemes.clear(); } authSchemes.add( authScheme ); } } DeferredCredentialsProvider.java000066400000000000000000000130151245546356100376650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.auth.NTCredentials; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.impl.client.BasicCredentialsProvider; import org.eclipse.aether.repository.AuthenticationContext; /** * Credentials provider that defers calls into the auth context until authentication is actually requested. */ final class DeferredCredentialsProvider implements CredentialsProvider { private final CredentialsProvider delegate; private final Map factories; public DeferredCredentialsProvider() { delegate = new BasicCredentialsProvider(); factories = new HashMap(); } public void setCredentials( AuthScope authScope, Factory factory ) { factories.put( authScope, factory ); } public void setCredentials( AuthScope authScope, Credentials credentials ) { delegate.setCredentials( authScope, credentials ); } public Credentials getCredentials( AuthScope authScope ) { synchronized ( factories ) { for ( Iterator> it = factories.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = it.next(); if ( authScope.match( entry.getKey() ) >= 0 ) { it.remove(); delegate.setCredentials( entry.getKey(), entry.getValue().newCredentials() ); } } } return delegate.getCredentials( authScope ); } public void clear() { delegate.clear(); } interface Factory { Credentials newCredentials(); } static class BasicFactory implements Factory { private final AuthenticationContext authContext; public BasicFactory( AuthenticationContext authContext ) { this.authContext = authContext; } public Credentials newCredentials() { String username = authContext.get( AuthenticationContext.USERNAME ); if ( username == null ) { return null; } String password = authContext.get( AuthenticationContext.PASSWORD ); return new UsernamePasswordCredentials( username, password ); } } static class NtlmFactory implements Factory { private final AuthenticationContext authContext; public NtlmFactory( AuthenticationContext authContext ) { this.authContext = authContext; } public Credentials newCredentials() { String username = authContext.get( AuthenticationContext.USERNAME ); if ( username == null ) { return null; } String password = authContext.get( AuthenticationContext.PASSWORD ); String domain = authContext.get( AuthenticationContext.NTLM_DOMAIN ); String workstation = authContext.get( AuthenticationContext.NTLM_WORKSTATION ); if ( domain == null ) { int backslash = username.indexOf( '\\' ); if ( backslash < 0 ) { domain = guessDomain(); } else { domain = username.substring( 0, backslash ); username = username.substring( backslash + 1 ); } } if ( workstation == null ) { workstation = guessWorkstation(); } return new NTCredentials( username, password, workstation, domain ); } private static String guessDomain() { return safeNtlmString( System.getProperty( "http.auth.ntlm.domain" ), System.getenv( "USERDOMAIN" ) ); } private static String guessWorkstation() { String localHost = null; try { localHost = InetAddress.getLocalHost().getHostName(); } catch ( UnknownHostException e ) { // well, we have other options to try } return safeNtlmString( System.getProperty( "http.auth.ntlm.host" ), System.getenv( "COMPUTERNAME" ), localHost ); } private static String safeNtlmString( String... strings ) { for ( String string : strings ) { if ( string != null ) { return string; } } // avoid NPE from httpclient and trigger proper auth failure instead return ""; } } } DemuxCredentialsProvider.java000066400000000000000000000046761245546356100372440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import org.apache.http.HttpHost; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.client.CredentialsProvider; /** * Credentials provider that helps to isolate server from proxy credentials. Apache HttpClient uses a single provider * for both server and proxy auth, using the auth scope (host, port, etc.) to select the proper credentials. With regard * to redirects, we use an auth scope for server credentials that's not specific enough to not be mistaken for proxy * auth. This provider helps to maintain the proper isolation. */ final class DemuxCredentialsProvider implements CredentialsProvider { private final CredentialsProvider serverCredentialsProvider; private final CredentialsProvider proxyCredentialsProvider; private final HttpHost proxy; public DemuxCredentialsProvider( CredentialsProvider serverCredentialsProvider, CredentialsProvider proxyCredentialsProvider, HttpHost proxy ) { this.serverCredentialsProvider = serverCredentialsProvider; this.proxyCredentialsProvider = proxyCredentialsProvider; this.proxy = proxy; } private CredentialsProvider getDelegate( AuthScope authScope ) { if ( proxy.getPort() == authScope.getPort() && proxy.getHostName().equalsIgnoreCase( authScope.getHost() ) ) { return proxyCredentialsProvider; } return serverCredentialsProvider; } public Credentials getCredentials( AuthScope authScope ) { return getDelegate( authScope ).getCredentials( authScope ); } public void setCredentials( AuthScope authScope, Credentials credentials ) { getDelegate( authScope ).setCredentials( authScope, credentials ); } public void clear() { serverCredentialsProvider.clear(); proxyCredentialsProvider.clear(); } } GlobalState.java000066400000000000000000000141751245546356100344650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.Closeable; import java.util.Arrays; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.apache.http.HttpHost; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.util.ConfigUtils; /** * Container for HTTP-related state that can be shared across incarnations of the transporter to optimize the * communication with servers. */ final class GlobalState implements Closeable { static class CompoundKey { private final Object[] keys; public CompoundKey( Object... keys ) { this.keys = keys; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } CompoundKey that = (CompoundKey) obj; return Arrays.equals( keys, that.keys ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + Arrays.hashCode( keys ); return hash; } @Override public String toString() { return Arrays.toString( keys ); } } private static final String KEY = GlobalState.class.getName(); private static final String CONFIG_PROP_CACHE_STATE = "aether.connector.http.cacheState"; private final ConcurrentMap connectionManagers; private final ConcurrentMap userTokens; private final ConcurrentMap authSchemePools; private final ConcurrentMap expectContinues; public static GlobalState get( RepositorySystemSession session ) { GlobalState cache; RepositoryCache repoCache = session.getCache(); if ( repoCache == null || !ConfigUtils.getBoolean( session, true, CONFIG_PROP_CACHE_STATE ) ) { cache = null; } else { Object tmp = repoCache.get( session, KEY ); if ( tmp instanceof GlobalState ) { cache = (GlobalState) tmp; } else { synchronized ( GlobalState.class ) { tmp = repoCache.get( session, KEY ); if ( tmp instanceof GlobalState ) { cache = (GlobalState) tmp; } else { cache = new GlobalState(); repoCache.put( session, KEY, cache ); } } } } return cache; } private GlobalState() { connectionManagers = new ConcurrentHashMap(); userTokens = new ConcurrentHashMap(); authSchemePools = new ConcurrentHashMap(); expectContinues = new ConcurrentHashMap(); } public void close() { for ( Iterator> it = connectionManagers.entrySet().iterator(); it.hasNext(); ) { ClientConnectionManager connMgr = it.next().getValue(); it.remove(); connMgr.shutdown(); } } public ClientConnectionManager getConnectionManager( SslConfig config ) { ClientConnectionManager manager = connectionManagers.get( config ); if ( manager == null ) { ClientConnectionManager connMgr = newConnectionManager( config ); manager = connectionManagers.putIfAbsent( config, connMgr ); if ( manager != null ) { connMgr.shutdown(); } else { manager = connMgr; } } return manager; } public static ClientConnectionManager newConnectionManager( SslConfig sslConfig ) { SchemeRegistry schemeReg = new SchemeRegistry(); schemeReg.register( new Scheme( "http", 80, new PlainSocketFactory() ) ); schemeReg.register( new Scheme( "https", 443, new SslSocketFactory( sslConfig ) ) ); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager( schemeReg ); connMgr.setMaxTotal( 100 ); connMgr.setDefaultMaxPerRoute( 50 ); return connMgr; } public Object getUserToken( CompoundKey key ) { return userTokens.get( key ); } public void setUserToken( CompoundKey key, Object userToken ) { if ( userToken != null ) { userTokens.put( key, userToken ); } else { userTokens.remove( key ); } } public ConcurrentMap getAuthSchemePools() { return authSchemePools; } public Boolean getExpectContinue( CompoundKey key ) { return expectContinues.get( key ); } public void setExpectContinue( CompoundKey key, boolean enabled ) { expectContinues.put( key, enabled ); } } HttpMkCol.java000066400000000000000000000016141245546356100341230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.net.URI; import org.apache.http.client.methods.HttpRequestBase; /** * WebDAV MKCOL request to create parent directories. */ final class HttpMkCol extends HttpRequestBase { public HttpMkCol( URI uri ) { setURI( uri ); } @Override public String getMethod() { return "MKCOL"; } } HttpTransporter.java000066400000000000000000000512051245546356100354420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpHeaders; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.auth.AuthScope; import org.apache.http.auth.params.AuthParams; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.HttpClient; import org.apache.http.client.HttpResponseException; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpOptions; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.utils.URIUtils; import org.apache.http.conn.params.ConnRouteParams; import org.apache.http.entity.AbstractHttpEntity; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.DecompressingHttpClient; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.cookie.DateUtils; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; import org.apache.http.util.EntityUtils; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.AbstractTransporter; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.TransportTask; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.util.ConfigUtils; /** * A transporter for HTTP/HTTPS. */ final class HttpTransporter extends AbstractTransporter { private static final Pattern CONTENT_RANGE_PATTERN = Pattern.compile( "\\s*bytes\\s+([0-9]+)\\s*-\\s*([0-9]+)\\s*/.*" ); private final Logger logger; private final AuthenticationContext repoAuthContext; private final AuthenticationContext proxyAuthContext; private final URI baseUri; private final HttpHost server; private final HttpHost proxy; private final HttpClient client; private final Map headers; private final LocalState state; public HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ) throws NoTransporterException { if ( !"http".equalsIgnoreCase( repository.getProtocol() ) && !"https".equalsIgnoreCase( repository.getProtocol() ) ) { throw new NoTransporterException( repository ); } this.logger = logger; try { baseUri = new URI( repository.getUrl() ).parseServerAuthority(); if ( baseUri.isOpaque() ) { throw new URISyntaxException( repository.getUrl(), "URL must not be opaque" ); } server = URIUtils.extractHost( baseUri ); if ( server == null ) { throw new URISyntaxException( repository.getUrl(), "URL lacks host name" ); } } catch ( URISyntaxException e ) { throw new NoTransporterException( repository, e.getMessage(), e ); } proxy = toHost( repository.getProxy() ); repoAuthContext = AuthenticationContext.forRepository( session, repository ); proxyAuthContext = AuthenticationContext.forProxy( session, repository ); state = new LocalState( session, repository, new SslConfig( session, repoAuthContext ) ); headers = ConfigUtils.getMap( session, Collections.emptyMap(), ConfigurationProperties.HTTP_HEADERS + "." + repository.getId(), ConfigurationProperties.HTTP_HEADERS ); DefaultHttpClient client = new DefaultHttpClient( state.getConnectionManager() ); configureClient( client.getParams(), session, repository, proxy ); client.setCredentialsProvider( toCredentialsProvider( server, repoAuthContext, proxy, proxyAuthContext ) ); this.client = new DecompressingHttpClient( client ); } private static HttpHost toHost( Proxy proxy ) { HttpHost host = null; if ( proxy != null ) { host = new HttpHost( proxy.getHost(), proxy.getPort() ); } return host; } private static void configureClient( HttpParams params, RepositorySystemSession session, RemoteRepository repository, HttpHost proxy ) { AuthParams.setCredentialCharset( params, ConfigUtils.getString( session, ConfigurationProperties.DEFAULT_HTTP_CREDENTIAL_ENCODING, ConfigurationProperties.HTTP_CREDENTIAL_ENCODING + "." + repository.getId(), ConfigurationProperties.HTTP_CREDENTIAL_ENCODING ) ); ConnRouteParams.setDefaultProxy( params, proxy ); HttpConnectionParams.setConnectionTimeout( params, ConfigUtils.getInteger( session, ConfigurationProperties.DEFAULT_CONNECT_TIMEOUT, ConfigurationProperties.CONNECT_TIMEOUT + "." + repository.getId(), ConfigurationProperties.CONNECT_TIMEOUT ) ); HttpConnectionParams.setSoTimeout( params, ConfigUtils.getInteger( session, ConfigurationProperties.DEFAULT_REQUEST_TIMEOUT, ConfigurationProperties.REQUEST_TIMEOUT + "." + repository.getId(), ConfigurationProperties.REQUEST_TIMEOUT ) ); HttpProtocolParams.setUserAgent( params, ConfigUtils.getString( session, ConfigurationProperties.DEFAULT_USER_AGENT, ConfigurationProperties.USER_AGENT ) ); } private static CredentialsProvider toCredentialsProvider( HttpHost server, AuthenticationContext serverAuthCtx, HttpHost proxy, AuthenticationContext proxyAuthCtx ) { CredentialsProvider provider = toCredentialsProvider( server.getHostName(), AuthScope.ANY_PORT, serverAuthCtx ); if ( proxy != null ) { CredentialsProvider p = toCredentialsProvider( proxy.getHostName(), proxy.getPort(), proxyAuthCtx ); provider = new DemuxCredentialsProvider( provider, p, proxy ); } return provider; } private static CredentialsProvider toCredentialsProvider( String host, int port, AuthenticationContext ctx ) { DeferredCredentialsProvider provider = new DeferredCredentialsProvider(); if ( ctx != null ) { AuthScope basicScope = new AuthScope( host, port ); provider.setCredentials( basicScope, new DeferredCredentialsProvider.BasicFactory( ctx ) ); AuthScope ntlmScope = new AuthScope( host, port, AuthScope.ANY_REALM, "ntlm" ); provider.setCredentials( ntlmScope, new DeferredCredentialsProvider.NtlmFactory( ctx ) ); } return provider; } LocalState getState() { return state; } private URI resolve( TransportTask task ) { return UriUtils.resolve( baseUri, task.getLocation() ); } public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } @Override protected void implPeek( PeekTask task ) throws Exception { HttpHead request = commonHeaders( new HttpHead( resolve( task ) ) ); execute( request, null ); } @Override protected void implGet( GetTask task ) throws Exception { EntityGetter getter = new EntityGetter( task ); HttpGet request = commonHeaders( new HttpGet( resolve( task ) ) ); resume( request, task ); try { execute( request, getter ); } catch ( HttpResponseException e ) { if ( e.getStatusCode() == HttpStatus.SC_PRECONDITION_FAILED && request.containsHeader( HttpHeaders.RANGE ) ) { request = commonHeaders( new HttpGet( request.getURI() ) ); execute( request, getter ); return; } throw e; } } @Override protected void implPut( PutTask task ) throws Exception { PutTaskEntity entity = new PutTaskEntity( task ); HttpPut request = commonHeaders( entity( new HttpPut( resolve( task ) ), entity ) ); try { execute( request, null ); } catch ( HttpResponseException e ) { if ( e.getStatusCode() == HttpStatus.SC_EXPECTATION_FAILED && request.containsHeader( HttpHeaders.EXPECT ) ) { state.setExpectContinue( false ); request = commonHeaders( entity( new HttpPut( request.getURI() ), entity ) ); execute( request, null ); return; } throw e; } } private void execute( HttpUriRequest request, EntityGetter getter ) throws Exception { try { SharingHttpContext context = new SharingHttpContext( state ); prepare( request, context ); HttpResponse response = client.execute( server, request, context ); try { context.close(); handleStatus( response ); if ( getter != null ) { getter.handle( response ); } } finally { EntityUtils.consumeQuietly( response.getEntity() ); } } catch ( IOException e ) { if ( e.getCause() instanceof TransferCancelledException ) { throw (Exception) e.getCause(); } throw e; } } private void prepare( HttpUriRequest request, SharingHttpContext context ) { boolean put = HttpPut.METHOD_NAME.equalsIgnoreCase( request.getMethod() ); if ( state.getWebDav() == null && ( put || isPayloadPresent( request ) ) ) { try { HttpOptions req = commonHeaders( new HttpOptions( request.getURI() ) ); HttpResponse response = client.execute( server, req, context ); state.setWebDav( isWebDav( response ) ); EntityUtils.consumeQuietly( response.getEntity() ); } catch ( IOException e ) { logger.debug( "Failed to prepare HTTP context", e ); } } if ( put && Boolean.TRUE.equals( state.getWebDav() ) ) { mkdirs( request.getURI(), context ); } } private boolean isWebDav( HttpResponse response ) { return response.containsHeader( HttpHeaders.DAV ); } private void mkdirs( URI uri, SharingHttpContext context ) { List dirs = UriUtils.getDirectories( baseUri, uri ); int index = 0; for ( ; index < dirs.size(); index++ ) { try { HttpResponse response = client.execute( server, commonHeaders( new HttpMkCol( dirs.get( index ) ) ), context ); try { int status = response.getStatusLine().getStatusCode(); if ( status < 300 || status == HttpStatus.SC_METHOD_NOT_ALLOWED ) { break; } else if ( status == HttpStatus.SC_CONFLICT ) { continue; } handleStatus( response ); } finally { EntityUtils.consumeQuietly( response.getEntity() ); } } catch ( IOException e ) { logger.debug( "Failed to create parent directory " + dirs.get( index ), e ); return; } } for ( index--; index >= 0; index-- ) { try { HttpResponse response = client.execute( server, commonHeaders( new HttpMkCol( dirs.get( index ) ) ), context ); try { handleStatus( response ); } finally { EntityUtils.consumeQuietly( response.getEntity() ); } } catch ( IOException e ) { logger.debug( "Failed to create parent directory " + dirs.get( index ), e ); return; } } } private T entity( T request, HttpEntity entity ) { request.setEntity( entity ); return request; } private boolean isPayloadPresent( HttpUriRequest request ) { if ( request instanceof HttpEntityEnclosingRequest ) { HttpEntity entity = ( (HttpEntityEnclosingRequest) request ).getEntity(); return entity != null && entity.getContentLength() != 0; } return false; } private T commonHeaders( T request ) { request.setHeader( HttpHeaders.CACHE_CONTROL, "no-cache, no-store" ); request.setHeader( HttpHeaders.PRAGMA, "no-cache" ); if ( state.isExpectContinue() && isPayloadPresent( request ) ) { request.setHeader( HttpHeaders.EXPECT, "100-continue" ); } for ( Map.Entry entry : headers.entrySet() ) { if ( !( entry.getKey() instanceof String ) ) { continue; } if ( entry.getValue() instanceof String ) { request.setHeader( entry.getKey().toString(), entry.getValue().toString() ); } else { request.removeHeaders( entry.getKey().toString() ); } } if ( !state.isExpectContinue() ) { request.removeHeaders( HttpHeaders.EXPECT ); } return request; } private T resume( T request, GetTask task ) { long resumeOffset = task.getResumeOffset(); if ( resumeOffset > 0 && task.getDataFile() != null ) { request.setHeader( HttpHeaders.RANGE, "bytes=" + Long.toString( resumeOffset ) + '-' ); request.setHeader( HttpHeaders.IF_UNMODIFIED_SINCE, DateUtils.formatDate( new Date( task.getDataFile().lastModified() - 60 * 1000 ) ) ); request.setHeader( HttpHeaders.ACCEPT_ENCODING, "identity" ); } return request; } private void handleStatus( HttpResponse response ) throws HttpResponseException { int status = response.getStatusLine().getStatusCode(); if ( status >= 300 ) { throw new HttpResponseException( status, response.getStatusLine().getReasonPhrase() + " (" + status + ")" ); } } @Override protected void implClose() { AuthenticationContext.close( repoAuthContext ); AuthenticationContext.close( proxyAuthContext ); state.close(); } private class EntityGetter { private final GetTask task; public EntityGetter( GetTask task ) { this.task = task; } public void handle( HttpResponse response ) throws IOException, TransferCancelledException { HttpEntity entity = response.getEntity(); if ( entity == null ) { entity = new ByteArrayEntity( new byte[0] ); } long offset = 0, length = entity.getContentLength(); String range = getHeader( response, HttpHeaders.CONTENT_RANGE ); if ( range != null ) { Matcher m = CONTENT_RANGE_PATTERN.matcher( range ); if ( !m.matches() ) { throw new IOException( "Invalid Content-Range header for partial download: " + range ); } offset = Long.parseLong( m.group( 1 ) ); length = Long.parseLong( m.group( 2 ) ) + 1; if ( offset < 0 || offset >= length || ( offset > 0 && offset != task.getResumeOffset() ) ) { throw new IOException( "Invalid Content-Range header for partial download from offset " + task.getResumeOffset() + ": " + range ); } } InputStream is = entity.getContent(); utilGet( task, is, true, length, offset > 0 ); extractChecksums( response ); } private void extractChecksums( HttpResponse response ) { // Nexus-style, ETag: "{SHA1{d40d68ba1f88d8e9b0040f175a6ff41928abd5e7}}" String etag = getHeader( response, HttpHeaders.ETAG ); if ( etag != null ) { int start = etag.indexOf( "SHA1{" ), end = etag.indexOf( "}", start + 5 ); if ( start >= 0 && end > start ) { task.setChecksum( "SHA-1", etag.substring( start + 5, end ) ); } } } private String getHeader( HttpResponse response, String name ) { Header header = response.getFirstHeader( name ); return ( header != null ) ? header.getValue() : null; } } private class PutTaskEntity extends AbstractHttpEntity { private final PutTask task; public PutTaskEntity( PutTask task ) { this.task = task; } public boolean isRepeatable() { return true; } public boolean isStreaming() { return false; } public long getContentLength() { return task.getDataLength(); } public InputStream getContent() throws IOException { return task.newInputStream(); } public void writeTo( OutputStream os ) throws IOException { try { utilPut( task, os, false ); } catch ( TransferCancelledException e ) { throw (IOException) new InterruptedIOException().initCause( e ); } } } } HttpTransporterFactory.java000066400000000000000000000062221245546356100367710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoTransporterException; /** * A transporter factory for repositories using the {@code http:} or {@code https:} protocol. The provided transporters * support uploads to WebDAV servers and resumable downloads. */ @Named( "http" ) public final class HttpTransporterFactory implements TransporterFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private float priority = 5; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation * by clients, the new factory needs to be configured via its various mutators before first use or runtime errors * will occur. */ public HttpTransporterFactory() { // enables default constructor } @Inject HttpTransporterFactory( LoggerFactory loggerFactory ) { setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); } /** * Sets the logger factory to use for this component. * * @param loggerFactory The logger factory to use, may be {@code null} to disable logging. * @return This component for chaining, never {@code null}. */ public HttpTransporterFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, HttpTransporter.class ); return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public HttpTransporterFactory setPriority( float priority ) { this.priority = priority; return this; } public Transporter newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException { return new HttpTransporter( repository, session, logger ); } } LocalState.java000066400000000000000000000103351245546356100343110ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.Closeable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.apache.http.HttpHost; import org.apache.http.auth.AuthScheme; import org.apache.http.conn.ClientConnectionManager; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transport.http.GlobalState.CompoundKey; /** * Container for HTTP-related state that can be shared across invocations of the transporter to optimize the * communication with server. */ final class LocalState implements Closeable { private final GlobalState global; private final ClientConnectionManager connMgr; private final CompoundKey userTokenKey; private volatile Object userToken; private final CompoundKey expectContinueKey; private volatile Boolean expectContinue; private volatile Boolean webDav; private final ConcurrentMap authSchemePools; public LocalState( RepositorySystemSession session, RemoteRepository repo, SslConfig sslConfig ) { global = GlobalState.get( session ); userToken = this; if ( global == null ) { connMgr = GlobalState.newConnectionManager( sslConfig ); userTokenKey = null; expectContinueKey = null; authSchemePools = new ConcurrentHashMap(); } else { connMgr = global.getConnectionManager( sslConfig ); userTokenKey = new CompoundKey( repo.getId(), repo.getUrl(), repo.getAuthentication(), repo.getProxy() ); expectContinueKey = new CompoundKey( repo.getUrl(), repo.getProxy() ); authSchemePools = global.getAuthSchemePools(); } } public ClientConnectionManager getConnectionManager() { return connMgr; } public Object getUserToken() { if ( userToken == this ) { userToken = ( global != null ) ? global.getUserToken( userTokenKey ) : null; } return userToken; } public void setUserToken( Object userToken ) { this.userToken = userToken; if ( global != null ) { global.setUserToken( userTokenKey, userToken ); } } public boolean isExpectContinue() { if ( expectContinue == null ) { expectContinue = !Boolean.FALSE.equals( ( global != null ) ? global.getExpectContinue( expectContinueKey ) : null ); } return expectContinue; } public void setExpectContinue( boolean enabled ) { expectContinue = enabled; if ( global != null ) { global.setExpectContinue( expectContinueKey, enabled ); } } public Boolean getWebDav() { return webDav; } public void setWebDav( boolean webDav ) { this.webDav = webDav; } public AuthScheme getAuthScheme( HttpHost host ) { AuthSchemePool pool = authSchemePools.get( host ); if ( pool != null ) { return pool.get(); } return null; } public void setAuthScheme( HttpHost host, AuthScheme authScheme ) { AuthSchemePool pool = authSchemePools.get( host ); if ( pool == null ) { AuthSchemePool p = new AuthSchemePool(); pool = authSchemePools.putIfAbsent( host, p ); if ( pool == null ) { pool = p; } } pool.put( authScheme ); } public void close() { if ( global == null ) { connMgr.shutdown(); } } } SharingAuthCache.java000066400000000000000000000050071245546356100354170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.util.HashMap; import java.util.Map; import org.apache.http.HttpHost; import org.apache.http.auth.AuthScheme; import org.apache.http.client.AuthCache; /** * Auth scheme cache that upon clearing releases all cached schemes into a pool for future reuse by other requests, * thereby reducing challenge-response roundtrips. */ final class SharingAuthCache implements AuthCache { private final LocalState state; private final Map authSchemes; public SharingAuthCache( LocalState state ) { this.state = state; authSchemes = new HashMap(); } private static HttpHost toKey( HttpHost host ) { if ( host.getPort() <= 0 ) { int port = host.getSchemeName().equalsIgnoreCase( "https" ) ? 443 : 80; return new HttpHost( host.getHostName(), port, host.getSchemeName() ); } return host; } public AuthScheme get( HttpHost host ) { host = toKey( host ); AuthScheme authScheme = authSchemes.get( host ); if ( authScheme == null ) { authScheme = state.getAuthScheme( host ); authSchemes.put( host, authScheme ); } return authScheme; } public void put( HttpHost host, AuthScheme authScheme ) { if ( authScheme != null ) { authSchemes.put( toKey( host ), authScheme ); } else { remove( host ); } } public void remove( HttpHost host ) { authSchemes.remove( toKey( host ) ); } public void clear() { share(); authSchemes.clear(); } private void share() { for ( Map.Entry entry : authSchemes.entrySet() ) { state.setAuthScheme( entry.getKey(), entry.getValue() ); } } @Override public String toString() { return authSchemes.toString(); } } SharingHttpContext.java000066400000000000000000000041571245546356100360630ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.Closeable; import org.apache.http.client.protocol.ClientContext; import org.apache.http.protocol.BasicHttpContext; /** * HTTP context that shares certain attributes among requests to optimize the communication with the server. * * @see Stateful HTTP * connections */ final class SharingHttpContext extends BasicHttpContext implements Closeable { private final LocalState state; private final SharingAuthCache authCache; public SharingHttpContext( LocalState state ) { this.state = state; authCache = new SharingAuthCache( state ); super.setAttribute( ClientContext.AUTH_CACHE, authCache ); } @Override public Object getAttribute( String id ) { if ( ClientContext.USER_TOKEN.equals( id ) ) { return state.getUserToken(); } return super.getAttribute( id ); } @Override public void setAttribute( String id, Object obj ) { if ( ClientContext.USER_TOKEN.equals( id ) ) { state.setUserToken( obj ); } else { super.setAttribute( id, obj ); } } @Override public Object removeAttribute( String id ) { if ( ClientContext.USER_TOKEN.equals( id ) ) { state.setUserToken( null ); return null; } return super.removeAttribute( id ); } public void close() { authCache.clear(); } } SslConfig.java000066400000000000000000000063631245546356100341530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.util.Arrays; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.util.ConfigUtils; /** * SSL-related configuration and cache key for connection pools (whose scheme registries are derived from this config). */ final class SslConfig { private static final String CIPHER_SUITES = "https.cipherSuites"; private static final String PROTOCOLS = "https.protocols"; final SSLContext context; final HostnameVerifier verifier; final String[] cipherSuites; final String[] protocols; public SslConfig( RepositorySystemSession session, AuthenticationContext authContext ) { context = ( authContext != null ) ? authContext.get( AuthenticationContext.SSL_CONTEXT, SSLContext.class ) : null; verifier = ( authContext != null ) ? authContext.get( AuthenticationContext.SSL_HOSTNAME_VERIFIER, HostnameVerifier.class ) : null; cipherSuites = split( get( session, CIPHER_SUITES ) ); protocols = split( get( session, PROTOCOLS ) ); } private static String get( RepositorySystemSession session, String key ) { String value = ConfigUtils.getString( session, null, "aether.connector." + key, key ); if ( value == null ) { value = System.getProperty( key ); } return value; } private static String[] split( String value ) { if ( value == null || value.length() <= 0 ) { return null; } return value.split( ",+" ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } SslConfig that = (SslConfig) obj; return eq( context, that.context ) && eq( verifier, that.verifier ) && Arrays.equals( cipherSuites, that.cipherSuites ) && Arrays.equals( protocols, that.protocols ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( context ); hash = hash * 31 + hash( verifier ); hash = hash * 31 + Arrays.hashCode( cipherSuites ); hash = hash * 31 + Arrays.hashCode( protocols ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } } SslSocketFactory.java000066400000000000000000000051471245546356100355250ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.IOException; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import org.apache.http.conn.ssl.X509HostnameVerifier; /** * Specialized SSL socket factory to more closely resemble the JRE's HttpsClient and respect well-known SSL-related * configuration properties. * * @see JSSE * Reference Guide, Customization */ final class SslSocketFactory extends org.apache.http.conn.ssl.SSLSocketFactory { private final String[] cipherSuites; private final String[] protocols; public SslSocketFactory( SslConfig config ) { this( getSocketFactory( config.context ), getHostnameVerifier( config.verifier ), config.cipherSuites, config.protocols ); } private static SSLSocketFactory getSocketFactory( SSLContext context ) { return ( context != null ) ? context.getSocketFactory() : (SSLSocketFactory) SSLSocketFactory.getDefault(); } private static X509HostnameVerifier getHostnameVerifier( HostnameVerifier verifier ) { return ( verifier != null ) ? X509HostnameVerifierAdapter.adapt( verifier ) : org.apache.http.conn.ssl.SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; } private SslSocketFactory( SSLSocketFactory socketfactory, X509HostnameVerifier hostnameVerifier, String[] cipherSuites, String[] protocols ) { super( socketfactory, hostnameVerifier ); this.cipherSuites = cipherSuites; this.protocols = protocols; } @Override protected void prepareSocket( SSLSocket socket ) throws IOException { super.prepareSocket( socket ); if ( cipherSuites != null ) { socket.setEnabledCipherSuites( cipherSuites ); } if ( protocols != null ) { socket.setEnabledProtocols( protocols ); } } } UriUtils.java000066400000000000000000000042231245546356100340350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import org.apache.http.client.utils.URIUtils; /** * Helps to deal with URIs. */ final class UriUtils { public static URI resolve( URI base, URI ref ) { String path = ref.getRawPath(); if ( path != null && path.length() > 0 ) { path = base.getRawPath(); if ( path == null || !path.endsWith( "/" ) ) { try { base = new URI( base.getScheme(), base.getAuthority(), base.getPath() + '/', null, null ); } catch ( URISyntaxException e ) { throw new IllegalStateException( e ); } } } return URIUtils.resolve( base, ref ); } public static List getDirectories( URI base, URI uri ) { List dirs = new ArrayList(); for ( URI dir = uri.resolve( "." ); !isBase( base, dir ); dir = dir.resolve( ".." ) ) { dirs.add( dir ); } return dirs; } private static boolean isBase( URI base, URI uri ) { String path = uri.getRawPath(); if ( path == null || "/".equals( path ) ) { return true; } if ( base != null ) { URI rel = base.relativize( uri ); if ( rel.getRawPath() == null || rel.getRawPath().length() <= 0 || rel.equals( uri ) ) { return true; } } return false; } } X509HostnameVerifierAdapter.java000066400000000000000000000041411245546356100374150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.IOException; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import org.apache.http.conn.ssl.X509HostnameVerifier; /** * Makes a standard hostname verifier compatible with Apache HttpClient's API. */ final class X509HostnameVerifierAdapter implements X509HostnameVerifier { private final HostnameVerifier verifier; public static X509HostnameVerifier adapt( HostnameVerifier verifier ) { if ( verifier instanceof X509HostnameVerifier ) { return (X509HostnameVerifier) verifier; } return new X509HostnameVerifierAdapter( verifier ); } private X509HostnameVerifierAdapter( HostnameVerifier verifier ) { this.verifier = verifier; } public boolean verify( String hostname, SSLSession session ) { return verifier.verify( hostname, session ); } public void verify( String host, SSLSocket socket ) throws IOException { if ( !verify( host, socket.getSession() ) ) { throw new SSLException( "<" + host + "> does not pass hostname verification" ); } } public void verify( String host, X509Certificate cert ) throws SSLException { throw new UnsupportedOperationException(); } public void verify( String host, String[] cns, String[] subjectAlts ) throws SSLException { throw new UnsupportedOperationException(); } } package-info.java000066400000000000000000000014121245546356100345760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Support for downloads/uploads via the HTTP and HTTPS protocols. The current implementation is backed by * Apache HttpClient. */ package org.eclipse.aether.transport.http; aether-1.0.2.v20150114/aether-transport-http/src/main/resources/000077500000000000000000000000001245546356100240635ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/main/resources/about.html000066400000000000000000000026401245546356100260650ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-transport-http/src/test/000077500000000000000000000000001245546356100221045ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/000077500000000000000000000000001245546356100230255ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/000077500000000000000000000000001245546356100236145ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/000077500000000000000000000000001245546356100252405ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100265105ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100305445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/000077500000000000000000000000001245546356100315235ustar00rootroot00000000000000HttpServer.java000066400000000000000000000441031245546356100344170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.aether.util.ChecksumUtils; import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; import org.eclipse.jetty.util.B64Code; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HttpServer { public static class LogEntry { public final String method; public final String path; public final Map headers; public LogEntry( String method, String path, Map headers ) { this.method = method; this.path = path; this.headers = headers; } @Override public String toString() { return method + " " + path; } } public enum ExpectContinue { FAIL, PROPER, BROKEN } public enum ChecksumHeader { NEXUS } private static final Logger log = LoggerFactory.getLogger( HttpServer.class ); private File repoDir; private boolean rangeSupport = true; private boolean webDav; private ExpectContinue expectContinue = ExpectContinue.PROPER; private ChecksumHeader checksumHeader; private Server server; private Connector httpConnector; private Connector httpsConnector; private String username; private String password; private String proxyUsername; private String proxyPassword; private List logEntries = Collections.synchronizedList( new ArrayList() ); public String getHost() { return "localhost"; } public int getHttpPort() { return httpConnector != null ? httpConnector.getLocalPort() : -1; } public int getHttpsPort() { return httpsConnector != null ? httpsConnector.getLocalPort() : -1; } public String getHttpUrl() { return "http://" + getHost() + ":" + getHttpPort(); } public String getHttpsUrl() { return "https://" + getHost() + ":" + getHttpsPort(); } public HttpServer addSslConnector() { if ( httpsConnector == null ) { SslContextFactory ssl = new SslContextFactory(); ssl.setKeyStorePath( new File( "src/test/resources/ssl/server-store" ).getAbsolutePath() ); ssl.setKeyStorePassword( "server-pwd" ); ssl.setTrustStore( new File( "src/test/resources/ssl/client-store" ).getAbsolutePath() ); ssl.setTrustStorePassword( "client-pwd" ); ssl.setNeedClientAuth( true ); httpsConnector = new SslSelectChannelConnector( ssl ); server.addConnector( httpsConnector ); try { httpsConnector.start(); } catch ( Exception e ) { throw new IllegalStateException( e ); } } return this; } public List getLogEntries() { return logEntries; } public HttpServer setRepoDir( File repoDir ) { this.repoDir = repoDir; return this; } public HttpServer setRangeSupport( boolean rangeSupport ) { this.rangeSupport = rangeSupport; return this; } public HttpServer setWebDav( boolean webDav ) { this.webDav = webDav; return this; } public HttpServer setExpectSupport( ExpectContinue expectContinue ) { this.expectContinue = expectContinue; return this; } public HttpServer setChecksumHeader( ChecksumHeader checksumHeader ) { this.checksumHeader = checksumHeader; return this; } public HttpServer setAuthentication( String username, String password ) { this.username = username; this.password = password; return this; } public HttpServer setProxyAuthentication( String username, String password ) { proxyUsername = username; proxyPassword = password; return this; } public HttpServer start() throws Exception { if ( server != null ) { return this; } httpConnector = new SelectChannelConnector(); HandlerList handlers = new HandlerList(); handlers.addHandler( new LogHandler() ); handlers.addHandler( new ProxyAuthHandler() ); handlers.addHandler( new AuthHandler() ); handlers.addHandler( new RedirectHandler() ); handlers.addHandler( new RepoHandler() ); server = new Server(); server.addConnector( httpConnector ); server.setHandler( handlers ); server.start(); return this; } public void stop() throws Exception { if ( server != null ) { server.stop(); server = null; httpConnector = null; httpsConnector = null; } } private class LogHandler extends AbstractHandler { @SuppressWarnings( "unchecked" ) public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) throws IOException { log.info( "{} {}{}", new Object[] { req.getMethod(), req.getRequestURL(), req.getQueryString() != null ? "?" + req.getQueryString() : "" } ); Map headers = new TreeMap( String.CASE_INSENSITIVE_ORDER ); for ( Enumeration en = req.getHeaderNames(); en.hasMoreElements(); ) { String name = en.nextElement(); StringBuilder buffer = new StringBuilder( 128 ); for ( Enumeration ien = req.getHeaders( name ); ien.hasMoreElements(); ) { if ( buffer.length() > 0 ) { buffer.append( ", " ); } buffer.append( ien.nextElement() ); } headers.put( name, buffer.toString() ); } logEntries.add( new LogEntry( req.getMethod(), req.getPathInfo(), Collections.unmodifiableMap( headers ) ) ); } } private class RepoHandler extends AbstractHandler { private final Pattern SIMPLE_RANGE = Pattern.compile( "bytes=([0-9])+-" ); public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) throws IOException { String path = req.getPathInfo().substring( 1 ); if ( !path.startsWith( "repo/" ) ) { return; } req.setHandled( true ); if ( ExpectContinue.FAIL.equals( expectContinue ) && request.getHeader( HttpHeaders.EXPECT ) != null ) { response.setStatus( HttpServletResponse.SC_EXPECTATION_FAILED ); return; } File file = new File( repoDir, path.substring( 5 ) ); if ( HttpMethods.GET.equals( req.getMethod() ) || HttpMethods.HEAD.equals( req.getMethod() ) ) { if ( !file.isFile() || path.endsWith( URIUtil.SLASH ) ) { response.setStatus( HttpServletResponse.SC_NOT_FOUND ); return; } long ifUnmodifiedSince = request.getDateHeader( HttpHeaders.IF_UNMODIFIED_SINCE ); if ( ifUnmodifiedSince != -1 && file.lastModified() > ifUnmodifiedSince ) { response.setStatus( HttpServletResponse.SC_PRECONDITION_FAILED ); return; } long offset = 0; String range = request.getHeader( HttpHeaders.RANGE ); if ( range != null && rangeSupport ) { Matcher m = SIMPLE_RANGE.matcher( range ); if ( m.matches() ) { offset = Long.parseLong( m.group( 1 ) ); if ( offset >= file.length() ) { response.setStatus( HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE ); return; } } String encoding = request.getHeader( HttpHeaders.ACCEPT_ENCODING ); if ( ( encoding != null && !"identity".equals( encoding ) ) || ifUnmodifiedSince == -1 ) { response.setStatus( HttpServletResponse.SC_BAD_REQUEST ); return; } } response.setStatus( ( offset > 0 ) ? HttpServletResponse.SC_PARTIAL_CONTENT : HttpServletResponse.SC_OK ); response.setDateHeader( HttpHeaders.LAST_MODIFIED, file.lastModified() ); response.setHeader( HttpHeaders.CONTENT_LENGTH, Long.toString( file.length() - offset ) ); if ( offset > 0 ) { response.setHeader( HttpHeaders.CONTENT_RANGE, "bytes " + offset + "-" + ( file.length() - 1 ) + "/" + file.length() ); } if ( checksumHeader != null ) { Map checksums = ChecksumUtils.calc( file, Collections.singleton( "SHA-1" ) ); switch ( checksumHeader ) { case NEXUS: response.setHeader( HttpHeaders.ETAG, "{SHA1{" + checksums.get( "SHA-1" ) + "}}" ); break; } } if ( HttpMethods.HEAD.equals( req.getMethod() ) ) { return; } FileInputStream is = new FileInputStream( file ); try { if ( offset > 0 ) { long skipped = is.skip( offset ); while ( skipped < offset && is.read() >= 0 ) { skipped++; } } IO.copy( is, response.getOutputStream() ); } finally { IO.close( is ); } } else if ( HttpMethods.PUT.equals( req.getMethod() ) ) { if ( !webDav ) { file.getParentFile().mkdirs(); } if ( file.getParentFile().exists() ) { try { FileOutputStream os = new FileOutputStream( file ); try { IO.copy( request.getInputStream(), os ); } finally { os.close(); } } catch ( IOException e ) { file.delete(); throw e; } response.setStatus( HttpServletResponse.SC_NO_CONTENT ); } else { response.setStatus( HttpServletResponse.SC_FORBIDDEN ); } } else if ( HttpMethods.OPTIONS.equals( req.getMethod() ) ) { if ( webDav ) { response.setHeader( "DAV", "1,2" ); } response.setHeader( HttpHeaders.ALLOW, "GET, PUT, HEAD, OPTIONS" ); response.setStatus( HttpServletResponse.SC_OK ); } else if ( webDav && "MKCOL".equals( req.getMethod() ) ) { if ( file.exists() ) { response.setStatus( HttpServletResponse.SC_METHOD_NOT_ALLOWED ); } else if ( file.mkdir() ) { response.setStatus( HttpServletResponse.SC_CREATED ); } else { response.setStatus( HttpServletResponse.SC_CONFLICT ); } } else { response.setStatus( HttpServletResponse.SC_METHOD_NOT_ALLOWED ); } } } private class RedirectHandler extends AbstractHandler { public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) throws IOException { String path = req.getPathInfo(); if ( !path.startsWith( "/redirect/" ) ) { return; } req.setHandled( true ); StringBuilder location = new StringBuilder( 128 ); String scheme = req.getParameter( "scheme" ); location.append( scheme != null ? scheme : req.getScheme() ); location.append( "://" ); location.append( req.getServerName() ); location.append( ":" ); if ( "http".equalsIgnoreCase( scheme ) ) { location.append( getHttpPort() ); } else if ( "https".equalsIgnoreCase( scheme ) ) { location.append( getHttpsPort() ); } else { location.append( req.getServerPort() ); } location.append( "/repo" ).append( path.substring( 9 ) ); response.setStatus( HttpServletResponse.SC_MOVED_PERMANENTLY ); response.setHeader( HttpHeaders.LOCATION, location.toString() ); } } private class AuthHandler extends AbstractHandler { public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) throws IOException { if ( ExpectContinue.BROKEN.equals( expectContinue ) && "100-continue".equalsIgnoreCase( request.getHeader( HttpHeaders.EXPECT ) ) ) { request.getInputStream(); } if ( username != null && password != null ) { if ( checkBasicAuth( request.getHeader( HttpHeaders.AUTHORIZATION ), username, password ) ) { return; } req.setHandled( true ); response.setHeader( HttpHeaders.WWW_AUTHENTICATE, "basic realm=\"Test-Realm\"" ); response.setStatus( HttpServletResponse.SC_UNAUTHORIZED ); } } } private class ProxyAuthHandler extends AbstractHandler { public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) throws IOException { if ( proxyUsername != null && proxyPassword != null ) { if ( checkBasicAuth( request.getHeader( HttpHeaders.PROXY_AUTHORIZATION ), proxyUsername, proxyPassword ) ) { return; } req.setHandled( true ); response.setHeader( HttpHeaders.PROXY_AUTHENTICATE, "basic realm=\"Test-Realm\"" ); response.setStatus( HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED ); } } } static boolean checkBasicAuth( String credentials, String username, String password ) { if ( credentials != null ) { int space = credentials.indexOf( ' ' ); if ( space > 0 ) { String method = credentials.substring( 0, space ); if ( "basic".equalsIgnoreCase( method ) ) { credentials = credentials.substring( space + 1 ); try { credentials = B64Code.decode( credentials, StringUtil.__ISO_8859_1 ); } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException( e ); } int i = credentials.indexOf( ':' ); if ( i > 0 ) { String user = credentials.substring( 0, i ); String pass = credentials.substring( i + 1 ); if ( username.equals( user ) && password.equals( pass ) ) { return true; } } } } } return false; } } HttpTransporterTest.java000066400000000000000000001312221245546356100363330ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; import java.net.ConnectException; import java.net.ServerSocket; import java.net.SocketTimeoutException; import java.net.URI; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import org.apache.http.client.HttpResponseException; import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.pool.ConnPoolControl; import org.apache.http.pool.PoolStats; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.DefaultRepositoryCache; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; /** */ public class HttpTransporterTest { static { System.setProperty( "javax.net.ssl.trustStore", new File( "src/test/resources/ssl/server-store" ).getAbsolutePath() ); System.setProperty( "javax.net.ssl.trustStorePassword", "server-pwd" ); System.setProperty( "javax.net.ssl.keyStore", new File( "src/test/resources/ssl/client-store" ).getAbsolutePath() ); System.setProperty( "javax.net.ssl.keyStorePassword", "client-pwd" ); } @Rule public TestName testName = new TestName(); private DefaultRepositorySystemSession session; private TransporterFactory factory; private Transporter transporter; private File repoDir; private HttpServer httpServer; private Authentication auth; private Proxy proxy; private RemoteRepository newRepo( String url ) { return new RemoteRepository.Builder( "test", "default", url ).setAuthentication( auth ).setProxy( proxy ).build(); } private void newTransporter( String url ) throws Exception { if ( transporter != null ) { transporter.close(); transporter = null; } transporter = factory.newInstance( session, newRepo( url ) ); } @Before public void setUp() throws Exception { System.out.println( "=== " + testName.getMethodName() + " ===" ); session = TestUtils.newSession(); factory = new HttpTransporterFactory( new TestLoggerFactory() ); repoDir = TestFileUtils.createTempDir(); TestFileUtils.writeString( new File( repoDir, "file.txt" ), "test" ); TestFileUtils.writeString( new File( repoDir, "dir/file.txt" ), "test" ); TestFileUtils.writeString( new File( repoDir, "empty.txt" ), "" ); TestFileUtils.writeString( new File( repoDir, "some space.txt" ), "space" ); File resumable = new File( repoDir, "resume.txt" ); TestFileUtils.writeString( resumable, "resumable" ); resumable.setLastModified( System.currentTimeMillis() - 90 * 1000 ); httpServer = new HttpServer().setRepoDir( repoDir ).start(); newTransporter( httpServer.getHttpUrl() ); } @After public void tearDown() throws Exception { if ( transporter != null ) { transporter.close(); transporter = null; } if ( httpServer != null ) { httpServer.stop(); httpServer = null; } factory = null; session = null; } @Test public void testClassify() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( new FileNotFoundException() ) ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( new HttpResponseException( 403, "Forbidden" ) ) ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( new HttpResponseException( 404, "Not Found" ) ) ); } @Test public void testPeek() throws Exception { transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); } @Test public void testPeek_NotFound() throws Exception { try { transporter.peek( new PeekTask( URI.create( "repo/missing.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 404, e.getStatusCode() ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testPeek_Closed() throws Exception { transporter.close(); try { transporter.peek( new PeekTask( URI.create( "repo/missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPeek_Authenticated() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); } @Test public void testPeek_Unauthenticated() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); try { transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 401, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPeek_ProxyAuthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); newTransporter( "http://bad.localhost:1/" ); transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); } @Test public void testPeek_ProxyUnauthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); newTransporter( "http://bad.localhost:1/" ); try { transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 407, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPeek_SSL() throws Exception { httpServer.addSslConnector(); newTransporter( httpServer.getHttpsUrl() ); transporter.peek( new PeekTask( URI.create( "repo/file.txt" ) ) ); } @Test public void testPeek_Redirect() throws Exception { httpServer.addSslConnector(); transporter.peek( new PeekTask( URI.create( "redirect/file.txt" ) ) ); transporter.peek( new PeekTask( URI.create( "redirect/file.txt?scheme=https" ) ) ); } @Test public void testGet_ToMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ToFile() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "test", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EmptyResource() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EncodedResourcePath() throws Exception { GetTask task = new GetTask( URI.create( "repo/some%20space.txt" ) ); transporter.get( task ); assertEquals( "space", task.getDataString() ); } @Test public void testGet_Authenticated() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_Unauthenticated() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 401, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_ProxyAuthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); Authentication auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); newTransporter( "http://bad.localhost:1/" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ProxyUnauthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); newTransporter( "http://bad.localhost:1/" ); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 407, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_SSL() throws Exception { httpServer.addSslConnector(); newTransporter( httpServer.getHttpsUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_WebDav() throws Exception { httpServer.setWebDav( true ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/dir/file.txt" ) ).setListener( listener ); ( (HttpTransporter) transporter ).getState().setWebDav( true ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); assertEquals( httpServer.getLogEntries().toString(), 1, httpServer.getLogEntries().size() ); } @Test public void testGet_Redirect() throws Exception { httpServer.addSslConnector(); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "redirect/file.txt?scheme=https" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_Resume() throws Exception { File file = TestFileUtils.createTempFile( "re" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); assertEquals( 1, listener.startedCount ); assertEquals( 2, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "sumable", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ResumeLocalContentsOutdated() throws Exception { File file = TestFileUtils.createTempFile( "re" ); file.setLastModified( System.currentTimeMillis() - 5 * 60 * 1000 ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "resumable", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ResumeRangesNotSupportedByServer() throws Exception { httpServer.setRangeSupport( false ); File file = TestFileUtils.createTempFile( "re" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "resumable", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_Checksums_Nexus() throws Exception { httpServer.setChecksumHeader( HttpServer.ChecksumHeader.NEXUS ); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", task.getChecksums().get( "SHA-1" ) ); } @Test public void testGet_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File file = TestFileUtils.createTempFile( "failure" ); transporter.get( new GetTask( URI.create( "repo/file.txt" ) ).setDataFile( file ) ); assertTrue( i + ", " + file.getAbsolutePath(), file.delete() ); } } @Test public void testGet_NotFound() throws Exception { try { transporter.get( new GetTask( URI.create( "repo/missing.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 404, e.getStatusCode() ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testGet_Closed() throws Exception { transporter.close(); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testGet_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test public void testPut_FromMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_FromFile() throws Exception { File file = TestFileUtils.createTempFile( "upload" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_EmptyResource() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_EncodedResourcePath() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 2, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", TestFileUtils.readString( new File( repoDir, "some space.txt" ) ) ); } @Test public void testPut_Authenticated_ExpectContinue() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_Authenticated_ExpectContinueBroken() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); httpServer.setExpectSupport( HttpServer.ExpectContinue.BROKEN ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_Authenticated_ExpectContinueRejected() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); httpServer.setExpectSupport( HttpServer.ExpectContinue.FAIL ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_Authenticated_ExpectContinueRejected_ExplicitlyConfiguredHeader() throws Exception { Map headers = new HashMap(); headers.put( "Expect", "100-continue" ); session.setConfigProperty( ConfigurationProperties.HTTP_HEADERS + ".test", headers ); httpServer.setAuthentication( "testuser", "testpass" ); httpServer.setExpectSupport( HttpServer.ExpectContinue.FAIL ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_Unauthenticated() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 401, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testPut_ProxyAuthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); Authentication auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); newTransporter( "http://bad.localhost:1/" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_ProxyUnauthenticated() throws Exception { httpServer.setProxyAuthentication( "testuser", "testpass" ); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); newTransporter( "http://bad.localhost:1/" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 407, e.getStatusCode() ); assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testPut_SSL() throws Exception { httpServer.addSslConnector(); httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpsUrl() ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); } @Test public void testPut_WebDav() throws Exception { httpServer.setWebDav( true ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/dir1/dir2/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir1/dir2/file.txt" ) ) ); assertEquals( 5, httpServer.getLogEntries().size() ); assertEquals( "OPTIONS", httpServer.getLogEntries().get( 0 ).method ); assertEquals( "MKCOL", httpServer.getLogEntries().get( 1 ).method ); assertEquals( "/repo/dir1/dir2/", httpServer.getLogEntries().get( 1 ).path ); assertEquals( "MKCOL", httpServer.getLogEntries().get( 2 ).method ); assertEquals( "/repo/dir1/", httpServer.getLogEntries().get( 2 ).path ); assertEquals( "MKCOL", httpServer.getLogEntries().get( 3 ).method ); assertEquals( "/repo/dir1/dir2/", httpServer.getLogEntries().get( 3 ).path ); assertEquals( "PUT", httpServer.getLogEntries().get( 4 ).method ); } @Test public void testPut_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File src = TestFileUtils.createTempFile( "upload" ); File dst = new File( repoDir, "file.txt" ); transporter.put( new PutTask( URI.create( "repo/file.txt" ) ).setDataFile( src ) ); assertTrue( i + ", " + src.getAbsolutePath(), src.delete() ); assertTrue( i + ", " + dst.getAbsolutePath(), dst.delete() ); } } @Test public void testPut_Closed() throws Exception { transporter.close(); try { transporter.put( new PutTask( URI.create( "repo/missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPut_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @Test public void testPut_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test public void testGetPut_AuthCache() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); GetTask get = new GetTask( URI.create( "repo/file.txt" ) ); transporter.get( get ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 1, listener.startedCount ); } @Test( timeout = 10000 ) public void testConcurrency() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); newTransporter( httpServer.getHttpUrl() ); final AtomicReference error = new AtomicReference(); Thread threads[] = new Thread[20]; for ( int i = 0; i < threads.length; i++ ) { final String path = "repo/file.txt?i=" + i; threads[i] = new Thread() { @Override public void run() { try { for ( int j = 0; j < 100; j++ ) { GetTask task = new GetTask( URI.create( path ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } } catch ( Throwable t ) { error.compareAndSet( null, t ); System.err.println( path ); t.printStackTrace(); } } }; threads[i].setName( "Task-" + i ); } for ( Thread thread : threads ) { thread.start(); } for ( Thread thread : threads ) { thread.join(); } assertNull( String.valueOf( error.get() ), error.get() ); } @Test( timeout = 1000 ) public void testConnectTimeout() throws Exception { session.setConfigProperty( ConfigurationProperties.CONNECT_TIMEOUT, 100 ); int port = 1; newTransporter( "http://localhost:" + port ); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( ConnectTimeoutException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } catch ( ConnectException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test( timeout = 1000 ) public void testRequestTimeout() throws Exception { session.setConfigProperty( ConfigurationProperties.REQUEST_TIMEOUT, 100 ); ServerSocket server = new ServerSocket( 0 ); newTransporter( "http://localhost:" + server.getLocalPort() ); try { try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( SocketTimeoutException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } finally { server.close(); } } @Test public void testUserAgent() throws Exception { session.setConfigProperty( ConfigurationProperties.USER_AGENT, "SomeTest/1.0" ); newTransporter( httpServer.getHttpUrl() ); transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); assertEquals( 1, httpServer.getLogEntries().size() ); for ( HttpServer.LogEntry log : httpServer.getLogEntries() ) { assertEquals( "SomeTest/1.0", log.headers.get( "User-Agent" ) ); } } @Test public void testCustomHeaders() throws Exception { Map headers = new HashMap(); headers.put( "User-Agent", "Custom/1.0" ); headers.put( "X-CustomHeader", "Custom-Value" ); session.setConfigProperty( ConfigurationProperties.USER_AGENT, "SomeTest/1.0" ); session.setConfigProperty( ConfigurationProperties.HTTP_HEADERS + ".test", headers ); newTransporter( httpServer.getHttpUrl() ); transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); assertEquals( 1, httpServer.getLogEntries().size() ); for ( HttpServer.LogEntry log : httpServer.getLogEntries() ) { for ( Map.Entry entry : headers.entrySet() ) { assertEquals( entry.getKey(), entry.getValue(), log.headers.get( entry.getKey() ) ); } } } @Test public void testServerAuthScope_NotUsedForProxy() throws Exception { String username = "testuser", password = "testpass"; httpServer.setProxyAuthentication( username, password ); auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); newTransporter( "http://" + httpServer.getHost() + ":12/" ); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Server auth must not be used as proxy auth" ); } catch ( HttpResponseException e ) { assertEquals( 407, e.getStatusCode() ); } } @Test public void testProxyAuthScope_NotUsedForServer() throws Exception { String username = "testuser", password = "testpass"; httpServer.setAuthentication( username, password ); Authentication auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); newTransporter( "http://" + httpServer.getHost() + ":12/" ); try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Proxy auth must not be used as server auth" ); } catch ( HttpResponseException e ) { assertEquals( 401, e.getStatusCode() ); } } @Test public void testAuthSchemeReuse() throws Exception { httpServer.setAuthentication( "testuser", "testpass" ); httpServer.setProxyAuthentication( "proxyuser", "proxypass" ); session.setCache( new DefaultRepositoryCache() ); auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); Authentication auth = new AuthenticationBuilder().addUsername( "proxyuser" ).addPassword( "proxypass" ).build(); proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); newTransporter( "http://bad.localhost:1/" ); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 3, httpServer.getLogEntries().size() ); httpServer.getLogEntries().clear(); newTransporter( "http://bad.localhost:1/" ); task = new GetTask( URI.create( "repo/file.txt" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 1, httpServer.getLogEntries().size() ); assertNotNull( httpServer.getLogEntries().get( 0 ).headers.get( "Authorization" ) ); assertNotNull( httpServer.getLogEntries().get( 0 ).headers.get( "Proxy-Authorization" ) ); } @Test public void testConnectionReuse() throws Exception { httpServer.addSslConnector(); session.setCache( new DefaultRepositoryCache() ); for ( int i = 0; i < 3; i++ ) { newTransporter( httpServer.getHttpsUrl() ); GetTask task = new GetTask( URI.create( "repo/file.txt" ) ); transporter.get( task ); assertEquals( "test", task.getDataString() ); } PoolStats stats = ( (ConnPoolControl) ( (HttpTransporter) transporter ).getState().getConnectionManager() ).getTotalStats(); assertEquals( stats.toString(), 1, stats.getAvailable() ); } @Test( expected = NoTransporterException.class ) public void testInit_BadProtocol() throws Exception { newTransporter( "bad:/void" ); } @Test( expected = NoTransporterException.class ) public void testInit_BadUrl() throws Exception { newTransporter( "http://localhost:NaN" ); } @Test public void testInit_CaseInsensitiveProtocol() throws Exception { newTransporter( "http://localhost" ); newTransporter( "HTTP://localhost" ); newTransporter( "Http://localhost" ); newTransporter( "https://localhost" ); newTransporter( "HTTPS://localhost" ); newTransporter( "HttpS://localhost" ); } } RecordingTransportListener.java000066400000000000000000000034551245546356100376550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; class RecordingTransportListener extends TransportListener { public final ByteArrayOutputStream baos = new ByteArrayOutputStream( 1024 ); public long dataOffset; public long dataLength; public int startedCount; public int progressedCount; public boolean cancelStart; public boolean cancelProgress; @Override public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { startedCount++; progressedCount = 0; this.dataLength = dataLength; this.dataOffset = dataOffset; baos.reset(); if ( cancelStart ) { throw new TransferCancelledException(); } } @Override public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { progressedCount++; baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() ); if ( cancelProgress ) { throw new TransferCancelledException(); } } } UriUtilsTest.java000066400000000000000000000121351245546356100347310ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.http; import static org.junit.Assert.*; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.junit.Test; public class UriUtilsTest { private String resolve( URI base, String ref ) { return UriUtils.resolve( base, URI.create( ref ) ).toString(); } @Test public void testResolve_BaseEmptyPath() { URI base = URI.create( "http://host" ); assertEquals( "http://host/file.jar", resolve( base, "file.jar" ) ); assertEquals( "http://host/dir/file.jar", resolve( base, "dir/file.jar" ) ); assertEquals( "http://host?arg=val", resolve( base, "?arg=val" ) ); assertEquals( "http://host/file?arg=val", resolve( base, "file?arg=val" ) ); assertEquals( "http://host/dir/file?arg=val", resolve( base, "dir/file?arg=val" ) ); } @Test public void testResolve_BaseRootPath() { URI base = URI.create( "http://host/" ); assertEquals( "http://host/file.jar", resolve( base, "file.jar" ) ); assertEquals( "http://host/dir/file.jar", resolve( base, "dir/file.jar" ) ); assertEquals( "http://host/?arg=val", resolve( base, "?arg=val" ) ); assertEquals( "http://host/file?arg=val", resolve( base, "file?arg=val" ) ); assertEquals( "http://host/dir/file?arg=val", resolve( base, "dir/file?arg=val" ) ); } @Test public void testResolve_BasePathTrailingSlash() { URI base = URI.create( "http://host/sub/dir/" ); assertEquals( "http://host/sub/dir/file.jar", resolve( base, "file.jar" ) ); assertEquals( "http://host/sub/dir/dir/file.jar", resolve( base, "dir/file.jar" ) ); assertEquals( "http://host/sub/dir/?arg=val", resolve( base, "?arg=val" ) ); assertEquals( "http://host/sub/dir/file?arg=val", resolve( base, "file?arg=val" ) ); assertEquals( "http://host/sub/dir/dir/file?arg=val", resolve( base, "dir/file?arg=val" ) ); } @Test public void testResolve_BasePathNoTrailingSlash() { URI base = URI.create( "http://host/sub/d%20r" ); assertEquals( "http://host/sub/d%20r/file.jar", resolve( base, "file.jar" ) ); assertEquals( "http://host/sub/d%20r/dir/file.jar", resolve( base, "dir/file.jar" ) ); assertEquals( "http://host/sub/d%20r?arg=val", resolve( base, "?arg=val" ) ); assertEquals( "http://host/sub/d%20r/file?arg=val", resolve( base, "file?arg=val" ) ); assertEquals( "http://host/sub/d%20r/dir/file?arg=val", resolve( base, "dir/file?arg=val" ) ); } private List getDirs( String base, String uri ) { return UriUtils.getDirectories( ( base != null ) ? URI.create( base ) : null, URI.create( uri ) ); } private void assertUris( List actual, String... expected ) { List uris = new ArrayList( actual.size() ); for ( URI uri : actual ) { uris.add( uri.toString() ); } assertEquals( Arrays.asList( expected ), uris ); } @Test public void testGetDirectories_NoBase() { List parents = getDirs( null, "http://host/repo/sub/dir/file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/", "http://host/repo/" ); parents = getDirs( null, "http://host/repo/sub/dir/?file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/", "http://host/repo/" ); parents = getDirs( null, "http://host/" ); assertUris( parents ); } @Test public void testGetDirectories_ExplicitBaseTrailingSlash() { List parents = getDirs( "http://host/repo/", "http://host/repo/sub/dir/file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/" ); parents = getDirs( "http://host/repo/", "http://host/repo/sub/dir/?file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/" ); parents = getDirs( "http://host/repo/", "http://host/" ); assertUris( parents ); } @Test public void testGetDirectories_ExplicitBaseNoTrailingSlash() { List parents = getDirs( "http://host/repo", "http://host/repo/sub/dir/file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/" ); parents = getDirs( "http://host/repo", "http://host/repo/sub/dir/?file.jar" ); assertUris( parents, "http://host/repo/sub/dir/", "http://host/repo/sub/" ); parents = getDirs( "http://host/repo", "http://host/" ); assertUris( parents ); } } aether-1.0.2.v20150114/aether-transport-http/src/test/resources/000077500000000000000000000000001245546356100241165ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/resources/logback.xml000066400000000000000000000014531245546356100262450ustar00rootroot00000000000000 %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n aether-1.0.2.v20150114/aether-transport-http/src/test/resources/ssl/000077500000000000000000000000001245546356100247175ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-http/src/test/resources/ssl/README.txt000066400000000000000000000007171245546356100264220ustar00rootroot00000000000000client-store generated via > keytool -genkey -alias localhost -keypass client-pwd -keystore client-store -storepass client-pwd -validity 4096 -dname "cn=localhost, ou=None, L=Seattle, ST=Washington, o=ExampleOrg, c=US" -keyalg RSA server-store generated via > keytool -genkey -alias localhost -keypass server-pwd -keystore server-store -storepass server-pwd -validity 4096 -dname "cn=localhost, ou=None, L=Seattle, ST=Washington, o=ExampleOrg, c=US" -keyalg RSA aether-1.0.2.v20150114/aether-transport-http/src/test/resources/ssl/client-store000066400000000000000000000043041245546356100272530ustar00rootroot00000000000000þíþí localhost?Çeæÿ0‚û0 +*‚çxƒL[è <û’†w‚L¯,rLʺ~§£1å4”v^ð ­¶ˆeUHÝ'ô?Dþõº®oeOS‹Æ7ÒîÏGLz}—FÀ—ãag‚Ó-Ék|ÐZíâ=¿B`/6¨>£X°ÏY‡3X¤Z¡&þ"éeë]° ê"6”G.Å! ë¸sÐ>—å÷EƒX£ Jˆ¡X¶_ó’«TÓ4Ïú}³R›0fîðK\iœš‰•äüþaT³„«w6àÄQPqÜ…w“>RÀcBmïãÁ» Žô Ž½¿€Ó¿Úµbä’Ëq†ô-/*ZÐr^T.²fÉôÑØìÿÿžzÞ9Qr˜–®ðÈ×gÒìErtÚŒìTÇ–¬ÑyÏ?lgg¿Ü~ ß8üUik,€y÷ßMÛzE.+„¨á‰é–!¢‘•®êê¨ÇÑ2ìkIçá–2a¨œœ¶€<°%*ê `iã2ŒšºÐ¦½@4‰CZ]Ø&1›c;žBŽ‘…ÏÁÎvÕ4Ùº²Ì×uˆœÁöiýšŸ7—^aqVÁÙ}, DV¨»ÆeZ(I@ øú[C·‡IyÈÁ“þ_‡Lù DJçsð¸!aç3húÂÁ Ý\Ó¸½‚”SP~F×ð‘ÙšxóÏþz·‰%Ýk)¨KQÿ§i¯fNÜýjȸ’Ï£´c_K)ì\ò/BïY¦e ö+ªA ëŸagÕOÎí¼h^¦†¾5Ù­Kßë¥XûY³ αO5ö«Û(Y³%G½¸Ã,púyìR÷J8YnጠEnAã½0nÒ‡.ÐìÈ™¤[ŒÆ”Ÿ‹éDߢ~ª{ÐiB^4‡ú¸µT®²Þ+Ncˆíí,~úYL¿®º <ÉU«—8ÇI¸³_‹ÇLv¯jn¯‘ªqK™eìMtþŽQß[î=«r€œñuߨÚqG4;ø/­˜§qÊ‘¸æúôÝ6mŽ£fø²À‰Jöc1¹}›Z›räЭ@unÔû¶Ã­ˆåÜ$7 ¢³û½cá²ÍtªcO¡•ÀLEU>Õíw$” x²Çf±8og÷¨ÄØ •Ц†ï’šùo[ÃÅßvÓ2<çQQÑ8Ü™ãGŽ`„øÂæ-«°Ä·B¯y¢¢«ã%Cܦé'é¸|n¾W›dUæ<£NÈ„JT)Dhd'5¸ÜlÄpˆ<¯<ø X¶ý}=ì¬ ÌÆÞ0Ç:¬nêê4ÁÑ£a£å VEYީńÖLx­Qpq…>(%ùcD¬qp´“«üÿ’цaB¬‚¼0O™ËÜhkÓu³žz´á¢Ù>qæ@q±î^ÓBu`j2¢ÁWZRäJöN:žŸežy#¦‡Âb²1¸ºÔ´IÒÞŽ þ°&R“ŸßÓ8ÖXÏ{M´Ræçé¡^²×OímCD÷ñ¥a¶ðæ3KK¼ðrFü”(VÆË¶¸Yâп¤Œînüœs²uy¶Dž/¨+ã3‡”žôQô¦)2õì‹-×…Ùm8ýù•B·”Â:¢òÃh:G2WV¿ëŒ×ugݺ‘IŒ»ðú¥>"}°Ç¢éÚàxïîêó¼cìî³ùFE§£ø—ónRÈxè‚ ‰ŒUÃße¶Z¤ˆâº•ª½ìš/µŸ»ç¢EœÃìC>Õ-í˜$;™pÚRKÄy+Mµ‰‘2#OŸ•Kø[ÝÛ¹©KæÜD,ܸ¯Jâ ‘Ÿ(*TÞDŠ©ý·ç ¿c.*dtÞšZtùÕ}ÀûŸ‹¾ü1Ôy,­ºô"É›ç½&*Ø'/jôšÈÖß©ýîÆFcÊj,O÷õëæ!û{hùÔø/k§}Ós˜4ç_a³Fº”$ê3s ø¼ÆA1öø)CtFÒì>;Aâû© m‡¶zu%®‘› ÷Hu‚V¥öø§-Ù`7k·ÏÊÑ:c©ŒòðËC”Wú Aþ•Ù!—FÈ9£–‚@¯ÖŽϾ1?ÌÓ%Às)€pÈöP¹“UV ¸3Â¥³âÌÄ%Ö{©Ù ~ËÑâ’D]¿IÈ1Y™gº1%µ‘j;.د¦îq !.¦5ö)‰¨ÁÕcH3÷p¯ T'Û¯|ÉßtzÐC’tS=>‰&«'Pèb(\CZhx€ª°oïÅ®MZn¢´L€“$[ÑŸshWWoFRi ƒLã½í‰z­J¢å’3-瀬Q퀭ür»È/„(õEù¢BC4ÍÇšÖÿ|Lñ qûfàrz%‹Ã¾Æ¯Ój‡Bkª —ncü¬šì,º}r·4o7Ðþ¶ºÀ¬)×€Ž<~ôÞŠá¿]ªxµôËÅ««÷غ›¬IõZÍBuÄ.ËñÅÖFwâ­2˜4:rÅ@Y| òP“ìÕEéÓ[TŽ÷¤>޲B‰ íê¿’@~I¥-g‡skKÝÆ§„è=wåÝŠ24{O1?ž7p—¿=æSü­–ç ýÑ}ŸŽþÙ€oÅ hA¯wϹp~-UOãÊ”ˆzÉ"=tx¶7×¥—•¯Vp¨Ô]b!t7(3üì\´à„^õ&é$»Ìq«²SxÆ­Äîó˜¤Í™ |ÜJúí?''ql¦‰`î&ʪ2xܾ~Òñ( óè="\Ë­ñ7¦XC\€¥ aØ}|Ö˜x}óT&X.509{0‚w0‚_ Ydÿ0  *†H†÷  0l1 0 UUS10U  ExampleOrg10U Washington10USeattle1 0 U None10U localhost0 130629163247Z 240915163247Z0l1 0 UUS10U  ExampleOrg10U Washington10USeattle1 0 U None10U localhost0‚"0  *†H†÷ ‚0‚ ‚«?sMƒ61îléd´h=g¾Çp¬ø)^§B^®ãò\Øù€ØwÀ³8î4@…%Šn«GnÖBí#[Kñ·?âÏV©â?¿úbõ¤DÃ`t®°¼Ù§Kqì‹ÕÉÝQp‘;›Húˆ¥?€+<ØÍÐÛ «.â˜r=[éj%Ú‰!ye8±>¢¬{a t{Ä'°jÊ”lÛò‚là€Z~ØI¡Î…0ðƲÌÕÎ݇n7‹-º£[ýÂ×TÔ*M " ®Ö¦m C”bÒ¹à|b">àt¨óÕ2ë̬QŽ7 §ØÌ)çÌâ–Hƒ »d£FeŒl9b/-Ó”yq£!00UøÖÏ·0<Â]ø¥Ü™¨Ö9+0  *†H†÷  ‚¤z¥sŽH€ò÷Û~ñß:õiÛ¢¬ËPàWŠÃý=U»Ür9øÅmŒ|²¨±ONášßÞטðïyœ) Ðt!=;Ušv2ü½ ì¢,ïQ'¦@|“÷¿F.{Ý)Š µæ´§©ØT6¹Âø°ÙU‹RÖ¿¥]úL6U 3çÜqºŸëÿ"”î\Ë|$mñ¡AÁ?`®MXaµ6þ ¹ª*²– È#Îéj¬=ª¿Ï{LëFÿx ÎÅaŒ…LÙ¬/­´ ™ò>±l ±ýN´¬³$&ôïÖ-èìr°Î†›,ºzbidæ/ÆÑzx3Ý+¢±¹uN­bÎ…^ÊWÌbm0í—¾†¥Z¤àaether-1.0.2.v20150114/aether-transport-wagon/000077500000000000000000000000001245546356100204725ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/pom.xml000066400000000000000000000073551245546356100220210ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-transport-wagon Aether Transport Wagon A transport implementation based on Maven Wagon. 1.0 org.eclipse.aether.transport.wagon org.eclipse.aether aether-api org.eclipse.aether aether-spi org.eclipse.aether aether-util org.apache.maven.wagon wagon-provider-api ${wagonVersion} javax.inject javax.inject provided true org.codehaus.plexus plexus-component-annotations provided true org.codehaus.plexus plexus-classworlds 2.4 true org.codehaus.plexus plexus-utils 2.1 true org.eclipse.sisu org.eclipse.sisu.plexus true org.sonatype.sisu sisu-guice no_aop test junit junit test org.hamcrest hamcrest-library test org.eclipse.aether aether-test-util test org.codehaus.mojo animal-sniffer-maven-plugin org.codehaus.plexus plexus-component-metadata org.eclipse.sisu sisu-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-transport-wagon/src/000077500000000000000000000000001245546356100212615ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/000077500000000000000000000000001245546356100222055ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/000077500000000000000000000000001245546356100231265ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/000077500000000000000000000000001245546356100237155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/000077500000000000000000000000001245546356100253415ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100266115ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/000077500000000000000000000000001245546356100304255ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/000077500000000000000000000000001245546356100324615ustar00rootroot00000000000000wagon/000077500000000000000000000000001245546356100335155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transportPlexusWagonConfigurator.java000066400000000000000000000100061245546356100412140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.transport.wagon; import org.apache.maven.wagon.Wagon; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.configurator.AbstractComponentConfigurator; import org.codehaus.plexus.component.configurator.ComponentConfigurationException; import org.codehaus.plexus.component.configurator.ConfigurationListener; import org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.aether.transport.wagon.WagonConfigurator; /** * A wagon configurator based on the Plexus component configuration framework. */ @Component( role = WagonConfigurator.class, hint = "plexus" ) public class PlexusWagonConfigurator implements WagonConfigurator { @Requirement private PlexusContainer container; /** * Creates an uninitialized wagon configurator. * * @noreference This constructor only supports the Plexus IoC container and should not be called directly by * clients. */ public PlexusWagonConfigurator() { // enables no-arg constructor } /** * Creates a wagon configurator using the specified Plexus container. * * @param container The Plexus container instance to use, must not be {@code null}. */ public PlexusWagonConfigurator( PlexusContainer container ) { if ( container == null ) { throw new IllegalArgumentException( "plexus container has not been specified" ); } this.container = container; } public void configure( Wagon wagon, Object configuration ) throws Exception { PlexusConfiguration config = null; if ( configuration instanceof PlexusConfiguration ) { config = (PlexusConfiguration) configuration; } else if ( configuration instanceof Xpp3Dom ) { config = new XmlPlexusConfiguration( (Xpp3Dom) configuration ); } else if ( configuration == null ) { return; } else { throw new IllegalArgumentException( "Unexpected configuration type: " + configuration.getClass().getName() ); } WagonComponentConfigurator configurator = new WagonComponentConfigurator(); configurator.configureComponent( wagon, config, container.getContainerRealm() ); } static class WagonComponentConfigurator extends AbstractComponentConfigurator { @Override public void configureComponent( Object component, PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm, ConfigurationListener listener ) throws ComponentConfigurationException { ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter(); converter.processConfiguration( converterLookup, component, containerRealm, configuration, expressionEvaluator, listener ); } } } PlexusWagonProvider.java000066400000000000000000000043271245546356100403550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.internal.transport.wagon; import org.apache.maven.wagon.Wagon; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.eclipse.aether.transport.wagon.WagonProvider; /** * A wagon provider backed by a Plexus container and the wagons registered with this container. */ @Component( role = WagonProvider.class, hint = "plexus" ) public class PlexusWagonProvider implements WagonProvider { @Requirement private PlexusContainer container; /** * Creates an uninitialized wagon provider. * * @noreference This constructor only supports the Plexus IoC container and should not be called directly by * clients. */ public PlexusWagonProvider() { // enables no-arg constructor } /** * Creates a wagon provider using the specified Plexus container. * * @param container The Plexus container instance to use, must not be {@code null}. */ public PlexusWagonProvider( PlexusContainer container ) { if ( container == null ) { throw new IllegalArgumentException( "plexus container has not been specified" ); } this.container = container; } public Wagon lookup( String roleHint ) throws Exception { return container.lookup( Wagon.class, roleHint ); } public void release( Wagon wagon ) { try { if ( wagon != null ) { container.release( wagon ); } } catch ( Exception e ) { // too bad } } } package-info.java000066400000000000000000000013061245546356100367040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Integration with the Plexus IoC container which is the native runtime environment expected by many wagon * implementations. */ package org.eclipse.aether.internal.transport.wagon; aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100306455ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/000077500000000000000000000000001245546356100317605ustar00rootroot00000000000000WagonCancelledException.java000066400000000000000000000021341245546356100372710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.eclipse.aether.transfer.TransferCancelledException; /** * Unchecked exception to allow the checked {@link TransferCancelledException} to bubble up from a wagon. */ class WagonCancelledException extends RuntimeException { public WagonCancelledException( TransferCancelledException cause ) { super( cause ); } public static Exception unwrap( Exception e ) { if ( e instanceof WagonCancelledException ) { e = (Exception) e.getCause(); } return e; } } WagonConfigurator.java000066400000000000000000000022401245546356100362000ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.apache.maven.wagon.Wagon; /** * A component to configure wagon instances with provider-specific parameters. */ public interface WagonConfigurator { /** * Configures the specified wagon instance with the given configuration. * * @param wagon The wagon instance to configure, must not be {@code null}. * @param configuration The configuration to apply to the wagon instance, must not be {@code null}. * @throws Exception If the configuration could not be applied to the wagon. */ void configure( Wagon wagon, Object configuration ) throws Exception; } WagonProvider.java000066400000000000000000000027301245546356100353340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.apache.maven.wagon.Wagon; /** * A component to acquire and release wagon instances for uploads/downloads. */ public interface WagonProvider { /** * Acquires a wagon instance that matches the specified role hint. The role hint is derived from the URI scheme, * e.g. "http" or "file". * * @param roleHint The role hint to get a wagon for, must not be {@code null}. * @return The requested wagon instance, never {@code null}. * @throws Exception If no wagon could be retrieved for the specified role hint. */ Wagon lookup( String roleHint ) throws Exception; /** * Releases the specified wagon. A wagon provider may either free any resources allocated for the wagon instance or * return the instance back to a pool for future use. * * @param wagon The wagon to release, may be {@code null}. */ void release( Wagon wagon ); } WagonTransferListener.java000066400000000000000000000037261245546356100370420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.nio.ByteBuffer; import org.apache.maven.wagon.events.TransferEvent; import org.apache.maven.wagon.observers.AbstractTransferListener; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; /** * A wagon transfer listener that forwards events to a transport listener. */ final class WagonTransferListener extends AbstractTransferListener { private final TransportListener listener; public WagonTransferListener( TransportListener listener ) { this.listener = listener; } @Override public void transferStarted( TransferEvent event ) { try { listener.transportStarted( 0, event.getResource().getContentLength() ); } catch ( TransferCancelledException e ) { /* * NOTE: Wagon transfers are not freely abortable. In particular, aborting from * AbstractWagon.fire(Get|Put)Started() would result in unclosed streams so we avoid this case. */ } } @Override public void transferProgress( TransferEvent event, byte[] buffer, int length ) { try { listener.transportProgressed( ByteBuffer.wrap( buffer, 0, length ) ); } catch ( TransferCancelledException e ) { throw new WagonCancelledException( e ); } } } WagonTransporter.java000066400000000000000000000500541245546356100360670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.Method; import java.util.Locale; import java.util.Map; import java.util.Properties; import java.util.Queue; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.StreamingWagon; import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.authentication.AuthenticationInfo; import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.proxy.ProxyInfoProvider; import org.apache.maven.wagon.repository.Repository; import org.apache.maven.wagon.repository.RepositoryPermissions; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.TransportTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.util.ConfigUtils; /** * A transporter using Maven Wagon. */ final class WagonTransporter implements Transporter { private static final String CONFIG_PROP_CONFIG = "aether.connector.wagon.config"; private static final String CONFIG_PROP_FILE_MODE = "aether.connector.perms.fileMode"; private static final String CONFIG_PROP_DIR_MODE = "aether.connector.perms.dirMode"; private static final String CONFIG_PROP_GROUP = "aether.connector.perms.group"; private final Logger logger; private final RemoteRepository repository; private final RepositorySystemSession session; private final AuthenticationContext repoAuthContext; private final AuthenticationContext proxyAuthContext; private final WagonProvider wagonProvider; private final WagonConfigurator wagonConfigurator; private final String wagonHint; private final Repository wagonRepo; private final AuthenticationInfo wagonAuth; private final ProxyInfoProvider wagonProxy; private final Properties headers; private final Queue wagons = new ConcurrentLinkedQueue(); private final AtomicBoolean closed = new AtomicBoolean(); public WagonTransporter( WagonProvider wagonProvider, WagonConfigurator wagonConfigurator, RemoteRepository repository, RepositorySystemSession session, Logger logger ) throws NoTransporterException { this.logger = logger; this.wagonProvider = wagonProvider; this.wagonConfigurator = wagonConfigurator; this.repository = repository; this.session = session; wagonRepo = new Repository( repository.getId(), repository.getUrl() ); wagonRepo.setPermissions( getPermissions( repository.getId(), session ) ); wagonHint = wagonRepo.getProtocol().toLowerCase( Locale.ENGLISH ); if ( wagonHint == null || wagonHint.length() <= 0 ) { throw new NoTransporterException( repository ); } try { wagons.add( lookupWagon() ); } catch ( Exception e ) { logger.debug( e.getMessage(), e ); throw new NoTransporterException( repository, e.getMessage(), e ); } repoAuthContext = AuthenticationContext.forRepository( session, repository ); proxyAuthContext = AuthenticationContext.forProxy( session, repository ); wagonAuth = getAuthenticationInfo( repository, repoAuthContext ); wagonProxy = getProxy( repository, proxyAuthContext ); headers = new Properties(); headers.put( "User-Agent", ConfigUtils.getString( session, ConfigurationProperties.DEFAULT_USER_AGENT, ConfigurationProperties.USER_AGENT ) ); Map headers = ConfigUtils.getMap( session, null, ConfigurationProperties.HTTP_HEADERS + "." + repository.getId(), ConfigurationProperties.HTTP_HEADERS ); if ( headers != null ) { this.headers.putAll( headers ); } } private static RepositoryPermissions getPermissions( String repoId, RepositorySystemSession session ) { RepositoryPermissions result = null; RepositoryPermissions perms = new RepositoryPermissions(); String suffix = '.' + repoId; String fileMode = ConfigUtils.getString( session, (String) null, CONFIG_PROP_FILE_MODE + suffix ); if ( fileMode != null ) { perms.setFileMode( fileMode ); result = perms; } String dirMode = ConfigUtils.getString( session, (String) null, CONFIG_PROP_DIR_MODE + suffix ); if ( dirMode != null ) { perms.setDirectoryMode( dirMode ); result = perms; } String group = ConfigUtils.getString( session, (String) null, CONFIG_PROP_GROUP + suffix ); if ( group != null ) { perms.setGroup( group ); result = perms; } return result; } private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository, final AuthenticationContext authContext ) { AuthenticationInfo auth = null; if ( authContext != null ) { auth = new AuthenticationInfo() { @Override public String getUserName() { return authContext.get( AuthenticationContext.USERNAME ); } @Override public String getPassword() { return authContext.get( AuthenticationContext.PASSWORD ); } @Override public String getPrivateKey() { return authContext.get( AuthenticationContext.PRIVATE_KEY_PATH ); } @Override public String getPassphrase() { return authContext.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ); } }; } return auth; } private ProxyInfoProvider getProxy( RemoteRepository repository, final AuthenticationContext authContext ) { ProxyInfoProvider proxy = null; Proxy p = repository.getProxy(); if ( p != null ) { final ProxyInfo prox; if ( authContext != null ) { prox = new ProxyInfo() { @Override public String getUserName() { return authContext.get( AuthenticationContext.USERNAME ); } @Override public String getPassword() { return authContext.get( AuthenticationContext.PASSWORD ); } @Override public String getNtlmDomain() { return authContext.get( AuthenticationContext.NTLM_DOMAIN ); } @Override public String getNtlmHost() { return authContext.get( AuthenticationContext.NTLM_WORKSTATION ); } }; } else { prox = new ProxyInfo(); } prox.setType( p.getType() ); prox.setHost( p.getHost() ); prox.setPort( p.getPort() ); proxy = new ProxyInfoProvider() { public ProxyInfo getProxyInfo( String protocol ) { return prox; } }; } return proxy; } private Wagon lookupWagon() throws Exception { return wagonProvider.lookup( wagonHint ); } private void releaseWagon( Wagon wagon ) { wagonProvider.release( wagon ); } private void connectWagon( Wagon wagon ) throws Exception { if ( !headers.isEmpty() ) { try { Method setHttpHeaders = wagon.getClass().getMethod( "setHttpHeaders", Properties.class ); setHttpHeaders.invoke( wagon, headers ); } catch ( NoSuchMethodException e ) { // normal for non-http wagons } catch ( Exception e ) { logger.debug( "Could not set user agent for wagon " + wagon.getClass().getName() + ": " + e ); } } int connectTimeout = ConfigUtils.getInteger( session, ConfigurationProperties.DEFAULT_CONNECT_TIMEOUT, ConfigurationProperties.CONNECT_TIMEOUT ); int requestTimeout = ConfigUtils.getInteger( session, ConfigurationProperties.DEFAULT_REQUEST_TIMEOUT, ConfigurationProperties.REQUEST_TIMEOUT ); wagon.setTimeout( Math.max( Math.max( connectTimeout, requestTimeout ), 0 ) ); wagon.setInteractive( ConfigUtils.getBoolean( session, ConfigurationProperties.DEFAULT_INTERACTIVE, ConfigurationProperties.INTERACTIVE ) ); Object configuration = ConfigUtils.getObject( session, null, CONFIG_PROP_CONFIG + "." + repository.getId() ); if ( configuration != null && wagonConfigurator != null ) { try { wagonConfigurator.configure( wagon, configuration ); } catch ( Exception e ) { String msg = "Could not apply configuration for " + repository.getId() + " to wagon " + wagon.getClass().getName() + ":" + e.getMessage(); if ( logger.isDebugEnabled() ) { logger.warn( msg, e ); } else { logger.warn( msg ); } } } wagon.connect( wagonRepo, wagonAuth, wagonProxy ); } private void disconnectWagon( Wagon wagon ) { try { if ( wagon != null ) { wagon.disconnect(); } } catch ( Exception e ) { logger.debug( "Could not disconnect wagon " + wagon, e ); } } private Wagon pollWagon() throws Exception { Wagon wagon = wagons.poll(); if ( wagon == null ) { try { wagon = lookupWagon(); connectWagon( wagon ); } catch ( Exception e ) { releaseWagon( wagon ); throw e; } } else if ( wagon.getRepository() == null ) { try { connectWagon( wagon ); } catch ( Exception e ) { wagons.add( wagon ); throw e; } } return wagon; } public int classify( Throwable error ) { if ( error instanceof ResourceDoesNotExistException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } public void peek( PeekTask task ) throws Exception { execute( task, new PeekTaskRunner( task ) ); } public void get( GetTask task ) throws Exception { execute( task, new GetTaskRunner( task ) ); } public void put( PutTask task ) throws Exception { execute( task, new PutTaskRunner( task ) ); } private void execute( TransportTask task, TaskRunner runner ) throws Exception { if ( closed.get() ) { throw new IllegalStateException( "transporter closed, cannot execute task " + task ); } try { WagonTransferListener listener = new WagonTransferListener( task.getListener() ); Wagon wagon = pollWagon(); try { wagon.addTransferListener( listener ); runner.run( wagon ); } finally { wagon.removeTransferListener( listener ); wagons.add( wagon ); } } catch ( Exception e ) { throw WagonCancelledException.unwrap( e ); } } private static File newTempFile() throws IOException { return File.createTempFile( "wagon-" + UUID.randomUUID().toString().replace( "-", "" ), ".tmp" ); } private void delTempFile( File path ) { if ( path != null && !path.delete() && path.exists() ) { logger.debug( "Could not delete temorary file " + path ); } } private static void copy( OutputStream os, InputStream is ) throws IOException { byte[] buffer = new byte[1024 * 32]; for ( int read = is.read( buffer ); read >= 0; read = is.read( buffer ) ) { os.write( buffer, 0, read ); } } private static void close( Closeable file ) { if ( file != null ) { try { file.close(); } catch ( IOException e ) { // too bad } } } public void close() { if ( closed.compareAndSet( false, true ) ) { AuthenticationContext.close( repoAuthContext ); AuthenticationContext.close( proxyAuthContext ); for ( Wagon wagon = wagons.poll(); wagon != null; wagon = wagons.poll() ) { disconnectWagon( wagon ); releaseWagon( wagon ); } } } private interface TaskRunner { public void run( Wagon wagon ) throws Exception; } private static class PeekTaskRunner implements TaskRunner { private final PeekTask task; public PeekTaskRunner( PeekTask task ) { this.task = task; } public void run( Wagon wagon ) throws Exception { String src = task.getLocation().toString(); if ( !wagon.resourceExists( src ) ) { throw new ResourceDoesNotExistException( "Could not find " + src + " in " + wagon.getRepository().getUrl() ); } } } private class GetTaskRunner implements TaskRunner { private final GetTask task; public GetTaskRunner( GetTask task ) { this.task = task; } public void run( Wagon wagon ) throws Exception { String src = task.getLocation().toString(); File file = task.getDataFile(); if ( file == null && wagon instanceof StreamingWagon ) { OutputStream dst = task.newOutputStream(); try { ( (StreamingWagon) wagon ).getToStream( src, dst ); } finally { dst.close(); } } else { File dst = ( file != null ) ? file : newTempFile(); try { wagon.get( src, dst ); if ( !dst.exists() ) { /* * NOTE: Wagon (1.0-beta-6) doesn't create the destination file when transferring a 0-byte * resource. So if the resource we asked for didn't cause any exception but doesn't show up in * the dst file either, Wagon tells us in its weird way the file is empty. */ new FileOutputStream( dst ).close(); } if ( file == null ) { readTempFile( dst ); } } finally { if ( file == null ) { delTempFile( dst ); } } } } private void readTempFile( File dst ) throws IOException { FileInputStream fis = new FileInputStream( dst ); try { OutputStream os = task.newOutputStream(); try { copy( os, fis ); os.close(); } finally { close( os ); } } finally { close( fis ); } } } private class PutTaskRunner implements TaskRunner { private final PutTask task; public PutTaskRunner( PutTask task ) { this.task = task; } public void run( Wagon wagon ) throws Exception { String dst = task.getLocation().toString(); File file = task.getDataFile(); if ( file == null && wagon instanceof StreamingWagon ) { InputStream src = task.newInputStream(); try { // StreamingWagon uses an internal buffer on src input stream. ( (StreamingWagon) wagon ).putFromStream( src, dst, task.getDataLength(), -1 ); } finally { close( src ); } } else { File src = ( file != null ) ? file : createTempFile(); try { wagon.put( src, dst ); } finally { if ( file == null ) { delTempFile( src ); } } } } private File createTempFile() throws IOException { File tmp = newTempFile(); try { FileOutputStream fos = new FileOutputStream( tmp ); try { InputStream is = task.newInputStream(); try { copy( fos, is ); fos.close(); } finally { close( is ); } } finally { close( fos ); } } catch ( IOException e ) { delTempFile( tmp ); throw e; } return tmp; } } } WagonTransporterFactory.java000066400000000000000000000111261245546356100374140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.log.NullLoggerFactory; import org.eclipse.aether.transfer.NoTransporterException; /** * A transporter factory using Apache Maven Wagon. Note * that this factory merely serves as an adapter to the Wagon API and by itself does not provide any transport services * unless one or more wagon implementations are registered with the {@link WagonProvider}. */ @Named( "wagon" ) public final class WagonTransporterFactory implements TransporterFactory, Service { private Logger logger = NullLoggerFactory.LOGGER; private WagonProvider wagonProvider; private WagonConfigurator wagonConfigurator; private float priority = -1; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation * by clients, the new factory needs to be configured via its various mutators before first use or runtime errors * will occur. */ public WagonTransporterFactory() { // enables default constructor } @Inject WagonTransporterFactory( WagonProvider wagonProvider, WagonConfigurator wagonConfigurator, LoggerFactory loggerFactory ) { setWagonProvider( wagonProvider ); setWagonConfigurator( wagonConfigurator ); setLoggerFactory( loggerFactory ); } public void initService( ServiceLocator locator ) { setLoggerFactory( locator.getService( LoggerFactory.class ) ); setWagonProvider( locator.getService( WagonProvider.class ) ); setWagonConfigurator( locator.getService( WagonConfigurator.class ) ); } /** * Sets the logger factory to use for this component. * * @param loggerFactory The logger factory to use, may be {@code null} to disable logging. * @return This component for chaining, never {@code null}. */ public WagonTransporterFactory setLoggerFactory( LoggerFactory loggerFactory ) { this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, WagonTransporter.class ); return this; } /** * Sets the wagon provider to use to acquire and release wagon instances. * * @param wagonProvider The wagon provider to use, may be {@code null}. * @return This factory for chaining, never {@code null}. */ public WagonTransporterFactory setWagonProvider( WagonProvider wagonProvider ) { this.wagonProvider = wagonProvider; return this; } /** * Sets the wagon configurator to use to apply provider-specific configuration to wagon instances. * * @param wagonConfigurator The wagon configurator to use, may be {@code null}. * @return This factory for chaining, never {@code null}. */ public WagonTransporterFactory setWagonConfigurator( WagonConfigurator wagonConfigurator ) { this.wagonConfigurator = wagonConfigurator; return this; } public float getPriority() { return priority; } /** * Sets the priority of this component. * * @param priority The priority. * @return This component for chaining, never {@code null}. */ public WagonTransporterFactory setPriority( float priority ) { this.priority = priority; return this; } public Transporter newInstance( RepositorySystemSession session, RemoteRepository repository ) throws NoTransporterException { return new WagonTransporter( wagonProvider, wagonConfigurator, repository, session, logger ); } } package-info.java000066400000000000000000000012651245546356100350740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Support for downloads/uploads using Apache Maven Wagon. */ package org.eclipse.aether.transport.wagon; aether-1.0.2.v20150114/aether-transport-wagon/src/main/resources/000077500000000000000000000000001245546356100242175ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/main/resources/about.html000066400000000000000000000026401245546356100262210ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-transport-wagon/src/test/000077500000000000000000000000001245546356100222405ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/000077500000000000000000000000001245546356100231615ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/000077500000000000000000000000001245546356100237505ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/000077500000000000000000000000001245546356100253745ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100266445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/000077500000000000000000000000001245546356100307005ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/000077500000000000000000000000001245546356100320135ustar00rootroot00000000000000AbstractWagonTransporterTest.java000066400000000000000000000433531245546356100404520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; import java.net.URI; import java.util.Map; import java.util.UUID; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.Wagon; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.transport.GetTask; import org.eclipse.aether.spi.connector.transport.PeekTask; import org.eclipse.aether.spi.connector.transport.PutTask; import org.eclipse.aether.spi.connector.transport.Transporter; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.transfer.NoTransporterException; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.junit.After; import org.junit.Before; import org.junit.Test; /** */ public abstract class AbstractWagonTransporterTest { private DefaultRepositorySystemSession session; private TransporterFactory factory; private Transporter transporter; private String id; private Map fs; protected abstract Wagon newWagon(); private RemoteRepository newRepo( String url ) { return new RemoteRepository.Builder( "test", "default", url ).build(); } private void newTransporter( String url ) throws Exception { newTransporter( newRepo( url ) ); } private void newTransporter( RemoteRepository repo ) throws Exception { if ( transporter != null ) { transporter.close(); transporter = null; } transporter = factory.newInstance( session, repo ); } @Before public void setUp() throws Exception { session = TestUtils.newSession(); factory = new WagonTransporterFactory( new WagonProvider() { public Wagon lookup( String roleHint ) throws Exception { if ( "mem".equalsIgnoreCase( roleHint ) ) { return newWagon(); } throw new IllegalArgumentException( "Unknown wagon role: " + roleHint ); } public void release( Wagon wagon ) { } }, new WagonConfigurator() { public void configure( Wagon wagon, Object configuration ) throws Exception { ( (Configurable) wagon ).setConfiguration( configuration ); } }, new TestLoggerFactory() ); id = UUID.randomUUID().toString().replace( "-", "" ); fs = MemWagonUtils.getFilesystem( id ); fs.put( "file.txt", "test" ); fs.put( "empty.txt", "" ); fs.put( "some space.txt", "space" ); newTransporter( "mem://" + id ); } @After public void tearDown() { if ( transporter != null ) { transporter.close(); transporter = null; } factory = null; session = null; } @Test public void testClassify() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( new TransferFailedException( "test" ) ) ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( new ResourceDoesNotExistException( "test" ) ) ); } @Test public void testPeek() throws Exception { transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testPeek_NotFound() throws Exception { try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceDoesNotExistException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testPeek_Closed() throws Exception { transporter.close(); try { transporter.peek( new PeekTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_ToMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_ToFile() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "test", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EmptyResource() throws Exception { File file = TestFileUtils.createTempFile( "failure" ); assertTrue( file.delete() && !file.exists() ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", listener.baos.toString( "UTF-8" ) ); } @Test public void testGet_EncodedResourcePath() throws Exception { GetTask task = new GetTask( URI.create( "some%20space.txt" ) ); transporter.get( task ); assertEquals( "space", task.getDataString() ); } @Test public void testGet_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File file = TestFileUtils.createTempFile( "failure" ); transporter.get( new GetTask( URI.create( "file.txt" ) ).setDataFile( file ) ); assertTrue( i + ", " + file.getAbsolutePath(), file.delete() ); } } @Test public void testGet_NotFound() throws Exception { try { transporter.get( new GetTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( ResourceDoesNotExistException e ) { assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } } @Test public void testGet_Closed() throws Exception { transporter.close(); try { transporter.get( new GetTask( URI.create( "file.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testGet_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( 1, listener.startedCount ); } @Test public void testGet_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); try { transporter.get( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 4, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test public void testPut_FromMemory() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "file.txt" ) ); } @Test public void testPut_FromFile() throws Exception { File file = TestFileUtils.createTempFile( "upload" ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "file.txt" ) ); } @Test public void testPut_EmptyResource() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 0, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", fs.get( "file.txt" ) ); } @Test public void testPut_NonExistentParentDir() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "dir/sub/dir/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "dir/sub/dir/file.txt" ) ); } @Test public void testPut_EncodedResourcePath() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); assertEquals( 0, listener.dataOffset ); assertEquals( 2, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", fs.get( "some space.txt" ) ); } @Test public void testPut_FileHandleLeak() throws Exception { for ( int i = 0; i < 100; i++ ) { File src = TestFileUtils.createTempFile( "upload" ); transporter.put( new PutTask( URI.create( "file.txt" ) ).setDataFile( src ) ); assertTrue( i + ", " + src.getAbsolutePath(), src.delete() ); } } @Test public void testPut_Closed() throws Exception { transporter.close(); try { transporter.put( new PutTask( URI.create( "missing.txt" ) ) ); fail( "Expected error" ); } catch ( IllegalStateException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } @Test public void testPut_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); assertEquals( 1, listener.startedCount ); } @Test public void testPut_ProgressCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelProgress = true; PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @Test( expected = NoTransporterException.class ) public void testInit_BadProtocol() throws Exception { newTransporter( "bad:/void" ); } @Test public void testInit_CaseInsensitiveProtocol() throws Exception { newTransporter( "mem:/void" ); newTransporter( "MEM:/void" ); newTransporter( "mEm:/void" ); } @Test public void testInit_Configuration() throws Exception { session.setConfigProperty( "aether.connector.wagon.config.test", "passed" ); newTransporter( "mem://" + id + "?config=passed" ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testInit_UserAgent() throws Exception { session.setConfigProperty( ConfigurationProperties.USER_AGENT, "Test/1.0" ); newTransporter( "mem://" + id + "?userAgent=Test/1.0" ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testInit_Timeout() throws Exception { session.setConfigProperty( ConfigurationProperties.REQUEST_TIMEOUT, "12345678" ); newTransporter( "mem://" + id + "?requestTimeout=12345678" ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testInit_ServerAuth() throws Exception { String url = "mem://" + id + "?serverUsername=testuser&serverPassword=testpass" + "&serverPrivateKey=testkey&serverPassphrase=testphrase"; Authentication auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).addPrivateKey( "testkey", "testphrase" ).build(); RemoteRepository repo = new RemoteRepository.Builder( "test", "default", url ).setAuthentication( auth ).build(); newTransporter( repo ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testInit_Proxy() throws Exception { String url = "mem://" + id + "?proxyHost=testhost&proxyPort=8888"; RemoteRepository repo = new RemoteRepository.Builder( "test", "default", url ).setProxy( new Proxy( "http", "testhost", 8888 ) ).build(); newTransporter( repo ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } @Test public void testInit_ProxyAuth() throws Exception { String url = "mem://" + id + "?proxyUsername=testuser&proxyPassword=testpass"; Authentication auth = new AuthenticationBuilder().addUsername( "testuser" ).addPassword( "testpass" ).build(); RemoteRepository repo = new RemoteRepository.Builder( "test", "default", url ).setProxy( new Proxy( "http", "testhost", 8888, auth ) ).build(); newTransporter( repo ); transporter.peek( new PeekTask( URI.create( "file.txt" ) ) ); } } Configurable.java000066400000000000000000000012551245546356100352020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; /** */ public interface Configurable { Object getConfiguration(); void setConfiguration( Object config ); } MemStreamWagon.java000066400000000000000000000077541245546356100355020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.Map; import java.util.Properties; import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.InputData; import org.apache.maven.wagon.OutputData; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.StreamWagon; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.resource.Resource; /** */ public class MemStreamWagon extends StreamWagon implements Configurable { private Map fs; private Properties headers; private Object config; public void setConfiguration( Object config ) { this.config = config; } public Object getConfiguration() { return config; } public void setHttpHeaders( Properties httpHeaders ) { headers = httpHeaders; } @Override protected void openConnectionInternal() throws ConnectionException, AuthenticationException { fs = MemWagonUtils.openConnection( this, getAuthenticationInfo(), getProxyInfo( "mem", getRepository().getHost() ), headers ); } @Override public void closeConnection() throws ConnectionException { fs = null; } private String getData( String resource ) { return fs.get( URI.create( resource ).getSchemeSpecificPart() ); } @Override public boolean resourceExists( String resourceName ) throws TransferFailedException, AuthorizationException { String data = getData( resourceName ); return data != null; } @Override public void fillInputData( InputData inputData ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String data = getData( inputData.getResource().getName() ); if ( data == null ) { throw new ResourceDoesNotExistException( "Missing resource: " + inputData.getResource().getName() ); } byte[] bytes; try { bytes = data.getBytes( "UTF-8" ); } catch ( UnsupportedEncodingException e ) { throw new TransferFailedException( e.getMessage(), e ); } inputData.getResource().setContentLength( bytes.length ); inputData.setInputStream( new ByteArrayInputStream( bytes ) ); } @Override public void fillOutputData( OutputData outputData ) throws TransferFailedException { outputData.setOutputStream( new ByteArrayOutputStream() ); } @Override protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { String data; try { data = ( (ByteArrayOutputStream) output ).toString( "UTF-8" ); } catch ( UnsupportedEncodingException e ) { throw new TransferFailedException( e.getMessage(), e ); } fs.put( URI.create( resource.getName() ).getSchemeSpecificPart(), data ); } } MemWagon.java000066400000000000000000000156561245546356100343260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.Map; import java.util.Properties; import org.apache.maven.wagon.AbstractWagon; import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.InputData; import org.apache.maven.wagon.OutputData; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.events.TransferEvent; import org.apache.maven.wagon.resource.Resource; /** */ public class MemWagon extends AbstractWagon implements Configurable { private Map fs; private Properties headers; private Object config; public void setConfiguration( Object config ) { this.config = config; } public Object getConfiguration() { return config; } public void setHttpHeaders( Properties httpHeaders ) { headers = httpHeaders; } @Override protected void openConnectionInternal() throws ConnectionException, AuthenticationException { fs = MemWagonUtils.openConnection( this, getAuthenticationInfo(), getProxyInfo( "mem", getRepository().getHost() ), headers ); } @Override protected void closeConnection() throws ConnectionException { fs = null; } private String getData( String resource ) { return fs.get( URI.create( resource ).getSchemeSpecificPart() ); } @Override public boolean resourceExists( String resourceName ) throws TransferFailedException, AuthorizationException { String data = getData( resourceName ); return data != null; } public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { getIfNewer( resourceName, destination, 0 ); } public boolean getIfNewer( String resourceName, File destination, long timestamp ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); resource.setLastModified( timestamp ); getTransfer( resource, destination, getInputStream( resource ) ); return true; } protected InputStream getInputStream( Resource resource ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { InputData inputData = new InputData(); inputData.setResource( resource ); try { fillInputData( inputData ); } catch ( TransferFailedException e ) { fireTransferError( resource, e, TransferEvent.REQUEST_GET ); cleanupGetTransfer( resource ); throw e; } catch ( ResourceDoesNotExistException e ) { fireTransferError( resource, e, TransferEvent.REQUEST_GET ); cleanupGetTransfer( resource ); throw e; } catch ( AuthorizationException e ) { fireTransferError( resource, e, TransferEvent.REQUEST_GET ); cleanupGetTransfer( resource ); throw e; } finally { if ( inputData.getInputStream() == null ) { cleanupGetTransfer( resource ); } } return inputData.getInputStream(); } protected void fillInputData( InputData inputData ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String data = getData( inputData.getResource().getName() ); if ( data == null ) { throw new ResourceDoesNotExistException( "Missing resource: " + inputData.getResource().getName() ); } byte[] bytes; try { bytes = data.getBytes( "UTF-8" ); } catch ( UnsupportedEncodingException e ) { throw new TransferFailedException( e.getMessage(), e ); } inputData.getResource().setContentLength( bytes.length ); inputData.setInputStream( new ByteArrayInputStream( bytes ) ); } public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); firePutInitiated( resource, source ); resource.setContentLength( source.length() ); resource.setLastModified( source.lastModified() ); OutputStream os = getOutputStream( resource ); putTransfer( resource, source, os, true ); } protected OutputStream getOutputStream( Resource resource ) throws TransferFailedException { OutputData outputData = new OutputData(); outputData.setResource( resource ); try { fillOutputData( outputData ); } catch ( TransferFailedException e ) { fireTransferError( resource, e, TransferEvent.REQUEST_PUT ); throw e; } finally { if ( outputData.getOutputStream() == null ) { cleanupPutTransfer( resource ); } } return outputData.getOutputStream(); } protected void fillOutputData( OutputData outputData ) throws TransferFailedException { outputData.setOutputStream( new ByteArrayOutputStream() ); } @Override protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { String data; try { data = ( (ByteArrayOutputStream) output ).toString( "UTF-8" ); } catch ( UnsupportedEncodingException e ) { throw new TransferFailedException( e.getMessage(), e ); } fs.put( URI.create( resource.getName() ).getSchemeSpecificPart(), data ); } } MemWagonUtils.java000066400000000000000000000074531245546356100353430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.net.URI; import java.util.Map; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.authentication.AuthenticationInfo; import org.apache.maven.wagon.proxy.ProxyInfo; /** */ class MemWagonUtils { private static final ConcurrentMap> mounts = new ConcurrentHashMap>(); public static Map getFilesystem( String id ) { Map fs = mounts.get( id ); if ( fs == null ) { fs = new ConcurrentHashMap(); Map prev = mounts.putIfAbsent( id, fs ); if ( prev != null ) { fs = prev; } } return fs; } public static Map openConnection( Wagon wagon, AuthenticationInfo auth, ProxyInfo proxy, Properties headers ) throws ConnectionException, AuthenticationException { URI uri = URI.create( wagon.getRepository().getUrl() ); String query = uri.getQuery(); if ( query != null ) { verify( query, "config", String.valueOf( ( (Configurable) wagon ).getConfiguration() ) ); verify( query, "userAgent", ( headers != null ) ? headers.getProperty( "User-Agent" ) : null ); verify( query, "requestTimeout", Integer.toString( wagon.getTimeout() ) ); verify( query, "serverUsername", ( auth != null ) ? auth.getUserName() : null ); verify( query, "serverPassword", ( auth != null ) ? auth.getPassword() : null ); verify( query, "serverPrivateKey", ( auth != null ) ? auth.getPrivateKey() : null ); verify( query, "serverPassphrase", ( auth != null ) ? auth.getPassphrase() : null ); verify( query, "proxyHost", ( proxy != null ) ? proxy.getHost() : null ); verify( query, "proxyPort", ( proxy != null ) ? Integer.toString( proxy.getPort() ) : null ); verify( query, "proxyUsername", ( proxy != null ) ? proxy.getUserName() : null ); verify( query, "proxyPassword", ( proxy != null ) ? proxy.getPassword() : null ); } return getFilesystem( uri.getHost() ); } private static void verify( String query, String key, String value ) throws ConnectionException { int index = query.indexOf( key + "=" ); if ( index < 0 ) { return; } String expected = query.substring( index + key.length() + 1 ); index = expected.indexOf( "&" ); if ( index >= 0 ) { expected = expected.substring( 0, index ); } if ( expected.length() == 0 ) { if ( value != null ) { throw new ConnectionException( "Bad " + key + ": " + value ); } } else if ( !expected.equals( value ) ) { throw new ConnectionException( "Bad " + key + ": " + value ); } } } PlexusSupportTest.java000066400000000000000000000027131245546356100363170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.spi.log.LoggerFactory; /** */ public class PlexusSupportTest extends PlexusTestCase { @Override protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { containerConfiguration.setClassPathScanning( "cache" ); } public void testExistenceOfPlexusComponentMetadata() throws Exception { getContainer().addComponent( new TestLoggerFactory(), LoggerFactory.class, null ); TransporterFactory factory = lookup( TransporterFactory.class, "wagon" ); assertNotNull( factory ); assertEquals( WagonTransporterFactory.class, factory.getClass() ); } } RecordingTransportListener.java000066400000000000000000000034561245546356100401460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import org.eclipse.aether.spi.connector.transport.TransportListener; import org.eclipse.aether.transfer.TransferCancelledException; class RecordingTransportListener extends TransportListener { public final ByteArrayOutputStream baos = new ByteArrayOutputStream( 1024 ); public long dataOffset; public long dataLength; public int startedCount; public int progressedCount; public boolean cancelStart; public boolean cancelProgress; @Override public void transportStarted( long dataOffset, long dataLength ) throws TransferCancelledException { startedCount++; progressedCount = 0; this.dataLength = dataLength; this.dataOffset = dataOffset; baos.reset(); if ( cancelStart ) { throw new TransferCancelledException(); } } @Override public void transportProgressed( ByteBuffer data ) throws TransferCancelledException { progressedCount++; baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() ); if ( cancelProgress ) { throw new TransferCancelledException(); } } } StreamWagonTransporterTest.java000066400000000000000000000014301245546356100401300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.apache.maven.wagon.Wagon; /** */ public class StreamWagonTransporterTest extends AbstractWagonTransporterTest { @Override protected Wagon newWagon() { return new MemStreamWagon(); } } WagonTransporterTest.java000066400000000000000000000014141245546356100367560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.transport.wagon; import org.apache.maven.wagon.Wagon; /** */ public class WagonTransporterTest extends AbstractWagonTransporterTest { @Override protected Wagon newWagon() { return new MemWagon(); } } aether-1.0.2.v20150114/aether-transport-wagon/src/test/resources/000077500000000000000000000000001245546356100242525ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-transport-wagon/src/test/resources/logback-test.xml000066400000000000000000000015731245546356100273610ustar00rootroot00000000000000 %d{HH:mm:ss.SSS} [%-18thread] %c{1} [%p] %m%n aether-1.0.2.v20150114/aether-util/000077500000000000000000000000001245546356100163025ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/pom.xml000066400000000000000000000041121245546356100176150ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 aether-util Aether Utilities A collection of utility classes to ease usage of the repository system. org.eclipse.aether.util org.eclipse.aether aether-api org.eclipse.aether aether-test-util test org.hamcrest hamcrest-library test junit junit test org.codehaus.mojo animal-sniffer-maven-plugin org.codehaus.mojo clirr-maven-plugin org.apache.felix maven-bundle-plugin aether-1.0.2.v20150114/aether-util/src/000077500000000000000000000000001245546356100170715ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/000077500000000000000000000000001245546356100200155ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/000077500000000000000000000000001245546356100207365ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/000077500000000000000000000000001245546356100215255ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/000077500000000000000000000000001245546356100231515ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/000077500000000000000000000000001245546356100244215ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/000077500000000000000000000000001245546356100253765ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java000066400000000000000000000135721245546356100310340ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; /** * A utility class to assist in the verification and generation of checksums. */ public final class ChecksumUtils { private ChecksumUtils() { // hide constructor } /** * Extracts the checksum from the specified file. * * @param checksumFile The path to the checksum file, must not be {@code null}. * @return The checksum stored in the file, never {@code null}. * @throws IOException If the checksum does not exist or could not be read for other reasons. */ public static String read( File checksumFile ) throws IOException { String checksum = ""; FileInputStream fis = new FileInputStream( checksumFile ); try { BufferedReader br = new BufferedReader( new InputStreamReader( fis, "UTF-8" ), 512 ); try { while ( true ) { String line = br.readLine(); if ( line == null ) { break; } line = line.trim(); if ( line.length() > 0 ) { checksum = line; break; } } } finally { try { br.close(); } catch ( IOException e ) { // ignored } } } finally { try { fis.close(); } catch ( IOException e ) { // ignored } } if ( checksum.matches( ".+= [0-9A-Fa-f]+" ) ) { int lastSpacePos = checksum.lastIndexOf( ' ' ); checksum = checksum.substring( lastSpacePos + 1 ); } else { int spacePos = checksum.indexOf( ' ' ); if ( spacePos != -1 ) { checksum = checksum.substring( 0, spacePos ); } } return checksum; } /** * Calculates checksums for the specified file. * * @param dataFile The file for which to calculate checksums, must not be {@code null}. * @param algos The names of checksum algorithms (cf. {@link MessageDigest#getInstance(String)} to use, must not be * {@code null}. * @return The calculated checksums, indexed by algorithm name, or the exception that occurred while trying to * calculate it, never {@code null}. * @throws IOException If the data file could not be read. */ public static Map calc( File dataFile, Collection algos ) throws IOException { Map results = new LinkedHashMap(); Map digests = new LinkedHashMap(); for ( String algo : algos ) { try { digests.put( algo, MessageDigest.getInstance( algo ) ); } catch ( NoSuchAlgorithmException e ) { results.put( algo, e ); } } FileInputStream fis = new FileInputStream( dataFile ); try { for ( byte[] buffer = new byte[32 * 1024];; ) { int read = fis.read( buffer ); if ( read < 0 ) { break; } for ( MessageDigest digest : digests.values() ) { digest.update( buffer, 0, read ); } } } finally { try { fis.close(); } catch ( IOException e ) { // ignored } } for ( Map.Entry entry : digests.entrySet() ) { byte[] bytes = entry.getValue().digest(); results.put( entry.getKey(), toHexString( bytes ) ); } return results; } /** * Creates a hexadecimal representation of the specified bytes. Each byte is converted into a two-digit hex number * and appended to the result with no separator between consecutive bytes. * * @param bytes The bytes to represent in hex notation, may be be {@code null}. * @return The hexadecimal representation of the input or {@code null} if the input was {@code null}. */ public static String toHexString( byte[] bytes ) { if ( bytes == null ) { return null; } StringBuilder buffer = new StringBuilder( bytes.length * 2 ); for ( byte aByte : bytes ) { int b = aByte & 0xFF; if ( b < 0x10 ) { buffer.append( '0' ); } buffer.append( Integer.toHexString( b ) ); } return buffer.toString(); } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java000066400000000000000000000352421245546356100304750ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import org.eclipse.aether.RepositorySystemSession; /** * A utility class to read configuration properties from a repository system session. * * @see RepositorySystemSession#getConfigProperties() */ public final class ConfigUtils { private ConfigUtils() { // hide constructor } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys are set, may be {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a valid value is found. * @return The property value or {@code null} if none. */ public static Object getObject( Map properties, Object defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value != null ) { return value; } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys are set, may be {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a valid value is found. * @return The property value or {@code null} if none. */ public static Object getObject( RepositorySystemSession session, Object defaultValue, String... keys ) { return getObject( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a string, may be * {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a string value is found. * @return The property value or {@code null} if none. */ public static String getString( Map properties, String defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof String ) { return (String) value; } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a string, may be * {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a string value is found. * @return The property value or {@code null} if none. */ public static String getString( RepositorySystemSession session, String defaultValue, String... keys ) { return getString( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of an {@link Integer} is found. * @return The property value. */ public static int getInteger( Map properties, int defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof Number ) { return ( (Number) value ).intValue(); } try { return Integer.valueOf( (String) value ); } catch ( Exception e ) { // try next key } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of an {@link Integer} is found. * @return The property value. */ public static int getInteger( RepositorySystemSession session, int defaultValue, String... keys ) { return getInteger( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Long} is found. * @return The property value. */ public static long getLong( Map properties, long defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof Number ) { return ( (Number) value ).longValue(); } try { return Long.valueOf( (String) value ); } catch ( Exception e ) { // try next key } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Long} is found. * @return The property value. */ public static long getLong( RepositorySystemSession session, long defaultValue, String... keys ) { return getLong( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Float} is found. * @return The property value. */ public static float getFloat( Map properties, float defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof Number ) { return ( (Number) value ).floatValue(); } try { return Float.valueOf( (String) value ); } catch ( Exception e ) { // try next key } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a number. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Float} is found. * @return The property value. */ public static float getFloat( RepositorySystemSession session, float defaultValue, String... keys ) { return getFloat( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a boolean. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Boolean} or a string (to be {@link Boolean#parseBoolean(String) parsed as boolean}) is found. * @return The property value. */ public static boolean getBoolean( Map properties, boolean defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof Boolean ) { return (Boolean) value; } else if ( value instanceof String ) { return Boolean.parseBoolean( (String) value ); } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a boolean. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Boolean} or a string (to be {@link Boolean#parseBoolean(String) parsed as boolean}) is found. * @return The property value. */ public static boolean getBoolean( RepositorySystemSession session, boolean defaultValue, String... keys ) { return getBoolean( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a collection. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a collection is found. * @return The property value or {@code null} if none. */ public static List getList( Map properties, List defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof List ) { return (List) value; } else if ( value instanceof Collection ) { return Collections.unmodifiableList( new ArrayList( (Collection) value ) ); } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a collection. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a collection is found. * @return The property value or {@code null} if none. */ public static List getList( RepositorySystemSession session, List defaultValue, String... keys ) { return getList( session.getConfigProperties(), defaultValue, keys ); } /** * Gets the specified configuration property. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a map. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a map is found. * @return The property value or {@code null} if none. */ public static Map getMap( Map properties, Map defaultValue, String... keys ) { for ( String key : keys ) { Object value = properties.get( key ); if ( value instanceof Map ) { return (Map) value; } } return defaultValue; } /** * Gets the specified configuration property. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a map. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a map is found. * @return The property value or {@code null} if none. */ public static Map getMap( RepositorySystemSession session, Map defaultValue, String... keys ) { return getMap( session.getConfigProperties(), defaultValue, keys ); } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/StringUtils.java000066400000000000000000000021031245546356100305240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; /** * A utility class to ease string processing. */ public final class StringUtils { private StringUtils() { // hide constructor } /** * Checks whether a string is {@code null} or of zero length. * * @param string The string to check, may be {@code null}. * @return {@code true} if the string is {@code null} or of zero length, {@code false} otherwise. */ public static boolean isEmpty( String string ) { return string == null || string.length() <= 0; } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/000077500000000000000000000000001245546356100271735ustar00rootroot00000000000000ArtifactIdUtils.java000066400000000000000000000217141245546356100330170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import org.eclipse.aether.artifact.Artifact; /** * A utility class for artifact identifiers. */ public final class ArtifactIdUtils { private static final char SEP = ':'; private ArtifactIdUtils() { // hide constructor } /** * Creates an artifact identifier of the form {@code ::[:]:}. * * @param artifact The artifact to create an identifer for, may be {@code null}. * @return The artifact identifier or {@code null} if the input was {@code null}. */ public static String toId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier(), artifact.getVersion() ); } return id; } /** * Creates an artifact identifier of the form {@code ::[:]:}. * * @param groupId The group id, may be {@code null}. * @param artifactId The artifact id, may be {@code null}. * @param extension The file extensiion, may be {@code null}. * @param classifier The classifier, may be {@code null}. * @param version The version, may be {@code null}. * @return The artifact identifier, never {@code null}. */ public static String toId( String groupId, String artifactId, String extension, String classifier, String version ) { StringBuilder buffer = concat( groupId, artifactId, extension, classifier ); buffer.append( SEP ); if ( version != null ) { buffer.append( version ); } return buffer.toString(); } /** * Creates an artifact identifier of the form * {@code ::[:]:}. * * @param artifact The artifact to create an identifer for, may be {@code null}. * @return The artifact identifier or {@code null} if the input was {@code null}. */ public static String toBaseId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier(), artifact.getBaseVersion() ); } return id; } /** * Creates an artifact identifier of the form {@code ::[:]}. * * @param artifact The artifact to create an identifer for, may be {@code null}. * @return The artifact identifier or {@code null} if the input was {@code null}. */ public static String toVersionlessId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier() ); } return id; } /** * Creates an artifact identifier of the form {@code ::[:]}. * * @param groupId The group id, may be {@code null}. * @param artifactId The artifact id, may be {@code null}. * @param extension The file extensiion, may be {@code null}. * @param classifier The classifier, may be {@code null}. * @return The artifact identifier, never {@code null}. */ public static String toVersionlessId( String groupId, String artifactId, String extension, String classifier ) { return concat( groupId, artifactId, extension, classifier ).toString(); } private static StringBuilder concat( String groupId, String artifactId, String extension, String classifier ) { StringBuilder buffer = new StringBuilder( 128 ); if ( groupId != null ) { buffer.append( groupId ); } buffer.append( SEP ); if ( artifactId != null ) { buffer.append( artifactId ); } buffer.append( SEP ); if ( extension != null ) { buffer.append( extension ); } if ( classifier != null && classifier.length() > 0 ) { buffer.append( SEP ).append( classifier ); } return buffer; } /** * Determines whether two artifacts have the same identifier. This method is equivalent to calling * {@link String#equals(Object)} on the return values from {@link #toId(Artifact)} for the artifacts but does not * incur the overhead of creating temporary strings. * * @param artifact1 The first artifact, may be {@code null}. * @param artifact2 The second artifact, may be {@code null}. * @return {@code true} if both artifacts are not {@code null} and have equal ids, {@code false} otherwise. */ public static boolean equalsId( Artifact artifact1, Artifact artifact2 ) { if ( artifact1 == null || artifact2 == null ) { return false; } if ( !eq( artifact1.getArtifactId(), artifact2.getArtifactId() ) ) { return false; } if ( !eq( artifact1.getGroupId(), artifact2.getGroupId() ) ) { return false; } if ( !eq( artifact1.getExtension(), artifact2.getExtension() ) ) { return false; } if ( !eq( artifact1.getClassifier(), artifact2.getClassifier() ) ) { return false; } if ( !eq( artifact1.getVersion(), artifact2.getVersion() ) ) { return false; } return true; } /** * Determines whether two artifacts have the same base identifier. This method is equivalent to calling * {@link String#equals(Object)} on the return values from {@link #toBaseId(Artifact)} for the artifacts but does * not incur the overhead of creating temporary strings. * * @param artifact1 The first artifact, may be {@code null}. * @param artifact2 The second artifact, may be {@code null}. * @return {@code true} if both artifacts are not {@code null} and have equal base ids, {@code false} otherwise. */ public static boolean equalsBaseId( Artifact artifact1, Artifact artifact2 ) { if ( artifact1 == null || artifact2 == null ) { return false; } if ( !eq( artifact1.getArtifactId(), artifact2.getArtifactId() ) ) { return false; } if ( !eq( artifact1.getGroupId(), artifact2.getGroupId() ) ) { return false; } if ( !eq( artifact1.getExtension(), artifact2.getExtension() ) ) { return false; } if ( !eq( artifact1.getClassifier(), artifact2.getClassifier() ) ) { return false; } if ( !eq( artifact1.getBaseVersion(), artifact2.getBaseVersion() ) ) { return false; } return true; } /** * Determines whether two artifacts have the same versionless identifier. This method is equivalent to calling * {@link String#equals(Object)} on the return values from {@link #toVersionlessId(Artifact)} for the artifacts but * does not incur the overhead of creating temporary strings. * * @param artifact1 The first artifact, may be {@code null}. * @param artifact2 The second artifact, may be {@code null}. * @return {@code true} if both artifacts are not {@code null} and have equal versionless ids, {@code false} * otherwise. */ public static boolean equalsVersionlessId( Artifact artifact1, Artifact artifact2 ) { if ( artifact1 == null || artifact2 == null ) { return false; } if ( !eq( artifact1.getArtifactId(), artifact2.getArtifactId() ) ) { return false; } if ( !eq( artifact1.getGroupId(), artifact2.getGroupId() ) ) { return false; } if ( !eq( artifact1.getExtension(), artifact2.getExtension() ) ) { return false; } if ( !eq( artifact1.getClassifier(), artifact2.getClassifier() ) ) { return false; } return true; } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } } DefaultArtifactTypeRegistry.java000066400000000000000000000024441245546356100354200ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import org.eclipse.aether.artifact.ArtifactType; /** * A simple artifact type registry. */ public final class DefaultArtifactTypeRegistry extends SimpleArtifactTypeRegistry { /** * Creates a new artifact type registry with initally no registered artifact types. Use {@link #add(ArtifactType)} * to populate the registry. */ public DefaultArtifactTypeRegistry() { } /** * Adds the specified artifact type to the registry. * * @param type The artifact type to add, must not be {@code null}. * @return This registry for chaining, never {@code null}. */ public DefaultArtifactTypeRegistry add( ArtifactType type ) { super.add( type ); return this; } } DelegatingArtifact.java000066400000000000000000000076561245546356100335160ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import java.io.File; import java.util.Map; import org.eclipse.aether.artifact.AbstractArtifact; import org.eclipse.aether.artifact.Artifact; /** * An artifact that delegates to another artifact instance. This class serves as a base for subclasses that want to * carry additional data fields. */ public abstract class DelegatingArtifact extends AbstractArtifact { private final Artifact delegate; /** * Creates a new artifact instance that delegates to the specified artifact. * * @param delegate The artifact to delegate to, must not be {@code null}. */ protected DelegatingArtifact( Artifact delegate ) { if ( delegate == null ) { throw new IllegalArgumentException( "delegate artifact not specified" ); } this.delegate = delegate; } /** * Creates a new artifact instance that delegates to the specified artifact. Subclasses should use this hook to * instantiate themselves, taking along any data from the current instance that was added. * * @param delegate The artifact to delegate to, must not be {@code null}. * @return The new delegating artifact, never {@code null}. */ protected abstract DelegatingArtifact newInstance( Artifact delegate ); public String getGroupId() { return delegate.getGroupId(); } public String getArtifactId() { return delegate.getArtifactId(); } public String getVersion() { return delegate.getVersion(); } public Artifact setVersion( String version ) { Artifact artifact = delegate.setVersion( version ); if ( artifact != delegate ) { return newInstance( artifact ); } return this; } public String getBaseVersion() { return delegate.getBaseVersion(); } public boolean isSnapshot() { return delegate.isSnapshot(); } public String getClassifier() { return delegate.getClassifier(); } public String getExtension() { return delegate.getExtension(); } public File getFile() { return delegate.getFile(); } public Artifact setFile( File file ) { Artifact artifact = delegate.setFile( file ); if ( artifact != delegate ) { return newInstance( artifact ); } return this; } public String getProperty( String key, String defaultValue ) { return delegate.getProperty( key, defaultValue ); } public Map getProperties() { return delegate.getProperties(); } public Artifact setProperties( Map properties ) { Artifact artifact = delegate.setProperties( properties ); if ( artifact != delegate ) { return newInstance( artifact ); } return this; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof DelegatingArtifact ) { return delegate.equals( ( (DelegatingArtifact) obj ).delegate ); } return delegate.equals( obj ); } @Override public int hashCode() { return delegate.hashCode(); } @Override public String toString() { return delegate.toString(); } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java000066400000000000000000000020311245546356100320700ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; /** * The dependency scopes used for Java dependencies. * * @see org.eclipse.aether.graph.Dependency#getScope() */ public final class JavaScopes { public static final String COMPILE = "compile"; public static final String PROVIDED = "provided"; public static final String SYSTEM = "system"; public static final String RUNTIME = "runtime"; public static final String TEST = "test"; private JavaScopes() { // hide constructor } } OverlayArtifactTypeRegistry.java000066400000000000000000000036541245546356100354610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; /** * An artifact type registry which first consults its own mappings and in case of an unknown type falls back to another * type registry. */ public final class OverlayArtifactTypeRegistry extends SimpleArtifactTypeRegistry { private final ArtifactTypeRegistry delegate; /** * Creates a new artifact type registry with initially no registered artifact types and the specified fallback * registry. Use {@link #add(ArtifactType)} to populate the registry. * * @param delegate The artifact type registry to fall back to, may be {@code null}. */ public OverlayArtifactTypeRegistry( ArtifactTypeRegistry delegate ) { this.delegate = delegate; } /** * Adds the specified artifact type to the registry. * * @param type The artifact type to add, must not be {@code null}. * @return This registry for chaining, never {@code null}. */ public OverlayArtifactTypeRegistry add( ArtifactType type ) { super.add( type ); return this; } public ArtifactType get( String typeId ) { ArtifactType type = super.get( typeId ); if ( type == null && delegate != null ) { type = delegate.get( typeId ); } return type; } } SimpleArtifactTypeRegistry.java000066400000000000000000000033261245546356100352650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; /** * A simple map-based artifact type registry. */ class SimpleArtifactTypeRegistry implements ArtifactTypeRegistry { private final Map types; /** * Creates a new artifact type registry with initally no registered artifact types. Use {@link #add(ArtifactType)} * to populate the registry. */ public SimpleArtifactTypeRegistry() { types = new HashMap(); } /** * Adds the specified artifact type to the registry. * * @param type The artifact type to add, must not be {@code null}. * @return This registry for chaining, never {@code null}. */ public SimpleArtifactTypeRegistry add( ArtifactType type ) { types.put( type.getId(), type ); return this; } public ArtifactType get( String typeId ) { ArtifactType type = types.get( typeId ); return type; } @Override public String toString() { return types.toString(); } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java000066400000000000000000000204031245546356100322440ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import java.io.File; import java.util.Map; import org.eclipse.aether.artifact.AbstractArtifact; import org.eclipse.aether.artifact.Artifact; /** * An artifact whose identity is derived from another artifact. Note: Instances of this class are immutable and * the exposed mutators return new objects rather than changing the current instance. */ public final class SubArtifact extends AbstractArtifact { private final Artifact mainArtifact; private final String classifier; private final String extension; private final File file; private final Map properties; /** * Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk * character "*" to refer to the corresponding property of the main artifact. For instance, the classifier * "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be * used to refer to the GPG signature of an artifact. * * @param mainArtifact The artifact from which to derive the identity, must not be {@code null}. * @param classifier The classifier for this artifact, may be {@code null} if none. * @param extension The extension for this artifact, may be {@code null} if none. */ public SubArtifact( Artifact mainArtifact, String classifier, String extension ) { this( mainArtifact, classifier, extension, (File) null ); } /** * Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk * character "*" to refer to the corresponding property of the main artifact. For instance, the classifier * "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be * used to refer to the GPG signature of an artifact. * * @param mainArtifact The artifact from which to derive the identity, must not be {@code null}. * @param classifier The classifier for this artifact, may be {@code null} if none. * @param extension The extension for this artifact, may be {@code null} if none. * @param file The file for this artifact, may be {@code null} if unresolved. */ public SubArtifact( Artifact mainArtifact, String classifier, String extension, File file ) { this( mainArtifact, classifier, extension, null, file ); } /** * Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk * character "*" to refer to the corresponding property of the main artifact. For instance, the classifier * "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be * used to refer to the GPG signature of an artifact. * * @param mainArtifact The artifact from which to derive the identity, must not be {@code null}. * @param classifier The classifier for this artifact, may be {@code null} if none. * @param extension The extension for this artifact, may be {@code null} if none. * @param properties The properties of the artifact, may be {@code null}. */ public SubArtifact( Artifact mainArtifact, String classifier, String extension, Map properties ) { this( mainArtifact, classifier, extension, properties, null ); } /** * Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk * character "*" to refer to the corresponding property of the main artifact. For instance, the classifier * "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be * used to refer to the GPG signature of an artifact. * * @param mainArtifact The artifact from which to derive the identity, must not be {@code null}. * @param classifier The classifier for this artifact, may be {@code null} if none. * @param extension The extension for this artifact, may be {@code null} if none. * @param properties The properties of the artifact, may be {@code null}. * @param file The file for this artifact, may be {@code null} if unresolved. */ public SubArtifact( Artifact mainArtifact, String classifier, String extension, Map properties, File file ) { if ( mainArtifact == null ) { throw new IllegalArgumentException( "no artifact specified" ); } this.mainArtifact = mainArtifact; this.classifier = classifier; this.extension = extension; this.file = file; this.properties = copyProperties( properties ); } private SubArtifact( Artifact mainArtifact, String classifier, String extension, File file, Map properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.mainArtifact = mainArtifact; this.classifier = classifier; this.extension = extension; this.file = file; this.properties = properties; } public String getGroupId() { return mainArtifact.getGroupId(); } public String getArtifactId() { return mainArtifact.getArtifactId(); } public String getVersion() { return mainArtifact.getVersion(); } public String getBaseVersion() { return mainArtifact.getBaseVersion(); } public boolean isSnapshot() { return mainArtifact.isSnapshot(); } public String getClassifier() { return expand( classifier, mainArtifact.getClassifier() ); } public String getExtension() { return expand( extension, mainArtifact.getExtension() ); } public File getFile() { return file; } public Artifact setFile( File file ) { if ( ( this.file == null ) ? file == null : this.file.equals( file ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, file, properties ); } public Map getProperties() { return properties; } public Artifact setProperties( Map properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); } private static String expand( String pattern, String replacement ) { String result = ""; if ( pattern != null ) { result = pattern.replace( "*", replacement ); if ( replacement.length() <= 0 ) { if ( pattern.startsWith( "*" ) ) { int i = 0; for ( ; i < result.length(); i++ ) { char c = result.charAt( i ); if ( c != '-' && c != '.' ) { break; } } result = result.substring( i ); } if ( pattern.endsWith( "*" ) ) { int i = result.length() - 1; for ( ; i >= 0; i-- ) { char c = result.charAt( i ); if ( c != '-' && c != '.' ) { break; } } result = result.substring( 0, i + 1 ); } } } return result; } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java000066400000000000000000000011671245546356100323670ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Utilities around artifacts and artifact type registries. */ package org.eclipse.aether.util.artifact; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/concurrency/000077500000000000000000000000001245546356100277305ustar00rootroot00000000000000RunnableErrorForwarder.java000066400000000000000000000105621245546356100351540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/concurrency/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.concurrency; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.LockSupport; /** * A utility class to forward any uncaught {@link Error} or {@link RuntimeException} from a {@link Runnable} executed in * a worker thread back to the parent thread. The simplified usage pattern looks like this: * *
 * RunnableErrorForwarder errorForwarder = new RunnableErrorForwarder();
 * for ( Runnable task : tasks )
 * {
 *     executor.execute( errorForwarder.wrap( task ) );
 * }
 * errorForwarder.await();
 * 
*/ public final class RunnableErrorForwarder { private final Thread thread = Thread.currentThread(); private final AtomicInteger counter = new AtomicInteger(); private final AtomicReference error = new AtomicReference(); /** * Creates a new error forwarder for worker threads spawned by the current thread. */ public RunnableErrorForwarder() { } /** * Wraps the specified runnable into an equivalent runnable that will allow forwarding of uncaught errors. * * @param runnable The runnable from which to forward errors, must not be {@code null}. * @return The error-forwarding runnable to eventually execute, never {@code null}. */ public Runnable wrap( final Runnable runnable ) { if ( runnable == null ) { throw new IllegalArgumentException( "runnable missing" ); } counter.incrementAndGet(); return new Runnable() { public void run() { try { runnable.run(); } catch ( RuntimeException e ) { error.compareAndSet( null, e ); throw e; } catch ( Error e ) { error.compareAndSet( null, e ); throw e; } finally { counter.decrementAndGet(); LockSupport.unpark( thread ); } } }; } /** * Causes the current thread to wait until all previously {@link #wrap(Runnable) wrapped} runnables have terminated * and potentially re-throws an uncaught {@link RuntimeException} or {@link Error} from any of the runnables. In * case multiple runnables encountered uncaught errors, one error is arbitrarily selected. Note: This * method must be called from the same thread that created this error forwarder instance. */ public void await() { awaitTerminationOfAllRunnables(); Throwable error = this.error.get(); if ( error != null ) { if ( error instanceof RuntimeException ) { throw (RuntimeException) error; } else if ( error instanceof ThreadDeath ) { throw new IllegalStateException( error ); } else if ( error instanceof Error ) { throw (Error) error; } throw new IllegalStateException( error ); } } private void awaitTerminationOfAllRunnables() { if ( !thread.equals( Thread.currentThread() ) ) { throw new IllegalStateException( "wrong caller thread, expected " + thread + " and not " + Thread.currentThread() ); } boolean interrupted = false; while ( counter.get() > 0 ) { LockSupport.park(); if ( Thread.interrupted() ) { interrupted = true; } } if ( interrupted ) { Thread.currentThread().interrupt(); } } } WorkerThreadFactory.java000066400000000000000000000043451245546356100344530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/concurrency/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.concurrency; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** * A factory to create worker threads with a given name prefix. */ public final class WorkerThreadFactory implements ThreadFactory { private final ThreadFactory factory; private final String namePrefix; private final AtomicInteger threadIndex; private static final AtomicInteger poolIndex = new AtomicInteger(); /** * Creates a new thread factory whose threads will have names using the specified prefix. * * @param namePrefix The prefix for the thread names, may be {@code null} or empty to derive the prefix from the * caller's simple class name. */ public WorkerThreadFactory( String namePrefix ) { this.factory = Executors.defaultThreadFactory(); this.namePrefix = ( ( namePrefix != null && namePrefix.length() > 0 ) ? namePrefix : getCallerSimpleClassName() + '-' ) + poolIndex.getAndIncrement() + '-'; threadIndex = new AtomicInteger(); } private static String getCallerSimpleClassName() { StackTraceElement[] stack = new Exception().getStackTrace(); if ( stack == null || stack.length <= 2 ) { return "Worker-"; } String name = stack[2].getClassName(); name = name.substring( name.lastIndexOf( '.' ) + 1 ); return name; } public Thread newThread( Runnable r ) { Thread thread = factory.newThread( r ); thread.setName( namePrefix + threadIndex.getAndIncrement() ); thread.setDaemon( true ); return thread; } } package-info.java000066400000000000000000000011531245546356100330400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/concurrency/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Utilities for concurrent task processing. */ package org.eclipse.aether.util.concurrency; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/000077500000000000000000000000001245546356100266635ustar00rootroot00000000000000AbstractPatternDependencyFilter.java000066400000000000000000000156701245546356100357260ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; import org.eclipse.aether.version.VersionScheme; /** */ class AbstractPatternDependencyFilter implements DependencyFilter { private final Set patterns = new HashSet(); private final VersionScheme versionScheme; /** * Creates a new filter using the specified patterns. * * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public AbstractPatternDependencyFilter( final String... patterns ) { this( null, patterns ); } /** * Creates a new filter using the specified patterns. * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be included. * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public AbstractPatternDependencyFilter( final VersionScheme versionScheme, final String... patterns ) { this( versionScheme, patterns == null ? null : Arrays.asList( patterns ) ); } /** * Creates a new filter using the specified patterns. * * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public AbstractPatternDependencyFilter( final Collection patterns ) { this( null, patterns ); } /** * Creates a new filter using the specified patterns and {@link VersionScheme} . * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be included. * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public AbstractPatternDependencyFilter( final VersionScheme versionScheme, final Collection patterns ) { if ( patterns != null ) { this.patterns.addAll( patterns ); } this.versionScheme = versionScheme; } public boolean accept( final DependencyNode node, List parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } return accept( dependency.getArtifact() ); } protected boolean accept( final Artifact artifact ) { for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; } private boolean accept( final Artifact artifact, final String pattern ) { final String[] tokens = new String[] { artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getBaseVersion() }; final String[] patternTokens = pattern.split( ":" ); // fail immediately if pattern tokens outnumber tokens to match boolean matched = ( patternTokens.length <= tokens.length ); for ( int i = 0; matched && i < patternTokens.length; i++ ) { matched = matches( tokens[i], patternTokens[i] ); } return matched; } private boolean matches( final String token, final String pattern ) { boolean matches; // support full wildcard and implied wildcard if ( "*".equals( pattern ) || pattern.length() == 0 ) { matches = true; } // support contains wildcard else if ( pattern.startsWith( "*" ) && pattern.endsWith( "*" ) ) { final String contains = pattern.substring( 1, pattern.length() - 1 ); matches = ( token.contains( contains ) ); } // support leading wildcard else if ( pattern.startsWith( "*" ) ) { final String suffix = pattern.substring( 1, pattern.length() ); matches = token.endsWith( suffix ); } // support trailing wildcard else if ( pattern.endsWith( "*" ) ) { final String prefix = pattern.substring( 0, pattern.length() - 1 ); matches = token.startsWith( prefix ); } // support versions range else if ( pattern.startsWith( "[" ) || pattern.startsWith( "(" ) ) { matches = isVersionIncludedInRange( token, pattern ); } // support exact match else { matches = token.equals( pattern ); } return matches; } private boolean isVersionIncludedInRange( final String version, final String range ) { if ( versionScheme == null ) { return false; } else { try { final Version parsedVersion = versionScheme.parseVersion( version ); final VersionRange parsedRange = versionScheme.parseVersionRange( range ); return parsedRange.containsVersion( parsedVersion ); } catch ( final InvalidVersionSpecificationException e ) { return false; } } } @Override public boolean equals( final Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } final AbstractPatternDependencyFilter that = (AbstractPatternDependencyFilter) obj; return this.patterns.equals( that.patterns ) && ( this.versionScheme == null ? that.versionScheme == null : this.versionScheme.equals( that.versionScheme ) ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + patterns.hashCode(); hash = hash * 31 + ( ( versionScheme == null ) ? 0 : versionScheme.hashCode() ); return hash; } } AndDependencyFilter.java000066400000000000000000000066671245546356100333350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A dependency filter that combines zero or more other filters using a logical {@code AND}. The resulting filter * accepts a given dependency node if and only if all constituent filters accept it. */ public final class AndDependencyFilter implements DependencyFilter { private final Set filters = new LinkedHashSet(); /** * Creates a new filter from the specified filters. Prefer {@link #newInstance(DependencyFilter, DependencyFilter)} * if any of the input filters might be {@code null}. * * @param filters The filters to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyFilter( DependencyFilter... filters ) { if ( filters != null ) { Collections.addAll( this.filters, filters ); } } /** * Creates a new filter from the specified filters. * * @param filters The filters to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyFilter( Collection filters ) { if ( filters != null ) { this.filters.addAll( filters ); } } /** * Creates a new filter from the specified filters. * * @param filter1 The first filter to combine, may be {@code null}. * @param filter2 The second filter to combine, may be {@code null}. * @return The combined filter or {@code null} if both filter were {@code null}. */ public static DependencyFilter newInstance( DependencyFilter filter1, DependencyFilter filter2 ) { if ( filter1 == null ) { return filter2; } else if ( filter2 == null ) { return filter1; } return new AndDependencyFilter( filter1, filter2 ); } public boolean accept( DependencyNode node, List parents ) { for ( DependencyFilter filter : filters ) { if ( !filter.accept( node, parents ) ) { return false; } } return true; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyFilter that = (AndDependencyFilter) obj; return this.filters.equals( that.filters ); } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + filters.hashCode(); return hash; } } DependencyFilterUtils.java000066400000000000000000000146151245546356100337230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.util.artifact.JavaScopes; /** * A utility class assisting in the creation of dependency node filters. */ public final class DependencyFilterUtils { private DependencyFilterUtils() { // hide constructor } /** * Creates a new filter that negates the specified filter. * * @param filter The filter to negate, must not be {@code null}. * @return The new filter, never {@code null}. */ public static DependencyFilter notFilter( DependencyFilter filter ) { return new NotDependencyFilter( filter ); } /** * Creates a new filter that combines the specified filters using a logical {@code AND}. If no filters are * specified, the resulting filter accepts everything. * * @param filters The filters to combine, may be {@code null}. * @return The new filter, never {@code null}. */ public static DependencyFilter andFilter( DependencyFilter... filters ) { if ( filters != null && filters.length == 1 ) { return filters[0]; } else { return new AndDependencyFilter( filters ); } } /** * Creates a new filter that combines the specified filters using a logical {@code AND}. If no filters are * specified, the resulting filter accepts everything. * * @param filters The filters to combine, may be {@code null}. * @return The new filter, never {@code null}. */ public static DependencyFilter andFilter( Collection filters ) { if ( filters != null && filters.size() == 1 ) { return filters.iterator().next(); } else { return new AndDependencyFilter( filters ); } } /** * Creates a new filter that combines the specified filters using a logical {@code OR}. If no filters are specified, * the resulting filter accepts nothing. * * @param filters The filters to combine, may be {@code null}. * @return The new filter, never {@code null}. */ public static DependencyFilter orFilter( DependencyFilter... filters ) { if ( filters != null && filters.length == 1 ) { return filters[0]; } else { return new OrDependencyFilter( filters ); } } /** * Creates a new filter that combines the specified filters using a logical {@code OR}. If no filters are specified, * the resulting filter accepts nothing. * * @param filters The filters to combine, may be {@code null}. * @return The new filter, never {@code null}. */ public static DependencyFilter orFilter( Collection filters ) { if ( filters != null && filters.size() == 1 ) { return filters.iterator().next(); } else { return new OrDependencyFilter( filters ); } } /** * Creates a new filter that selects dependencies whose scope matches one or more of the specified classpath types. * A classpath type is a set of scopes separated by either {@code ','} or {@code '+'}. * * @param classpathTypes The classpath types, may be {@code null} or empty to match no dependency. * @return The new filter, never {@code null}. * @see JavaScopes */ public static DependencyFilter classpathFilter( String... classpathTypes ) { return classpathFilter( ( classpathTypes != null ) ? Arrays.asList( classpathTypes ) : null ); } /** * Creates a new filter that selects dependencies whose scope matches one or more of the specified classpath types. * A classpath type is a set of scopes separated by either {@code ','} or {@code '+'}. * * @param classpathTypes The classpath types, may be {@code null} or empty to match no dependency. * @return The new filter, never {@code null}. * @see JavaScopes */ public static DependencyFilter classpathFilter( Collection classpathTypes ) { Collection types = new HashSet(); if ( classpathTypes != null ) { for ( String classpathType : classpathTypes ) { String[] tokens = classpathType.split( "[+,]" ); for ( String token : tokens ) { token = token.trim(); if ( token.length() > 0 ) { types.add( token ); } } } } Collection included = new HashSet(); for ( String type : types ) { if ( JavaScopes.COMPILE.equals( type ) ) { Collections.addAll( included, JavaScopes.COMPILE, JavaScopes.PROVIDED, JavaScopes.SYSTEM ); } else if ( JavaScopes.RUNTIME.equals( type ) ) { Collections.addAll( included, JavaScopes.COMPILE, JavaScopes.RUNTIME ); } else if ( JavaScopes.TEST.equals( type ) ) { Collections.addAll( included, JavaScopes.COMPILE, JavaScopes.PROVIDED, JavaScopes.SYSTEM, JavaScopes.RUNTIME, JavaScopes.TEST ); } else { included.add( type ); } } Collection excluded = new HashSet(); Collections.addAll( excluded, JavaScopes.COMPILE, JavaScopes.PROVIDED, JavaScopes.SYSTEM, JavaScopes.RUNTIME, JavaScopes.TEST ); excluded.removeAll( included ); return new ScopeDependencyFilter( null, excluded ); } } ExclusionsDependencyFilter.java000066400000000000000000000051131245546356100347500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A simple filter to exclude artifacts based on either artifact id or group id and artifact id. */ public final class ExclusionsDependencyFilter implements DependencyFilter { private final Set excludes = new HashSet(); /** * Creates a new filter using the specified exclude patterns. A pattern can either be of the form * {@code groupId:artifactId} (recommended) or just {@code artifactId} (deprecated). * * @param excludes The exclude patterns, may be {@code null} or empty to exclude no artifacts. */ public ExclusionsDependencyFilter( Collection excludes ) { if ( excludes != null ) { this.excludes.addAll( excludes ); } } public boolean accept( DependencyNode node, List parents ) { Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } String id = dependency.getArtifact().getArtifactId(); if ( excludes.contains( id ) ) { return false; } id = dependency.getArtifact().getGroupId() + ':' + id; if ( excludes.contains( id ) ) { return false; } return true; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ExclusionsDependencyFilter that = (ExclusionsDependencyFilter) obj; return this.excludes.equals( that.excludes ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + excludes.hashCode(); return hash; } } NotDependencyFilter.java000066400000000000000000000035731245546356100333640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A dependency filter that negates another filter. */ public final class NotDependencyFilter implements DependencyFilter { private final DependencyFilter filter; /** * Creates a new filter negatint the specified filter. * * @param filter The filter to negate, must not be {@code null}. */ public NotDependencyFilter( DependencyFilter filter ) { if ( filter == null ) { throw new IllegalArgumentException( "no filter specified" ); } this.filter = filter; } public boolean accept( DependencyNode node, List parents ) { return !filter.accept( node, parents ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } NotDependencyFilter that = (NotDependencyFilter) obj; return this.filter.equals( that.filter ); } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + filter.hashCode(); return hash; } } OrDependencyFilter.java000066400000000000000000000061641245546356100332030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A dependency filter that combines zero or more other filters using a logical {@code OR}. */ public final class OrDependencyFilter implements DependencyFilter { private final Set filters = new LinkedHashSet(); /** * Creates a new filter from the specified filters. * * @param filters The filters to combine, may be {@code null}. */ public OrDependencyFilter( DependencyFilter... filters ) { if ( filters != null ) { Collections.addAll( this.filters, filters ); } } /** * Creates a new filter from the specified filters. * * @param filters The filters to combine, may be {@code null}. */ public OrDependencyFilter( Collection filters ) { if ( filters != null ) { this.filters.addAll( filters ); } } /** * Creates a new filter from the specified filters. * * @param filter1 The first filter to combine, may be {@code null}. * @param filter2 The first filter to combine, may be {@code null}. * @return The combined filter or {@code null} if both filter were {@code null}. */ public static DependencyFilter newInstance( DependencyFilter filter1, DependencyFilter filter2 ) { if ( filter1 == null ) { return filter2; } else if ( filter2 == null ) { return filter1; } return new OrDependencyFilter( filter1, filter2 ); } public boolean accept( DependencyNode node, List parents ) { for ( DependencyFilter filter : filters ) { if ( filter.accept( node, parents ) ) { return true; } } return false; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } OrDependencyFilter that = (OrDependencyFilter) obj; return this.filters.equals( that.filters ); } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + filters.hashCode(); return hash; } } PatternExclusionsDependencyFilter.java000066400000000000000000000062221245546356100363100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Collection; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.version.VersionScheme; /** * A simple filter to exclude artifacts from a list of patterns. The artifact pattern syntax is of the form: * *
 * [groupId]:[artifactId]:[extension]:[version]
 * 
*

* Where each pattern segment is optional and supports full and partial * wildcards. An empty pattern * segment is treated as an implicit wildcard. Version can be a range in case a {@link VersionScheme} is specified. *

*

* For example, org.eclipse.* would match all artifacts whose group id started with * org.eclipse. , and :::*-SNAPSHOT would match all snapshot artifacts. *

*/ public final class PatternExclusionsDependencyFilter extends AbstractPatternDependencyFilter { /** * Creates a new filter using the specified patterns. * * @param patterns The exclude patterns, may be {@code null} or empty to exclude no artifacts. */ public PatternExclusionsDependencyFilter( final String... patterns ) { super( patterns ); } /** * Creates a new filter using the specified patterns. * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be excluded. * @param patterns The exclude patterns, may be {@code null} or empty to exclude no artifacts. */ public PatternExclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns ) { super( versionScheme, patterns ); } /** * Creates a new filter using the specified patterns. * * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public PatternExclusionsDependencyFilter( final Collection patterns ) { super( patterns ); } /** * Creates a new filter using the specified patterns and {@link VersionScheme} . * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be excluded. * @param patterns The exclude patterns, may be {@code null} or empty to exclude no artifacts. */ public PatternExclusionsDependencyFilter( final VersionScheme versionScheme, final Collection patterns ) { super( versionScheme, patterns ); } @Override protected boolean accept( Artifact artifact ) { return !super.accept( artifact ); } } PatternInclusionsDependencyFilter.java000066400000000000000000000057561245546356100363150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Collection; import org.eclipse.aether.version.VersionScheme; /** * A simple filter to include artifacts from a list of patterns. The artifact pattern syntax is of the form: * *
 * [groupId]:[artifactId]:[extension]:[version]
 * 
*

* Where each pattern segment is optional and supports full and partial * wildcards. An empty pattern * segment is treated as an implicit wildcard. Version can be a range in case a {@link VersionScheme} is specified. *

*

* For example, org.eclipse.* would match all artifacts whose group id started with * org.eclipse. , and :::*-SNAPSHOT would match all snapshot artifacts. *

*/ public final class PatternInclusionsDependencyFilter extends AbstractPatternDependencyFilter { /** * Creates a new filter using the specified patterns. * * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public PatternInclusionsDependencyFilter( final String... patterns ) { super( patterns ); } /** * Creates a new filter using the specified patterns. * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be included. * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns ) { super( versionScheme, patterns ); } /** * Creates a new filter using the specified patterns. * * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public PatternInclusionsDependencyFilter( final Collection patterns ) { super( patterns ); } /** * Creates a new filter using the specified patterns and {@link VersionScheme} . * * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a * range no artifact will be included. * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. */ public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection patterns ) { super( versionScheme, patterns ); } } ScopeDependencyFilter.java000066400000000000000000000063551245546356100336760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; /** * A dependency filter based on dependency scopes. Note: This filter does not assume any relationships between * the scopes. In particular, the filter is not aware of scopes that logically include other scopes. * * @see Dependency#getScope() */ public final class ScopeDependencyFilter implements DependencyFilter { private final Set included = new HashSet(); private final Set excluded = new HashSet(); /** * Creates a new filter using the specified includes and excludes. * * @param included The set of scopes to include, may be {@code null} or empty to include any scope. * @param excluded The set of scopes to exclude, may be {@code null} or empty to exclude no scope. */ public ScopeDependencyFilter( Collection included, Collection excluded ) { if ( included != null ) { this.included.addAll( included ); } if ( excluded != null ) { this.excluded.addAll( excluded ); } } /** * Creates a new filter using the specified excludes. * * @param excluded The set of scopes to exclude, may be {@code null} or empty to exclude no scope. */ public ScopeDependencyFilter( String... excluded ) { if ( excluded != null ) { this.excluded.addAll( Arrays.asList( excluded ) ); } } public boolean accept( DependencyNode node, List parents ) { Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } String scope = node.getDependency().getScope(); return ( included.isEmpty() || included.contains( scope ) ) && ( excluded.isEmpty() || !excluded.contains( scope ) ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ScopeDependencyFilter that = (ScopeDependencyFilter) obj; return this.included.equals( that.included ) && this.excluded.equals( that.excluded ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + included.hashCode(); hash = hash * 31 + excluded.hashCode(); return hash; } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/filter/package-info.java000066400000000000000000000012021245546356100320450ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency filters for selecting nodes in a dependency graph. */ package org.eclipse.aether.util.filter; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/000077500000000000000000000000001245546356100264775ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/000077500000000000000000000000001245546356100301115ustar00rootroot00000000000000ClassicDependencyManager.java000066400000000000000000000262641245546356100355620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.manager; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.util.artifact.JavaScopes; /** * A dependency manager that mimics the way Maven 2.x works. */ public final class ClassicDependencyManager implements DependencyManager { private final int depth; private final Map managedVersions; private final Map managedScopes; private final Map managedOptionals; private final Map managedLocalPaths; private final Map> managedExclusions; private int hashCode; /** * Creates a new dependency manager without any management information. */ public ClassicDependencyManager() { this( 0, Collections. emptyMap(), Collections. emptyMap(), Collections. emptyMap(), Collections. emptyMap(), Collections.> emptyMap() ); } private ClassicDependencyManager( int depth, Map managedVersions, Map managedScopes, Map managedOptionals, Map managedLocalPaths, Map> managedExclusions ) { this.depth = depth; this.managedVersions = managedVersions; this.managedScopes = managedScopes; this.managedOptionals = managedOptionals; this.managedLocalPaths = managedLocalPaths; this.managedExclusions = managedExclusions; } public DependencyManager deriveChildManager( DependencyCollectionContext context ) { if ( depth >= 2 ) { return this; } else if ( depth == 1 ) { return new ClassicDependencyManager( depth + 1, managedVersions, managedScopes, managedOptionals, managedLocalPaths, managedExclusions ); } Map managedVersions = this.managedVersions; Map managedScopes = this.managedScopes; Map managedOptionals = this.managedOptionals; Map managedLocalPaths = this.managedLocalPaths; Map> managedExclusions = this.managedExclusions; for ( Dependency managedDependency : context.getManagedDependencies() ) { Artifact artifact = managedDependency.getArtifact(); Object key = getKey( artifact ); String version = artifact.getVersion(); if ( version.length() > 0 && !managedVersions.containsKey( key ) ) { if ( managedVersions == this.managedVersions ) { managedVersions = new HashMap( this.managedVersions ); } managedVersions.put( key, version ); } String scope = managedDependency.getScope(); if ( scope.length() > 0 && !managedScopes.containsKey( key ) ) { if ( managedScopes == this.managedScopes ) { managedScopes = new HashMap( this.managedScopes ); } managedScopes.put( key, scope ); } Boolean optional = managedDependency.getOptional(); if ( optional != null && !managedOptionals.containsKey( key ) ) { if ( managedOptionals == this.managedOptionals ) { managedOptionals = new HashMap( this.managedOptionals ); } managedOptionals.put( key, optional ); } String localPath = managedDependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ); if ( localPath != null && !managedLocalPaths.containsKey( key ) ) { if ( managedLocalPaths == this.managedLocalPaths ) { managedLocalPaths = new HashMap( this.managedLocalPaths ); } managedLocalPaths.put( key, localPath ); } Collection exclusions = managedDependency.getExclusions(); if ( !exclusions.isEmpty() ) { if ( managedExclusions == this.managedExclusions ) { managedExclusions = new HashMap>( this.managedExclusions ); } Collection managed = managedExclusions.get( key ); if ( managed == null ) { managed = new LinkedHashSet(); managedExclusions.put( key, managed ); } managed.addAll( exclusions ); } } return new ClassicDependencyManager( depth + 1, managedVersions, managedScopes, managedOptionals, managedLocalPaths, managedExclusions ); } public DependencyManagement manageDependency( Dependency dependency ) { DependencyManagement management = null; Object key = getKey( dependency.getArtifact() ); if ( depth >= 2 ) { String version = managedVersions.get( key ); if ( version != null ) { if ( management == null ) { management = new DependencyManagement(); } management.setVersion( version ); } String scope = managedScopes.get( key ); if ( scope != null ) { if ( management == null ) { management = new DependencyManagement(); } management.setScope( scope ); if ( !JavaScopes.SYSTEM.equals( scope ) && dependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null ) { Map properties = new HashMap( dependency.getArtifact().getProperties() ); properties.remove( ArtifactProperties.LOCAL_PATH ); management.setProperties( properties ); } } if ( ( scope != null && JavaScopes.SYSTEM.equals( scope ) ) || ( scope == null && JavaScopes.SYSTEM.equals( dependency.getScope() ) ) ) { String localPath = managedLocalPaths.get( key ); if ( localPath != null ) { if ( management == null ) { management = new DependencyManagement(); } Map properties = new HashMap( dependency.getArtifact().getProperties() ); properties.put( ArtifactProperties.LOCAL_PATH, localPath ); management.setProperties( properties ); } } Boolean optional = managedOptionals.get( key ); if ( optional != null ) { if ( management == null ) { management = new DependencyManagement(); } management.setOptional( optional ); } } Collection exclusions = managedExclusions.get( key ); if ( exclusions != null ) { if ( management == null ) { management = new DependencyManagement(); } Collection result = new LinkedHashSet( dependency.getExclusions() ); result.addAll( exclusions ); management.setExclusions( result ); } return management; } private Object getKey( Artifact a ) { return new Key( a ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } ClassicDependencyManager that = (ClassicDependencyManager) obj; return depth == that.depth && managedVersions.equals( that.managedVersions ) && managedScopes.equals( that.managedScopes ) && managedOptionals.equals( that.managedOptionals ) && managedExclusions.equals( that.managedExclusions ); } @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + depth; hash = hash * 31 + managedVersions.hashCode(); hash = hash * 31 + managedScopes.hashCode(); hash = hash * 31 + managedOptionals.hashCode(); hash = hash * 31 + managedExclusions.hashCode(); hashCode = hash; } return hashCode; } static class Key { private final Artifact artifact; private final int hashCode; public Key( Artifact artifact ) { this.artifact = artifact; int hash = 17; hash = hash * 31 + artifact.getGroupId().hashCode(); hash = hash * 31 + artifact.getArtifactId().hashCode(); hashCode = hash; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Key ) ) { return false; } Key that = (Key) obj; return artifact.getArtifactId().equals( that.artifact.getArtifactId() ) && artifact.getGroupId().equals( that.artifact.getGroupId() ) && artifact.getExtension().equals( that.artifact.getExtension() ) && artifact.getClassifier().equals( that.artifact.getClassifier() ); } @Override public int hashCode() { return hashCode; } } } DependencyManagerUtils.java000066400000000000000000000104231245546356100352670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.manager; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.graph.DependencyNode; /** * A utility class assisting in analyzing the effects of dependency management. */ public final class DependencyManagerUtils { /** * The key in the repository session's {@link RepositorySystemSession#getConfigProperties() configuration * properties} used to store a {@link Boolean} flag controlling the verbose mode for dependency management. If * enabled, the original attributes of a dependency before its update due to dependency managemnent will be recorded * in the node's {@link DependencyNode#getData() custom data} when building a dependency graph. */ public static final String CONFIG_PROP_VERBOSE = "aether.dependencyManager.verbose"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original version is * stored. */ public static final String NODE_DATA_PREMANAGED_VERSION = "premanaged.version"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original scope is * stored. */ public static final String NODE_DATA_PREMANAGED_SCOPE = "premanaged.scope"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the original optional * flag is stored. */ public static final String NODE_DATA_PREMANAGED_OPTIONAL = "premanaged.optional"; /** * Gets the version or version range of the specified dependency node before dependency management was applied (if * any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's dependency version before dependency management or {@code null} if the version was not managed * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedVersion( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_VERSION ), String.class ); } /** * Gets the scope of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's dependency scope before dependency management or {@code null} if the scope was not managed or * if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedScope( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_SCOPE ), String.class ); } /** * Gets the optional flag of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's optional flag before dependency management or {@code null} if the flag was not managed or if * {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static Boolean getPremanagedOptional( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_OPTIONAL ), Boolean.class ); } private static T cast( Object obj, Class type ) { return type.isInstance( obj ) ? type.cast( obj ) : null; } } NoopDependencyManager.java000066400000000000000000000036731245546356100351130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.manager; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.graph.Dependency; /** * A dependency manager that does not do any dependency management. */ public final class NoopDependencyManager implements DependencyManager { /** * A ready-made instance of this dependency manager which can safely be reused throughout an entire application * regardless of multi-threading. */ public static final DependencyManager INSTANCE = new NoopDependencyManager(); /** * Creates a new instance of this dependency manager. Usually, {@link #INSTANCE} should be used instead. */ public NoopDependencyManager() { } public DependencyManager deriveChildManager( DependencyCollectionContext context ) { return this; } public DependencyManagement manageDependency( Dependency dependency ) { return null; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } return true; } @Override public int hashCode() { return getClass().hashCode(); } } package-info.java000066400000000000000000000012001245546356100332120ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency managers for building a dependency graph. */ package org.eclipse.aether.util.graph.manager; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/000077500000000000000000000000001245546356100303175ustar00rootroot00000000000000AndDependencySelector.java000066400000000000000000000136021245546356100353070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; /** * A dependency selector that combines zero or more other selectors using a logical {@code AND}. The resulting selector * selects a given dependency if and only if all constituent selectors do so. */ public final class AndDependencySelector implements DependencySelector { private final Set selectors; private int hashCode; /** * Creates a new selector from the specified selectors. Prefer * {@link #newInstance(DependencySelector, DependencySelector)} if any of the input selectors might be {@code null}. * * @param selectors The selectors to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencySelector( DependencySelector... selectors ) { if ( selectors != null && selectors.length > 0 ) { this.selectors = new LinkedHashSet( Arrays.asList( selectors ) ); } else { this.selectors = Collections.emptySet(); } } /** * Creates a new selector from the specified selectors. * * @param selectors The selectors to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencySelector( Collection selectors ) { if ( selectors != null && !selectors.isEmpty() ) { this.selectors = new LinkedHashSet( selectors ); } else { this.selectors = Collections.emptySet(); } } private AndDependencySelector( Set selectors ) { if ( selectors != null && !selectors.isEmpty() ) { this.selectors = selectors; } else { this.selectors = Collections.emptySet(); } } /** * Creates a new selector from the specified selectors. * * @param selector1 The first selector to combine, may be {@code null}. * @param selector2 The second selector to combine, may be {@code null}. * @return The combined selector or {@code null} if both selectors were {@code null}. */ public static DependencySelector newInstance( DependencySelector selector1, DependencySelector selector2 ) { if ( selector1 == null ) { return selector2; } else if ( selector2 == null || selector2.equals( selector1 ) ) { return selector1; } return new AndDependencySelector( selector1, selector2 ); } public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { int seen = 0; Set childSelectors = null; for ( DependencySelector selector : selectors ) { DependencySelector childSelector = selector.deriveChildSelector( context ); if ( childSelectors != null ) { if ( childSelector != null ) { childSelectors.add( childSelector ); } } else if ( selector != childSelector ) { childSelectors = new LinkedHashSet(); if ( seen > 0 ) { for ( DependencySelector s : selectors ) { if ( childSelectors.size() >= seen ) { break; } childSelectors.add( s ); } } if ( childSelector != null ) { childSelectors.add( childSelector ); } } else { seen++; } } if ( childSelectors == null ) { return this; } if ( childSelectors.size() <= 1 ) { if ( childSelectors.isEmpty() ) { return null; } return childSelectors.iterator().next(); } return new AndDependencySelector( childSelectors ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencySelector that = (AndDependencySelector) obj; return selectors.equals( that.selectors ); } @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; } } ExclusionDependencySelector.java000066400000000000000000000146371245546356100365670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.TreeSet; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.Exclusion; /** * A dependency selector that applies exclusions based on artifact coordinates. * * @see Dependency#getExclusions() */ public final class ExclusionDependencySelector implements DependencySelector { // sorted and dupe-free array, faster to iterate than LinkedHashSet private final Exclusion[] exclusions; private int hashCode; /** * Creates a new selector without any exclusions. */ public ExclusionDependencySelector() { this.exclusions = new Exclusion[0]; } /** * Creates a new selector with the specified exclusions. * * @param exclusions The exclusions, may be {@code null}. */ public ExclusionDependencySelector( Collection exclusions ) { if ( exclusions != null && !exclusions.isEmpty() ) { TreeSet sorted = new TreeSet( ExclusionComparator.INSTANCE ); sorted.addAll( exclusions ); this.exclusions = sorted.toArray( new Exclusion[sorted.size()] ); } else { this.exclusions = new Exclusion[0]; } } private ExclusionDependencySelector( Exclusion[] exclusions ) { this.exclusions = exclusions; } public boolean selectDependency( Dependency dependency ) { Artifact artifact = dependency.getArtifact(); for ( Exclusion exclusion : exclusions ) { if ( matches( exclusion, artifact ) ) { return false; } } return true; } private boolean matches( Exclusion exclusion, Artifact artifact ) { if ( !matches( exclusion.getArtifactId(), artifact.getArtifactId() ) ) { return false; } if ( !matches( exclusion.getGroupId(), artifact.getGroupId() ) ) { return false; } if ( !matches( exclusion.getExtension(), artifact.getExtension() ) ) { return false; } if ( !matches( exclusion.getClassifier(), artifact.getClassifier() ) ) { return false; } return true; } private boolean matches( String pattern, String value ) { return "*".equals( pattern ) || pattern.equals( value ); } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { Dependency dependency = context.getDependency(); Collection exclusions = ( dependency != null ) ? dependency.getExclusions() : null; if ( exclusions == null || exclusions.isEmpty() ) { return this; } Exclusion[] merged = this.exclusions; int count = merged.length; for ( Exclusion exclusion : exclusions ) { int index = Arrays.binarySearch( merged, exclusion, ExclusionComparator.INSTANCE ); if ( index < 0 ) { index = -( index + 1 ); if ( count >= merged.length ) { Exclusion[] tmp = new Exclusion[merged.length + exclusions.size()]; System.arraycopy( merged, 0, tmp, 0, index ); tmp[index] = exclusion; System.arraycopy( merged, index, tmp, index + 1, count - index ); merged = tmp; } else { System.arraycopy( merged, index, merged, index + 1, count - index ); merged[index] = exclusion; } count++; } } if ( merged == this.exclusions ) { return this; } if ( merged.length != count ) { Exclusion[] tmp = new Exclusion[count]; System.arraycopy( merged, 0, tmp, 0, count ); merged = tmp; } return new ExclusionDependencySelector( merged ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } ExclusionDependencySelector that = (ExclusionDependencySelector) obj; return Arrays.equals( exclusions, that.exclusions ); } @Override public int hashCode() { if ( hashCode == 0 ) { int hash = getClass().hashCode(); hash = hash * 31 + Arrays.hashCode( exclusions ); hashCode = hash; } return hashCode; } private static class ExclusionComparator implements Comparator { static final ExclusionComparator INSTANCE = new ExclusionComparator(); public int compare( Exclusion e1, Exclusion e2 ) { if ( e1 == null ) { return ( e2 == null ) ? 0 : 1; } else if ( e2 == null ) { return -1; } int rel = e1.getArtifactId().compareTo( e2.getArtifactId() ); if ( rel == 0 ) { rel = e1.getGroupId().compareTo( e2.getGroupId() ); if ( rel == 0 ) { rel = e1.getExtension().compareTo( e2.getExtension() ); if ( rel == 0 ) { rel = e1.getClassifier().compareTo( e2.getClassifier() ); } } } return rel; } } } OptionalDependencySelector.java000066400000000000000000000041531245546356100363730ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; /** * A dependency selector that excludes optional dependencies which occur beyond level one of the dependency graph. * * @see Dependency#isOptional() */ public final class OptionalDependencySelector implements DependencySelector { private final int depth; /** * Creates a new selector to exclude optional transitive dependencies. */ public OptionalDependencySelector() { depth = 0; } private OptionalDependencySelector( int depth ) { this.depth = depth; } public boolean selectDependency( Dependency dependency ) { return depth < 2 || !dependency.isOptional(); } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { if ( depth >= 2 ) { return this; } return new OptionalDependencySelector( depth + 1 ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } OptionalDependencySelector that = (OptionalDependencySelector) obj; return depth == that.depth; } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + depth; return hash; } } ScopeDependencySelector.java000066400000000000000000000110131245546356100356500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.TreeSet; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; /** * A dependency selector that filters transitive dependencies based on their scope. Direct dependencies are always * included regardless of their scope. Note: This filter does not assume any relationships between the scopes. * In particular, the filter is not aware of scopes that logically include other scopes. * * @see Dependency#getScope() */ public final class ScopeDependencySelector implements DependencySelector { private final boolean transitive; private final Collection included; private final Collection excluded; /** * Creates a new selector using the specified includes and excludes. * * @param included The set of scopes to include, may be {@code null} or empty to include any scope. * @param excluded The set of scopes to exclude, may be {@code null} or empty to exclude no scope. */ public ScopeDependencySelector( Collection included, Collection excluded ) { transitive = false; this.included = clone( included ); this.excluded = clone( excluded ); } private static Collection clone( Collection scopes ) { Collection copy; if ( scopes == null || scopes.isEmpty() ) { // checking for null is faster than isEmpty() copy = null; } else { copy = new HashSet( scopes ); if ( copy.size() <= 2 ) { // contains() is faster for smallish array (sorted for equals()!) copy = new ArrayList( new TreeSet( copy ) ); } } return copy; } /** * Creates a new selector using the specified excludes. * * @param excluded The set of scopes to exclude, may be {@code null} or empty to exclude no scope. */ public ScopeDependencySelector( String... excluded ) { this( null, ( excluded != null ) ? Arrays.asList( excluded ) : null ); } private ScopeDependencySelector( boolean transitive, Collection included, Collection excluded ) { this.transitive = transitive; this.included = included; this.excluded = excluded; } public boolean selectDependency( Dependency dependency ) { if ( !transitive ) { return true; } String scope = dependency.getScope(); return ( included == null || included.contains( scope ) ) && ( excluded == null || !excluded.contains( scope ) ); } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { if ( this.transitive || context.getDependency() == null ) { return this; } return new ScopeDependencySelector( true, included, excluded ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } ScopeDependencySelector that = (ScopeDependencySelector) obj; return transitive == that.transitive && eq( included, that.included ) && eq( excluded, that.excluded ); } private static boolean eq( T o1, T o2 ) { return ( o1 != null ) ? o1.equals( o2 ) : o2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + ( transitive ? 1 : 0 ); hash = hash * 31 + ( included != null ? included.hashCode() : 0 ); hash = hash * 31 + ( excluded != null ? excluded.hashCode() : 0 ); return hash; } } StaticDependencySelector.java000066400000000000000000000037031245546356100360350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; /** * A dependency selector that always includes or excludes dependencies. */ public final class StaticDependencySelector implements DependencySelector { private final boolean select; /** * Creates a new selector with the specified selection behavior. * * @param select {@code true} to select all dependencies, {@code false} to exclude all dependencies. */ public StaticDependencySelector( boolean select ) { this.select = select; } public boolean selectDependency( Dependency dependency ) { return select; } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { return this; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencySelector that = (StaticDependencySelector) obj; return select == that.select; } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + ( select ? 1 : 0 ); return hash; } } package-info.java000066400000000000000000000012021245546356100334220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency selectors for building a dependency graph. */ package org.eclipse.aether.util.graph.selector; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/000077500000000000000000000000001245546356100310415ustar00rootroot00000000000000ChainedDependencyGraphTransformer.java000066400000000000000000000053411245546356100403670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; /** * A dependency graph transformer that chains other transformers. */ public final class ChainedDependencyGraphTransformer implements DependencyGraphTransformer { private final DependencyGraphTransformer[] transformers; /** * Creates a new transformer that chains the specified transformers. * * @param transformers The transformers to chain, may be {@code null} or empty. */ public ChainedDependencyGraphTransformer( DependencyGraphTransformer... transformers ) { if ( transformers == null ) { this.transformers = new DependencyGraphTransformer[0]; } else { this.transformers = transformers; } } /** * Creates a new transformer that chains the specified transformers or simply returns one of them if the other one * is {@code null}. * * @param transformer1 The first transformer of the chain, may be {@code null}. * @param transformer2 The second transformer of the chain, may be {@code null}. * @return The chained transformer or {@code null} if both input transformers are {@code null}. */ public static DependencyGraphTransformer newInstance( DependencyGraphTransformer transformer1, DependencyGraphTransformer transformer2 ) { if ( transformer1 == null ) { return transformer2; } else if ( transformer2 == null ) { return transformer1; } return new ChainedDependencyGraphTransformer( transformer1, transformer2 ); } public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { for ( DependencyGraphTransformer transformer : transformers ) { node = transformer.transformGraph( node, context ); } return node; } } ConflictIdSorter.java000066400000000000000000000255361245546356100350550ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; /** * A dependency graph transformer that creates a topological sorting of the conflict ids which have been assigned to the * dependency nodes. Conflict ids are sorted according to the dependency relation induced by the dependency graph. This * transformer will query the key {@link TransformationContextKeys#CONFLICT_IDS} in the transformation context for an * existing mapping of nodes to their conflicts ids. In absence of this map, the transformer will automatically invoke * the {@link ConflictMarker} to calculate the conflict ids. When this transformer has executed, the transformation * context holds a {@code List} that denotes the topologically sorted conflict ids. The list will be stored * using the key {@link TransformationContextKeys#SORTED_CONFLICT_IDS}. In addition, the transformer will store a * {@code Collection>} using the key {@link TransformationContextKeys#CYCLIC_CONFLICT_IDS} that * describes cycles among conflict ids. */ public final class ConflictIdSorter implements DependencyGraphTransformer { public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { Map conflictIds = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); if ( conflictIds == null ) { ConflictMarker marker = new ConflictMarker(); marker.transformGraph( node, context ); conflictIds = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); } @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); long time1 = System.currentTimeMillis(); Map ids = new LinkedHashMap( 256 ); { ConflictId id = null; Object key = conflictIds.get( node ); if ( key != null ) { id = new ConflictId( key, 0 ); ids.put( key, id ); } Map visited = new IdentityHashMap( conflictIds.size() ); buildConflitIdDAG( ids, node, id, 0, visited, conflictIds ); } long time2 = System.currentTimeMillis(); int cycles = topsortConflictIds( ids.values(), context ); if ( stats != null ) { long time3 = System.currentTimeMillis(); stats.put( "ConflictIdSorter.graphTime", time2 - time1 ); stats.put( "ConflictIdSorter.topsortTime", time3 - time2 ); stats.put( "ConflictIdSorter.conflictIdCount", ids.size() ); stats.put( "ConflictIdSorter.conflictIdCycleCount", cycles ); } return node; } private void buildConflitIdDAG( Map ids, DependencyNode node, ConflictId id, int depth, Map visited, Map conflictIds ) { if ( visited.put( node, Boolean.TRUE ) != null ) { return; } depth++; for ( DependencyNode child : node.getChildren() ) { Object key = conflictIds.get( child ); ConflictId childId = ids.get( key ); if ( childId == null ) { childId = new ConflictId( key, depth ); ids.put( key, childId ); } else { childId.pullup( depth ); } if ( id != null ) { id.add( childId ); } buildConflitIdDAG( ids, child, childId, depth, visited, conflictIds ); } } private int topsortConflictIds( Collection conflictIds, DependencyGraphTransformationContext context ) { List sorted = new ArrayList( conflictIds.size() ); RootQueue roots = new RootQueue( conflictIds.size() / 2 ); for ( ConflictId id : conflictIds ) { if ( id.inDegree <= 0 ) { roots.add( id ); } } processRoots( sorted, roots ); boolean cycle = sorted.size() < conflictIds.size(); while ( sorted.size() < conflictIds.size() ) { // cycle -> deal gracefully with nodes still having positive in-degree ConflictId nearest = null; for ( ConflictId id : conflictIds ) { if ( id.inDegree <= 0 ) { continue; } if ( nearest == null || id.minDepth < nearest.minDepth || ( id.minDepth == nearest.minDepth && id.inDegree < nearest.inDegree ) ) { nearest = id; } } nearest.inDegree = 0; roots.add( nearest ); processRoots( sorted, roots ); } Collection> cycles = Collections.emptySet(); if ( cycle ) { cycles = findCycles( conflictIds ); } context.put( TransformationContextKeys.SORTED_CONFLICT_IDS, sorted ); context.put( TransformationContextKeys.CYCLIC_CONFLICT_IDS, cycles ); return cycles.size(); } private void processRoots( List sorted, RootQueue roots ) { while ( !roots.isEmpty() ) { ConflictId root = roots.remove(); sorted.add( root.key ); for ( ConflictId child : root.children ) { child.inDegree--; if ( child.inDegree == 0 ) { roots.add( child ); } } } } private Collection> findCycles( Collection conflictIds ) { Collection> cycles = new HashSet>(); Map stack = new HashMap( 128 ); Map visited = new IdentityHashMap( conflictIds.size() ); for ( ConflictId id : conflictIds ) { findCycles( id, visited, stack, cycles ); } return cycles; } private void findCycles( ConflictId id, Map visited, Map stack, Collection> cycles ) { Integer depth = stack.put( id.key, stack.size() ); if ( depth != null ) { stack.put( id.key, depth ); Collection cycle = new HashSet(); for ( Map.Entry entry : stack.entrySet() ) { if ( entry.getValue() >= depth ) { cycle.add( entry.getKey() ); } } cycles.add( cycle ); } else { if ( visited.put( id, Boolean.TRUE ) == null ) { for ( ConflictId childId : id.children ) { findCycles( childId, visited, stack, cycles ); } } stack.remove( id.key ); } } static final class ConflictId { final Object key; Collection children = Collections.emptySet(); int inDegree; int minDepth; public ConflictId( Object key, int depth ) { this.key = key; this.minDepth = depth; } public void add( ConflictId child ) { if ( children.isEmpty() ) { children = new HashSet(); } if ( children.add( child ) ) { child.inDegree++; } } public void pullup( int depth ) { if ( depth < minDepth ) { minDepth = depth; depth++; for ( ConflictId child : children ) { child.pullup( depth ); } } } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( !( obj instanceof ConflictId ) ) { return false; } ConflictId that = (ConflictId) obj; return this.key.equals( that.key ); } @Override public int hashCode() { return key.hashCode(); } @Override public String toString() { return key + " @ " + minDepth + " <" + inDegree; } } static final class RootQueue { private int nextOut; private int nextIn; private ConflictId[] ids; RootQueue( int capacity ) { ids = new ConflictId[capacity + 16]; } boolean isEmpty() { return nextOut >= nextIn; } void add( ConflictId id ) { if ( nextOut >= nextIn && nextOut > 0 ) { nextIn -= nextOut; nextOut = 0; } if ( nextIn >= ids.length ) { ConflictId[] tmp = new ConflictId[ids.length + ids.length / 2 + 16]; System.arraycopy( ids, nextOut, tmp, 0, nextIn - nextOut ); ids = tmp; nextIn -= nextOut; nextOut = 0; } int i; for ( i = nextIn - 1; i >= nextOut && id.minDepth < ids[i].minDepth; i-- ) { ids[i + 1] = ids[i]; } ids[i + 1] = id; nextIn++; } ConflictId remove() { return ids[nextOut++]; } } } ConflictMarker.java000066400000000000000000000223251245546356100345340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Map; import java.util.Set; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; /** * A dependency graph transformer that identifies conflicting dependencies. When this transformer has executed, the * transformation context holds a {@code Map} where dependency nodes that belong to the same * conflict group will have an equal conflict identifier. This map is stored using the key * {@link TransformationContextKeys#CONFLICT_IDS}. */ public final class ConflictMarker implements DependencyGraphTransformer { /** * After the execution of this method, every DependencyNode with an attached dependency is member of one conflict * group. * * @see DependencyGraphTransformer#transformGraph(DependencyNode, DependencyGraphTransformationContext) */ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); long time1 = System.currentTimeMillis(); Map nodes = new IdentityHashMap( 1024 ); Map groups = new HashMap( 1024 ); analyze( node, nodes, groups, new int[] { 0 } ); long time2 = System.currentTimeMillis(); Map conflictIds = mark( nodes.keySet(), groups ); context.put( TransformationContextKeys.CONFLICT_IDS, conflictIds ); if ( stats != null ) { long time3 = System.currentTimeMillis(); stats.put( "ConflictMarker.analyzeTime", time2 - time1 ); stats.put( "ConflictMarker.markTime", time3 - time2 ); stats.put( "ConflictMarker.nodeCount", nodes.size() ); } return node; } private void analyze( DependencyNode node, Map nodes, Map groups, int[] counter ) { if ( nodes.put( node, Boolean.TRUE ) != null ) { return; } Set keys = getKeys( node ); if ( !keys.isEmpty() ) { ConflictGroup group = null; boolean fixMappings = false; for ( Object key : keys ) { ConflictGroup g = groups.get( key ); if ( group != g ) { if ( group == null ) { Set newKeys = merge( g.keys, keys ); if ( newKeys == g.keys ) { group = g; break; } else { group = new ConflictGroup( newKeys, counter[0]++ ); fixMappings = true; } } else if ( g == null ) { fixMappings = true; } else { Set newKeys = merge( g.keys, group.keys ); if ( newKeys == g.keys ) { group = g; fixMappings = false; break; } else if ( newKeys != group.keys ) { group = new ConflictGroup( newKeys, counter[0]++ ); fixMappings = true; } } } } if ( group == null ) { group = new ConflictGroup( keys, counter[0]++ ); fixMappings = true; } if ( fixMappings ) { for ( Object key : group.keys ) { groups.put( key, group ); } } } for ( DependencyNode child : node.getChildren() ) { analyze( child, nodes, groups, counter ); } } private Set merge( Set keys1, Set keys2 ) { int size1 = keys1.size(); int size2 = keys2.size(); if ( size1 < size2 ) { if ( keys2.containsAll( keys1 ) ) { return keys2; } } else { if ( keys1.containsAll( keys2 ) ) { return keys1; } } Set keys = new HashSet(); keys.addAll( keys1 ); keys.addAll( keys2 ); return keys; } private Set getKeys( DependencyNode node ) { Set keys; Dependency dependency = node.getDependency(); if ( dependency == null ) { keys = Collections.emptySet(); } else { Object key = toKey( dependency.getArtifact() ); if ( node.getRelocations().isEmpty() && node.getAliases().isEmpty() ) { keys = Collections.singleton( key ); } else { keys = new HashSet(); keys.add( key ); for ( Artifact relocation : node.getRelocations() ) { key = toKey( relocation ); keys.add( key ); } for ( Artifact alias : node.getAliases() ) { key = toKey( alias ); keys.add( key ); } } } return keys; } private Map mark( Collection nodes, Map groups ) { Map conflictIds = new IdentityHashMap( nodes.size() + 1 ); for ( DependencyNode node : nodes ) { Dependency dependency = node.getDependency(); if ( dependency != null ) { Object key = toKey( dependency.getArtifact() ); conflictIds.put( node, groups.get( key ).index ); } } return conflictIds; } private static Object toKey( Artifact artifact ) { return new Key( artifact ); } static class ConflictGroup { final Set keys; final int index; public ConflictGroup( Set keys, int index ) { this.keys = keys; this.index = index; } @Override public String toString() { return String.valueOf( keys ); } } static class Key { private final Artifact artifact; public Key( Artifact artifact ) { this.artifact = artifact; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Key ) ) { return false; } Key that = (Key) obj; return artifact.getArtifactId().equals( that.artifact.getArtifactId() ) && artifact.getGroupId().equals( that.artifact.getGroupId() ) && artifact.getExtension().equals( that.artifact.getExtension() ) && artifact.getClassifier().equals( that.artifact.getClassifier() ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + artifact.getArtifactId().hashCode(); hash = hash * 31 + artifact.getGroupId().hashCode(); hash = hash * 31 + artifact.getClassifier().hashCode(); hash = hash * 31 + artifact.getExtension().hashCode(); return hash; } @Override public String toString() { return artifact.getGroupId() + ':' + artifact.getArtifactId() + ':' + artifact.getClassifier() + ':' + artifact.getExtension(); } } } ConflictResolver.java000066400000000000000000001466401245546356100351230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2012, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.ConfigUtils; /** * A dependency graph transformer that resolves version and scope conflicts among dependencies. For a given set of * conflicting nodes, one node will be chosen as the winner and the other nodes are removed from the dependency graph. * The exact rules by which a winning node and its effective scope are determined are controlled by user-supplied * implementations of {@link VersionSelector}, {@link ScopeSelector}, {@link OptionalitySelector} and * {@link ScopeDeriver}. *

* By default, this graph transformer will turn the dependency graph into a tree without duplicate artifacts. Using the * configuration property {@link #CONFIG_PROP_VERBOSE}, a verbose mode can be enabled where the graph is still turned * into a tree but all nodes participating in a conflict are retained. The nodes that were rejected during conflict * resolution have no children and link back to the winner node via the {@link #NODE_DATA_WINNER} key in their custom * data. Additionally, the keys {@link #NODE_DATA_ORIGINAL_SCOPE} and {@link #NODE_DATA_ORIGINAL_OPTIONALITY} are used * to store the original scope and optionality of each node. Obviously, the resulting dependency tree is not suitable * for artifact resolution unless a filter is employed to exclude the duplicate dependencies. *

* This transformer will query the keys {@link TransformationContextKeys#CONFLICT_IDS}, * {@link TransformationContextKeys#SORTED_CONFLICT_IDS}, {@link TransformationContextKeys#CYCLIC_CONFLICT_IDS} for * existing information about conflict ids. In absence of this information, it will automatically invoke the * {@link ConflictIdSorter} to calculate it. */ public final class ConflictResolver implements DependencyGraphTransformer { /** * The key in the repository session's {@link RepositorySystemSession#getConfigProperties() configuration * properties} used to store a {@link Boolean} flag controlling the transformer's verbose mode. */ public static final String CONFIG_PROP_VERBOSE = "aether.conflictResolver.verbose"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which a reference to the * {@link DependencyNode} which has won the conflict is stored. */ public static final String NODE_DATA_WINNER = "conflict.winner"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the scope of the * dependency before scope derivation and conflict resolution is stored. */ public static final String NODE_DATA_ORIGINAL_SCOPE = "conflict.originalScope"; /** * The key in the dependency node's {@link DependencyNode#getData() custom data} under which the optional flag of * the dependency before derivation and conflict resolution is stored. */ public static final String NODE_DATA_ORIGINAL_OPTIONALITY = "conflict.originalOptionality"; private final VersionSelector versionSelector; private final ScopeSelector scopeSelector; private final ScopeDeriver scopeDeriver; private final OptionalitySelector optionalitySelector; /** * Creates a new conflict resolver instance with the specified hooks. * * @param versionSelector The version selector to use, must not be {@code null}. * @param scopeSelector The scope selector to use, must not be {@code null}. * @param optionalitySelector The optionality selector ot use, must not be {@code null}. * @param scopeDeriver The scope deriver to use, must not be {@code null}. */ public ConflictResolver( VersionSelector versionSelector, ScopeSelector scopeSelector, OptionalitySelector optionalitySelector, ScopeDeriver scopeDeriver ) { if ( versionSelector == null ) { throw new IllegalArgumentException( "version selector not specified" ); } this.versionSelector = versionSelector; if ( scopeSelector == null ) { throw new IllegalArgumentException( "scope selector not specified" ); } this.scopeSelector = scopeSelector; if ( scopeDeriver == null ) { throw new IllegalArgumentException( "scope deriver not specified" ); } this.scopeDeriver = scopeDeriver; if ( optionalitySelector == null ) { throw new IllegalArgumentException( "optionality selector not specified" ); } this.optionalitySelector = optionalitySelector; } public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { List sortedConflictIds = (List) context.get( TransformationContextKeys.SORTED_CONFLICT_IDS ); if ( sortedConflictIds == null ) { ConflictIdSorter sorter = new ConflictIdSorter(); sorter.transformGraph( node, context ); sortedConflictIds = (List) context.get( TransformationContextKeys.SORTED_CONFLICT_IDS ); } @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); long time1 = System.currentTimeMillis(); @SuppressWarnings( "unchecked" ) Collection> conflictIdCycles = (Collection>) context.get( TransformationContextKeys.CYCLIC_CONFLICT_IDS ); if ( conflictIdCycles == null ) { throw new RepositoryException( "conflict id cycles have not been identified" ); } Map conflictIds = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); if ( conflictIds == null ) { throw new RepositoryException( "conflict groups have not been identified" ); } Map> cyclicPredecessors = new HashMap>(); for ( Collection cycle : conflictIdCycles ) { for ( Object conflictId : cycle ) { Collection predecessors = cyclicPredecessors.get( conflictId ); if ( predecessors == null ) { predecessors = new HashSet(); cyclicPredecessors.put( conflictId, predecessors ); } predecessors.addAll( cycle ); } } State state = new State( node, conflictIds, sortedConflictIds.size(), context ); for ( Iterator it = sortedConflictIds.iterator(); it.hasNext(); ) { Object conflictId = it.next(); // reset data structures for next graph walk state.prepare( conflictId, cyclicPredecessors.get( conflictId ) ); // find nodes with the current conflict id and while walking the graph (more deeply), nuke leftover losers gatherConflictItems( node, state ); // now that we know the min depth of the parents, update depth of conflict items state.finish(); // earlier runs might have nuked all parents of the current conflict id, so it might not exist anymore if ( !state.items.isEmpty() ) { ConflictContext ctx = state.conflictCtx; state.versionSelector.selectVersion( ctx ); if ( ctx.winner == null ) { throw new RepositoryException( "conflict resolver did not select winner among " + state.items ); } DependencyNode winner = ctx.winner.node; state.scopeSelector.selectScope( ctx ); if ( state.verbose ) { winner.setData( NODE_DATA_ORIGINAL_SCOPE, winner.getDependency().getScope() ); } winner.setScope( ctx.scope ); state.optionalitySelector.selectOptionality( ctx ); if ( state.verbose ) { winner.setData( NODE_DATA_ORIGINAL_OPTIONALITY, winner.getDependency().isOptional() ); } winner.setOptional( ctx.optional ); removeLosers( state ); } // record the winner so we can detect leftover losers during future graph walks state.winner(); // in case of cycles, trigger final graph walk to ensure all leftover losers are gone if ( !it.hasNext() && !conflictIdCycles.isEmpty() && state.conflictCtx.winner != null ) { DependencyNode winner = state.conflictCtx.winner.node; state.prepare( state, null ); gatherConflictItems( winner, state ); } } if ( stats != null ) { long time2 = System.currentTimeMillis(); stats.put( "ConflictResolver.totalTime", time2 - time1 ); stats.put( "ConflictResolver.conflictItemCount", state.totalConflictItems ); } return node; } private boolean gatherConflictItems( DependencyNode node, State state ) throws RepositoryException { Object conflictId = state.conflictIds.get( node ); if ( state.currentId.equals( conflictId ) ) { // found it, add conflict item (if not already done earlier by another path) state.add( node ); // we don't recurse here so we might miss losers beneath us, those will be nuked during future walks below } else if ( state.loser( node, conflictId ) ) { // found a leftover loser (likely in a cycle) of an already processed conflict id, tell caller to nuke it return false; } else if ( state.push( node, conflictId ) ) { // found potential parent, no cycle and not visisted before with the same derived scope, so recurse for ( Iterator it = node.getChildren().iterator(); it.hasNext(); ) { DependencyNode child = it.next(); if ( !gatherConflictItems( child, state ) ) { it.remove(); } } state.pop(); } return true; } private void removeLosers( State state ) { ConflictItem winner = state.conflictCtx.winner; List previousParent = null; ListIterator childIt = null; boolean conflictVisualized = false; for ( ConflictItem item : state.items ) { if ( item == winner ) { continue; } if ( item.parent != previousParent ) { childIt = item.parent.listIterator(); previousParent = item.parent; conflictVisualized = false; } while ( childIt.hasNext() ) { DependencyNode child = childIt.next(); if ( child == item.node ) { if ( state.verbose && !conflictVisualized && item.parent != winner.parent ) { conflictVisualized = true; DependencyNode loser = new DefaultDependencyNode( child ); loser.setData( NODE_DATA_WINNER, winner.node ); loser.setData( NODE_DATA_ORIGINAL_SCOPE, loser.getDependency().getScope() ); loser.setData( NODE_DATA_ORIGINAL_OPTIONALITY, loser.getDependency().isOptional() ); loser.setScope( item.getScopes().iterator().next() ); loser.setChildren( Collections. emptyList() ); childIt.set( loser ); } else { childIt.remove(); } break; } } } // there might still be losers beneath the winner (e.g. in case of cycles) // those will be nuked during future graph walks when we include the winner in the recursion } static final class NodeInfo { /** * The smallest depth at which the node was seen, used for "the" depth of its conflict items. */ int minDepth; /** * The set of derived scopes the node was visited with, used to check whether an already seen node needs to be * revisited again in context of another scope. To conserve memory, we start with {@code String} and update to * {@code Set} if needed. */ Object derivedScopes; /** * The set of derived optionalities the node was visited with, used to check whether an already seen node needs * to be revisited again in context of another optionality. To conserve memory, encoded as bit field (bit 0 -> * optional=false, bit 1 -> optional=true). */ int derivedOptionalities; /** * The conflict items which are immediate children of the node, used to easily update those conflict items after * a new parent scope/optionality was encountered. */ List children; static final int CHANGE_SCOPE = 0x01; static final int CHANGE_OPTIONAL = 0x02; private static final int OPT_FALSE = 0x01; private static final int OPT_TRUE = 0x02; NodeInfo( int depth, String derivedScope, boolean optional ) { minDepth = depth; derivedScopes = derivedScope; derivedOptionalities = optional ? OPT_TRUE : OPT_FALSE; } @SuppressWarnings( "unchecked" ) int update( int depth, String derivedScope, boolean optional ) { if ( depth < minDepth ) { minDepth = depth; } int changes; if ( derivedScopes.equals( derivedScope ) ) { changes = 0; } else if ( derivedScopes instanceof Collection ) { changes = ( (Collection) derivedScopes ).add( derivedScope ) ? CHANGE_SCOPE : 0; } else { Collection scopes = new HashSet(); scopes.add( (String) derivedScopes ); scopes.add( derivedScope ); derivedScopes = scopes; changes = CHANGE_SCOPE; } int bit = optional ? OPT_TRUE : OPT_FALSE; if ( ( derivedOptionalities & bit ) == 0 ) { derivedOptionalities |= bit; changes |= CHANGE_OPTIONAL; } return changes; } void add( ConflictItem item ) { if ( children == null ) { children = new ArrayList( 1 ); } children.add( item ); } } final class State { /** * The conflict id currently processed. */ Object currentId; /** * Stats counter. */ int totalConflictItems; /** * Flag whether we should keep losers in the graph to enable visualization/troubleshooting of conflicts. */ final boolean verbose; /** * A mapping from conflict id to winner node, helps to recognize nodes that have their effective * scope&optionality set or are leftovers from previous removals. */ final Map resolvedIds; /** * The set of conflict ids which could apply to ancestors of nodes with the current conflict id, used to avoid * recursion early on. This is basically a superset of the key set of resolvedIds, the additional ids account * for cyclic dependencies. */ final Collection potentialAncestorIds; /** * The output from the conflict marker */ final Map conflictIds; /** * The conflict items we have gathered so far for the current conflict id. */ final List items; /** * The (conceptual) mapping from nodes to extra infos, technically keyed by the node's child list which better * captures the identity of a node since we're basically concerned with effects towards children. */ final Map, NodeInfo> infos; /** * The set of nodes on the DFS stack to detect cycles, technically keyed by the node's child list to match the * dirty graph structure produced by the dependency collector for cycles. */ final Map, Object> stack; /** * The stack of parent nodes. */ final List parentNodes; /** * The stack of derived scopes for parent nodes. */ final List parentScopes; /** * The stack of derived optional flags for parent nodes. */ final List parentOptionals; /** * The stack of node infos for parent nodes, may contain {@code null} which is used to disable creating new * conflict items when visiting their parent again (conflict items are meant to be unique by parent-node combo). */ final List parentInfos; /** * The conflict context passed to the version/scope/optionality selectors, updated as we move along rather than * recreated to avoid tmp objects. */ final ConflictContext conflictCtx; /** * The scope context passed to the scope deriver, updated as we move along rather than recreated to avoid tmp * objects. */ final ScopeContext scopeCtx; /** * The effective version selector, i.e. after initialization. */ final VersionSelector versionSelector; /** * The effective scope selector, i.e. after initialization. */ final ScopeSelector scopeSelector; /** * The effective scope deriver, i.e. after initialization. */ final ScopeDeriver scopeDeriver; /** * The effective optionality selector, i.e. after initialization. */ final OptionalitySelector optionalitySelector; State( DependencyNode root, Map conflictIds, int conflictIdCount, DependencyGraphTransformationContext context ) throws RepositoryException { this.conflictIds = conflictIds; verbose = ConfigUtils.getBoolean( context.getSession(), false, CONFIG_PROP_VERBOSE ); potentialAncestorIds = new HashSet( conflictIdCount * 2 ); resolvedIds = new HashMap( conflictIdCount * 2 ); items = new ArrayList( 256 ); infos = new IdentityHashMap, NodeInfo>( 64 ); stack = new IdentityHashMap, Object>( 64 ); parentNodes = new ArrayList( 64 ); parentScopes = new ArrayList( 64 ); parentOptionals = new ArrayList( 64 ); parentInfos = new ArrayList( 64 ); conflictCtx = new ConflictContext( root, conflictIds, items ); scopeCtx = new ScopeContext( null, null ); versionSelector = ConflictResolver.this.versionSelector.getInstance( root, context ); scopeSelector = ConflictResolver.this.scopeSelector.getInstance( root, context ); scopeDeriver = ConflictResolver.this.scopeDeriver.getInstance( root, context ); optionalitySelector = ConflictResolver.this.optionalitySelector.getInstance( root, context ); } void prepare( Object conflictId, Collection cyclicPredecessors ) { currentId = conflictCtx.conflictId = conflictId; conflictCtx.winner = null; conflictCtx.scope = null; conflictCtx.optional = null; items.clear(); infos.clear(); if ( cyclicPredecessors != null ) { potentialAncestorIds.addAll( cyclicPredecessors ); } } void finish() { List previousParent = null; int previousDepth = 0; totalConflictItems += items.size(); for ( int i = items.size() - 1; i >= 0; i-- ) { ConflictItem item = items.get( i ); if ( item.parent == previousParent ) { item.depth = previousDepth; } else if ( item.parent != null ) { previousParent = item.parent; NodeInfo info = infos.get( previousParent ); previousDepth = info.minDepth + 1; item.depth = previousDepth; } } potentialAncestorIds.add( currentId ); } void winner() { resolvedIds.put( currentId, ( conflictCtx.winner != null ) ? conflictCtx.winner.node : null ); } boolean loser( DependencyNode node, Object conflictId ) { DependencyNode winner = resolvedIds.get( conflictId ); return winner != null && winner != node; } boolean push( DependencyNode node, Object conflictId ) throws RepositoryException { if ( conflictId == null ) { if ( node.getDependency() != null ) { if ( node.getData().get( NODE_DATA_WINNER ) != null ) { return false; } throw new RepositoryException( "missing conflict id for node " + node ); } } else if ( !potentialAncestorIds.contains( conflictId ) ) { return false; } List graphNode = node.getChildren(); if ( stack.put( graphNode, Boolean.TRUE ) != null ) { return false; } int depth = depth(); String scope = deriveScope( node, conflictId ); boolean optional = deriveOptional( node, conflictId ); NodeInfo info = infos.get( graphNode ); if ( info == null ) { info = new NodeInfo( depth, scope, optional ); infos.put( graphNode, info ); parentInfos.add( info ); parentNodes.add( node ); parentScopes.add( scope ); parentOptionals.add( optional ); } else { int changes = info.update( depth, scope, optional ); if ( changes == 0 ) { stack.remove( graphNode ); return false; } parentInfos.add( null ); // disable creating new conflict items, we update the existing ones below parentNodes.add( node ); parentScopes.add( scope ); parentOptionals.add( optional ); if ( info.children != null ) { if ( ( changes & NodeInfo.CHANGE_SCOPE ) != 0 ) { for ( int i = info.children.size() - 1; i >= 0; i-- ) { ConflictItem item = info.children.get( i ); String childScope = deriveScope( item.node, null ); item.addScope( childScope ); } } if ( ( changes & NodeInfo.CHANGE_OPTIONAL ) != 0 ) { for ( int i = info.children.size() - 1; i >= 0; i-- ) { ConflictItem item = info.children.get( i ); boolean childOptional = deriveOptional( item.node, null ); item.addOptional( childOptional ); } } } } return true; } void pop() { int last = parentInfos.size() - 1; parentInfos.remove( last ); parentScopes.remove( last ); parentOptionals.remove( last ); DependencyNode node = parentNodes.remove( last ); stack.remove( node.getChildren() ); } void add( DependencyNode node ) throws RepositoryException { DependencyNode parent = parent(); if ( parent == null ) { ConflictItem item = newConflictItem( parent, node ); items.add( item ); } else { NodeInfo info = parentInfos.get( parentInfos.size() - 1 ); if ( info != null ) { ConflictItem item = newConflictItem( parent, node ); info.add( item ); items.add( item ); } } } private ConflictItem newConflictItem( DependencyNode parent, DependencyNode node ) throws RepositoryException { return new ConflictItem( parent, node, deriveScope( node, null ), deriveOptional( node, null ) ); } private int depth() { return parentNodes.size(); } private DependencyNode parent() { int size = parentNodes.size(); return ( size <= 0 ) ? null : parentNodes.get( size - 1 ); } private String deriveScope( DependencyNode node, Object conflictId ) throws RepositoryException { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return scope( node.getDependency() ); } int depth = parentNodes.size(); scopes( depth, node.getDependency() ); if ( depth > 0 ) { scopeDeriver.deriveScope( scopeCtx ); } return scopeCtx.derivedScope; } private void scopes( int parent, Dependency child ) { scopeCtx.parentScope = ( parent > 0 ) ? parentScopes.get( parent - 1 ) : null; scopeCtx.derivedScope = scopeCtx.childScope = scope( child ); } private String scope( Dependency dependency ) { return ( dependency != null ) ? dependency.getScope() : null; } private boolean deriveOptional( DependencyNode node, Object conflictId ) { Dependency dep = node.getDependency(); boolean optional = ( dep != null ) ? dep.isOptional() : false; if ( optional || ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return optional; } int depth = parentNodes.size(); return ( depth > 0 ) ? parentOptionals.get( depth - 1 ) : false; } } /** * A context used to hold information that is relevant for deriving the scope of a child dependency. * * @see ScopeDeriver * @noinstantiate This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public static final class ScopeContext { String parentScope; String childScope; String derivedScope; /** * Creates a new scope context with the specified properties. * * @param parentScope The scope of the parent dependency, may be {@code null}. * @param childScope The scope of the child dependency, may be {@code null}. * @noreference This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public ScopeContext( String parentScope, String childScope ) { this.parentScope = ( parentScope != null ) ? parentScope : ""; derivedScope = this.childScope = ( childScope != null ) ? childScope : ""; } /** * Gets the scope of the parent dependency. This is usually the scope that was derived by earlier invocations of * the scope deriver. * * @return The scope of the parent dependency, never {@code null}. */ public String getParentScope() { return parentScope; } /** * Gets the original scope of the child dependency. This is the scope that was declared in the artifact * descriptor of the parent dependency. * * @return The original scope of the child dependency, never {@code null}. */ public String getChildScope() { return childScope; } /** * Gets the derived scope of the child dependency. This is initially equal to {@link #getChildScope()} until the * scope deriver makes changes. * * @return The derived scope of the child dependency, never {@code null}. */ public String getDerivedScope() { return derivedScope; } /** * Sets the derived scope of the child dependency. * * @param derivedScope The derived scope of the dependency, may be {@code null}. */ public void setDerivedScope( String derivedScope ) { this.derivedScope = ( derivedScope != null ) ? derivedScope : ""; } } /** * A conflicting dependency. * * @noinstantiate This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public static final class ConflictItem { // nodes can share child lists, we care about the unique owner of a child node which is the child list final List parent; // only for debugging/toString() to help identify the parent node(s) final Artifact artifact; final DependencyNode node; int depth; // we start with String and update to Set if needed Object scopes; // bit field of OPTIONAL_FALSE and OPTIONAL_TRUE int optionalities; /** * Bit flag indicating whether one or more paths consider the dependency non-optional. */ public static final int OPTIONAL_FALSE = 0x01; /** * Bit flag indicating whether one or more paths consider the dependency optional. */ public static final int OPTIONAL_TRUE = 0x02; ConflictItem( DependencyNode parent, DependencyNode node, String scope, boolean optional ) { if ( parent != null ) { this.parent = parent.getChildren(); this.artifact = parent.getArtifact(); } else { this.parent = null; this.artifact = null; } this.node = node; this.scopes = scope; this.optionalities = optional ? OPTIONAL_TRUE : OPTIONAL_FALSE; } /** * Creates a new conflict item with the specified properties. * * @param parent The parent node of the conflicting dependency, may be {@code null}. * @param node The conflicting dependency, must not be {@code null}. * @param depth The zero-based depth of the conflicting dependency. * @param optionalities The optionalities the dependency was encountered with, encoded as a bit field consisting * of {@link ConflictResolver.ConflictItem#OPTIONAL_TRUE} and * {@link ConflictResolver.ConflictItem#OPTIONAL_FALSE}. * @param scopes The derived scopes of the conflicting dependency, must not be {@code null}. * @noreference This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public ConflictItem( DependencyNode parent, DependencyNode node, int depth, int optionalities, String... scopes ) { this.parent = ( parent != null ) ? parent.getChildren() : null; this.artifact = ( parent != null ) ? parent.getArtifact() : null; this.node = node; this.depth = depth; this.optionalities = optionalities; this.scopes = Arrays.asList( scopes ); } /** * Determines whether the specified conflict item is a sibling of this item. * * @param item The other conflict item, must not be {@code null}. * @return {@code true} if the given item has the same parent as this item, {@code false} otherwise. */ public boolean isSibling( ConflictItem item ) { return parent == item.parent; } /** * Gets the dependency node involved in the conflict. * * @return The involved dependency node, never {@code null}. */ public DependencyNode getNode() { return node; } /** * Gets the dependency involved in the conflict, short for {@code getNode.getDependency()}. * * @return The involved dependency, never {@code null}. */ public Dependency getDependency() { return node.getDependency(); } /** * Gets the zero-based depth at which the conflicting node occurs in the graph. As such, the depth denotes the * number of parent nodes. If actually multiple paths lead to the node, the return value denotes the smallest * possible depth. * * @return The zero-based depth of the node in the graph. */ public int getDepth() { return depth; } /** * Gets the derived scopes of the dependency. In general, the same dependency node could be reached via * different paths and each path might result in a different derived scope. * * @see ScopeDeriver * @return The (read-only) set of derived scopes of the dependency, never {@code null}. */ @SuppressWarnings( "unchecked" ) public Collection getScopes() { if ( scopes instanceof String ) { return Collections.singleton( (String) scopes ); } return (Collection) scopes; } @SuppressWarnings( "unchecked" ) void addScope( String scope ) { if ( scopes instanceof Collection ) { ( (Collection) scopes ).add( scope ); } else if ( !scopes.equals( scope ) ) { Collection set = new HashSet(); set.add( scopes ); set.add( scope ); scopes = set; } } /** * Gets the derived optionalities of the dependency. In general, the same dependency node could be reached via * different paths and each path might result in a different derived optionality. * * @return A bit field consisting of {@link ConflictResolver.ConflictItem#OPTIONAL_FALSE} and/or * {@link ConflictResolver.ConflictItem#OPTIONAL_TRUE} indicating the derived optionalities the * dependency was encountered with. */ public int getOptionalities() { return optionalities; } void addOptional( boolean optional ) { optionalities |= optional ? OPTIONAL_TRUE : OPTIONAL_FALSE; } @Override public String toString() { return node + " @ " + depth + " < " + artifact; } } /** * A context used to hold information that is relevant for resolving version and scope conflicts. * * @see VersionSelector * @see ScopeSelector * @noinstantiate This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public static final class ConflictContext { final DependencyNode root; final Map conflictIds; final Collection items; Object conflictId; ConflictItem winner; String scope; Boolean optional; ConflictContext( DependencyNode root, Map conflictIds, Collection items ) { this.root = root; this.conflictIds = conflictIds; this.items = Collections.unmodifiableCollection( items ); } /** * Creates a new conflict context. * * @param root The root node of the dependency graph, must not be {@code null}. * @param conflictId The conflict id for the set of conflicting dependencies in this context, must not be * {@code null}. * @param conflictIds The mapping from dependency node to conflict id, must not be {@code null}. * @param items The conflict items in this context, must not be {@code null}. * @noreference This class is not intended to be instantiated by clients in production code, the constructor may * change without notice and only exists to enable unit testing. */ public ConflictContext( DependencyNode root, Object conflictId, Map conflictIds, Collection items ) { this( root, conflictIds, items ); this.conflictId = conflictId; } /** * Gets the root node of the dependency graph being transformed. * * @return The root node of the dependeny graph, never {@code null}. */ public DependencyNode getRoot() { return root; } /** * Determines whether the specified dependency node belongs to this conflict context. * * @param node The dependency node to check, must not be {@code null}. * @return {@code true} if the given node belongs to this conflict context, {@code false} otherwise. */ public boolean isIncluded( DependencyNode node ) { return conflictId.equals( conflictIds.get( node ) ); } /** * Gets the collection of conflict items in this context. * * @return The (read-only) collection of conflict items in this context, never {@code null}. */ public Collection getItems() { return items; } /** * Gets the conflict item which has been selected as the winner among the conflicting dependencies. * * @return The winning conflict item or {@code null} if not set yet. */ public ConflictItem getWinner() { return winner; } /** * Sets the conflict item which has been selected as the winner among the conflicting dependencies. * * @param winner The winning conflict item, may be {@code null}. */ public void setWinner( ConflictItem winner ) { this.winner = winner; } /** * Gets the effective scope of the winning dependency. * * @return The effective scope of the winning dependency or {@code null} if none. */ public String getScope() { return scope; } /** * Sets the effective scope of the winning dependency. * * @param scope The effective scope, may be {@code null}. */ public void setScope( String scope ) { this.scope = scope; } /** * Gets the effective optional flag of the winning dependency. * * @return The effective optional flag or {@code null} if none. */ public Boolean getOptional() { return optional; } /** * Sets the effective optional flag of the winning dependency. * * @param optional The effective optional flag, may be {@code null}. */ public void setOptional( Boolean optional ) { this.optional = optional; } @Override public String toString() { return winner + " @ " + scope + " < " + items; } } /** * An extension point of {@link ConflictResolver} that determines the winner among conflicting dependencies. The * winning node (and its children) will be retained in the dependency graph, the other nodes will get removed. The * version selector does not need to deal with potential scope conflicts, these will be addressed afterwards by the * {@link ScopeSelector}. *

* Note: Implementations must be stateless. */ public static abstract class VersionSelector { /** * Retrieves the version selector for use during the specified graph transformation. The conflict resolver calls * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * * @param root The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. * @param context The graph transformation context, must not be {@code null}. * @return The scope deriver to use for the given graph transformation, never {@code null}. * @throws RepositoryException If the instance could not be retrieved. */ public VersionSelector getInstance( DependencyNode root, DependencyGraphTransformationContext context ) throws RepositoryException { return this; } /** * Determines the winning node among conflicting dependencies. Implementations will usually iterate * {@link ConflictContext#getItems()}, inspect {@link ConflictItem#getNode()} and eventually call * {@link ConflictContext#setWinner(ConflictResolver.ConflictItem)} to deliver the winner. Failure to select a * winner will automatically fail the entire conflict resolution. * * @param context The conflict context, must not be {@code null}. * @throws RepositoryException If the version selection failed. */ public abstract void selectVersion( ConflictContext context ) throws RepositoryException; } /** * An extension point of {@link ConflictResolver} that determines the effective scope of a dependency from a * potentially conflicting set of {@link ScopeDeriver derived scopes}. The scope selector gets invoked after the * {@link VersionSelector} has picked the winning node. *

* Note: Implementations must be stateless. */ public static abstract class ScopeSelector { /** * Retrieves the scope selector for use during the specified graph transformation. The conflict resolver calls * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * * @param root The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. * @param context The graph transformation context, must not be {@code null}. * @return The scope selector to use for the given graph transformation, never {@code null}. * @throws RepositoryException If the instance could not be retrieved. */ public ScopeSelector getInstance( DependencyNode root, DependencyGraphTransformationContext context ) throws RepositoryException { return this; } /** * Determines the effective scope of the dependency given by {@link ConflictContext#getWinner()}. * Implementations will usually iterate {@link ConflictContext#getItems()}, inspect * {@link ConflictItem#getScopes()} and eventually call {@link ConflictContext#setScope(String)} to deliver the * effective scope. * * @param context The conflict context, must not be {@code null}. * @throws RepositoryException If the scope selection failed. */ public abstract void selectScope( ConflictContext context ) throws RepositoryException; } /** * An extension point of {@link ConflictResolver} that determines the scope of a dependency in relation to the scope * of its parent. *

* Note: Implementations must be stateless. */ public static abstract class ScopeDeriver { /** * Retrieves the scope deriver for use during the specified graph transformation. The conflict resolver calls * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * * @param root The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. * @param context The graph transformation context, must not be {@code null}. * @return The scope deriver to use for the given graph transformation, never {@code null}. * @throws RepositoryException If the instance could not be retrieved. */ public ScopeDeriver getInstance( DependencyNode root, DependencyGraphTransformationContext context ) throws RepositoryException { return this; } /** * Determines the scope of a dependency in relation to the scope of its parent. Implementors need to call * {@link ScopeContext#setDerivedScope(String)} to deliver the result of their calculation. If said method is * not invoked, the conflict resolver will assume the scope of the child dependency remains unchanged. * * @param context The scope context, must not be {@code null}. * @throws RepositoryException If the scope deriviation failed. */ public abstract void deriveScope( ScopeContext context ) throws RepositoryException; } /** * An extension point of {@link ConflictResolver} that determines the effective optional flag of a dependency from a * potentially conflicting set of derived optionalities. The optionality selector gets invoked after the * {@link VersionSelector} has picked the winning node. *

* Note: Implementations must be stateless. */ public static abstract class OptionalitySelector { /** * Retrieves the optionality selector for use during the specified graph transformation. The conflict resolver * calls this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * * @param root The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. * @param context The graph transformation context, must not be {@code null}. * @return The optionality selector to use for the given graph transformation, never {@code null}. * @throws RepositoryException If the instance could not be retrieved. */ public OptionalitySelector getInstance( DependencyNode root, DependencyGraphTransformationContext context ) throws RepositoryException { return this; } /** * Determines the effective optional flag of the dependency given by {@link ConflictContext#getWinner()}. * Implementations will usually iterate {@link ConflictContext#getItems()}, inspect * {@link ConflictItem#getOptionalities()} and eventually call {@link ConflictContext#setOptional(Boolean)} to * deliver the effective optional flag. * * @param context The conflict context, must not be {@code null}. * @throws RepositoryException If the optionality selection failed. */ public abstract void selectOptionality( ConflictContext context ) throws RepositoryException; } } JavaDependencyContextRefiner.java000066400000000000000000000051301245546356100373640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.artifact.JavaScopes; /** * A dependency graph transformer that refines the request context for nodes that belong to the "project" context by * appending the classpath type to which the node belongs. For instance, a compile-time project dependency will be * assigned the request context "project/compile". * * @see DependencyNode#getRequestContext() */ public final class JavaDependencyContextRefiner implements DependencyGraphTransformer { public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { String ctx = node.getRequestContext(); if ( "project".equals( ctx ) ) { String scope = getClasspathScope( node ); if ( scope != null ) { ctx += '/' + scope; node.setRequestContext( ctx ); } } for ( DependencyNode child : node.getChildren() ) { transformGraph( child, context ); } return node; } private String getClasspathScope( DependencyNode node ) { Dependency dependency = node.getDependency(); if ( dependency == null ) { return null; } String scope = dependency.getScope(); if ( JavaScopes.COMPILE.equals( scope ) || JavaScopes.SYSTEM.equals( scope ) || JavaScopes.PROVIDED.equals( scope ) ) { return JavaScopes.COMPILE; } else if ( JavaScopes.RUNTIME.equals( scope ) ) { return JavaScopes.RUNTIME; } else if ( JavaScopes.TEST.equals( scope ) ) { return JavaScopes.TEST; } return null; } } JavaScopeDeriver.java000066400000000000000000000042771245546356100350330ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeContext; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeDeriver; /** * A scope deriver for use with {@link ConflictResolver} that supports the scopes from {@link JavaScopes}. */ public final class JavaScopeDeriver extends ScopeDeriver { /** * Creates a new instance of this scope deriver. */ public JavaScopeDeriver() { } @Override public void deriveScope( ScopeContext context ) throws RepositoryException { context.setDerivedScope( getDerivedScope( context.getParentScope(), context.getChildScope() ) ); } private String getDerivedScope( String parentScope, String childScope ) { String derivedScope; if ( JavaScopes.SYSTEM.equals( childScope ) || JavaScopes.TEST.equals( childScope ) ) { derivedScope = childScope; } else if ( parentScope == null || parentScope.length() <= 0 || JavaScopes.COMPILE.equals( parentScope ) ) { derivedScope = childScope; } else if ( JavaScopes.TEST.equals( parentScope ) || JavaScopes.RUNTIME.equals( parentScope ) ) { derivedScope = parentScope; } else if ( JavaScopes.SYSTEM.equals( parentScope ) || JavaScopes.PROVIDED.equals( parentScope ) ) { derivedScope = JavaScopes.PROVIDED; } else { derivedScope = JavaScopes.RUNTIME; } return derivedScope; } } JavaScopeSelector.java000066400000000000000000000061371245546356100352100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictContext; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictItem; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeSelector; /** * A scope selector for use with {@link ConflictResolver} that supports the scopes from {@link JavaScopes}. In general, * this selector picks the widest scope present among conflicting dependencies where e.g. "compile" is wider than * "runtime" which is wider than "test". If however a direct dependency is involved, its scope is selected. */ public final class JavaScopeSelector extends ScopeSelector { /** * Creates a new instance of this scope selector. */ public JavaScopeSelector() { } @Override public void selectScope( ConflictContext context ) throws RepositoryException { String scope = context.getWinner().getDependency().getScope(); if ( !JavaScopes.SYSTEM.equals( scope ) ) { scope = chooseEffectiveScope( context.getItems() ); } context.setScope( scope ); } private String chooseEffectiveScope( Collection items ) { Set scopes = new HashSet(); for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().getScope(); } scopes.addAll( item.getScopes() ); } return chooseEffectiveScope( scopes ); } private String chooseEffectiveScope( Set scopes ) { if ( scopes.size() > 1 ) { scopes.remove( JavaScopes.SYSTEM ); } String effectiveScope = ""; if ( scopes.size() == 1 ) { effectiveScope = scopes.iterator().next(); } else if ( scopes.contains( JavaScopes.COMPILE ) ) { effectiveScope = JavaScopes.COMPILE; } else if ( scopes.contains( JavaScopes.RUNTIME ) ) { effectiveScope = JavaScopes.RUNTIME; } else if ( scopes.contains( JavaScopes.PROVIDED ) ) { effectiveScope = JavaScopes.PROVIDED; } else if ( scopes.contains( JavaScopes.TEST ) ) { effectiveScope = JavaScopes.TEST; } return effectiveScope; } } NearestVersionSelector.java000066400000000000000000000127011245546356100362760ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.UnsolvableVersionConflictException; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictContext; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictItem; import org.eclipse.aether.util.graph.transformer.ConflictResolver.VersionSelector; import org.eclipse.aether.util.graph.visitor.PathRecordingDependencyVisitor; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; /** * A version selector for use with {@link ConflictResolver} that resolves version conflicts using a nearest-wins * strategy. If there is no single node that satisfies all encountered version ranges, the selector will fail. */ public final class NearestVersionSelector extends VersionSelector { /** * Creates a new instance of this version selector. */ public NearestVersionSelector() { } @Override public void selectVersion( ConflictContext context ) throws RepositoryException { ConflictGroup group = new ConflictGroup(); for ( ConflictItem item : context.getItems() ) { DependencyNode node = item.getNode(); VersionConstraint constraint = node.getVersionConstraint(); boolean backtrack = false; boolean hardConstraint = constraint.getRange() != null; if ( hardConstraint ) { if ( group.constraints.add( constraint ) ) { if ( group.winner != null && !constraint.containsVersion( group.winner.getNode().getVersion() ) ) { backtrack = true; } } } if ( isAcceptable( group, node.getVersion() ) ) { group.candidates.add( item ); if ( backtrack ) { backtrack( group, context ); } else if ( group.winner == null || isNearer( item, group.winner ) ) { group.winner = item; } } else if ( backtrack ) { backtrack( group, context ); } } context.setWinner( group.winner ); } private void backtrack( ConflictGroup group, ConflictContext context ) throws UnsolvableVersionConflictException { group.winner = null; for ( Iterator it = group.candidates.iterator(); it.hasNext(); ) { ConflictItem candidate = it.next(); if ( !isAcceptable( group, candidate.getNode().getVersion() ) ) { it.remove(); } else if ( group.winner == null || isNearer( candidate, group.winner ) ) { group.winner = candidate; } } if ( group.winner == null ) { throw newFailure( context ); } } private boolean isAcceptable( ConflictGroup group, Version version ) { for ( VersionConstraint constraint : group.constraints ) { if ( !constraint.containsVersion( version ) ) { return false; } } return true; } private boolean isNearer( ConflictItem item1, ConflictItem item2 ) { if ( item1.isSibling( item2 ) ) { return item1.getNode().getVersion().compareTo( item2.getNode().getVersion() ) > 0; } else { return item1.getDepth() < item2.getDepth(); } } private UnsolvableVersionConflictException newFailure( final ConflictContext context ) { DependencyFilter filter = new DependencyFilter() { public boolean accept( DependencyNode node, List parents ) { return context.isIncluded( node ); } }; PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( filter ); context.getRoot().accept( visitor ); return new UnsolvableVersionConflictException( visitor.getPaths() ); } static final class ConflictGroup { final Collection constraints; final Collection candidates; ConflictItem winner; public ConflictGroup() { constraints = new HashSet(); candidates = new ArrayList( 64 ); } @Override public String toString() { return String.valueOf( winner ); } } } NoopDependencyGraphTransformer.java000066400000000000000000000031521245546356100377450ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; /** * A dependency graph transformer that does not perform any changes on its input. */ public final class NoopDependencyGraphTransformer implements DependencyGraphTransformer { /** * A ready-made instance of this dependency graph transformer which can safely be reused throughout an entire * application regardless of multi-threading. */ public static final DependencyGraphTransformer INSTANCE = new NoopDependencyGraphTransformer(); /** * Creates a new instance of this graph transformer. Usually, {@link #INSTANCE} should be used instead. */ public NoopDependencyGraphTransformer() { } public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { return node; } } SimpleOptionalitySelector.java000066400000000000000000000040511245546356100370130ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.Collection; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictContext; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictItem; import org.eclipse.aether.util.graph.transformer.ConflictResolver.OptionalitySelector; /** * An optionality selector for use with {@link ConflictResolver}. In general, this selector only marks a dependency as * optional if all its occurrences are optional. If however a direct dependency is involved, its optional flag is * selected. */ public final class SimpleOptionalitySelector extends OptionalitySelector { /** * Creates a new instance of this optionality selector. */ public SimpleOptionalitySelector() { } @Override public void selectOptionality( ConflictContext context ) throws RepositoryException { boolean optional = chooseEffectiveOptionality( context.getItems() ); context.setOptional( optional ); } private boolean chooseEffectiveOptionality( Collection items ) { boolean optional = true; for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().isOptional(); } if ( ( item.getOptionalities() & ConflictItem.OPTIONAL_FALSE ) != 0 ) { optional = false; } } return optional; } } TransformationContextKeys.java000066400000000000000000000045131245546356100370370ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; /** * A collection of keys used by the dependency graph transformers when exchanging information via the graph * transformation context. * * @see org.eclipse.aether.collection.DependencyGraphTransformationContext#get(Object) */ public final class TransformationContextKeys { /** * The key in the graph transformation context where a {@code Map} is stored which maps * dependency nodes to their conflict ids. All nodes that map to an equal conflict id belong to the same group of * conflicting dependencies. Note that the map keys use reference equality. * * @see ConflictMarker */ public static final Object CONFLICT_IDS = "conflictIds"; /** * The key in the graph transformation context where a {@code List} is stored that denotes a topological * sorting of the conflict ids. * * @see ConflictIdSorter */ public static final Object SORTED_CONFLICT_IDS = "sortedConflictIds"; /** * The key in the graph transformation context where a {@code Collection>} is stored that denotes * cycles among conflict ids. Each element in the outer collection denotes one cycle, i.e. if the collection is * empty, the conflict ids have no cyclic dependencies. * * @see ConflictIdSorter */ public static final Object CYCLIC_CONFLICT_IDS = "cyclicConflictIds"; /** * The key in the graph transformation context where a {@code Map} is stored that can be used to * include some runtime/performance stats in the debug log. If this map is not present, no stats should be recorded. */ public static final Object STATS = "stats"; private TransformationContextKeys() { // hide constructor } } package-info.java000066400000000000000000000012251245546356100341510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency graph transformers for post-processing a dependency graph. */ package org.eclipse.aether.util.graph.transformer; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/000077500000000000000000000000001245546356100305145ustar00rootroot00000000000000AndDependencyTraverser.java000066400000000000000000000140171245546356100357020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; /** * A dependency traverser that combines zero or more other traversers using a logical {@code AND}. The resulting * traverser enables processing of child dependencies if and only if all constituent traversers request traversal. */ public final class AndDependencyTraverser implements DependencyTraverser { private final Set traversers; private int hashCode; /** * Creates a new traverser from the specified traversers. Prefer * {@link #newInstance(DependencyTraverser, DependencyTraverser)} if any of the input traversers might be * {@code null}. * * @param traversers The traversers to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyTraverser( DependencyTraverser... traversers ) { if ( traversers != null && traversers.length > 0 ) { this.traversers = new LinkedHashSet( Arrays.asList( traversers ) ); } else { this.traversers = Collections.emptySet(); } } /** * Creates a new traverser from the specified traversers. * * @param traversers The traversers to combine, may be {@code null} but must not contain {@code null} elements. */ public AndDependencyTraverser( Collection traversers ) { if ( traversers != null && !traversers.isEmpty() ) { this.traversers = new LinkedHashSet( traversers ); } else { this.traversers = Collections.emptySet(); } } private AndDependencyTraverser( Set traversers ) { if ( traversers != null && !traversers.isEmpty() ) { this.traversers = traversers; } else { this.traversers = Collections.emptySet(); } } /** * Creates a new traverser from the specified traversers. * * @param traverser1 The first traverser to combine, may be {@code null}. * @param traverser2 The second traverser to combine, may be {@code null}. * @return The combined traverser or {@code null} if both traversers were {@code null}. */ public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); } public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; } public DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ) { int seen = 0; Set childTraversers = null; for ( DependencyTraverser traverser : traversers ) { DependencyTraverser childTraverser = traverser.deriveChildTraverser( context ); if ( childTraversers != null ) { if ( childTraverser != null ) { childTraversers.add( childTraverser ); } } else if ( traverser != childTraverser ) { childTraversers = new LinkedHashSet(); if ( seen > 0 ) { for ( DependencyTraverser s : traversers ) { if ( childTraversers.size() >= seen ) { break; } childTraversers.add( s ); } } if ( childTraverser != null ) { childTraversers.add( childTraverser ); } } else { seen++; } } if ( childTraversers == null ) { return this; } if ( childTraversers.size() <= 1 ) { if ( childTraversers.isEmpty() ) { return null; } return childTraversers.iterator().next(); } return new AndDependencyTraverser( childTraversers ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); } @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + traversers.hashCode(); hashCode = hash; } return hashCode; } } FatArtifactTraverser.java000066400000000000000000000040011245546356100353610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; /** * A dependency traverser that excludes the dependencies of fat artifacts from the traversal. Fat artifacts are * artifacts that have the property {@link org.eclipse.aether.artifact.ArtifactProperties#INCLUDES_DEPENDENCIES} set to * {@code true}. * * @see org.eclipse.aether.artifact.Artifact#getProperties() */ public final class FatArtifactTraverser implements DependencyTraverser { /** * Creates a new instance of this dependency traverser. */ public FatArtifactTraverser() { } public boolean traverseDependency( Dependency dependency ) { String prop = dependency.getArtifact().getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES, "" ); return !Boolean.parseBoolean( prop ); } public DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ) { return this; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } return true; } @Override public int hashCode() { return getClass().hashCode(); } } StaticDependencyTraverser.java000066400000000000000000000037251245546356100364330ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; /** * A dependency traverser which always or never traverses children. */ public final class StaticDependencyTraverser implements DependencyTraverser { private final boolean traverse; /** * Creates a new traverser with the specified traversal behavior. * * @param traverse {@code true} to traverse all dependencies, {@code false} to never traverse. */ public StaticDependencyTraverser( boolean traverse ) { this.traverse = traverse; } public boolean traverseDependency( Dependency dependency ) { return traverse; } public DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ) { return this; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + ( traverse ? 1 : 0 ); return hash; } } package-info.java000066400000000000000000000012041245546356100336210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency traversers for building a dependency graph. */ package org.eclipse.aether.util.graph.traverser; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/000077500000000000000000000000001245546356100301645ustar00rootroot00000000000000ChainedVersionFilter.java000066400000000000000000000123271245546356100350240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.version; import java.util.Arrays; import java.util.Collection; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.VersionFilter; /** * A version filter that combines multiple version filters into a chain where each filter gets invoked one after the * other, thereby accumulating their filtering effects. */ public final class ChainedVersionFilter implements VersionFilter { private final VersionFilter[] filters; private int hashCode; /** * Chains the specified version filters. * * @param filter1 The first version filter, may be {@code null}. * @param filter2 The second version filter, may be {@code null}. * @return The chained version filter or {@code null} if both input filters are {@code null}. */ public static VersionFilter newInstance( VersionFilter filter1, VersionFilter filter2 ) { if ( filter1 == null ) { return filter2; } if ( filter2 == null ) { return filter1; } return new ChainedVersionFilter( new VersionFilter[] { filter1, filter2 } ); } /** * Chains the specified version filters. * * @param filters The version filters to chain, must not be {@code null} or contain {@code null}. * @return The chained version filter or {@code null} if the input array is empty. */ public static VersionFilter newInstance( VersionFilter... filters ) { if ( filters.length <= 1 ) { if ( filters.length <= 0 ) { return null; } return filters[0]; } return new ChainedVersionFilter( filters.clone() ); } /** * Chains the specified version filters. * * @param filters The version filters to chain, must not be {@code null} or contain {@code null}. * @return The chained version filter or {@code null} if the input collection is empty. */ public static VersionFilter newInstance( Collection filters ) { if ( filters.size() <= 1 ) { if ( filters.isEmpty() ) { return null; } return filters.iterator().next(); } return new ChainedVersionFilter( filters.toArray( new VersionFilter[filters.size()] ) ); } private ChainedVersionFilter( VersionFilter[] filters ) { this.filters = filters; } public void filterVersions( VersionFilterContext context ) throws RepositoryException { for ( int i = 0, n = filters.length; i < n && context.getCount() > 0; i++ ) { filters[i].filterVersions( context ); } } public VersionFilter deriveChildFilter( DependencyCollectionContext context ) { VersionFilter[] children = null; int removed = 0; for ( int i = 0, n = filters.length; i < n; i++ ) { VersionFilter child = filters[i].deriveChildFilter( context ); if ( children != null ) { children[i - removed] = child; } else if ( child != filters[i] ) { children = new VersionFilter[filters.length]; System.arraycopy( filters, 0, children, 0, i ); children[i - removed] = child; } if ( child == null ) { removed++; } } if ( children == null ) { return this; } if ( removed > 0 ) { int count = filters.length - removed; if ( count <= 0 ) { return null; } if ( count == 1 ) { return children[0]; } VersionFilter[] tmp = new VersionFilter[count]; System.arraycopy( children, 0, tmp, 0, count ); children = tmp; } return new ChainedVersionFilter( children ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } ChainedVersionFilter that = (ChainedVersionFilter) obj; return Arrays.equals( filters, that.filters ); } @Override public int hashCode() { if ( hashCode == 0 ) { int hash = getClass().hashCode(); hash = hash * 31 + Arrays.hashCode( filters ); hashCode = hash; } return hashCode; } } ContextualSnapshotVersionFilter.java000066400000000000000000000065051245546356100373400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.version; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.util.ConfigUtils; /** * A version filter that blocks "*-SNAPSHOT" versions if the * {@link org.eclipse.aether.collection.CollectRequest#getRootArtifact() root artifact} of the dependency graph is not a * snapshot. Alternatively, this filter can be forced to always ban snapshot versions by setting the boolean * {@link RepositorySystemSession#getConfigProperties() configuration property} {@link #CONFIG_PROP_ENABLE} to * {@code true}. */ public final class ContextualSnapshotVersionFilter implements VersionFilter { /** * The key in the repository session's {@link RepositorySystemSession#getConfigProperties() configuration * properties} used to store a {@link Boolean} flag whether this filter should be forced to ban snapshots. By * default, snapshots are only filtered if the root artifact is not a snapshot. */ public static final String CONFIG_PROP_ENABLE = "aether.snapshotFilter"; private final SnapshotVersionFilter filter; /** * Creates a new instance of this version filter. */ public ContextualSnapshotVersionFilter() { filter = new SnapshotVersionFilter(); } private boolean isEnabled( RepositorySystemSession session ) { return ConfigUtils.getBoolean( session, false, CONFIG_PROP_ENABLE ); } public void filterVersions( VersionFilterContext context ) { if ( isEnabled( context.getSession() ) ) { filter.filterVersions( context ); } } public VersionFilter deriveChildFilter( DependencyCollectionContext context ) { if ( !isEnabled( context.getSession() ) ) { Artifact artifact = context.getArtifact(); if ( artifact == null ) { // no root artifact to test, allow snapshots and recheck once we reach the direct dependencies return this; } if ( artifact.isSnapshot() ) { // root is a snapshot, allow snapshots all the way down return null; } } // artifact is a non-snapshot or filter explicitly enabled, block snapshots all the way down return filter; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } return true; } @Override public int hashCode() { return getClass().hashCode(); } } HighestVersionFilter.java000066400000000000000000000034561245546356100350670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.version; import java.util.Iterator; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.version.Version; /** * A version filter that excludes any version except the highest one. */ public final class HighestVersionFilter implements VersionFilter { /** * Creates a new instance of this version filter. */ public HighestVersionFilter() { } public void filterVersions( VersionFilterContext context ) { Iterator it = context.iterator(); for ( boolean hasNext = it.hasNext(); hasNext; ) { it.next(); if ( hasNext = it.hasNext() ) { it.remove(); } } } public VersionFilter deriveChildFilter( DependencyCollectionContext context ) { return this; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } return true; } @Override public int hashCode() { return getClass().hashCode(); } } SnapshotVersionFilter.java000066400000000000000000000036221245546356100352660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.version; import java.util.Iterator; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.version.Version; /** * A version filter that (unconditionally) blocks "*-SNAPSHOT" versions. For practical purposes, * {@link ContextualSnapshotVersionFilter} is usually more desirable. */ public final class SnapshotVersionFilter implements VersionFilter { /** * Creates a new instance of this version filter. */ public SnapshotVersionFilter() { } public void filterVersions( VersionFilterContext context ) { for ( Iterator it = context.iterator(); it.hasNext(); ) { String version = it.next().toString(); if ( version.endsWith( "SNAPSHOT" ) ) { it.remove(); } } } public VersionFilter deriveChildFilter( DependencyCollectionContext context ) { return this; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } return true; } @Override public int hashCode() { return getClass().hashCode(); } } package-info.java000066400000000000000000000011741245546356100332770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/version/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various version filters for building a dependency graph. */ package org.eclipse.aether.util.graph.version; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/000077500000000000000000000000001245546356100301765ustar00rootroot00000000000000AbstractDepthFirstNodeListGenerator.java000066400000000000000000000136021245546356100400350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; import java.io.File; import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Abstract base class for depth first dependency tree traversers. Subclasses of this visitor will visit each node * exactly once regardless how many paths within the dependency graph lead to the node such that the resulting node * sequence is free of duplicates. *

* Actual vertex ordering (preorder, inorder, postorder) needs to be defined by subclasses through appropriate * implementations for {@link #visitEnter(org.eclipse.aether.graph.DependencyNode)} and * {@link #visitLeave(org.eclipse.aether.graph.DependencyNode)} */ abstract class AbstractDepthFirstNodeListGenerator implements DependencyVisitor { private final Map visitedNodes; protected final List nodes; public AbstractDepthFirstNodeListGenerator() { nodes = new ArrayList( 128 ); visitedNodes = new IdentityHashMap( 512 ); } /** * Gets the list of dependency nodes that was generated during the graph traversal. * * @return The list of dependency nodes, never {@code null}. */ public List getNodes() { return nodes; } /** * Gets the dependencies seen during the graph traversal. * * @param includeUnresolved Whether unresolved dependencies shall be included in the result or not. * @return The list of dependencies, never {@code null}. */ public List getDependencies( boolean includeUnresolved ) { List dependencies = new ArrayList( getNodes().size() ); for ( DependencyNode node : getNodes() ) { Dependency dependency = node.getDependency(); if ( dependency != null ) { if ( includeUnresolved || dependency.getArtifact().getFile() != null ) { dependencies.add( dependency ); } } } return dependencies; } /** * Gets the artifacts associated with the list of dependency nodes generated during the graph traversal. * * @param includeUnresolved Whether unresolved artifacts shall be included in the result or not. * @return The list of artifacts, never {@code null}. */ public List getArtifacts( boolean includeUnresolved ) { List artifacts = new ArrayList( getNodes().size() ); for ( DependencyNode node : getNodes() ) { if ( node.getDependency() != null ) { Artifact artifact = node.getDependency().getArtifact(); if ( includeUnresolved || artifact.getFile() != null ) { artifacts.add( artifact ); } } } return artifacts; } /** * Gets the files of resolved artifacts seen during the graph traversal. * * @return The list of artifact files, never {@code null}. */ public List getFiles() { List files = new ArrayList( getNodes().size() ); for ( DependencyNode node : getNodes() ) { if ( node.getDependency() != null ) { File file = node.getDependency().getArtifact().getFile(); if ( file != null ) { files.add( file ); } } } return files; } /** * Gets a class path by concatenating the artifact files of the visited dependency nodes. Nodes with unresolved * artifacts are automatically skipped. * * @return The class path, using the platform-specific path separator, never {@code null}. */ public String getClassPath() { StringBuilder buffer = new StringBuilder( 1024 ); for ( Iterator it = getNodes().iterator(); it.hasNext(); ) { DependencyNode node = it.next(); if ( node.getDependency() != null ) { Artifact artifact = node.getDependency().getArtifact(); if ( artifact.getFile() != null ) { buffer.append( artifact.getFile().getAbsolutePath() ); if ( it.hasNext() ) { buffer.append( File.pathSeparatorChar ); } } } } return buffer.toString(); } /** * Marks the specified node as being visited and determines whether the node has been visited before. * * @param node The node being visited, must not be {@code null}. * @return {@code true} if the node has not been visited before, {@code false} if the node was already visited. */ protected boolean setVisited( DependencyNode node ) { return visitedNodes.put( node, Boolean.TRUE ) == null; } public abstract boolean visitEnter( DependencyNode node ); public abstract boolean visitLeave( DependencyNode node ); } CloningDependencyVisitor.java000066400000000000000000000057071245546356100357430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import java.util.IdentityHashMap; import java.util.Map; import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; /** * A dependency visitor that constructs a clone of the visited dependency graph. If such a visitor is passed into a * {@link FilteringDependencyVisitor}, a sub graph can be created. This class creates shallow clones of the visited * dependency nodes (via {@link DefaultDependencyNode#DefaultDependencyNode(DependencyNode)}) but clients can create a * subclass and override {@link #clone(DependencyNode)} to alter the clone process. */ public class CloningDependencyVisitor implements DependencyVisitor { private final Map clones; private final Stack parents; private DependencyNode root; /** * Creates a new visitor that clones the visited nodes. */ public CloningDependencyVisitor() { parents = new Stack(); clones = new IdentityHashMap( 256 ); } /** * Gets the root node of the cloned dependency graph. * * @return The root node of the cloned dependency graph or {@code null}. */ public final DependencyNode getRootNode() { return root; } /** * Creates a clone of the specified node. * * @param node The node to clone, must not be {@code null}. * @return The cloned node, never {@code null}. */ protected DependencyNode clone( DependencyNode node ) { DefaultDependencyNode clone = new DefaultDependencyNode( node ); return clone; } public final boolean visitEnter( DependencyNode node ) { boolean recurse = true; DependencyNode clone = clones.get( node ); if ( clone == null ) { clone = clone( node ); clones.put( node, clone ); } else { recurse = false; } DependencyNode parent = parents.peek(); if ( parent == null ) { root = clone; } else { parent.getChildren().add( clone ); } parents.push( clone ); return recurse; } public final boolean visitLeave( DependencyNode node ) { parents.pop(); return true; } } FilteringDependencyVisitor.java000066400000000000000000000056371245546356100362770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; /** * A dependency visitor that delegates to another visitor if nodes match a filter. Note that in case of a mismatching * node, the children of that node are still visisted and presented to the filter. */ public final class FilteringDependencyVisitor implements DependencyVisitor { private final DependencyFilter filter; private final DependencyVisitor visitor; private final Stack accepts; private final Stack parents; /** * Creates a new visitor that delegates traversal of nodes matching the given filter to the specified visitor. * * @param visitor The visitor to delegate to, must not be {@code null}. * @param filter The filter to apply, may be {@code null} to not filter. */ public FilteringDependencyVisitor( DependencyVisitor visitor, DependencyFilter filter ) { if ( visitor == null ) { throw new IllegalArgumentException( "dependency visitor not specified" ); } this.visitor = visitor; this.filter = filter; this.accepts = new Stack(); this.parents = new Stack(); } /** * Gets the visitor to which this visitor delegates to. * * @return The visitor being delegated to, never {@code null}. */ public DependencyVisitor getVisitor() { return visitor; } /** * Gets the filter being applied before delegation. * * @return The filter being applied or {@code null} if none. */ public DependencyFilter getFilter() { return filter; } public boolean visitEnter( DependencyNode node ) { boolean accept = filter == null || filter.accept( node, parents ); accepts.push( accept ); parents.push( node ); if ( accept ) { return visitor.visitEnter( node ); } else { return true; } } public boolean visitLeave( DependencyNode node ) { parents.pop(); Boolean accept = accepts.pop(); if ( accept ) { return visitor.visitLeave( node ); } else { return true; } } } PathRecordingDependencyVisitor.java000066400000000000000000000103501245546356100370710ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import java.util.ArrayList; import java.util.Arrays; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; /** * A dependency visitor that records all paths leading to nodes matching a certain filter criteria. */ public final class PathRecordingDependencyVisitor implements DependencyVisitor { private final DependencyFilter filter; private final List> paths; private final Stack parents; private final Map visited; private final boolean excludeChildrenOfMatches; /** * Creates a new visitor that uses the specified filter to identify terminal nodes of interesting paths. The visitor * will not search for paths going beyond an already matched node. * * @param filter The filter used to select terminal nodes of paths to record, may be {@code null} to match any node. */ public PathRecordingDependencyVisitor( DependencyFilter filter ) { this( filter, true ); } /** * Creates a new visitor that uses the specified filter to identify terminal nodes of interesting paths. * * @param filter The filter used to select terminal nodes of paths to record, may be {@code null} to match any node. * @param excludeChildrenOfMatches Flag controlling whether children of matched nodes should be excluded from the * traversal, thereby ignoring any potential paths to other matching nodes beneath a matching ancestor * node. If {@code true}, all recorded paths will have only one matching node (namely the terminal node), * if {@code false} a recorded path can consist of multiple matching nodes. */ public PathRecordingDependencyVisitor( DependencyFilter filter, boolean excludeChildrenOfMatches ) { this.filter = filter; this.excludeChildrenOfMatches = excludeChildrenOfMatches; paths = new ArrayList>(); parents = new Stack(); visited = new IdentityHashMap( 128 ); } /** * Gets the filter being used to select terminal nodes. * * @return The filter being used or {@code null} if none. */ public DependencyFilter getFilter() { return filter; } /** * Gets the paths leading to nodes matching the filter that have been recorded during the graph visit. A path is * given as a sequence of nodes, starting with the root node of the graph and ending with a node that matched the * filter. * * @return The recorded paths, never {@code null}. */ public List> getPaths() { return paths; } public boolean visitEnter( DependencyNode node ) { boolean accept = filter == null || filter.accept( node, parents ); parents.push( node ); if ( accept ) { DependencyNode[] path = new DependencyNode[parents.size()]; for ( int i = 0, n = parents.size(); i < n; i++ ) { path[n - i - 1] = parents.get( i ); } paths.add( Arrays.asList( path ) ); if ( excludeChildrenOfMatches ) { return false; } } if ( visited.put( node, Boolean.TRUE ) != null ) { return false; } return true; } public boolean visitLeave( DependencyNode node ) { parents.pop(); visited.remove( node ); return true; } } PostorderNodeListGenerator.java000066400000000000000000000033541245546356100362610ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import org.eclipse.aether.graph.DependencyNode; /** * Generates a sequence of dependency nodes from a dependeny graph by traversing the graph in postorder. This visitor * visits each node exactly once regardless how many paths within the dependency graph lead to the node such that the * resulting node sequence is free of duplicates. */ public final class PostorderNodeListGenerator extends AbstractDepthFirstNodeListGenerator { private final Stack visits; /** * Creates a new postorder list generator. */ public PostorderNodeListGenerator() { visits = new Stack(); } @Override public boolean visitEnter( DependencyNode node ) { boolean visited = !setVisited( node ); visits.push( visited ); if ( visited ) { return false; } return true; } @Override public boolean visitLeave( DependencyNode node ) { Boolean visited = visits.pop(); if ( visited ) { return true; } if ( node.getDependency() != null ) { nodes.add( node ); } return true; } } PreorderNodeListGenerator.java000066400000000000000000000027441245546356100360640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import org.eclipse.aether.graph.DependencyNode; /** * Generates a sequence of dependency nodes from a dependeny graph by traversing the graph in preorder. This visitor * visits each node exactly once regardless how many paths within the dependency graph lead to the node such that the * resulting node sequence is free of duplicates. */ public final class PreorderNodeListGenerator extends AbstractDepthFirstNodeListGenerator { /** * Creates a new preorder list generator. */ public PreorderNodeListGenerator() { } @Override public boolean visitEnter( DependencyNode node ) { if ( !setVisited( node ) ) { return false; } if ( node.getDependency() != null ) { nodes.add( node ); } return true; } @Override public boolean visitLeave( DependencyNode node ) { return true; } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java000066400000000000000000000037671245546356100321230ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import java.util.AbstractList; import java.util.NoSuchElementException; import java.util.RandomAccess; /** * A non-synchronized stack with a non-modifiable list view which starts at the top of the stack. While * {@code LinkedList} can provide the same behavior, it creates many temp objects upon frequent pushes/pops. */ class Stack extends AbstractList implements RandomAccess { @SuppressWarnings( "unchecked" ) private E[] elements = (E[]) new Object[96]; private int size; public void push( E element ) { if ( size >= elements.length ) { @SuppressWarnings( "unchecked" ) E[] tmp = (E[]) new Object[size + 64]; System.arraycopy( elements, 0, tmp, 0, elements.length ); elements = tmp; } elements[size++] = element; } public E pop() { if ( size <= 0 ) { throw new NoSuchElementException(); } return elements[--size]; } public E peek() { if ( size <= 0 ) { return null; } return elements[size - 1]; } @Override public E get( int index ) { if ( index < 0 || index >= size ) { throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + size ); } return elements[size - index - 1]; } @Override public int size() { return size; } } TreeDependencyVisitor.java000066400000000000000000000043051245546356100352420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import java.util.IdentityHashMap; import java.util.Map; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; /** * A dependency visitor that delegates to another visitor if a node hasn't been visited before. In other words, this * visitor provides a tree-view of a dependency graph which generally can have multiple paths to the same node or even * cycles. */ public final class TreeDependencyVisitor implements DependencyVisitor { private final Map visitedNodes; private final DependencyVisitor visitor; private final Stack visits; /** * Creates a new visitor that delegates to the specified visitor. * * @param visitor The visitor to delegate to, must not be {@code null}. */ public TreeDependencyVisitor( DependencyVisitor visitor ) { if ( visitor == null ) { throw new IllegalArgumentException( "no visitor delegate specified" ); } this.visitor = visitor; visitedNodes = new IdentityHashMap( 512 ); visits = new Stack(); } public boolean visitEnter( DependencyNode node ) { boolean visited = visitedNodes.put( node, Boolean.TRUE ) != null; visits.push( visited ); if ( visited ) { return false; } return visitor.visitEnter( node ); } public boolean visitLeave( DependencyNode node ) { Boolean visited = visits.pop(); if ( visited ) { return true; } return visitor.visitLeave( node ); } } package-info.java000066400000000000000000000012021245546356100333010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Various dependency visitors for inspecting a dependency graph. */ package org.eclipse.aether.util.graph.visitor; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/listener/000077500000000000000000000000001245546356100272235ustar00rootroot00000000000000ChainedRepositoryListener.java000066400000000000000000000260661245546356100351620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/listener/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.listener; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.aether.AbstractRepositoryListener; import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryListener; /** * A repository listener that delegates to zero or more other listeners (multicast). The list of target listeners is * thread-safe, i.e. target listeners can be added or removed by any thread at any time. */ public final class ChainedRepositoryListener extends AbstractRepositoryListener { private final List listeners = new CopyOnWriteArrayList(); /** * Creates a new multicast listener that delegates to the specified listeners. In contrast to the constructor, this * factory method will avoid creating an actual chained listener if one of the specified readers is actually * {@code null}. * * @param listener1 The first listener, may be {@code null}. * @param listener2 The second listener, may be {@code null}. * @return The chained listener or {@code null} if no listener was supplied. */ public static RepositoryListener newInstance( RepositoryListener listener1, RepositoryListener listener2 ) { if ( listener1 == null ) { return listener2; } else if ( listener2 == null ) { return listener1; } return new ChainedRepositoryListener( listener1, listener2 ); } /** * Creates a new multicast listener that delegates to the specified listeners. * * @param listeners The listeners to delegate to, may be {@code null} or empty. */ public ChainedRepositoryListener( RepositoryListener... listeners ) { if ( listeners != null ) { add( Arrays.asList( listeners ) ); } } /** * Creates a new multicast listener that delegates to the specified listeners. * * @param listeners The listeners to delegate to, may be {@code null} or empty. */ public ChainedRepositoryListener( Collection listeners ) { add( listeners ); } /** * Adds the specified listeners to the end of the multicast chain. * * @param listeners The listeners to add, may be {@code null} or empty. */ public void add( Collection listeners ) { if ( listeners != null ) { for ( RepositoryListener listener : listeners ) { add( listener ); } } } /** * Adds the specified listener to the end of the multicast chain. * * @param listener The listener to add, may be {@code null}. */ public void add( RepositoryListener listener ) { if ( listener != null ) { listeners.add( listener ); } } /** * Removes the specified listener from the multicast chain. Trying to remove a non-existing listener has no effect. * * @param listener The listener to remove, may be {@code null}. */ public void remove( RepositoryListener listener ) { if ( listener != null ) { listeners.remove( listener ); } } protected void handleError( RepositoryEvent event, RepositoryListener listener, RuntimeException error ) { // default just swallows errors } @Override public void artifactDeployed( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDeployed( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactDeploying( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDeploying( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactDescriptorInvalid( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDescriptorInvalid( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactDescriptorMissing( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDescriptorMissing( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactDownloaded( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDownloaded( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactDownloading( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactDownloading( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactInstalled( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactInstalled( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactInstalling( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactInstalling( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactResolved( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactResolved( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void artifactResolving( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.artifactResolving( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataDeployed( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataDeployed( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataDeploying( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataDeploying( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataDownloaded( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataDownloaded( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataDownloading( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataDownloading( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataInstalled( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataInstalled( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataInstalling( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataInstalling( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataInvalid( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataInvalid( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataResolved( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataResolved( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void metadataResolving( RepositoryEvent event ) { for ( RepositoryListener listener : listeners ) { try { listener.metadataResolving( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } } ChainedTransferListener.java000066400000000000000000000146111245546356100345600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/listener/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.listener; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.aether.transfer.AbstractTransferListener; import org.eclipse.aether.transfer.TransferCancelledException; import org.eclipse.aether.transfer.TransferEvent; import org.eclipse.aether.transfer.TransferListener; /** * A transfer listener that delegates to zero or more other listeners (multicast). The list of target listeners is * thread-safe, i.e. target listeners can be added or removed by any thread at any time. */ public final class ChainedTransferListener extends AbstractTransferListener { private final List listeners = new CopyOnWriteArrayList(); /** * Creates a new multicast listener that delegates to the specified listeners. In contrast to the constructor, this * factory method will avoid creating an actual chained listener if one of the specified readers is actually * {@code null}. * * @param listener1 The first listener, may be {@code null}. * @param listener2 The second listener, may be {@code null}. * @return The chained listener or {@code null} if no listener was supplied. */ public static TransferListener newInstance( TransferListener listener1, TransferListener listener2 ) { if ( listener1 == null ) { return listener2; } else if ( listener2 == null ) { return listener1; } return new ChainedTransferListener( listener1, listener2 ); } /** * Creates a new multicast listener that delegates to the specified listeners. * * @param listeners The listeners to delegate to, may be {@code null} or empty. */ public ChainedTransferListener( TransferListener... listeners ) { if ( listeners != null ) { add( Arrays.asList( listeners ) ); } } /** * Creates a new multicast listener that delegates to the specified listeners. * * @param listeners The listeners to delegate to, may be {@code null} or empty. */ public ChainedTransferListener( Collection listeners ) { add( listeners ); } /** * Adds the specified listeners to the end of the multicast chain. * * @param listeners The listeners to add, may be {@code null} or empty. */ public void add( Collection listeners ) { if ( listeners != null ) { for ( TransferListener listener : listeners ) { add( listener ); } } } /** * Adds the specified listener to the end of the multicast chain. * * @param listener The listener to add, may be {@code null}. */ public void add( TransferListener listener ) { if ( listener != null ) { listeners.add( listener ); } } /** * Removes the specified listener from the multicast chain. Trying to remove a non-existing listener has no effect. * * @param listener The listener to remove, may be {@code null}. */ public void remove( TransferListener listener ) { if ( listener != null ) { listeners.remove( listener ); } } protected void handleError( TransferEvent event, TransferListener listener, RuntimeException error ) { // default just swallows errors } @Override public void transferInitiated( TransferEvent event ) throws TransferCancelledException { for ( TransferListener listener : listeners ) { try { listener.transferInitiated( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void transferStarted( TransferEvent event ) throws TransferCancelledException { for ( TransferListener listener : listeners ) { try { listener.transferStarted( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void transferProgressed( TransferEvent event ) throws TransferCancelledException { for ( TransferListener listener : listeners ) { try { listener.transferProgressed( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void transferCorrupted( TransferEvent event ) throws TransferCancelledException { for ( TransferListener listener : listeners ) { try { listener.transferCorrupted( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void transferSucceeded( TransferEvent event ) { for ( TransferListener listener : listeners ) { try { listener.transferSucceeded( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } @Override public void transferFailed( TransferEvent event ) { for ( TransferListener listener : listeners ) { try { listener.transferFailed( event ); } catch ( RuntimeException e ) { handleError( event, listener, e ); } } } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/listener/package-info.java000066400000000000000000000011641245546356100324140ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Utilities to build repository and transfer listeners. */ package org.eclipse.aether.util.listener; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/package-info.java000066400000000000000000000011241245546356100305630ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Miscellaneous utility classes. */ package org.eclipse.aether.util; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/000077500000000000000000000000001245546356100276155ustar00rootroot00000000000000AuthenticationBuilder.java000066400000000000000000000176241245546356100347010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.ArrayList; import java.util.List; import javax.net.ssl.HostnameVerifier; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; /** * A utility class to build authentication info for repositories and proxies. */ public final class AuthenticationBuilder { private final List authentications; /** * Creates a new authentication builder. */ public AuthenticationBuilder() { authentications = new ArrayList(); } /** * Builds a new authentication object from the current data of this builder. The state of the builder itself remains * unchanged. * * @return The authentication or {@code null} if no authentication data was supplied to the builder. */ public Authentication build() { if ( authentications.isEmpty() ) { return null; } if ( authentications.size() == 1 ) { return authentications.get( 0 ); } return new ChainedAuthentication( authentications ); } /** * Adds username data to the authentication. * * @param username The username, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addUsername( String username ) { return addString( AuthenticationContext.USERNAME, username ); } /** * Adds password data to the authentication. * * @param password The password, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addPassword( String password ) { return addSecret( AuthenticationContext.PASSWORD, password ); } /** * Adds password data to the authentication. The resulting authentication object uses an encrypted copy of the * supplied character data and callers are advised to clear the input array soon after this method returns. * * @param password The password, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addPassword( char[] password ) { return addSecret( AuthenticationContext.PASSWORD, password ); } /** * Adds NTLM data to the authentication. * * @param workstation The NTLM workstation name, may be {@code null}. * @param domain The NTLM domain name, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addNtlm( String workstation, String domain ) { addString( AuthenticationContext.NTLM_WORKSTATION, workstation ); return addString( AuthenticationContext.NTLM_DOMAIN, domain ); } /** * Adds private key data to the authentication. * * @param pathname The (absolute) path to the private key file, may be {@code null}. * @param passphrase The passphrase protecting the private key, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addPrivateKey( String pathname, String passphrase ) { if ( pathname != null ) { addString( AuthenticationContext.PRIVATE_KEY_PATH, pathname ); addSecret( AuthenticationContext.PRIVATE_KEY_PASSPHRASE, passphrase ); } return this; } /** * Adds private key data to the authentication. The resulting authentication object uses an encrypted copy of the * supplied character data and callers are advised to clear the input array soon after this method returns. * * @param pathname The (absolute) path to the private key file, may be {@code null}. * @param passphrase The passphrase protecting the private key, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addPrivateKey( String pathname, char[] passphrase ) { if ( pathname != null ) { addString( AuthenticationContext.PRIVATE_KEY_PATH, pathname ); addSecret( AuthenticationContext.PRIVATE_KEY_PASSPHRASE, passphrase ); } return this; } /** * Adds a hostname verifier for SSL. Note: This method assumes that all possible instances of the * verifier's runtime type exhibit the exact same behavior, i.e. the behavior of the verifier depends solely on the * runtime type and not on any configuration. For verifiers that do not fit this assumption, use * {@link #addCustom(Authentication)} with a suitable implementation instead. * * @param verifier The hostname verifier, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addHostnameVerifier( HostnameVerifier verifier ) { if ( verifier != null ) { authentications.add( new ComponentAuthentication( AuthenticationContext.SSL_HOSTNAME_VERIFIER, verifier ) ); } return this; } /** * Adds custom string data to the authentication. Note: If the string data is confidential, use * {@link #addSecret(String, char[])} instead. * * @param key The key for the authentication data, must not be {@code null}. * @param value The value for the authentication data, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addString( String key, String value ) { if ( value != null ) { authentications.add( new StringAuthentication( key, value ) ); } return this; } /** * Adds sensitive custom string data to the authentication. * * @param key The key for the authentication data, must not be {@code null}. * @param value The value for the authentication data, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addSecret( String key, String value ) { if ( value != null ) { authentications.add( new SecretAuthentication( key, value ) ); } return this; } /** * Adds sensitive custom string data to the authentication. The resulting authentication object uses an encrypted * copy of the supplied character data and callers are advised to clear the input array soon after this method * returns. * * @param key The key for the authentication data, must not be {@code null}. * @param value The value for the authentication data, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addSecret( String key, char[] value ) { if ( value != null ) { authentications.add( new SecretAuthentication( key, value ) ); } return this; } /** * Adds custom authentication data to the authentication. * * @param authentication The authentication to add, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public AuthenticationBuilder addCustom( Authentication authentication ) { if ( authentication != null ) { authentications.add( authentication ); } return this; } } ChainedAuthentication.java000066400000000000000000000061171245546356100346410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.Arrays; import java.util.Collection; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; /** * Authentication that aggregates other authentication blocks. When multiple input authentication blocks provide the * same authentication key, the last written value wins. */ final class ChainedAuthentication implements Authentication { private final Authentication[] authentications; public ChainedAuthentication( Authentication... authentications ) { if ( authentications != null && authentications.length > 0 ) { this.authentications = authentications.clone(); } else { this.authentications = new Authentication[0]; } } public ChainedAuthentication( Collection authentications ) { if ( authentications != null && !authentications.isEmpty() ) { this.authentications = authentications.toArray( new Authentication[authentications.size()] ); } else { this.authentications = new Authentication[0]; } } public void fill( AuthenticationContext context, String key, Map data ) { for ( Authentication authentication : authentications ) { authentication.fill( context, key, data ); } } public void digest( AuthenticationDigest digest ) { for ( Authentication authentication : authentications ) { authentication.digest( digest ); } } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ChainedAuthentication that = (ChainedAuthentication) obj; return Arrays.equals( authentications, that.authentications ); } @Override public int hashCode() { return Arrays.hashCode( authentications ); } @Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); for ( Authentication authentication : authentications ) { if ( buffer.length() > 0 ) { buffer.append( ", " ); } buffer.append( authentication ); } return buffer.toString(); } } ChainedWorkspaceReader.java000066400000000000000000000107351245546356100347440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.WorkspaceReader; import org.eclipse.aether.repository.WorkspaceRepository; /** * A workspace reader that delegates to a chain of other readers, effectively aggregating their contents. */ public final class ChainedWorkspaceReader implements WorkspaceReader { private List readers = new ArrayList(); private WorkspaceRepository repository; /** * Creates a new workspace reader by chaining the specified readers. * * @param readers The readers to chain, may be {@code null}. * @see #newInstance(WorkspaceReader, WorkspaceReader) */ public ChainedWorkspaceReader( WorkspaceReader... readers ) { if ( readers != null ) { Collections.addAll( this.readers, readers ); } StringBuilder buffer = new StringBuilder(); for ( WorkspaceReader reader : this.readers ) { if ( buffer.length() > 0 ) { buffer.append( '+' ); } buffer.append( reader.getRepository().getContentType() ); } repository = new WorkspaceRepository( buffer.toString(), new Key( this.readers ) ); } /** * Creates a new workspace reader by chaining the specified readers. In contrast to the constructor, this factory * method will avoid creating an actual chained reader if one of the specified readers is actually {@code null}. * * @param reader1 The first workspace reader, may be {@code null}. * @param reader2 The second workspace reader, may be {@code null}. * @return The chained reader or {@code null} if no workspace reader was supplied. */ public static WorkspaceReader newInstance( WorkspaceReader reader1, WorkspaceReader reader2 ) { if ( reader1 == null ) { return reader2; } else if ( reader2 == null ) { return reader1; } return new ChainedWorkspaceReader( reader1, reader2 ); } public File findArtifact( Artifact artifact ) { File file = null; for ( WorkspaceReader reader : readers ) { file = reader.findArtifact( artifact ); if ( file != null ) { break; } } return file; } public List findVersions( Artifact artifact ) { Collection versions = new LinkedHashSet(); for ( WorkspaceReader reader : readers ) { versions.addAll( reader.findVersions( artifact ) ); } return Collections.unmodifiableList( new ArrayList( versions ) ); } public WorkspaceRepository getRepository() { Key key = new Key( readers ); if ( !key.equals( repository.getKey() ) ) { repository = new WorkspaceRepository( repository.getContentType(), key ); } return repository; } private static class Key { private final List keys = new ArrayList(); public Key( List readers ) { for ( WorkspaceReader reader : readers ) { keys.add( reader.getRepository().getKey() ); } } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } return keys.equals( ( (Key) obj ).keys ); } @Override public int hashCode() { return keys.hashCode(); } } } ComponentAuthentication.java000066400000000000000000000047751245546356100352600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; /** * Authentication block that manages a single authentication key and its component value. In this context, component * refers to an object whose behavior is solely dependent on its implementation class. */ final class ComponentAuthentication implements Authentication { private final String key; private final Object value; public ComponentAuthentication( String key, Object value ) { if ( key == null ) { throw new IllegalArgumentException( "authentication key missing" ); } this.key = key; this.value = value; } public void fill( AuthenticationContext context, String key, Map data ) { context.put( this.key, value ); } public void digest( AuthenticationDigest digest ) { if ( value != null ) { digest.update( key, value.getClass().getName() ); } } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); } private static boolean eqClass( T s1, T s2 ) { return ( s1 == null ) ? s2 == null : s2 != null && s1.getClass().equals( s2.getClass() ); } @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + ( ( value != null ) ? value.getClass().hashCode() : 0 ); return hash; } @Override public String toString() { return key + "=" + value; } } ConservativeAuthenticationSelector.java000066400000000000000000000035431245546356100374570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.RemoteRepository; /** * An authentication selector that delegates to another selector but only if a repository has no authentication data * yet. If authentication has already been assigned to a repository, that is selected. */ public final class ConservativeAuthenticationSelector implements AuthenticationSelector { private final AuthenticationSelector selector; /** * Creates a new selector that delegates to the specified selector. * * @param selector The selector to delegate to in case a repository has no authentication yet, must not be * {@code null}. */ public ConservativeAuthenticationSelector( AuthenticationSelector selector ) { if ( selector == null ) { throw new IllegalArgumentException( "no authentication selector specified" ); } this.selector = selector; } public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); } } ConservativeProxySelector.java000066400000000000000000000032671245546356100356240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; /** * A proxy selector that delegates to another selector but only if a repository has no proxy yet. If a proxy has already * been assigned to a repository, that is selected. */ public final class ConservativeProxySelector implements ProxySelector { private final ProxySelector selector; /** * Creates a new selector that delegates to the specified selector. * * @param selector The selector to delegate to in case a repository has no proxy yet, must not be {@code null}. */ public ConservativeProxySelector( ProxySelector selector ) { if ( selector == null ) { throw new IllegalArgumentException( "no proxy selector specified" ); } this.selector = selector; } public Proxy getProxy( RemoteRepository repository ) { Proxy proxy = repository.getProxy(); if ( proxy != null ) { return proxy; } return selector.getProxy( repository ); } } DefaultAuthenticationSelector.java000066400000000000000000000034371245546356100363750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.RemoteRepository; /** * A simple authentication selector that selects authentication based on repository identifiers. */ public final class DefaultAuthenticationSelector implements AuthenticationSelector { private final Map repos = new HashMap(); /** * Adds the specified authentication info for the given repository identifier. * * @param id The identifier of the repository to add the authentication for, must not be {@code null}. * @param auth The authentication to add, may be {@code null}. * @return This selector for chaining, never {@code null}. */ public DefaultAuthenticationSelector add( String id, Authentication auth ) { if ( auth != null ) { repos.put( id, auth ); } else { repos.remove( id ); } return this; } public Authentication getAuthentication( RemoteRepository repository ) { return repos.get( repository.getId() ); } } DefaultMirrorSelector.java000066400000000000000000000226271245546356100346720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.aether.repository.MirrorSelector; import org.eclipse.aether.repository.RemoteRepository; /** * A simple mirror selector that selects mirrors based on repository identifiers. */ public final class DefaultMirrorSelector implements MirrorSelector { private static final String WILDCARD = "*"; private static final String EXTERNAL_WILDCARD = "external:*"; private final List mirrors = new ArrayList(); /** * Adds the specified mirror to this selector. * * @param id The identifier of the mirror, must not be {@code null}. * @param url The URL of the mirror, must not be {@code null}. * @param type The content type of the mirror, must not be {@code null}. * @param repositoryManager A flag whether the mirror is a repository manager or a simple server. * @param mirrorOfIds The identifier(s) of remote repositories to mirror, must not be {@code null}. Multiple * identifiers can be separated by comma and additionally the wildcards "*" and "external:*" can be used * to match all (external) repositories, prefixing a repo id with an exclamation mark allows to express * an exclusion. For example "external:*,!central". * @param mirrorOfTypes The content type(s) of remote repositories to mirror, may be {@code null} or empty to match * any content type. Similar to the repo id specification, multiple types can be comma-separated, the * wildcard "*" and the "!" negation syntax are supported. For example "*,!p2". * @return This selector for chaining, never {@code null}. */ public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager, String mirrorOfIds, String mirrorOfTypes ) { mirrors.add( new MirrorDef( id, url, type, repositoryManager, mirrorOfIds, mirrorOfTypes ) ); return this; } public RemoteRepository getMirror( RemoteRepository repository ) { MirrorDef mirror = findMirror( repository ); if ( mirror == null ) { return null; } RemoteRepository.Builder builder = new RemoteRepository.Builder( mirror.id, repository.getContentType(), mirror.url ); builder.setRepositoryManager( mirror.repositoryManager ); if ( mirror.type != null && mirror.type.length() > 0 ) { builder.setContentType( mirror.type ); } builder.setSnapshotPolicy( repository.getPolicy( true ) ); builder.setReleasePolicy( repository.getPolicy( false ) ); builder.setMirroredRepositories( Collections.singletonList( repository ) ); return builder.build(); } private MirrorDef findMirror( RemoteRepository repository ) { String repoId = repository.getId(); if ( repoId != null && !mirrors.isEmpty() ) { for ( MirrorDef mirror : mirrors ) { if ( repoId.equals( mirror.mirrorOfIds ) && matchesType( repository.getContentType(), mirror.mirrorOfTypes ) ) { return mirror; } } for ( MirrorDef mirror : mirrors ) { if ( matchPattern( repository, mirror.mirrorOfIds ) && matchesType( repository.getContentType(), mirror.mirrorOfTypes ) ) { return mirror; } } } return null; } /** * This method checks if the pattern matches the originalRepository. Valid patterns: * = everything external:* = * everything not on the localhost and not file based. repo,repo1 = repo or repo1 *,!repo1 = everything except repo1 * * @param repository to compare for a match. * @param pattern used for match. Currently only '*' is supported. * @return true if the repository is a match to this pattern. */ static boolean matchPattern( RemoteRepository repository, String pattern ) { boolean result = false; String originalId = repository.getId(); // simple checks first to short circuit processing below. if ( WILDCARD.equals( pattern ) || pattern.equals( originalId ) ) { result = true; } else { // process the list String[] repos = pattern.split( "," ); for ( String repo : repos ) { // see if this is a negative match if ( repo.length() > 1 && repo.startsWith( "!" ) ) { if ( repo.substring( 1 ).equals( originalId ) ) { // explicitly exclude. Set result and stop processing. result = false; break; } } // check for exact match else if ( repo.equals( originalId ) ) { result = true; break; } // check for external:* else if ( EXTERNAL_WILDCARD.equals( repo ) && isExternalRepo( repository ) ) { result = true; // don't stop processing in case a future segment explicitly excludes this repo } else if ( WILDCARD.equals( repo ) ) { result = true; // don't stop processing in case a future segment explicitly excludes this repo } } } return result; } /** * Checks the URL to see if this repository refers to an external repository. * * @param repository The repository to check, must not be {@code null}. * @return {@code true} if external, {@code false} otherwise. */ static boolean isExternalRepo( RemoteRepository repository ) { boolean local = "localhost".equals( repository.getHost() ) || "127.0.0.1".equals( repository.getHost() ) || "file".equalsIgnoreCase( repository.getProtocol() ); return !local; } /** * Checks whether the types configured for a mirror match with the type of the repository. * * @param repoType The type of the repository, may be {@code null}. * @param mirrorType The types supported by the mirror, may be {@code null}. * @return {@code true} if the types associated with the mirror match the type of the original repository, * {@code false} otherwise. */ static boolean matchesType( String repoType, String mirrorType ) { boolean result = false; // simple checks first to short circuit processing below. if ( mirrorType == null || mirrorType.length() <= 0 || WILDCARD.equals( mirrorType ) ) { result = true; } else if ( mirrorType.equals( repoType ) ) { result = true; } else { // process the list String[] layouts = mirrorType.split( "," ); for ( String layout : layouts ) { // see if this is a negative match if ( layout.length() > 1 && layout.startsWith( "!" ) ) { if ( layout.substring( 1 ).equals( repoType ) ) { // explicitly exclude. Set result and stop processing. result = false; break; } } // check for exact match else if ( layout.equals( repoType ) ) { result = true; break; } else if ( WILDCARD.equals( layout ) ) { result = true; // don't stop processing in case a future segment explicitly excludes this repo } } } return result; } static class MirrorDef { final String id; final String url; final String type; final boolean repositoryManager; final String mirrorOfIds; final String mirrorOfTypes; public MirrorDef( String id, String url, String type, boolean repositoryManager, String mirrorOfIds, String mirrorOfTypes ) { this.id = id; this.url = url; this.type = type; this.repositoryManager = repositoryManager; this.mirrorOfIds = mirrorOfIds; this.mirrorOfTypes = mirrorOfTypes; } } } DefaultProxySelector.java000066400000000000000000000106751245546356100345410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.StringTokenizer; import java.util.regex.Pattern; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; /** * A simple proxy selector that selects the first matching proxy from a list of configured proxies. */ public final class DefaultProxySelector implements ProxySelector { private List proxies = new ArrayList(); /** * Adds the specified proxy definition to the selector. Proxy definitions are ordered, the first matching proxy for * a given repository will be used. * * @param proxy The proxy definition to add, must not be {@code null}. * @param nonProxyHosts The list of (case-insensitive) host names to exclude from proxying, may be {@code null}. * @return This proxy selector for chaining, never {@code null}. */ public DefaultProxySelector add( Proxy proxy, String nonProxyHosts ) { if ( proxy == null ) { throw new IllegalArgumentException( "proxy not specified" ); } proxies.add( new ProxyDef( proxy, nonProxyHosts ) ); return this; } public Proxy getProxy( RemoteRepository repository ) { Map candidates = new HashMap(); String host = repository.getHost(); for ( ProxyDef proxy : proxies ) { if ( !proxy.nonProxyHosts.isNonProxyHost( host ) ) { String key = proxy.proxy.getType().toLowerCase( Locale.ENGLISH ); if ( !candidates.containsKey( key ) ) { candidates.put( key, proxy ); } } } String protocol = repository.getProtocol().toLowerCase( Locale.ENGLISH ); if ( "davs".equals( protocol ) ) { protocol = "https"; } else if ( "dav".equals( protocol ) ) { protocol = "http"; } else if ( protocol.startsWith( "dav:" ) ) { protocol = protocol.substring( "dav:".length() ); } ProxyDef proxy = candidates.get( protocol ); if ( proxy == null && "https".equals( protocol ) ) { proxy = candidates.get( "http" ); } return ( proxy != null ) ? proxy.proxy : null; } static class NonProxyHosts { private final Pattern[] patterns; public NonProxyHosts( String nonProxyHosts ) { List patterns = new ArrayList(); if ( nonProxyHosts != null ) { for ( StringTokenizer tokenizer = new StringTokenizer( nonProxyHosts, "|" ); tokenizer.hasMoreTokens(); ) { String pattern = tokenizer.nextToken(); pattern = pattern.replace( ".", "\\." ).replace( "*", ".*" ); patterns.add( Pattern.compile( pattern, Pattern.CASE_INSENSITIVE ) ); } } this.patterns = patterns.toArray( new Pattern[patterns.size()] ); } boolean isNonProxyHost( String host ) { if ( host != null ) { for ( Pattern pattern : patterns ) { if ( pattern.matcher( host ).matches() ) { return true; } } } return false; } } static class ProxyDef { final Proxy proxy; final NonProxyHosts nonProxyHosts; public ProxyDef( Proxy proxy, String nonProxyHosts ) { this.proxy = proxy; this.nonProxyHosts = new NonProxyHosts( nonProxyHosts ); } } } JreProxySelector.java000066400000000000000000000140611245546356100336660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.net.Authenticator; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.SocketAddress; import java.net.URI; import java.net.URL; import java.util.List; import java.util.Map; import java.util.UUID; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; /** * A proxy selector that uses the {@link java.net.ProxySelector#getDefault() JRE's global proxy selector}. In * combination with the system property {@code java.net.useSystemProxies}, this proxy selector can be employed to pick * up the proxy configuration from the operating system, see Java Networking and Proxies for * details. The {@link java.net.Authenticator JRE's global authenticator} is used to look up credentials for a proxy * when needed. */ public final class JreProxySelector implements ProxySelector { /** * Creates a new proxy selector that delegates to {@link java.net.ProxySelector#getDefault()}. */ public JreProxySelector() { } public Proxy getProxy( RemoteRepository repository ) { List proxies = null; try { URI uri = new URI( repository.getUrl() ).parseServerAuthority(); proxies = java.net.ProxySelector.getDefault().select( uri ); } catch ( Exception e ) { // URL invalid or not accepted by selector or no selector at all, simply use no proxy } if ( proxies != null ) { for ( java.net.Proxy proxy : proxies ) { if ( java.net.Proxy.Type.DIRECT.equals( proxy.type() ) ) { break; } if ( java.net.Proxy.Type.HTTP.equals( proxy.type() ) && isValid( proxy.address() ) ) { InetSocketAddress addr = (InetSocketAddress) proxy.address(); return new Proxy( Proxy.TYPE_HTTP, addr.getHostName(), addr.getPort(), JreProxyAuthentication.INSTANCE ); } } } return null; } private static boolean isValid( SocketAddress address ) { if ( address instanceof InetSocketAddress ) { /* * NOTE: On some platforms with java.net.useSystemProxies=true, unconfigured proxies show up as proxy * objects with empty host and port 0. */ InetSocketAddress addr = (InetSocketAddress) address; if ( addr.getPort() <= 0 ) { return false; } if ( addr.getHostName() == null || addr.getHostName().length() <= 0 ) { return false; } return true; } return false; } private static final class JreProxyAuthentication implements Authentication { public static final Authentication INSTANCE = new JreProxyAuthentication(); public void fill( AuthenticationContext context, String key, Map data ) { Proxy proxy = context.getProxy(); if ( proxy == null ) { return; } if ( !AuthenticationContext.USERNAME.equals( key ) && !AuthenticationContext.PASSWORD.equals( key ) ) { return; } try { URL url; try { url = new URL( context.getRepository().getUrl() ); } catch ( Exception e ) { url = null; } PasswordAuthentication auth = Authenticator.requestPasswordAuthentication( proxy.getHost(), null, proxy.getPort(), "http", "Credentials for proxy " + proxy, null, url, Authenticator.RequestorType.PROXY ); if ( auth != null ) { context.put( AuthenticationContext.USERNAME, auth.getUserName() ); context.put( AuthenticationContext.PASSWORD, auth.getPassword() ); } else { context.put( AuthenticationContext.USERNAME, System.getProperty( "http.proxyUser" ) ); context.put( AuthenticationContext.PASSWORD, System.getProperty( "http.proxyPassword" ) ); } } catch ( SecurityException e ) { // oh well, let's hope the proxy can do without auth } } public void digest( AuthenticationDigest digest ) { // we don't know anything about the JRE's current authenticator, assume the worst (i.e. interactive) digest.update( UUID.randomUUID().toString() ); } @Override public boolean equals( Object obj ) { return this == obj || ( obj != null && getClass().equals( obj.getClass() ) ); } @Override public int hashCode() { return getClass().hashCode(); } } } SecretAuthentication.java000066400000000000000000000107671245546356100345410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.Arrays; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; /** * Authentication block that manages a single authentication key and its secret string value (password, passphrase). * Unlike {@link StringAuthentication}, the string value is kept in an encrypted buffer and only decrypted when needed * to reduce the potential of leaking the secret in a heap dump. */ final class SecretAuthentication implements Authentication { private static final Object[] KEYS; static { KEYS = new Object[16]; for ( int i = 0; i < KEYS.length; i++ ) { KEYS[i] = new Object(); } } private final String key; private final char[] value; private final int secretHash; public SecretAuthentication( String key, String value ) { this( ( value != null ) ? value.toCharArray() : null, key ); } public SecretAuthentication( String key, char[] value ) { this( copy( value ), key ); } private SecretAuthentication( char[] value, String key ) { if ( key == null ) { throw new IllegalArgumentException( "authentication key missing" ); } this.key = key; this.secretHash = Arrays.hashCode( value ) ^ KEYS[0].hashCode(); this.value = xor( value ); } private static char[] copy( char[] chars ) { return ( chars != null ) ? chars.clone() : null; } private char[] xor( char[] chars ) { if ( chars != null ) { int mask = System.identityHashCode( this ); for ( int i = 0; i < chars.length; i++ ) { int key = KEYS[( i >> 1 ) % KEYS.length].hashCode(); key ^= mask; chars[i] ^= ( ( i & 1 ) == 0 ) ? ( key & 0xFFFF ) : ( key >>> 16 ); } } return chars; } private static void clear( char[] chars ) { if ( chars != null ) { for ( int i = 0; i < chars.length; i++ ) { chars[i] = '\0'; } } } public void fill( AuthenticationContext context, String key, Map data ) { char[] secret = copy( value ); xor( secret ); context.put( this.key, secret ); // secret will be cleared upon AuthenticationContext.close() } public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } SecretAuthentication that = (SecretAuthentication) obj; if ( !eq( key, that.key ) || secretHash != that.secretHash ) { return false; } char[] secret = copy( value ); char[] thatSecret = copy( that.value ); try { xor( secret ); that.xor( thatSecret ); return Arrays.equals( secret, thatSecret ); } finally { clear( secret ); clear( thatSecret ); } } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; } @Override public String toString() { return key + "=" + ( ( value != null ) ? "***" : "null" ); } } SimpleArtifactDescriptorPolicy.java000066400000000000000000000035031245546356100365300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.resolution.ArtifactDescriptorPolicyRequest; /** * An artifact descriptor error policy that allows to control error handling at a global level. */ public final class SimpleArtifactDescriptorPolicy implements ArtifactDescriptorPolicy { private final int policy; /** * Creates a new error policy with the specified behavior. * * @param ignoreMissing {@code true} to ignore missing descriptors, {@code false} to fail resolution. * @param ignoreInvalid {@code true} to ignore invalid descriptors, {@code false} to fail resolution. */ public SimpleArtifactDescriptorPolicy( boolean ignoreMissing, boolean ignoreInvalid ) { this( ( ignoreMissing ? IGNORE_MISSING : 0 ) | ( ignoreInvalid ? IGNORE_INVALID : 0 ) ); } /** * Creates a new error policy with the specified bit mask. * * @param policy The bit mask describing the policy. */ public SimpleArtifactDescriptorPolicy( int policy ) { this.policy = policy; } public int getPolicy( RepositorySystemSession session, ArtifactDescriptorPolicyRequest request ) { return policy; } } SimpleResolutionErrorPolicy.java000066400000000000000000000052761245546356100361220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.resolution.ResolutionErrorPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicyRequest; /** * A resolution error policy that allows to control caching for artifacts and metadata at a global level. */ public final class SimpleResolutionErrorPolicy implements ResolutionErrorPolicy { private final int artifactPolicy; private final int metadataPolicy; /** * Creates a new error policy with the specified behavior for both artifacts and metadata. * * @param cacheNotFound {@code true} to enable caching of missing items, {@code false} to disable it. * @param cacheTransferErrors {@code true} to enable chaching of transfer errors, {@code false} to disable it. */ public SimpleResolutionErrorPolicy( boolean cacheNotFound, boolean cacheTransferErrors ) { this( ( cacheNotFound ? CACHE_NOT_FOUND : 0 ) | ( cacheTransferErrors ? CACHE_TRANSFER_ERROR : 0 ) ); } /** * Creates a new error policy with the specified bit mask for both artifacts and metadata. * * @param policy The bit mask describing the policy for artifacts and metadata. */ public SimpleResolutionErrorPolicy( int policy ) { this( policy, policy ); } /** * Creates a new error policy with the specified bit masks for artifacts and metadata. * * @param artifactPolicy The bit mask describing the policy for artifacts. * @param metadataPolicy The bit mask describing the policy for metadata. */ public SimpleResolutionErrorPolicy( int artifactPolicy, int metadataPolicy ) { this.artifactPolicy = artifactPolicy; this.metadataPolicy = metadataPolicy; } public int getArtifactPolicy( RepositorySystemSession session, ResolutionErrorPolicyRequest request ) { return artifactPolicy; } public int getMetadataPolicy( RepositorySystemSession session, ResolutionErrorPolicyRequest request ) { return metadataPolicy; } } StringAuthentication.java000066400000000000000000000043621245546356100345540ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import java.util.Map; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; /** * Authentication block that manages a single authentication key and its string value. */ final class StringAuthentication implements Authentication { private final String key; private final String value; public StringAuthentication( String key, String value ) { if ( key == null ) { throw new IllegalArgumentException( "authentication key missing" ); } this.key = key; this.value = value; } public void fill( AuthenticationContext context, String key, Map data ) { context.put( this.key, value ); } public void digest( AuthenticationDigest digest ) { digest.update( key, value ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + ( ( value != null ) ? value.hashCode() : 0 ); return hash; } @Override public String toString() { return key + "=" + value; } } package-info.java000066400000000000000000000012551245546356100327300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Ready-to-use selectors for authentication, proxies and mirrors and a few other repository related utilities. */ package org.eclipse.aether.util.repository; aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/000077500000000000000000000000001245546356100270635ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java000066400000000000000000000311571245546356100326570ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeMap; import org.eclipse.aether.version.Version; /** * A generic version, that is a version that accepts any input string and tries to apply common sense sorting. See * {@link GenericVersionScheme} for details. */ final class GenericVersion implements Version { private final String version; private final Item[] items; private final int hash; /** * Creates a generic version from the specified string. * * @param version The version string, must not be {@code null}. */ public GenericVersion( String version ) { this.version = version; items = parse( version ); hash = Arrays.hashCode( items ); } private static Item[] parse( String version ) { List items = new ArrayList(); for ( Tokenizer tokenizer = new Tokenizer( version ); tokenizer.next(); ) { Item item = tokenizer.toItem(); items.add( item ); } trimPadding( items ); return items.toArray( new Item[items.size()] ); } private static void trimPadding( List items ) { Boolean number = null; int end = items.size() - 1; for ( int i = end; i > 0; i-- ) { Item item = items.get( i ); if ( !Boolean.valueOf( item.isNumber() ).equals( number ) ) { end = i; number = item.isNumber(); } if ( end == i && ( i == items.size() - 1 || items.get( i - 1 ).isNumber() == item.isNumber() ) && item.compareTo( null ) == 0 ) { items.remove( i ); end--; } } } public int compareTo( Version obj ) { final Item[] these = items; final Item[] those = ( (GenericVersion) obj ).items; boolean number = true; for ( int index = 0;; index++ ) { if ( index >= these.length && index >= those.length ) { return 0; } else if ( index >= these.length ) { return -comparePadding( those, index, null ); } else if ( index >= those.length ) { return comparePadding( these, index, null ); } Item thisItem = these[index]; Item thatItem = those[index]; if ( thisItem.isNumber() != thatItem.isNumber() ) { if ( number == thisItem.isNumber() ) { return comparePadding( these, index, number ); } else { return -comparePadding( those, index, number ); } } else { int rel = thisItem.compareTo( thatItem ); if ( rel != 0 ) { return rel; } number = thisItem.isNumber(); } } } private static int comparePadding( Item[] items, int index, Boolean number ) { int rel = 0; for ( int i = index; i < items.length; i++ ) { Item item = items[i]; if ( number != null && number != item.isNumber() ) { break; } rel = item.compareTo( null ); if ( rel != 0 ) { break; } } return rel; } @Override public boolean equals( Object obj ) { return ( obj instanceof GenericVersion ) && compareTo( (GenericVersion) obj ) == 0; } @Override public int hashCode() { return hash; } @Override public String toString() { return version; } static final class Tokenizer { private static final Integer QUALIFIER_ALPHA = -5; private static final Integer QUALIFIER_BETA = -4; private static final Integer QUALIFIER_MILESTONE = -3; private static final Map QUALIFIERS; static { QUALIFIERS = new TreeMap( String.CASE_INSENSITIVE_ORDER ); QUALIFIERS.put( "alpha", QUALIFIER_ALPHA ); QUALIFIERS.put( "beta", QUALIFIER_BETA ); QUALIFIERS.put( "milestone", QUALIFIER_MILESTONE ); QUALIFIERS.put( "cr", -2 ); QUALIFIERS.put( "rc", -2 ); QUALIFIERS.put( "snapshot", -1 ); QUALIFIERS.put( "ga", 0 ); QUALIFIERS.put( "final", 0 ); QUALIFIERS.put( "", 0 ); QUALIFIERS.put( "sp", 1 ); } private final String version; private int index; private String token; private boolean number; private boolean terminatedByNumber; public Tokenizer( String version ) { this.version = ( version.length() > 0 ) ? version : "0"; } public boolean next() { final int n = version.length(); if ( index >= n ) { return false; } int state = -2; int start = index; int end = n; terminatedByNumber = false; for ( ; index < n; index++ ) { char c = version.charAt( index ); if ( c == '.' || c == '-' || c == '_' ) { end = index; index++; break; } else { int digit = Character.digit( c, 10 ); if ( digit >= 0 ) { if ( state == -1 ) { end = index; terminatedByNumber = true; break; } if ( state == 0 ) { // normalize numbers and strip leading zeros (prereq for Integer/BigInteger handling) start++; } state = ( state > 0 || digit > 0 ) ? 1 : 0; } else { if ( state >= 0 ) { end = index; break; } state = -1; } } } if ( end - start > 0 ) { token = version.substring( start, end ); number = state >= 0; } else { token = "0"; number = true; } return true; } @Override public String toString() { return String.valueOf( token ); } public Item toItem() { if ( number ) { try { if ( token.length() < 10 ) { return new Item( Item.KIND_INT, Integer.parseInt( token ) ); } else { return new Item( Item.KIND_BIGINT, new BigInteger( token ) ); } } catch ( NumberFormatException e ) { throw new IllegalStateException( e ); } } else { if ( index >= version.length() ) { if ( "min".equalsIgnoreCase( token ) ) { return Item.MIN; } else if ( "max".equalsIgnoreCase( token ) ) { return Item.MAX; } } if ( terminatedByNumber && token.length() == 1 ) { switch ( token.charAt( 0 ) ) { case 'a': case 'A': return new Item( Item.KIND_QUALIFIER, QUALIFIER_ALPHA ); case 'b': case 'B': return new Item( Item.KIND_QUALIFIER, QUALIFIER_BETA ); case 'm': case 'M': return new Item( Item.KIND_QUALIFIER, QUALIFIER_MILESTONE ); } } Integer qualifier = QUALIFIERS.get( token ); if ( qualifier != null ) { return new Item( Item.KIND_QUALIFIER, qualifier ); } else { return new Item( Item.KIND_STRING, token.toLowerCase( Locale.ENGLISH ) ); } } } } static final class Item { static final int KIND_MAX = 8; static final int KIND_BIGINT = 5; static final int KIND_INT = 4; static final int KIND_STRING = 3; static final int KIND_QUALIFIER = 2; static final int KIND_MIN = 0; static final Item MAX = new Item( KIND_MAX, "max" ); static final Item MIN = new Item( KIND_MIN, "min" ); private final int kind; private final Object value; public Item( int kind, Object value ) { this.kind = kind; this.value = value; } public boolean isNumber() { return ( kind & KIND_QUALIFIER ) == 0; // i.e. kind != string/qualifier } public int compareTo( Item that ) { int rel; if ( that == null ) { // null in this context denotes the pad item (0 or "ga") switch ( kind ) { case KIND_MIN: rel = -1; break; case KIND_MAX: case KIND_BIGINT: case KIND_STRING: rel = 1; break; case KIND_INT: case KIND_QUALIFIER: rel = (Integer) value; break; default: throw new IllegalStateException( "unknown version item kind " + kind ); } } else { rel = kind - that.kind; if ( rel == 0 ) { switch ( kind ) { case KIND_MAX: case KIND_MIN: break; case KIND_BIGINT: rel = ( (BigInteger) value ).compareTo( (BigInteger) that.value ); break; case KIND_INT: case KIND_QUALIFIER: rel = ( (Integer) value ).compareTo( (Integer) that.value ); break; case KIND_STRING: rel = ( (String) value ).compareToIgnoreCase( (String) that.value ); break; default: throw new IllegalStateException( "unknown version item kind " + kind ); } } } return rel; } @Override public boolean equals( Object obj ) { return ( obj instanceof Item ) && compareTo( (Item) obj ) == 0; } @Override public int hashCode() { return value.hashCode() + kind * 31; } @Override public String toString() { return String.valueOf( value ); } } } GenericVersionConstraint.java000066400000000000000000000057641245546356100346520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; /** * A constraint on versions for a dependency. */ final class GenericVersionConstraint implements VersionConstraint { private final VersionRange range; private final Version version; /** * Creates a version constraint from the specified version range. * * @param range The version range, must not be {@code null}. */ public GenericVersionConstraint( VersionRange range ) { if ( range == null ) { throw new IllegalArgumentException( "version range missing" ); } this.range = range; this.version = null; } /** * Creates a version constraint from the specified version. * * @param version The version, must not be {@code null}. */ public GenericVersionConstraint( Version version ) { if ( version == null ) { throw new IllegalArgumentException( "version missing" ); } this.version = version; this.range = null; } public VersionRange getRange() { return range; } public Version getVersion() { return version; } public boolean containsVersion( Version version ) { if ( range == null ) { return version.equals( this.version ); } else { return range.containsVersion( version ); } } @Override public String toString() { return String.valueOf( ( range == null ) ? version : range ); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } GenericVersionConstraint that = (GenericVersionConstraint) obj; return eq( range, that.range ) && eq( version, that.getVersion() ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( getRange() ); hash = hash * 31 + hash( getVersion() ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } } GenericVersionRange.java000066400000000000000000000153401245546356100335510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; /** * A version range inspired by mathematical range syntax. For example, "[1.0,2.0)", "[1.0,)" or "[1.0]". */ final class GenericVersionRange implements VersionRange { private final Bound lowerBound; private final Bound upperBound; /** * Creates a version range from the specified range specification. * * @param range The range specification to parse, must not be {@code null}. * @throws InvalidVersionSpecificationException If the range could not be parsed. */ public GenericVersionRange( String range ) throws InvalidVersionSpecificationException { String process = range; boolean lowerBoundInclusive, upperBoundInclusive; Version lowerBound, upperBound; if ( range.startsWith( "[" ) ) { lowerBoundInclusive = true; } else if ( range.startsWith( "(" ) ) { lowerBoundInclusive = false; } else { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", a range must start with either [ or (" ); } if ( range.endsWith( "]" ) ) { upperBoundInclusive = true; } else if ( range.endsWith( ")" ) ) { upperBoundInclusive = false; } else { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", a range must end with either [ or (" ); } process = process.substring( 1, process.length() - 1 ); int index = process.indexOf( "," ); if ( index < 0 ) { if ( !lowerBoundInclusive || !upperBoundInclusive ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", single version must be surrounded by []" ); } String version = process.trim(); if ( version.endsWith( ".*" ) ) { String prefix = version.substring( 0, version.length() - 1 ); lowerBound = parse( prefix + "min" ); upperBound = parse( prefix + "max" ); } else { lowerBound = upperBound = parse( version ); } } else { String parsedLowerBound = process.substring( 0, index ).trim(); String parsedUpperBound = process.substring( index + 1 ).trim(); // more than two bounds, e.g. (1,2,3) if ( parsedUpperBound.contains( "," ) ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", bounds may not contain additional ','" ); } lowerBound = parsedLowerBound.length() > 0 ? parse( parsedLowerBound ) : null; upperBound = parsedUpperBound.length() > 0 ? parse( parsedUpperBound ) : null; if ( upperBound != null && lowerBound != null ) { if ( upperBound.compareTo( lowerBound ) < 0 ) { throw new InvalidVersionSpecificationException( range, "Invalid version range " + range + ", lower bound must not be greater than upper bound" ); } } } this.lowerBound = ( lowerBound != null ) ? new Bound( lowerBound, lowerBoundInclusive ) : null; this.upperBound = ( upperBound != null ) ? new Bound( upperBound, upperBoundInclusive ) : null; } private Version parse( String version ) { return new GenericVersion( version ); } public Bound getLowerBound() { return lowerBound; } public Bound getUpperBound() { return upperBound; } public boolean containsVersion( Version version ) { if ( lowerBound != null ) { int comparison = lowerBound.getVersion().compareTo( version ); if ( comparison == 0 && !lowerBound.isInclusive() ) { return false; } if ( comparison > 0 ) { return false; } } if ( upperBound != null ) { int comparison = upperBound.getVersion().compareTo( version ); if ( comparison == 0 && !upperBound.isInclusive() ) { return false; } if ( comparison < 0 ) { return false; } } return true; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } GenericVersionRange that = (GenericVersionRange) obj; return eq( upperBound, that.upperBound ) && eq( lowerBound, that.lowerBound ); } private static boolean eq( T s1, T s2 ) { return s1 != null ? s1.equals( s2 ) : s2 == null; } @Override public int hashCode() { int hash = 17; hash = hash * 31 + hash( upperBound ); hash = hash * 31 + hash( lowerBound ); return hash; } private static int hash( Object obj ) { return obj != null ? obj.hashCode() : 0; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); } } GenericVersionScheme.java000066400000000000000000000117071245546356100337240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import java.util.ArrayList; import java.util.Collection; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; import org.eclipse.aether.version.VersionScheme; /** * A version scheme using a generic version syntax and common sense sorting. *

* This scheme accepts versions of any form, interpreting a version as a sequence of numeric and alphabetic segments. * The characters '-', '_', and '.' as well as the mere transitions from digit to letter and vice versa delimit the * version segments. Delimiters are treated as equivalent. *

*

* Numeric segments are compared mathematically, alphabetic segments are compared lexicographically and * case-insensitively. However, the following qualifier strings are recognized and treated specially: "alpha" = "a" < * "beta" = "b" < "milestone" = "m" < "cr" = "rc" < "snapshot" < "final" = "ga" < "sp". All of those * well-known qualifiers are considered smaller/older than other strings. An empty segment/string is equivalent to 0. *

*

* In addition to the above mentioned qualifiers, the tokens "min" and "max" may be used as final version segment to * denote the smallest/greatest version having a given prefix. For example, "1.2.min" denotes the smallest version in * the 1.2 line, "1.2.max" denotes the greatest version in the 1.2 line. A version range of the form "[M.N.*]" is short * for "[M.N.min, M.N.max]". *

*

* Numbers and strings are considered incomparable against each other. Where version segments of different kind would * collide, comparison will instead assume that the previous segments are padded with trailing 0 or "ga" segments, * respectively, until the kind mismatch is resolved, e.g. "1-alpha" = "1.0.0-alpha" < "1.0.1-ga" = "1.0.1". *

*/ public final class GenericVersionScheme implements VersionScheme { /** * Creates a new instance of the version scheme for parsing versions. */ public GenericVersionScheme() { } public Version parseVersion( final String version ) throws InvalidVersionSpecificationException { return new GenericVersion( version ); } public VersionRange parseVersionRange( final String range ) throws InvalidVersionSpecificationException { return new GenericVersionRange( range ); } public VersionConstraint parseVersionConstraint( final String constraint ) throws InvalidVersionSpecificationException { Collection ranges = new ArrayList(); String process = constraint; while ( process.startsWith( "[" ) || process.startsWith( "(" ) ) { int index1 = process.indexOf( ')' ); int index2 = process.indexOf( ']' ); int index = index2; if ( index2 < 0 || ( index1 >= 0 && index1 < index2 ) ) { index = index1; } if ( index < 0 ) { throw new InvalidVersionSpecificationException( constraint, "Unbounded version range " + constraint ); } VersionRange range = parseVersionRange( process.substring( 0, index + 1 ) ); ranges.add( range ); process = process.substring( index + 1 ).trim(); if ( process.length() > 0 && process.startsWith( "," ) ) { process = process.substring( 1 ).trim(); } } if ( process.length() > 0 && !ranges.isEmpty() ) { throw new InvalidVersionSpecificationException( constraint, "Invalid version range " + constraint + ", expected [ or ( but got " + process ); } VersionConstraint result; if ( ranges.isEmpty() ) { result = new GenericVersionConstraint( parseVersion( constraint ) ); } else { result = new GenericVersionConstraint( UnionVersionRange.from( ranges ) ); } return result; } @Override public boolean equals( final Object obj ) { if ( this == obj ) { return true; } return obj != null && getClass().equals( obj.getClass() ); } @Override public int hashCode() { return getClass().hashCode(); } } UnionVersionRange.java000066400000000000000000000110051245546356100332570ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2011, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; /** * A union of version ranges. */ final class UnionVersionRange implements VersionRange { private final Set ranges; private final Bound lowerBound; private final Bound upperBound; public static VersionRange from( VersionRange... ranges ) { if ( ranges == null ) { return from( Collections. emptySet() ); } return from( Arrays.asList( ranges ) ); } public static VersionRange from( Collection ranges ) { if ( ranges != null && ranges.size() == 1 ) { return ranges.iterator().next(); } return new UnionVersionRange( ranges ); } private UnionVersionRange( Collection ranges ) { if ( ranges == null || ranges.isEmpty() ) { this.ranges = Collections.emptySet(); lowerBound = upperBound = null; } else { this.ranges = new HashSet( ranges ); Bound lowerBound = null, upperBound = null; for ( VersionRange range : this.ranges ) { Bound lb = range.getLowerBound(); if ( lb == null ) { lowerBound = null; break; } else if ( lowerBound == null ) { lowerBound = lb; } else { int c = lb.getVersion().compareTo( lowerBound.getVersion() ); if ( c < 0 || ( c == 0 && !lowerBound.isInclusive() ) ) { lowerBound = lb; } } } for ( VersionRange range : this.ranges ) { Bound ub = range.getUpperBound(); if ( ub == null ) { upperBound = null; break; } else if ( upperBound == null ) { upperBound = ub; } else { int c = ub.getVersion().compareTo( upperBound.getVersion() ); if ( c > 0 || ( c == 0 && !upperBound.isInclusive() ) ) { upperBound = ub; } } } this.lowerBound = lowerBound; this.upperBound = upperBound; } } public boolean containsVersion( Version version ) { for ( VersionRange range : ranges ) { if ( range.containsVersion( version ) ) { return true; } } return false; } public Bound getLowerBound() { return lowerBound; } public Bound getUpperBound() { return upperBound; } @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } UnionVersionRange that = (UnionVersionRange) obj; return ranges.equals( that.ranges ); } @Override public int hashCode() { int hash = 97 * ranges.hashCode(); return hash; } @Override public String toString() { StringBuilder buffer = new StringBuilder( 128 ); for ( VersionRange range : ranges ) { if ( buffer.length() > 0 ) { buffer.append( ", " ); } buffer.append( range ); } return buffer.toString(); } } aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/version/package-info.java000066400000000000000000000011721245546356100322530ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ /** * Ready-to-use version schemes for parsing/comparing versions. */ package org.eclipse.aether.util.version; aether-1.0.2.v20150114/aether-util/src/main/resources/000077500000000000000000000000001245546356100220275ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/main/resources/about.html000066400000000000000000000026401245546356100240310ustar00rootroot00000000000000 About

About This Content

September 23, 2011

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

aether-1.0.2.v20150114/aether-util/src/test/000077500000000000000000000000001245546356100200505ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/000077500000000000000000000000001245546356100207715ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/000077500000000000000000000000001245546356100215605ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/000077500000000000000000000000001245546356100232045ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/000077500000000000000000000000001245546356100244545ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/000077500000000000000000000000001245546356100254315ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java000066400000000000000000000140011245546356100315300ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; import static org.eclipse.aether.internal.test.util.TestFileUtils.*; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import org.eclipse.aether.util.ChecksumUtils; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class ChecksumUtilTest { private File emptyFile; private File patternFile; private File textFile; private static Map emptyFileChecksums = new HashMap(); private static Map patternFileChecksums = new HashMap(); private static Map textFileChecksums = new HashMap(); private Map> sums = new HashMap>(); @BeforeClass public static void beforeClass() throws IOException { emptyFileChecksums.put( "MD5", "d41d8cd98f00b204e9800998ecf8427e" ); emptyFileChecksums.put( "SHA-1", "da39a3ee5e6b4b0d3255bfef95601890afd80709" ); patternFileChecksums.put( "MD5", "14f01d6c7de7d4cf0a4887baa3528b5a" ); patternFileChecksums.put( "SHA-1", "feeeda19f626f9b0ef6cbf5948c1ec9531694295" ); textFileChecksums.put( "MD5", "12582d1a662cefe3385f2113998e43ed" ); textFileChecksums.put( "SHA-1", "a8ae272db549850eef2ff54376f8cac2770745ee" ); } @Before public void before() throws IOException { sums.clear(); emptyFile = createTempFile( new byte[] {}, 0 ); sums.put( emptyFile, emptyFileChecksums ); patternFile = createTempFile( new byte[] { 0, 1, 2, 4, 8, 16, 32, 64, 127, -1, -2, -4, -8, -16, -32, -64, -127 }, 1000 ); sums.put( patternFile, patternFileChecksums ); textFile = createTempFile( "the quick brown fox jumps over the lazy dog\n".getBytes( "UTF-8" ), 500 ); sums.put( textFile, textFileChecksums ); } @Test public void testEquality() throws Throwable { Map checksums = null; for ( File file : new File[] { emptyFile, patternFile, textFile } ) { checksums = ChecksumUtils.calc( file, Arrays.asList( "SHA-1", "MD5" ) ); for ( Entry entry : checksums.entrySet() ) { if ( entry.getValue() instanceof Throwable ) { throw (Throwable) entry.getValue(); } String actual = entry.getValue().toString(); String expected = sums.get( file ).get( entry.getKey() ); assertEquals( String.format( "checksums do not match for '%s', algorithm '%s'", file.getName(), entry.getKey() ), expected, actual ); } assertTrue( "Could not delete file", file.delete() ); } } @Test public void testFileHandleLeakage() throws IOException { for ( File file : new File[] { emptyFile, patternFile, textFile } ) { for ( int i = 0; i < 150; i++ ) { ChecksumUtils.calc( file, Arrays.asList( "SHA-1", "MD5" ) ); } assertTrue( "Could not delete file", file.delete() ); } } @Test public void testRead() throws IOException { for ( Map checksums : sums.values() ) { String sha1 = checksums.get( "SHA-1" ); String md5 = checksums.get( "MD5" ); File sha1File = createTempFile( sha1 ); File md5File = createTempFile( md5 ); assertEquals( sha1, ChecksumUtils.read( sha1File ) ); assertEquals( md5, ChecksumUtils.read( md5File ) ); assertTrue( "ChecksumUtils leaks file handles (cannot delete checksums.sha1)", sha1File.delete() ); assertTrue( "ChecksumUtils leaks file handles (cannot delete checksums.md5)", md5File.delete() ); } } @Test public void testReadSpaces() throws IOException { for ( Map checksums : sums.values() ) { String sha1 = checksums.get( "SHA-1" ); String md5 = checksums.get( "MD5" ); File sha1File = createTempFile( "sha1-checksum = " + sha1 ); File md5File = createTempFile( md5 + " test" ); assertEquals( sha1, ChecksumUtils.read( sha1File ) ); assertEquals( md5, ChecksumUtils.read( md5File ) ); assertTrue( "ChecksumUtils leaks file handles (cannot delete checksums.sha1)", sha1File.delete() ); assertTrue( "ChecksumUtils leaks file handles (cannot delete checksums.md5)", md5File.delete() ); } } @Test public void testReadEmptyFile() throws IOException { File file = createTempFile( "" ); assertEquals( "", ChecksumUtils.read( file ) ); assertTrue( "ChecksumUtils leaks file handles (cannot delete checksum.empty)", file.delete() ); } @Test public void testToHexString() { assertEquals( null, ChecksumUtils.toHexString( null ) ); assertEquals( "", ChecksumUtils.toHexString( new byte[] {} ) ); assertEquals( "00", ChecksumUtils.toHexString( new byte[] { 0 } ) ); assertEquals( "ff", ChecksumUtils.toHexString( new byte[] { -1 } ) ); assertEquals( "00017f", ChecksumUtils.toHexString( new byte[] { 0, 1, 127 } ) ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java000066400000000000000000000160251245546356100313660ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Test; public class ConfigUtilsTest { Map config = new HashMap(); @Test public void testGetObject_Default() { Object val = new Object(); assertSame( val, ConfigUtils.getObject( config, val, "no-value" ) ); } @Test public void testGetObject_AlternativeKeys() { Object val = new Object(); config.put( "some-object", val ); assertSame( val, ConfigUtils.getObject( config, null, "no-object", "some-object" ) ); } @Test public void testGetMap_Default() { Map val = new HashMap(); assertSame( val, ConfigUtils.getMap( config, val, "no-value" ) ); } @Test public void testGetMap_AlternativeKeys() { Map val = new HashMap(); config.put( "some-map", val ); assertSame( val, ConfigUtils.getMap( config, null, "no-object", "some-map" ) ); } @Test public void testGetList_Default() { List val = new ArrayList(); assertSame( val, ConfigUtils.getList( config, val, "no-value" ) ); } @Test public void testGetList_AlternativeKeys() { List val = new ArrayList(); config.put( "some-list", val ); assertSame( val, ConfigUtils.getList( config, null, "no-object", "some-list" ) ); } @Test public void testGetList_CollectionConversion() { Collection val = Collections.singleton( "item" ); config.put( "some-collection", val ); assertEquals( Arrays.asList( "item" ), ConfigUtils.getList( config, null, "some-collection" ) ); } @Test public void testGetString_Default() { config.put( "no-string", new Object() ); assertEquals( "default", ConfigUtils.getString( config, "default", "no-value" ) ); assertEquals( "default", ConfigUtils.getString( config, "default", "no-string" ) ); } @Test public void testGetString_AlternativeKeys() { config.put( "no-string", new Object() ); config.put( "some-string", "passed" ); assertEquals( "passed", ConfigUtils.getString( config, "default", "no-string", "some-string" ) ); } @Test public void testGetBoolean_Default() { config.put( "no-boolean", new Object() ); assertEquals( true, ConfigUtils.getBoolean( config, true, "no-value" ) ); assertEquals( false, ConfigUtils.getBoolean( config, false, "no-value" ) ); assertEquals( true, ConfigUtils.getBoolean( config, true, "no-boolean" ) ); assertEquals( false, ConfigUtils.getBoolean( config, false, "no-boolean" ) ); } @Test public void testGetBoolean_AlternativeKeys() { config.put( "no-boolean", new Object() ); config.put( "some-boolean", true ); assertEquals( true, ConfigUtils.getBoolean( config, false, "no-boolean", "some-boolean" ) ); config.put( "some-boolean", false ); assertEquals( false, ConfigUtils.getBoolean( config, true, "no-boolean", "some-boolean" ) ); } @Test public void testGetBoolean_StringConversion() { config.put( "some-boolean", "true" ); assertEquals( true, ConfigUtils.getBoolean( config, false, "some-boolean" ) ); config.put( "some-boolean", "false" ); assertEquals( false, ConfigUtils.getBoolean( config, true, "some-boolean" ) ); } @Test public void testGetInteger_Default() { config.put( "no-integer", new Object() ); assertEquals( -17, ConfigUtils.getInteger( config, -17, "no-value" ) ); assertEquals( 43, ConfigUtils.getInteger( config, 43, "no-integer" ) ); } @Test public void testGetInteger_AlternativeKeys() { config.put( "no-integer", "text" ); config.put( "some-integer", 23 ); assertEquals( 23, ConfigUtils.getInteger( config, 0, "no-integer", "some-integer" ) ); } @Test public void testGetInteger_StringConversion() { config.put( "some-integer", "-123456" ); assertEquals( -123456, ConfigUtils.getInteger( config, 0, "some-integer" ) ); } @Test public void testGetInteger_NumberConversion() { config.put( "some-number", -123456.789 ); assertEquals( -123456, ConfigUtils.getInteger( config, 0, "some-number" ) ); } @Test public void testGetLong_Default() { config.put( "no-long", new Object() ); assertEquals( -17, ConfigUtils.getLong( config, -17L, "no-value" ) ); assertEquals( 43, ConfigUtils.getLong( config, 43L, "no-long" ) ); } @Test public void testGetLong_AlternativeKeys() { config.put( "no-long", "text" ); config.put( "some-long", 23 ); assertEquals( 23, ConfigUtils.getLong( config, 0, "no-long", "some-long" ) ); } @Test public void testGetLong_StringConversion() { config.put( "some-long", "-123456789012" ); assertEquals( -123456789012L, ConfigUtils.getLong( config, 0, "some-long" ) ); } @Test public void testGetLong_NumberConversion() { config.put( "some-number", -123456789012.789 ); assertEquals( -123456789012L, ConfigUtils.getLong( config, 0, "some-number" ) ); } @Test public void testGetFloat_Default() { config.put( "no-float", new Object() ); assertEquals( -17.1f, ConfigUtils.getFloat( config, -17.1f, "no-value" ), 0.01f ); assertEquals( 43.2f, ConfigUtils.getFloat( config, 43.2f, "no-float" ), 0.01f ); } @Test public void testGetFloat_AlternativeKeys() { config.put( "no-float", "text" ); config.put( "some-float", 12.3f ); assertEquals( 12.3f, ConfigUtils.getFloat( config, 0, "no-float", "some-float" ), 0.01f ); } @Test public void testGetFloat_StringConversion() { config.put( "some-float", "-12.3" ); assertEquals( -12.3f, ConfigUtils.getFloat( config, 0, "some-float" ), 0.01f ); config.put( "some-float", "NaN" ); assertEquals( true, Float.isNaN( ConfigUtils.getFloat( config, 0, "some-float" ) ) ); } @Test public void testGetFloat_NumberConversion() { config.put( "some-number", -1234 ); assertEquals( -1234f, ConfigUtils.getFloat( config, 0, "some-number" ), 0.1f ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java000066400000000000000000000017031245546356100314240ustar00rootroot00000000000000/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util; import static org.junit.Assert.*; import org.eclipse.aether.util.StringUtils; import org.junit.Test; /** */ public class StringUtilsTest { @Test public void testIsEmpty() { assertTrue( StringUtils.isEmpty( null ) ); assertTrue( StringUtils.isEmpty( "" ) ); assertFalse( StringUtils.isEmpty( " " ) ); assertFalse( StringUtils.isEmpty( "test" ) ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/artifact/000077500000000000000000000000001245546356100272265ustar00rootroot00000000000000ArtifactIdUtilsTest.java000066400000000000000000000217371245546356100337170ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import static org.junit.Assert.*; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.junit.Test; /** */ public class ArtifactIdUtilsTest { @Test public void testToIdArtifact() { Artifact artifact = null; assertSame( null, ArtifactIdUtils.toId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:1.0-20110205.132618-23", ArtifactIdUtils.toId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "cls", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:cls:1.0-20110205.132618-23", ArtifactIdUtils.toId( artifact ) ); } @Test public void testToIdStrings() { assertEquals( ":::", ArtifactIdUtils.toId( null, null, null, null, null ) ); assertEquals( "gid:aid:ext:1", ArtifactIdUtils.toId( "gid", "aid", "ext", "", "1" ) ); assertEquals( "gid:aid:ext:cls:1", ArtifactIdUtils.toId( "gid", "aid", "ext", "cls", "1" ) ); } @Test public void testToBaseIdArtifact() { Artifact artifact = null; assertSame( null, ArtifactIdUtils.toBaseId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:1.0-SNAPSHOT", ArtifactIdUtils.toBaseId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "cls", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:cls:1.0-SNAPSHOT", ArtifactIdUtils.toBaseId( artifact ) ); } @Test public void testToVersionlessIdArtifact() { Artifact artifact = null; assertSame( null, ArtifactIdUtils.toId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "ext", "1" ); assertEquals( "gid:aid:ext", ArtifactIdUtils.toVersionlessId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "cls", "ext", "1" ); assertEquals( "gid:aid:ext:cls", ArtifactIdUtils.toVersionlessId( artifact ) ); } @Test public void testToVersionlessIdStrings() { assertEquals( "::", ArtifactIdUtils.toVersionlessId( null, null, null, null ) ); assertEquals( "gid:aid:ext", ArtifactIdUtils.toVersionlessId( "gid", "aid", "ext", "" ) ); assertEquals( "gid:aid:ext:cls", ArtifactIdUtils.toVersionlessId( "gid", "aid", "ext", "cls" ) ); } @Test public void testEqualsId() { Artifact artifact1 = null; Artifact artifact2 = null; assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact1 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gidX", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aidX", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "extX", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-24" ); assertEquals( false, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( true, ArtifactIdUtils.equalsId( artifact1, artifact2 ) ); assertEquals( true, ArtifactIdUtils.equalsId( artifact2, artifact1 ) ); assertEquals( true, ArtifactIdUtils.equalsId( artifact1, artifact1 ) ); } @Test public void testEqualsBaseId() { Artifact artifact1 = null; Artifact artifact2 = null; assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact1 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gidX", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aidX", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "extX", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "X.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-24" ); assertEquals( true, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( true, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( true, ArtifactIdUtils.equalsBaseId( artifact1, artifact2 ) ); assertEquals( true, ArtifactIdUtils.equalsBaseId( artifact2, artifact1 ) ); assertEquals( true, ArtifactIdUtils.equalsBaseId( artifact1, artifact1 ) ); } @Test public void testEqualsVersionlessId() { Artifact artifact1 = null; Artifact artifact2 = null; assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact1 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gidX", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aidX", "ext", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "extX", "1.0-20110205.132618-23" ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( false, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-24" ); assertEquals( true, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( true, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); artifact2 = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( true, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact2 ) ); assertEquals( true, ArtifactIdUtils.equalsVersionlessId( artifact2, artifact1 ) ); assertEquals( true, ArtifactIdUtils.equalsVersionlessId( artifact1, artifact1 ) ); } } SubArtifactTest.java000066400000000000000000000116161245546356100330660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/artifact/******************************************************************************* * Copyright (c) 2010, 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.artifact; import static org.junit.Assert.*; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.util.artifact.SubArtifact; import org.junit.Test; /** */ public class SubArtifactTest { private Artifact newMainArtifact( String coords ) { return new DefaultArtifact( coords ); } @Test public void testMainArtifactFileNotRetained() { Artifact a = newMainArtifact( "gid:aid:ver" ).setFile( new File( "" ) ); assertNotNull( a.getFile() ); a = new SubArtifact( a, "", "pom" ); assertNull( a.getFile() ); } @Test public void testMainArtifactPropertiesNotRetained() { Artifact a = newMainArtifact( "gid:aid:ver" ).setProperties( Collections.singletonMap( "key", "value" ) ); assertEquals( 1, a.getProperties().size() ); a = new SubArtifact( a, "", "pom" ); assertEquals( 0, a.getProperties().size() ); assertSame( null, a.getProperty( "key", null ) ); } @Test( expected = IllegalArgumentException.class ) public void testMainArtifactMissing() { new SubArtifact( null, "", "pom" ); } @Test public void testEmptyClassifier() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "", "pom" ); assertEquals( "", sub.getClassifier() ); sub = new SubArtifact( main, null, "pom" ); assertEquals( "", sub.getClassifier() ); } @Test public void testEmptyExtension() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "tests", "" ); assertEquals( "", sub.getExtension() ); sub = new SubArtifact( main, "tests", null ); assertEquals( "", sub.getExtension() ); } @Test public void testSameClassifier() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "*", "pom" ); assertEquals( "cls", sub.getClassifier() ); } @Test public void testSameExtension() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "tests", "*" ); assertEquals( "ext", sub.getExtension() ); } @Test public void testDerivedClassifier() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "*-tests", "pom" ); assertEquals( "cls-tests", sub.getClassifier() ); sub = new SubArtifact( main, "tests-*", "pom" ); assertEquals( "tests-cls", sub.getClassifier() ); main = newMainArtifact( "gid:aid:ext:ver" ); sub = new SubArtifact( main, "*-tests", "pom" ); assertEquals( "tests", sub.getClassifier() ); sub = new SubArtifact( main, "tests-*", "pom" ); assertEquals( "tests", sub.getClassifier() ); } @Test public void testDerivedExtension() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "", "*.asc" ); assertEquals( "ext.asc", sub.getExtension() ); sub = new SubArtifact( main, "", "asc.*" ); assertEquals( "asc.ext", sub.getExtension() ); } @Test public void testImmutability() { Artifact a = new SubArtifact( newMainArtifact( "gid:aid:ver" ), "", "pom" ); assertNotSame( a, a.setFile( new File( "file" ) ) ); assertNotSame( a, a.setVersion( "otherVersion" ) ); assertNotSame( a, a.setProperties( Collections.singletonMap( "key", "value" ) ) ); } @Test public void testPropertiesCopied() { Map props = new HashMap(); props.put( "key", "value1" ); Artifact a = new SubArtifact( newMainArtifact( "gid:aid:ver" ), "", "pom", props, null ); assertEquals( "value1", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value1", a.getProperty( "key", null ) ); props.put( "key", "value2" ); a = a.setProperties( props ); assertEquals( "value2", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value2", a.getProperty( "key", null ) ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/000077500000000000000000000000001245546356100267165ustar00rootroot00000000000000AbstractDependencyFilterTest.java000066400000000000000000000023761245546356100352620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; public abstract class AbstractDependencyFilterTest { protected DependencyFilter getAcceptFilter() { return new DependencyFilter() { public boolean accept( DependencyNode node, List parents ) { return true; } }; } protected DependencyFilter getDenyFilter() { return new DependencyFilter() { public boolean accept( DependencyNode node, List parents ) { return false; } }; } } AndDependencyFilterTest.java000066400000000000000000000107411245546356100342140ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.AndDependencyFilter; import org.junit.Test; public class AndDependencyFilterTest extends AbstractDependencyFilterTest { @Test public void acceptTest() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "test" ); List parents = new LinkedList(); // Empty AND assertTrue( new AndDependencyFilter().accept( builder.build(), parents ) ); // Basic Boolean Input assertTrue( new AndDependencyFilter( getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getDenyFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new AndDependencyFilter( getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getDenyFilter(), getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getAcceptFilter(), getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( new AndDependencyFilter( getAcceptFilter(), getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new AndDependencyFilter( getAcceptFilter(), getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); // User another constructor Collection filters = new LinkedList(); filters.add( getDenyFilter() ); filters.add( getAcceptFilter() ); assertFalse( new AndDependencyFilter( filters ).accept( builder.build(), parents ) ); filters = new LinkedList(); filters.add( getDenyFilter() ); filters.add( getDenyFilter() ); assertFalse( new AndDependencyFilter( filters ).accept( builder.build(), parents ) ); filters = new LinkedList(); filters.add( getAcceptFilter() ); filters.add( getAcceptFilter() ); assertTrue( new AndDependencyFilter( filters ).accept( builder.build(), parents ) ); // newInstance assertTrue( AndDependencyFilter.newInstance( getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( AndDependencyFilter.newInstance( getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( AndDependencyFilter.newInstance( getDenyFilter(), null ).accept( builder.build(), parents ) ); assertTrue( AndDependencyFilter.newInstance( getAcceptFilter(), null ).accept( builder.build(), parents ) ); assertNull( AndDependencyFilter.newInstance( null, null ) ); } } DependencyFilterUtilsTest.java000066400000000000000000000135201245546356100346100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.Collections; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.DependencyFilterUtils; import org.junit.Test; /** */ public class DependencyFilterUtilsTest { private static List PARENTS = Collections.emptyList(); @Test public void testClasspathFilterCompile() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "compile" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterRuntime() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "runtime" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterTest() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "test" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterCompileRuntime() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "compile", "runtime" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterCompilePlusRuntime() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "compile+runtime" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterRuntimeCommaSystem() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "runtime,system" ); assertTrue( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterNull() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( (String[]) null ); assertFalse( filter.accept( builder.scope( "compile" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "system" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "provided" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "runtime" ).build(), PARENTS ) ); assertFalse( filter.accept( builder.scope( "test" ).build(), PARENTS ) ); } @Test public void testClasspathFilterUnknownScope() { NodeBuilder builder = new NodeBuilder().artifactId( "aid" ); DependencyFilter filter = DependencyFilterUtils.classpathFilter( "compile" ); assertTrue( filter.accept( builder.scope( "" ).build(), PARENTS ) ); assertTrue( filter.accept( builder.scope( "unknown" ).build(), PARENTS ) ); } } ExclusionDependencyFilterTest.java000066400000000000000000000040601245546356100354600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; import org.junit.Test; public class ExclusionDependencyFilterTest { @Test public void acceptTest() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ); List parents = new LinkedList(); String[] excludes; excludes = new String[] { "com.example.test:testArtifact" }; assertFalse( new ExclusionsDependencyFilter( Arrays.asList( excludes ) ).accept( builder.build(), parents ) ); excludes = new String[] { "com.example.test:testArtifact", "com.foo:otherArtifact" }; assertFalse( new ExclusionsDependencyFilter( Arrays.asList( excludes ) ).accept( builder.build(), parents ) ); excludes = new String[] { "testArtifact" }; assertFalse( new ExclusionsDependencyFilter( Arrays.asList( excludes ) ).accept( builder.build(), parents ) ); excludes = new String[] { "otherArtifact" }; assertTrue( new ExclusionsDependencyFilter( Arrays.asList( excludes ) ).accept( builder.build(), parents ) ); assertTrue( new ExclusionsDependencyFilter( (Collection) null ).accept( builder.build(), parents ) ); } } OrDependencyFilterTest.java000066400000000000000000000104311245546356100340660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.AndDependencyFilter; import org.eclipse.aether.util.filter.OrDependencyFilter; import org.junit.Test; public class OrDependencyFilterTest extends AbstractDependencyFilterTest { @Test public void acceptTest() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "test" ); List parents = new LinkedList(); // Empty OR assertFalse( new OrDependencyFilter().accept( builder.build(), parents ) ); // Basic Boolean Input assertTrue( new OrDependencyFilter( getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( new OrDependencyFilter( getDenyFilter() ).accept( builder.build(), parents ) ); assertFalse( new OrDependencyFilter( getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getDenyFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( new OrDependencyFilter( getDenyFilter(), getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getAcceptFilter(), getDenyFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getAcceptFilter(), getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( new OrDependencyFilter( getAcceptFilter(), getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); // User another constructor Collection filters = new LinkedList(); filters.add( getDenyFilter() ); filters.add( getAcceptFilter() ); assertTrue( new OrDependencyFilter( filters ).accept( builder.build(), parents ) ); filters = new LinkedList(); filters.add( getDenyFilter() ); filters.add( getDenyFilter() ); assertFalse( new OrDependencyFilter( filters ).accept( builder.build(), parents ) ); // newInstance assertTrue( AndDependencyFilter.newInstance( getAcceptFilter(), getAcceptFilter() ).accept( builder.build(), parents ) ); assertFalse( AndDependencyFilter.newInstance( getAcceptFilter(), getDenyFilter() ).accept( builder.build(), parents ) ); assertTrue( AndDependencyFilter.newInstance( getAcceptFilter(), null ).accept( builder.build(), parents ) ); assertFalse( AndDependencyFilter.newInstance( getDenyFilter(), null ).accept( builder.build(), parents ) ); assertNull( AndDependencyFilter.newInstance( null, null ) ); } } PatternExclusionsDependencyFilterTest.java000066400000000000000000000216201245546356100372020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.VersionScheme; import org.junit.Test; public class PatternExclusionsDependencyFilterTest { @Test public void acceptTestCornerCases() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "testArtifact" ); DependencyNode node = builder.build(); List parents = new LinkedList(); // Empty String, Empty List assertTrue( dontAccept( node, "" ) ); assertTrue( new PatternExclusionsDependencyFilter( new LinkedList() ).accept( node, parents ) ); assertTrue( new PatternExclusionsDependencyFilter( (String[]) null ).accept( node, parents ) ); assertTrue( new PatternExclusionsDependencyFilter( (VersionScheme) null, "[1,10]" ).accept( node, parents ) ); } @Test public void acceptTestMatches() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); // full match assertEquals( "com.example.test:testArtifact:jar:1.0.3", true, dontAccept( node, "com.example.test:testArtifact:jar:1.0.3" ) ); // single wildcard assertEquals( "*:testArtifact:jar:1.0.3", true, dontAccept( node, "*:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:*:jar:1.0.3", true, dontAccept( node, "com.example.test:*:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:1.0.3", true, dontAccept( node, "com.example.test:testArtifact:*:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:1.0.3", true, dontAccept( node, "com.example.test:testArtifact:*:1.0.3" ) ); // implicit wildcard assertEquals( ":testArtifact:jar:1.0.3", true, dontAccept( node, ":testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test::jar:1.0.3", true, dontAccept( node, "com.example.test::jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact::1.0.3", true, dontAccept( node, "com.example.test:testArtifact::1.0.3" ) ); assertEquals( "com.example.test:testArtifact:jar:", true, dontAccept( node, "com.example.test:testArtifact:jar:" ) ); // multi wildcards assertEquals( "*:*:jar:1.0.3", true, dontAccept( node, "*:*:jar:1.0.3" ) ); assertEquals( "com.example.test:*:*:1.0.3", true, dontAccept( node, "com.example.test:*:*:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:*", true, dontAccept( node, "com.example.test:testArtifact:*:*" ) ); assertEquals( "*:testArtifact:jar:*", true, dontAccept( node, "*:testArtifact:jar:*" ) ); assertEquals( "*:*:jar:*", true, dontAccept( node, "*:*:jar:*" ) ); assertEquals( ":*:jar:", true, dontAccept( node, ":*:jar:" ) ); // partial wildcards assertEquals( "*.example.test:testArtifact:jar:1.0.3", true, dontAccept( node, "*.example.test:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*ar:1.0.*", true, dontAccept( node, "com.example.test:testArtifact:*ar:1.0.*" ) ); assertEquals( "com.example.test:testArtifact:jar:1.0.*", true, dontAccept( node, "com.example.test:testArtifact:jar:1.0.*" ) ); assertEquals( "*.example.*:testArtifact:jar:1.0.3", true, dontAccept( node, "*.example.*:testArtifact:jar:1.0.3" ) ); // wildcard as empty string assertEquals( "com.example.test*:testArtifact:jar:1.0.3", true, dontAccept( node, "com.example.test*:testArtifact:jar:1.0.3" ) ); } @Test public void acceptTestLessToken() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "com.example.test:testArtifact:jar", true, dontAccept( node, "com.example.test:testArtifact:jar" ) ); assertEquals( "com.example.test:testArtifact", true, dontAccept( node, "com.example.test:testArtifact" ) ); assertEquals( "com.example.test", true, dontAccept( node, "com.example.test" ) ); assertEquals( "com.example.foo", false, dontAccept( node, "com.example.foo" ) ); } @Test public void acceptTestMissmatch() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "OTHER.GROUP.ID:testArtifact:jar:1.0.3", false, dontAccept( node, "OTHER.GROUP.ID:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:OTHER_ARTIFACT:jar:1.0.3", false, dontAccept( node, "com.example.test:OTHER_ARTIFACT:jar:1.0.3" ) ); assertEquals( "com.example.test:OTHER_ARTIFACT:jar:1.0.3", false, dontAccept( node, "com.example.test:OTHER_ARTIFACT:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:WAR:1.0.3", false, dontAccept( node, "com.example.test:testArtifact:WAR:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:jar:SNAPSHOT", false, dontAccept( node, "com.example.test:testArtifact:jar:SNAPSHOT" ) ); assertEquals( "*:*:war:*", false, dontAccept( node, "*:*:war:*" ) ); assertEquals( "OTHER.GROUP.ID", false, dontAccept( node, "OTHER.GROUP.ID" ) ); } @Test public void acceptTestMoreToken() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "com.example.test:testArtifact:jar:1.0.3:foo", false, dontAccept( node, "com.example.test:testArtifact:jar:1.0.3:foo" ) ); } @Test public void acceptTestRange() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); String prefix = "com.example.test:testArtifact:jar:"; assertTrue( prefix + "[1.0.3,1.0.4)", dontAcceptVersionRange( node, prefix + "[1.0.3,1.0.4)" ) ); assertTrue( prefix + "[1.0.3,)", dontAcceptVersionRange( node, prefix + "[1.0.3,)" ) ); assertTrue( prefix + "[1.0.3,]", dontAcceptVersionRange( node, prefix + "[1.0.3,]" ) ); assertTrue( prefix + "(,1.0.3]", dontAcceptVersionRange( node, prefix + "(,1.0.3]" ) ); assertTrue( prefix + "[1.0,]", dontAcceptVersionRange( node, prefix + "[1.0,]" ) ); assertTrue( prefix + "[1,4]", dontAcceptVersionRange( node, prefix + "[1,4]" ) ); assertTrue( prefix + "(1,4)", dontAcceptVersionRange( node, prefix + "(1,4)" ) ); assertTrue( prefix + "(1.0.2,1.0.3]", dontAcceptVersionRange( node, prefix + "(1.0.2,1.0.3]", prefix + "(1.1,)" ) ); assertFalse( prefix + "(1.0.3,2.0]", dontAcceptVersionRange( node, prefix + "(1.0.3,2.0]" ) ); assertFalse( prefix + "(1,1.0.2]", dontAcceptVersionRange( node, prefix + "(1,1.0.2]" ) ); assertFalse( prefix + "(1.0.2,1.0.3)", dontAcceptVersionRange( node, prefix + "(1.0.2,1.0.3)", prefix + "(1.0.3,)" ) ); } private boolean dontAccept( DependencyNode node, String expression ) { return !new PatternExclusionsDependencyFilter( expression ).accept( node, new LinkedList() ); } private boolean dontAcceptVersionRange( DependencyNode node, String... expression ) { return !new PatternExclusionsDependencyFilter( new GenericVersionScheme(), expression ).accept( node, new LinkedList() ); } } PatternInclusionsDependencyFilterTest.java000066400000000000000000000212521245546356100371750ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.VersionScheme; import org.junit.Test; public class PatternInclusionsDependencyFilterTest extends AbstractDependencyFilterTest { @Test public void acceptTestCornerCases() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "testArtifact" ); DependencyNode node = builder.build(); List parents = new LinkedList(); // Empty String, Empty List assertTrue( accept( node, "" ) ); assertFalse( new PatternInclusionsDependencyFilter( new LinkedList() ).accept( node, parents ) ); assertFalse( new PatternInclusionsDependencyFilter( (String[]) null ).accept( node, parents ) ); assertFalse( new PatternInclusionsDependencyFilter( (VersionScheme) null, "[1,10]" ).accept( node, parents ) ); } @Test public void acceptTestMatches() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); // full match assertEquals( "com.example.test:testArtifact:jar:1.0.3", true, accept( node, "com.example.test:testArtifact:jar:1.0.3" ) ); // single wildcard assertEquals( "*:testArtifact:jar:1.0.3", true, accept( node, "*:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:*:jar:1.0.3", true, accept( node, "com.example.test:*:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:1.0.3", true, accept( node, "com.example.test:testArtifact:*:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:1.0.3", true, accept( node, "com.example.test:testArtifact:*:1.0.3" ) ); // implicit wildcard assertEquals( ":testArtifact:jar:1.0.3", true, accept( node, ":testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test::jar:1.0.3", true, accept( node, "com.example.test::jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact::1.0.3", true, accept( node, "com.example.test:testArtifact::1.0.3" ) ); assertEquals( "com.example.test:testArtifact:jar:", true, accept( node, "com.example.test:testArtifact:jar:" ) ); // multi wildcards assertEquals( "*:*:jar:1.0.3", true, accept( node, "*:*:jar:1.0.3" ) ); assertEquals( "com.example.test:*:*:1.0.3", true, accept( node, "com.example.test:*:*:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*:*", true, accept( node, "com.example.test:testArtifact:*:*" ) ); assertEquals( "*:testArtifact:jar:*", true, accept( node, "*:testArtifact:jar:*" ) ); assertEquals( "*:*:jar:*", true, accept( node, "*:*:jar:*" ) ); assertEquals( ":*:jar:", true, accept( node, ":*:jar:" ) ); // partial wildcards assertEquals( "*.example.test:testArtifact:jar:1.0.3", true, accept( node, "*.example.test:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:*ar:1.0.*", true, accept( node, "com.example.test:testArtifact:*ar:1.0.*" ) ); assertEquals( "com.example.test:testArtifact:jar:1.0.*", true, accept( node, "com.example.test:testArtifact:jar:1.0.*" ) ); assertEquals( "*.example.*:testArtifact:jar:1.0.3", true, accept( node, "*.example.*:testArtifact:jar:1.0.3" ) ); // wildcard as empty string assertEquals( "com.example.test*:testArtifact:jar:1.0.3", true, accept( node, "com.example.test*:testArtifact:jar:1.0.3" ) ); } @Test public void acceptTestLessToken() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "com.example.test:testArtifact:jar", true, accept( node, "com.example.test:testArtifact:jar" ) ); assertEquals( "com.example.test:testArtifact", true, accept( node, "com.example.test:testArtifact" ) ); assertEquals( "com.example.test", true, accept( node, "com.example.test" ) ); assertEquals( "com.example.foo", false, accept( node, "com.example.foo" ) ); } @Test public void acceptTestMissmatch() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "OTHER.GROUP.ID:testArtifact:jar:1.0.3", false, accept( node, "OTHER.GROUP.ID:testArtifact:jar:1.0.3" ) ); assertEquals( "com.example.test:OTHER_ARTIFACT:jar:1.0.3", false, accept( node, "com.example.test:OTHER_ARTIFACT:jar:1.0.3" ) ); assertEquals( "com.example.test:OTHER_ARTIFACT:jar:1.0.3", false, accept( node, "com.example.test:OTHER_ARTIFACT:jar:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:WAR:1.0.3", false, accept( node, "com.example.test:testArtifact:WAR:1.0.3" ) ); assertEquals( "com.example.test:testArtifact:jar:SNAPSHOT", false, accept( node, "com.example.test:testArtifact:jar:SNAPSHOT" ) ); assertEquals( "*:*:war:*", false, accept( node, "*:*:war:*" ) ); assertEquals( "OTHER.GROUP.ID", false, accept( node, "OTHER.GROUP.ID" ) ); } @Test public void acceptTestMoreToken() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); assertEquals( "com.example.test:testArtifact:jar:1.0.3:foo", false, accept( node, "com.example.test:testArtifact:jar:1.0.3:foo" ) ); } @Test public void acceptTestRange() { NodeBuilder builder = new NodeBuilder(); builder.groupId( "com.example.test" ).artifactId( "testArtifact" ).ext( "jar" ).version( "1.0.3" ); DependencyNode node = builder.build(); String prefix = "com.example.test:testArtifact:jar:"; assertTrue( prefix + "[1.0.3,1.0.4)", acceptVersionRange( node, prefix + "[1.0.3,1.0.4)" ) ); assertTrue( prefix + "[1.0.3,)", acceptVersionRange( node, prefix + "[1.0.3,)" ) ); assertTrue( prefix + "[1.0.3,]", acceptVersionRange( node, prefix + "[1.0.3,]" ) ); assertTrue( prefix + "(,1.0.3]", acceptVersionRange( node, prefix + "(,1.0.3]" ) ); assertTrue( prefix + "[1.0,]", acceptVersionRange( node, prefix + "[1.0,]" ) ); assertTrue( prefix + "[1,4]", acceptVersionRange( node, prefix + "[1,4]" ) ); assertTrue( prefix + "(1,4)", acceptVersionRange( node, prefix + "(1,4)" ) ); assertTrue( prefix + "(1.0.2,1.0.3]", acceptVersionRange( node, prefix + "(1.0.2,1.0.3]", prefix + "(1.1,)" ) ); assertFalse( prefix + "(1.0.3,2.0]", acceptVersionRange( node, prefix + "(1.0.3,2.0]" ) ); assertFalse( prefix + "(1,1.0.2]", acceptVersionRange( node, prefix + "(1,1.0.2]" ) ); assertFalse( prefix + "(1.0.2,1.0.3)", acceptVersionRange( node, prefix + "(1.0.2,1.0.3)", prefix + "(1.0.3,)" ) ); } public boolean accept( DependencyNode node, String expression ) { return new PatternInclusionsDependencyFilter( expression ).accept( node, new LinkedList() ); } public boolean acceptVersionRange( DependencyNode node, String... expression ) { return new PatternInclusionsDependencyFilter( new GenericVersionScheme(), expression ).accept( node, new LinkedList() ); } } ScopeDependencyFilterTest.java000066400000000000000000000054331245546356100345650ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/filter/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.filter; import static org.junit.Assert.*; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.NodeBuilder; import org.eclipse.aether.util.filter.ScopeDependencyFilter; import org.junit.Test; public class ScopeDependencyFilterTest extends AbstractDependencyFilterTest { @Test public void acceptTest() { NodeBuilder builder = new NodeBuilder(); builder.scope( "compile" ).artifactId( "test" ); List parents = new LinkedList(); // null or empty assertTrue( new ScopeDependencyFilter( null, null ).accept( builder.build(), parents ) ); assertTrue( new ScopeDependencyFilter( new LinkedList(), new LinkedList() ).accept( builder.build(), parents ) ); assertTrue( new ScopeDependencyFilter( (String[]) null ).accept( builder.build(), parents ) ); // only excludes assertTrue( new ScopeDependencyFilter( "test" ).accept( builder.build(), parents ) ); assertFalse( new ScopeDependencyFilter( "compile" ).accept( builder.build(), parents ) ); assertFalse( new ScopeDependencyFilter( "compile", "test" ).accept( builder.build(), parents ) ); // Both String[] excludes1 = { "provided" }; String[] includes1 = { "compile", "test" }; assertTrue( new ScopeDependencyFilter( Arrays.asList( includes1 ), Arrays.asList( excludes1 ) ).accept( builder.build(), parents ) ); assertTrue( new ScopeDependencyFilter( Arrays.asList( includes1 ), null ).accept( builder.build(), parents ) ); // exclude wins String[] excludes2 = { "compile" }; String[] includes2 = { "compile" }; assertFalse( new ScopeDependencyFilter( Arrays.asList( includes2 ), Arrays.asList( excludes2 ) ).accept( builder.build(), parents ) ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/000077500000000000000000000000001245546356100265325ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/manager/000077500000000000000000000000001245546356100301445ustar00rootroot00000000000000ClassicDependencyManagerTest.java000066400000000000000000000051021245546356100364410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/manager/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.manager; import static org.junit.Assert.*; import java.util.Arrays; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.internal.test.util.TestUtils; import org.junit.Before; import org.junit.Test; public class ClassicDependencyManagerTest { private final Artifact A = new DefaultArtifact( "test", "a", "", "" ); private final Artifact A1 = new DefaultArtifact( "test", "a", "", "1" ); private final Artifact B = new DefaultArtifact( "test", "b", "", "" ); private final Artifact B1 = new DefaultArtifact( "test", "b", "", "1" ); private RepositorySystemSession session; private DependencyCollectionContext newContext( Dependency... managedDependencies ) { return TestUtils.newCollectionContext( session, null, Arrays.asList( managedDependencies ) ); } @Before public void setUp() { session = TestUtils.newSession(); } @Test public void testManageOptional() { DependencyManager manager = new ClassicDependencyManager(); manager = manager.deriveChildManager( newContext( new Dependency( A, null, null ), new Dependency( B, null, true ) ) ); DependencyManagement mngt; mngt = manager.manageDependency( new Dependency( A1, null ) ); assertNull( mngt ); mngt = manager.manageDependency( new Dependency( B1, null ) ); assertNull( mngt ); manager = manager.deriveChildManager( newContext() ); mngt = manager.manageDependency( new Dependency( A1, null ) ); assertNull( mngt ); mngt = manager.manageDependency( new Dependency( B1, null ) ); assertNotNull( mngt ); assertEquals( Boolean.TRUE, mngt.getOptional() ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/selector/000077500000000000000000000000001245546356100303525ustar00rootroot00000000000000AndDependencySelectorTest.java000066400000000000000000000124411245546356100362020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/selector/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.selector; import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; import org.junit.Test; public class AndDependencySelectorTest { static class DummyDependencySelector implements DependencySelector { private final boolean select; private final DependencySelector child; public DummyDependencySelector() { this( true ); } public DummyDependencySelector( boolean select ) { this.select = select; this.child = this; } public DummyDependencySelector( boolean select, DependencySelector child ) { this.select = select; this.child = child; } public boolean selectDependency( Dependency dependency ) { return select; } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { return child; } } @Test public void testNewInstance() { assertNull( AndDependencySelector.newInstance( null, null ) ); DependencySelector selector = new DummyDependencySelector(); assertSame( selector, AndDependencySelector.newInstance( selector, null ) ); assertSame( selector, AndDependencySelector.newInstance( null, selector ) ); assertSame( selector, AndDependencySelector.newInstance( selector, selector ) ); assertNotNull( AndDependencySelector.newInstance( selector, new DummyDependencySelector() ) ); } @Test public void testTraverseDependency() { Dependency dependency = new Dependency( new DefaultArtifact( "g:a:v:1" ), "runtime" ); DependencySelector selector = new AndDependencySelector(); assertTrue( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( false ), new DummyDependencySelector( false ) ); assertFalse( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( true ), new DummyDependencySelector( false ) ); assertFalse( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( true ), new DummyDependencySelector( true ) ); assertTrue( selector.selectDependency( dependency ) ); } @Test public void testDeriveChildSelector_Unchanged() { DependencySelector other1 = new DummyDependencySelector( true ); DependencySelector other2 = new DummyDependencySelector( false ); DependencySelector selector = new AndDependencySelector( other1, other2 ); assertSame( selector, selector.deriveChildSelector( null ) ); } @Test public void testDeriveChildSelector_OneRemaining() { DependencySelector other1 = new DummyDependencySelector( true ); DependencySelector other2 = new DummyDependencySelector( false, null ); DependencySelector selector = new AndDependencySelector( other1, other2 ); assertSame( other1, selector.deriveChildSelector( null ) ); } @Test public void testDeriveChildSelector_ZeroRemaining() { DependencySelector other1 = new DummyDependencySelector( true, null ); DependencySelector other2 = new DummyDependencySelector( false, null ); DependencySelector selector = new AndDependencySelector( other1, other2 ); assertNull( selector.deriveChildSelector( null ) ); } @Test public void testEquals() { DependencySelector other1 = new DummyDependencySelector( true ); DependencySelector other2 = new DummyDependencySelector( false ); DependencySelector selector1 = new AndDependencySelector( other1, other2 ); DependencySelector selector2 = new AndDependencySelector( other2, other1 ); DependencySelector selector3 = new AndDependencySelector( other1 ); assertEquals( selector1, selector1 ); assertEquals( selector1, selector2 ); assertNotEquals( selector1, selector3 ); assertNotEquals( selector1, this ); assertNotEquals( selector1, null ); } @Test public void testHashCode() { DependencySelector other1 = new DummyDependencySelector( true ); DependencySelector other2 = new DummyDependencySelector( false ); DependencySelector selector1 = new AndDependencySelector( other1, other2 ); DependencySelector selector2 = new AndDependencySelector( other2, other1 ); assertEquals( selector1.hashCode(), selector2.hashCode() ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/000077500000000000000000000000001245546356100310745ustar00rootroot00000000000000AbstractDependencyGraphTransformerTest.java000066400000000000000000000066121245546356100414740ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import java.util.LinkedList; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.internal.test.util.TestUtils; import org.junit.After; import org.junit.Before; /** */ public abstract class AbstractDependencyGraphTransformerTest { protected DependencyGraphTransformer transformer; protected DependencyGraphParser parser; protected DefaultRepositorySystemSession session; protected DependencyGraphTransformationContext context; protected abstract DependencyGraphTransformer newTransformer(); protected abstract DependencyGraphParser newParser(); protected DependencyNode transform( DependencyNode root ) throws Exception { context = TestUtils.newTransformationContext( session ); root = transformer.transformGraph( root, context ); assertNotNull( root ); return root; } protected DependencyNode parseResource( String resource, String... substitutions ) throws Exception { parser.setSubstitutions( substitutions ); return parser.parseResource( resource ); } protected DependencyNode parseLiteral( String literal, String... substitutions ) throws Exception { parser.setSubstitutions( substitutions ); return parser.parseLiteral( literal ); } protected List find( DependencyNode node, String id ) { LinkedList trail = new LinkedList(); find( trail, node, id ); return trail; } private boolean find( LinkedList trail, DependencyNode node, String id ) { trail.addFirst( node ); if ( isMatch( node, id ) ) { return true; } for ( DependencyNode child : node.getChildren() ) { if ( find( trail, child, id ) ) { return true; } } trail.removeFirst(); return false; } private boolean isMatch( DependencyNode node, String id ) { if ( node.getDependency() == null ) { return false; } return id.equals( node.getDependency().getArtifact().getArtifactId() ); } @Before public void setUp() { transformer = newTransformer(); parser = newParser(); session = new DefaultRepositorySystemSession(); } @After public void tearDown() { transformer = null; parser = null; session = null; context = null; } } ConflictIdSorterTest.java000066400000000000000000000071331245546356100357410ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Queue; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.util.graph.transformer.ConflictIdSorter; import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; import org.junit.Test; /** */ public class ConflictIdSorterTest extends AbstractDependencyGraphTransformerTest { @Override protected DependencyGraphTransformer newTransformer() { return new ChainedDependencyGraphTransformer( new SimpleConflictMarker(), new ConflictIdSorter() ); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/conflict-id-sorter/" ); } private void expectOrder( List sorted, String... ids ) { Queue queue = new LinkedList( sorted ); for ( String id : ids ) { String item = queue.poll(); assertNotNull( String.format( "not enough conflict groups (no match for '%s'", id ), item ); if ( !"*".equals( id ) ) { assertEquals( id, item ); } } assertTrue( String.format( "leftover conflict groups (remaining: '%s')", queue ), queue.isEmpty() ); } private void expectOrder( String... id ) { @SuppressWarnings( "unchecked" ) List sorted = (List) context.get( TransformationContextKeys.SORTED_CONFLICT_IDS ); expectOrder( sorted, id ); } private void expectCycle( boolean cycle ) { Collection cycles = (Collection) context.get( TransformationContextKeys.CYCLIC_CONFLICT_IDS ); assertEquals( cycle, !cycles.isEmpty() ); } @Test public void testSimple() throws Exception { DependencyNode node = parseResource( "simple.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid2:aid::jar", "gid:aid::jar", "gid:aid2::jar" ); expectCycle( false ); } @Test public void testCycle() throws Exception { DependencyNode node = parseResource( "cycle.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid:aid::jar", "gid2:aid::jar" ); expectCycle( true ); } @Test public void testCycles() throws Exception { DependencyNode node = parseResource( "cycles.txt" ); assertSame( node, transform( node ) ); expectOrder( "*", "*", "*", "gid:aid::jar" ); expectCycle( true ); } @Test public void testNoConflicts() throws Exception { DependencyNode node = parseResource( "no-conflicts.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid:aid::jar", "gid3:aid::jar", "gid2:aid::jar", "gid4:aid::jar" ); expectCycle( false ); } } ConflictMarkerTest.java000066400000000000000000000076171245546356100354360ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import java.util.Map; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.util.graph.transformer.ConflictMarker; import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; import org.junit.Test; /** */ public class ConflictMarkerTest extends AbstractDependencyGraphTransformerTest { @Override protected DependencyGraphTransformer newTransformer() { return new ConflictMarker(); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/conflict-marker/" ); } @Test public void testSimple() throws Exception { DependencyNode root = parseResource( "simple.txt" ); assertSame( root, transform( root ) ); Map ids = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); assertNotNull( ids ); assertNull( ids.get( root ) ); assertNotNull( ids.get( root.getChildren().get( 0 ) ) ); assertNotNull( ids.get( root.getChildren().get( 1 ) ) ); assertNotSame( ids.get( root.getChildren().get( 0 ) ), ids.get( root.getChildren().get( 1 ) ) ); assertFalse( ids.get( root.getChildren().get( 0 ) ).equals( ids.get( root.getChildren().get( 1 ) ) ) ); } @Test public void testRelocation1() throws Exception { DependencyNode root = parseResource( "relocation1.txt" ); assertSame( root, transform( root ) ); Map ids = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); assertNotNull( ids ); assertNull( ids.get( root ) ); assertNotNull( ids.get( root.getChildren().get( 0 ) ) ); assertNotNull( ids.get( root.getChildren().get( 1 ) ) ); assertSame( ids.get( root.getChildren().get( 0 ) ), ids.get( root.getChildren().get( 1 ) ) ); } @Test public void testRelocation2() throws Exception { DependencyNode root = parseResource( "relocation2.txt" ); assertSame( root, transform( root ) ); Map ids = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); assertNotNull( ids ); assertNull( ids.get( root ) ); assertNotNull( ids.get( root.getChildren().get( 0 ) ) ); assertNotNull( ids.get( root.getChildren().get( 1 ) ) ); assertSame( ids.get( root.getChildren().get( 0 ) ), ids.get( root.getChildren().get( 1 ) ) ); } @Test public void testRelocation3() throws Exception { DependencyNode root = parseResource( "relocation3.txt" ); assertSame( root, transform( root ) ); Map ids = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); assertNotNull( ids ); assertNull( ids.get( root ) ); assertNotNull( ids.get( root.getChildren().get( 0 ) ) ); assertNotNull( ids.get( root.getChildren().get( 1 ) ) ); assertNotNull( ids.get( root.getChildren().get( 2 ) ) ); assertSame( ids.get( root.getChildren().get( 0 ) ), ids.get( root.getChildren().get( 1 ) ) ); assertSame( ids.get( root.getChildren().get( 1 ) ), ids.get( root.getChildren().get( 2 ) ) ); } } JavaDependencyContextRefinerTest.java000066400000000000000000000066441245546356100402720ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner; import org.junit.Test; /** */ public class JavaDependencyContextRefinerTest extends AbstractDependencyGraphTransformerTest { @Override protected DependencyGraphTransformer newTransformer() { return new JavaDependencyContextRefiner(); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/context-refiner/" ); } @Test public void testDoNotRefineOtherContext() throws Exception { DependencyNode node = parseLiteral( "gid:aid:cls:ver" ); node.setRequestContext( "otherContext" ); DependencyNode refinedNode = transform( node ); assertEquals( node, refinedNode ); } @Test public void testRefineToCompile() throws Exception { String expected = "project/compile"; DependencyNode node = parseLiteral( "gid:aid:ver compile" ); node.setRequestContext( "project" ); DependencyNode refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); node = parseLiteral( "gid:aid:ver system" ); node.setRequestContext( "project" ); refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); node = parseLiteral( "gid:aid:ver provided" ); node.setRequestContext( "project" ); refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); } @Test public void testRefineToTest() throws Exception { String expected = "project/test"; DependencyNode node = parseLiteral( "gid:aid:ver test" ); node.setRequestContext( "project" ); DependencyNode refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); } @Test public void testRefineToRuntime() throws Exception { String expected = "project/runtime"; DependencyNode node = parseLiteral( "gid:aid:ver runtime" ); node.setRequestContext( "project" ); DependencyNode refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); } @Test public void testDoNotRefineUnknownScopes() throws Exception { String expected = "project"; DependencyNode node = parseLiteral( "gid:aid:ver unknownScope" ); node.setRequestContext( "project" ); DependencyNode refinedNode = transform( node ); assertEquals( expected, refinedNode.getRequestContext() ); } } JavaScopeSelectorTest.java000066400000000000000000000170701245546356100361010ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import java.util.Locale; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class JavaScopeSelectorTest extends AbstractDependencyGraphTransformerTest { private enum Scope { TEST, PROVIDED, RUNTIME, COMPILE; @Override public String toString() { return super.name().toLowerCase( Locale.ENGLISH ); } } @Override protected DependencyGraphTransformer newTransformer() { return new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new SimpleOptionalitySelector(), new JavaScopeDeriver() ); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/scope-calculator/" ); } private void expectScope( String expected, DependencyNode root, int... coords ) { expectScope( null, expected, root, coords ); } private void expectScope( String msg, String expected, DependencyNode root, int... coords ) { if ( msg == null ) { msg = ""; } try { DependencyNode node = root; node = path( node, coords ); assertEquals( msg + "\nculprit: " + node.toString() + "\n", expected, node.getDependency().getScope() ); } catch ( IndexOutOfBoundsException e ) { throw new IllegalArgumentException( "Illegal coordinates for child", e ); } catch ( NullPointerException e ) { throw new IllegalArgumentException( "Illegal coordinates for child", e ); } } private DependencyNode path( DependencyNode node, int... coords ) { for ( int coord : coords ) { node = node.getChildren().get( coord ); } return node; } @Test public void testScopeInheritanceProvided() throws Exception { String resource = "inheritance.txt"; String expected = "test"; DependencyNode root = transform( parseResource( resource, "provided", "test" ) ); expectScope( parser.dump( root ), expected, root, 0, 0 ); } @Test public void testConflictWinningScopeGetsUsedForInheritance() throws Exception { DependencyNode root = parseResource( "conflict-and-inheritance.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0, 0 ); expectScope( "compile", root, 0, 0, 0 ); } @Test public void testScopeOfDirectDependencyWinsConflictAndGetsUsedForInheritanceToChildrenEverywhereInGraph() throws Exception { DependencyNode root = parseResource( "direct-with-conflict-and-inheritance.txt" ); assertSame( root, transform( root ) ); expectScope( "test", root, 0, 0 ); } @Test public void testCycleA() throws Exception { DependencyNode root = parseResource( "cycle-a.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0 ); expectScope( "runtime", root, 1 ); } @Test public void testCycleB() throws Exception { DependencyNode root = parseResource( "cycle-b.txt" ); assertSame( root, transform( root ) ); expectScope( "runtime", root, 0 ); expectScope( "compile", root, 1 ); } @Test public void testCycleC() throws Exception { DependencyNode root = parseResource( "cycle-c.txt" ); assertSame( root, transform( root ) ); expectScope( "runtime", root, 0 ); expectScope( "runtime", root, 0, 0 ); expectScope( "runtime", root, 1 ); expectScope( "runtime", root, 1, 0 ); } @Test public void testCycleD() throws Exception { DependencyNode root = parseResource( "cycle-d.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0 ); expectScope( "compile", root, 0, 0 ); } @Test public void testDirectNodesAlwaysWin() throws Exception { for ( Scope directScope : Scope.values() ) { String direct = directScope.toString(); DependencyNode root = parseResource( "direct-nodes-winning.txt", direct ); String msg = String.format( "direct node should be setting scope ('%s') for all nodes.\n" + parser.dump( root ), direct ); assertSame( root, transform( root ) ); msg += "\ntransformed:\n" + parser.dump( root ); expectScope( msg, direct, root, 0 ); } } @Test public void testNonDirectMultipleInheritance() throws Exception { for ( Scope scope1 : Scope.values() ) { for ( Scope scope2 : Scope.values() ) { DependencyNode root = parseResource( "multiple-inheritance.txt", scope1.toString(), scope2.toString() ); String expected = scope1.compareTo( scope2 ) >= 0 ? scope1.toString() : scope2.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); assertSame( root, transform( root ) ); msg += "\ntransformed:\n" + parser.dump( root ); expectScope( msg, expected, root, 0, 0 ); } } } @Test public void testConflictScopeOrdering() throws Exception { for ( Scope scope1 : Scope.values() ) { for ( Scope scope2 : Scope.values() ) { DependencyNode root = parseResource( "dueling-scopes.txt", scope1.toString(), scope2.toString() ); String expected = scope1.compareTo( scope2 ) >= 0 ? scope1.toString() : scope2.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); assertSame( root, transform( root ) ); msg += "\ntransformed:\n" + parser.dump( root ); expectScope( msg, expected, root, 0, 0 ); } } } /** * obscure case (illegal maven POM). */ @Test public void testConflictingDirectNodes() throws Exception { for ( Scope scope1 : Scope.values() ) { for ( Scope scope2 : Scope.values() ) { DependencyNode root = parseResource( "conflicting-direct-nodes.txt", scope1.toString(), scope2.toString() ); String expected = scope1.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); assertSame( root, transform( root ) ); msg += "\ntransformed:\n" + parser.dump( root ); expectScope( msg, expected, root, 0 ); } } } } NearestVersionSelectorTest.java000066400000000000000000000202041245546356100371660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import java.util.List; import org.eclipse.aether.collection.UnsolvableVersionConflictException; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; /** */ public class NearestVersionSelectorTest extends AbstractDependencyGraphTransformerTest { @Override protected ConflictResolver newTransformer() { return new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new SimpleOptionalitySelector(), new JavaScopeDeriver() ); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/version-resolver/" ); } @Test public void testSelectHighestVersionFromMultipleVersionsAtSameLevel() throws Exception { DependencyNode root = parseResource( "sibling-versions.txt" ); assertSame( root, transform( root ) ); assertEquals( 1, root.getChildren().size() ); assertEquals( "3", root.getChildren().get( 0 ).getArtifact().getVersion() ); } @Test public void testSelectedVersionAtDeeperLevelThanOriginallySeen() throws Exception { DependencyNode root = parseResource( "nearest-underneath-loser-a.txt" ); assertSame( root, transform( root ) ); List trail = find( root, "j" ); assertEquals( 5, trail.size() ); } @Test public void testNearestDirtyVersionUnderneathRemovedNode() throws Exception { DependencyNode root = parseResource( "nearest-underneath-loser-b.txt" ); assertSame( root, transform( root ) ); List trail = find( root, "j" ); assertEquals( 5, trail.size() ); } @Test public void testViolationOfHardConstraintFallsBackToNearestSeenNotFirstSeen() throws Exception { DependencyNode root = parseResource( "range-backtracking.txt" ); assertSame( root, transform( root ) ); List trail = find( root, "x" ); assertEquals( 3, trail.size() ); assertEquals( "2", trail.get( 0 ).getArtifact().getVersion() ); } @Test public void testCyclicConflictIdGraph() throws Exception { DependencyNode root = parseResource( "conflict-id-cycle.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( "a", root.getChildren().get( 0 ).getArtifact().getArtifactId() ); assertEquals( "b", root.getChildren().get( 1 ).getArtifact().getArtifactId() ); assertTrue( root.getChildren().get( 0 ).getChildren().isEmpty() ); assertTrue( root.getChildren().get( 1 ).getChildren().isEmpty() ); } @Test( expected = UnsolvableVersionConflictException.class ) public void testUnsolvableRangeConflictBetweenHardConstraints() throws Exception { DependencyNode root = parseResource( "unsolvable.txt" ); assertSame( root, transform( root ) ); } @Test( expected = UnsolvableVersionConflictException.class ) public void testUnsolvableRangeConflictWithUnrelatedCycle() throws Exception { DependencyNode root = parseResource( "unsolvable-with-cycle.txt" ); transform( root ); } @Test public void testSolvableConflictBetweenHardConstraints() throws Exception { DependencyNode root = parseResource( "ranges.txt" ); assertSame( root, transform( root ) ); } @Test public void testConflictGroupCompletelyDroppedFromResolvedTree() throws Exception { DependencyNode root = parseResource( "dead-conflict-group.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( "a", root.getChildren().get( 0 ).getArtifact().getArtifactId() ); assertEquals( "b", root.getChildren().get( 1 ).getArtifact().getArtifactId() ); assertTrue( root.getChildren().get( 0 ).getChildren().isEmpty() ); assertTrue( root.getChildren().get( 1 ).getChildren().isEmpty() ); } @Test public void testNearestSoftVersionPrunedByFartherRange() throws Exception { DependencyNode root = parseResource( "soft-vs-range.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( "a", root.getChildren().get( 0 ).getArtifact().getArtifactId() ); assertEquals( 0, root.getChildren().get( 0 ).getChildren().size() ); assertEquals( "b", root.getChildren().get( 1 ).getArtifact().getArtifactId() ); assertEquals( 1, root.getChildren().get( 1 ).getChildren().size() ); } @Test public void testCyclicGraph() throws Exception { DependencyNode root = parseResource( "cycle.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( 1, root.getChildren().get( 0 ).getChildren().size() ); assertEquals( 0, root.getChildren().get( 0 ).getChildren().get( 0 ).getChildren().size() ); assertEquals( 0, root.getChildren().get( 1 ).getChildren().size() ); } @Test public void testLoop() throws Exception { DependencyNode root = parseResource( "loop.txt" ); assertSame( root, transform( root ) ); assertEquals( 0, root.getChildren().size() ); } @Test public void testOverlappingCycles() throws Exception { DependencyNode root = parseResource( "overlapping-cycles.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); } @Test public void testScopeDerivationAndConflictResolutionCantHappenForAllNodesBeforeVersionSelection() throws Exception { DependencyNode root = parseResource( "scope-vs-version.txt" ); assertSame( root, transform( root ) ); DependencyNode[] nodes = find( root, "y" ).toArray( new DependencyNode[0] ); assertEquals( 3, nodes.length ); assertEquals( "test", nodes[1].getDependency().getScope() ); assertEquals( "test", nodes[0].getDependency().getScope() ); } @Test public void testVerboseMode() throws Exception { DependencyNode root = parseResource( "verbose.txt" ); session.setConfigProperty( ConflictResolver.CONFIG_PROP_VERBOSE, Boolean.TRUE ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( 1, root.getChildren().get( 0 ).getChildren().size() ); DependencyNode winner = root.getChildren().get( 0 ).getChildren().get( 0 ); assertEquals( "test", winner.getDependency().getScope() ); assertEquals( "compile", winner.getData().get( ConflictResolver.NODE_DATA_ORIGINAL_SCOPE ) ); assertEquals( false, winner.getData().get( ConflictResolver.NODE_DATA_ORIGINAL_OPTIONALITY) ); assertEquals( 1, root.getChildren().get( 1 ).getChildren().size() ); DependencyNode loser = root.getChildren().get( 1 ).getChildren().get( 0 ); assertEquals( "test", loser.getDependency().getScope() ); assertEquals( 0, loser.getChildren().size() ); assertSame( winner, loser.getData().get( ConflictResolver.NODE_DATA_WINNER ) ); assertEquals( "compile", loser.getData().get( ConflictResolver.NODE_DATA_ORIGINAL_SCOPE ) ); assertEquals( false, loser.getData().get( ConflictResolver.NODE_DATA_ORIGINAL_OPTIONALITY ) ); } } RootQueueTest.java000066400000000000000000000060031245546356100344470ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import org.eclipse.aether.util.graph.transformer.ConflictIdSorter.ConflictId; import org.eclipse.aether.util.graph.transformer.ConflictIdSorter.RootQueue; import org.junit.Test; public class RootQueueTest { @Test public void testIsEmpty() { ConflictId id = new ConflictId( "a", 0 ); RootQueue queue = new RootQueue( 10 ); assertTrue( queue.isEmpty() ); queue.add( id ); assertFalse( queue.isEmpty() ); assertSame( id, queue.remove() ); assertTrue( queue.isEmpty() ); } @Test public void testAddSortsByDepth() { ConflictId id1 = new ConflictId( "a", 0 ); ConflictId id2 = new ConflictId( "b", 1 ); ConflictId id3 = new ConflictId( "c", 2 ); ConflictId id4 = new ConflictId( "d", 3 ); RootQueue queue = new RootQueue( 10 ); queue.add( id1 ); queue.add( id2 ); queue.add( id3 ); queue.add( id4 ); assertSame( id1, queue.remove() ); assertSame( id2, queue.remove() ); assertSame( id3, queue.remove() ); assertSame( id4, queue.remove() ); queue = new RootQueue( 10 ); queue.add( id4 ); queue.add( id3 ); queue.add( id2 ); queue.add( id1 ); assertSame( id1, queue.remove() ); assertSame( id2, queue.remove() ); assertSame( id3, queue.remove() ); assertSame( id4, queue.remove() ); } @Test public void testAddWithArrayCompact() { ConflictId id = new ConflictId( "a", 0 ); RootQueue queue = new RootQueue( 10 ); assertTrue( queue.isEmpty() ); queue.add( id ); assertFalse( queue.isEmpty() ); assertSame( id, queue.remove() ); assertTrue( queue.isEmpty() ); queue.add( id ); assertFalse( queue.isEmpty() ); assertSame( id, queue.remove() ); assertTrue( queue.isEmpty() ); } @Test public void testAddMinimumAfterSomeRemoves() { ConflictId id1 = new ConflictId( "a", 0 ); ConflictId id2 = new ConflictId( "b", 1 ); ConflictId id3 = new ConflictId( "c", 2 ); RootQueue queue = new RootQueue( 10 ); queue.add( id2 ); queue.add( id3 ); assertSame( id2, queue.remove() ); queue.add( id1 ); assertSame( id1, queue.remove() ); assertSame( id3, queue.remove() ); assertTrue( queue.isEmpty() ); } } SimpleConflictMarker.java000066400000000000000000000047131245546356100357420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import java.util.IdentityHashMap; import java.util.Map; import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; /** * Set "groupId:artId:classifier:extension" as conflict marker for every node. */ class SimpleConflictMarker implements DependencyGraphTransformer { public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) throws RepositoryException { @SuppressWarnings( "unchecked" ) Map conflictIds = (Map) context.get( TransformationContextKeys.CONFLICT_IDS ); if ( conflictIds == null ) { conflictIds = new IdentityHashMap(); context.put( TransformationContextKeys.CONFLICT_IDS, conflictIds ); } mark( node, conflictIds ); return node; } private void mark( DependencyNode node, Map conflictIds ) { Dependency dependency = node.getDependency(); if ( dependency != null ) { Artifact artifact = dependency.getArtifact(); String key = String.format( "%s:%s:%s:%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), artifact.getExtension() ); if ( conflictIds.put( node, key ) != null ) { return; } } for ( DependencyNode child : node.getChildren() ) { mark( child, conflictIds ); } } } SimpleOptionalitySelectorTest.java000066400000000000000000000054441245546356100377150ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyGraphTransformer; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class SimpleOptionalitySelectorTest extends AbstractDependencyGraphTransformerTest { @Override protected DependencyGraphTransformer newTransformer() { return new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(), new SimpleOptionalitySelector(), new JavaScopeDeriver() ); } @Override protected DependencyGraphParser newParser() { return new DependencyGraphParser( "transformer/optionality-selector/" ); } @Test public void testDeriveOptionality() throws Exception { DependencyNode root = parseResource( "derive.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( true, root.getChildren().get( 0 ).getDependency().isOptional() ); assertEquals( true, root.getChildren().get( 0 ).getChildren().get( 0 ).getDependency().isOptional() ); assertEquals( false, root.getChildren().get( 1 ).getDependency().isOptional() ); assertEquals( false, root.getChildren().get( 1 ).getChildren().get( 0 ).getDependency().isOptional() ); } @Test public void testResolveOptionalityConflict_NonOptionalWins() throws Exception { DependencyNode root = parseResource( "conflict.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( true, root.getChildren().get( 0 ).getDependency().isOptional() ); assertEquals( false, root.getChildren().get( 0 ).getChildren().get( 0 ).getDependency().isOptional() ); } @Test public void testResolveOptionalityConflict_DirectDeclarationWins() throws Exception { DependencyNode root = parseResource( "conflict-direct-dep.txt" ); assertSame( root, transform( root ) ); assertEquals( 2, root.getChildren().size() ); assertEquals( true, root.getChildren().get( 1 ).getDependency().isOptional() ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/000077500000000000000000000000001245546356100305475ustar00rootroot00000000000000AndDependencyTraverserTest.java000066400000000000000000000126671245546356100366060ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; import org.junit.Test; public class AndDependencyTraverserTest { static class DummyDependencyTraverser implements DependencyTraverser { private final boolean traverse; private final DependencyTraverser child; public DummyDependencyTraverser() { this( true ); } public DummyDependencyTraverser( boolean traverse ) { this.traverse = traverse; this.child = this; } public DummyDependencyTraverser( boolean traverse, DependencyTraverser child ) { this.traverse = traverse; this.child = child; } public boolean traverseDependency( Dependency dependency ) { return traverse; } public DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ) { return child; } } @Test public void testNewInstance() { assertNull( AndDependencyTraverser.newInstance( null, null ) ); DependencyTraverser traverser = new DummyDependencyTraverser(); assertSame( traverser, AndDependencyTraverser.newInstance( traverser, null ) ); assertSame( traverser, AndDependencyTraverser.newInstance( null, traverser ) ); assertSame( traverser, AndDependencyTraverser.newInstance( traverser, traverser ) ); assertNotNull( AndDependencyTraverser.newInstance( traverser, new DummyDependencyTraverser() ) ); } @Test public void testTraverseDependency() { Dependency dependency = new Dependency( new DefaultArtifact( "g:a:v:1" ), "runtime" ); DependencyTraverser traverser = new AndDependencyTraverser(); assertTrue( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( false ), new DummyDependencyTraverser( false ) ); assertFalse( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( true ), new DummyDependencyTraverser( false ) ); assertFalse( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( true ), new DummyDependencyTraverser( true ) ); assertTrue( traverser.traverseDependency( dependency ) ); } @Test public void testDeriveChildTraverser_Unchanged() { DependencyTraverser other1 = new DummyDependencyTraverser( true ); DependencyTraverser other2 = new DummyDependencyTraverser( false ); DependencyTraverser traverser = new AndDependencyTraverser( other1, other2 ); assertSame( traverser, traverser.deriveChildTraverser( null ) ); } @Test public void testDeriveChildTraverser_OneRemaining() { DependencyTraverser other1 = new DummyDependencyTraverser( true ); DependencyTraverser other2 = new DummyDependencyTraverser( false, null ); DependencyTraverser traverser = new AndDependencyTraverser( other1, other2 ); assertSame( other1, traverser.deriveChildTraverser( null ) ); } @Test public void testDeriveChildTraverser_ZeroRemaining() { DependencyTraverser other1 = new DummyDependencyTraverser( true, null ); DependencyTraverser other2 = new DummyDependencyTraverser( false, null ); DependencyTraverser traverser = new AndDependencyTraverser( other1, other2 ); assertNull( traverser.deriveChildTraverser( null ) ); } @Test public void testEquals() { DependencyTraverser other1 = new DummyDependencyTraverser( true ); DependencyTraverser other2 = new DummyDependencyTraverser( false ); DependencyTraverser traverser1 = new AndDependencyTraverser( other1, other2 ); DependencyTraverser traverser2 = new AndDependencyTraverser( other2, other1 ); DependencyTraverser traverser3 = new AndDependencyTraverser( other1 ); assertEquals( traverser1, traverser1 ); assertEquals( traverser1, traverser2 ); assertNotEquals( traverser1, traverser3 ); assertNotEquals( traverser1, this ); assertNotEquals( traverser1, null ); } @Test public void testHashCode() { DependencyTraverser other1 = new DummyDependencyTraverser( true ); DependencyTraverser other2 = new DummyDependencyTraverser( false ); DependencyTraverser traverser1 = new AndDependencyTraverser( other1, other2 ); DependencyTraverser traverser2 = new AndDependencyTraverser( other2, other1 ); assertEquals( traverser1.hashCode(), traverser2.hashCode() ); } } FatArtifactTraverserTest.java000066400000000000000000000052511245546356100362640ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import static org.junit.Assert.*; import java.util.Collections; import java.util.Map; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; import org.junit.Test; public class FatArtifactTraverserTest { @Test public void testTraverseDependency() { DependencyTraverser traverser = new FatArtifactTraverser(); Map props = null; assertTrue( traverser.traverseDependency( new Dependency( new DefaultArtifact( "g:a:v:1", props ), "test" ) ) ); props = Collections.singletonMap( ArtifactProperties.INCLUDES_DEPENDENCIES, "false" ); assertTrue( traverser.traverseDependency( new Dependency( new DefaultArtifact( "g:a:v:1", props ), "test" ) ) ); props = Collections.singletonMap( ArtifactProperties.INCLUDES_DEPENDENCIES, "unrecognized" ); assertTrue( traverser.traverseDependency( new Dependency( new DefaultArtifact( "g:a:v:1", props ), "test" ) ) ); props = Collections.singletonMap( ArtifactProperties.INCLUDES_DEPENDENCIES, "true" ); assertFalse( traverser.traverseDependency( new Dependency( new DefaultArtifact( "g:a:v:1", props ), "test" ) ) ); } @Test public void testDeriveChildTraverser() { DependencyTraverser traverser = new FatArtifactTraverser(); assertSame( traverser, traverser.deriveChildTraverser( null ) ); } @Test public void testEquals() { DependencyTraverser traverser1 = new FatArtifactTraverser(); DependencyTraverser traverser2 = new FatArtifactTraverser(); assertEquals( traverser1, traverser1 ); assertEquals( traverser1, traverser2 ); assertNotEquals( traverser1, this ); assertNotEquals( traverser1, null ); } @Test public void testHashCode() { DependencyTraverser traverser1 = new FatArtifactTraverser(); DependencyTraverser traverser2 = new FatArtifactTraverser(); assertEquals( traverser1.hashCode(), traverser2.hashCode() ); } } StaticDependencyTraverserTest.java000066400000000000000000000043661245546356100373300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/******************************************************************************* * Copyright (c) 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; import org.junit.Test; public class StaticDependencyTraverserTest { @Test public void testTraverseDependency() { Dependency dependency = new Dependency( new DefaultArtifact( "g:a:v:1" ), "runtime" ); DependencyTraverser traverser = new StaticDependencyTraverser( true ); assertTrue( traverser.traverseDependency( dependency ) ); traverser = new StaticDependencyTraverser( false ); assertFalse( traverser.traverseDependency( dependency ) ); } @Test public void testDeriveChildTraverser() { DependencyTraverser traverser = new StaticDependencyTraverser( true ); assertSame( traverser, traverser.deriveChildTraverser( null ) ); } @Test public void testEquals() { DependencyTraverser traverser1 = new StaticDependencyTraverser( true ); DependencyTraverser traverser2 = new StaticDependencyTraverser( true ); DependencyTraverser traverser3 = new StaticDependencyTraverser( false ); assertEquals( traverser1, traverser1 ); assertEquals( traverser1, traverser2 ); assertNotEquals( traverser1, traverser3 ); assertNotEquals( traverser1, this ); assertNotEquals( traverser1, null ); } @Test public void testHashCode() { DependencyTraverser traverser1 = new StaticDependencyTraverser( true ); DependencyTraverser traverser2 = new StaticDependencyTraverser( true ); assertEquals( traverser1.hashCode(), traverser2.hashCode() ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/000077500000000000000000000000001245546356100304025ustar00rootroot00000000000000AbstractVersionFilterTest.java000066400000000000000000000061331245546356100363100ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.versions; import static org.junit.Assert.*; import java.util.Iterator; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResult; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionScheme; import org.junit.After; import org.junit.Before; public abstract class AbstractVersionFilterTest { protected DefaultRepositorySystemSession session; @Before public void setUp() { session = TestUtils.newSession(); } @After public void tearDown() { session = null; } protected VersionFilter.VersionFilterContext newContext( String gav, String... versions ) { VersionRangeRequest request = new VersionRangeRequest(); request.setArtifact( new DefaultArtifact( gav ) ); VersionRangeResult result = new VersionRangeResult( request ); VersionScheme scheme = new GenericVersionScheme(); try { result.setVersionConstraint( scheme.parseVersionConstraint( request.getArtifact().getVersion() ) ); for ( String version : versions ) { result.addVersion( scheme.parseVersion( version ) ); } } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( e ); } return TestUtils.newVersionFilterContext( session, result ); } protected VersionFilter derive( VersionFilter filter, String gav ) { return filter.deriveChildFilter( TestUtils.newCollectionContext( session, new Dependency( new DefaultArtifact( gav ), "" ), null ) ); } protected void assertVersions( VersionFilter.VersionFilterContext context, String... versions ) { assertEquals( versions.length, context.getCount() ); Iterator it = context.iterator(); for ( String version : versions ) { assertTrue( it.hasNext() ); assertEquals( version, it.next().toString() ); } } } ChainedVersionFilterTest.java000066400000000000000000000053351245546356100361030ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.versions; import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; import org.eclipse.aether.util.graph.version.ChainedVersionFilter; import org.eclipse.aether.util.graph.version.HighestVersionFilter; import org.eclipse.aether.util.graph.version.SnapshotVersionFilter; import org.junit.Test; public class ChainedVersionFilterTest extends AbstractVersionFilterTest { @Test public void testFilterVersions() throws Exception { VersionFilter filter = ChainedVersionFilter.newInstance( new SnapshotVersionFilter(), new HighestVersionFilter() ); VersionFilterContext ctx = newContext( "g:a:[1,9]", "1", "2", "3-SNAPSHOT" ); filter.filterVersions( ctx ); assertVersions( ctx, "2" ); } @Test public void testDeriveChildFilter() { VersionFilter filter1 = new HighestVersionFilter(); VersionFilter filter2 = new VersionFilter() { public void filterVersions( VersionFilterContext context ) { } public VersionFilter deriveChildFilter( DependencyCollectionContext context ) { return null; } }; VersionFilter filter = ChainedVersionFilter.newInstance( filter1 ); assertSame( filter, derive( filter, "g:a:1" ) ); filter = ChainedVersionFilter.newInstance( filter2 ); assertSame( null, derive( filter, "g:a:1" ) ); filter = ChainedVersionFilter.newInstance( filter1, filter2 ); assertSame( filter1, derive( filter, "g:a:1" ) ); filter = ChainedVersionFilter.newInstance( filter2, filter1 ); assertSame( filter1, derive( filter, "g:a:1" ) ); } @Test public void testEquals() { VersionFilter filter = ChainedVersionFilter.newInstance( new HighestVersionFilter() ); assertFalse( filter.equals( null ) ); assertTrue( filter.equals( filter ) ); assertTrue( filter.equals( ChainedVersionFilter.newInstance( new HighestVersionFilter() ) ) ); } } ContextualSnapshotVersionFilterTest.java000066400000000000000000000047351245546356100404210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.versions; import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; import org.eclipse.aether.util.graph.version.ContextualSnapshotVersionFilter; import org.eclipse.aether.util.graph.version.SnapshotVersionFilter; import org.junit.Test; public class ContextualSnapshotVersionFilterTest extends AbstractVersionFilterTest { @Test public void testFilterVersions() throws Exception { VersionFilter filter = new ContextualSnapshotVersionFilter(); VersionFilterContext ctx = newContext( "g:a:[1,9]", "1", "2-SNAPSHOT" ); filter.filterVersions( ctx ); assertVersions( ctx, "1", "2-SNAPSHOT" ); ctx = newContext( "g:a:[1,9]", "1", "2-SNAPSHOT" ); derive( filter, "g:a:1" ).filterVersions( ctx ); assertVersions( ctx, "1" ); ctx = newContext( "g:a:[1,9]", "1", "2-SNAPSHOT" ); session.setConfigProperty( ContextualSnapshotVersionFilter.CONFIG_PROP_ENABLE, "true" ); derive( filter, "g:a:1-SNAPSHOT" ).filterVersions( ctx ); assertVersions( ctx, "1" ); } @Test public void testDeriveChildFilter() { ContextualSnapshotVersionFilter filter = new ContextualSnapshotVersionFilter(); assertTrue( derive( filter, "g:a:1" ) instanceof SnapshotVersionFilter ); assertSame( null, derive( filter, "g:a:1-SNAPSHOT" ) ); session.setConfigProperty( ContextualSnapshotVersionFilter.CONFIG_PROP_ENABLE, "true" ); assertTrue( derive( filter, "g:a:1-SNAPSHOT" ) instanceof SnapshotVersionFilter ); } @Test public void testEquals() { ContextualSnapshotVersionFilter filter = new ContextualSnapshotVersionFilter(); assertFalse( filter.equals( null ) ); assertTrue( filter.equals( filter ) ); assertTrue( filter.equals( new ContextualSnapshotVersionFilter() ) ); } } HighestVersionFilterTest.java000066400000000000000000000031241245546356100361350ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.versions; import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; import org.eclipse.aether.util.graph.version.HighestVersionFilter; import org.junit.Test; public class HighestVersionFilterTest extends AbstractVersionFilterTest { @Test public void testFilterVersions() { HighestVersionFilter filter = new HighestVersionFilter(); VersionFilterContext ctx = newContext( "g:a:[1,9]", "1", "2", "3", "4", "5", "6", "7", "8", "9" ); filter.filterVersions( ctx ); assertVersions( ctx, "9" ); } @Test public void testDeriveChildFilter() { HighestVersionFilter filter = new HighestVersionFilter(); assertSame( filter, derive( filter, "g:a:1" ) ); } @Test public void testEquals() { HighestVersionFilter filter = new HighestVersionFilter(); assertFalse( filter.equals( null ) ); assertTrue( filter.equals( filter ) ); assertTrue( filter.equals( new HighestVersionFilter() ) ); } } SnapshotVersionFilterTest.java000066400000000000000000000031631245546356100363440ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.versions; import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; import org.eclipse.aether.util.graph.version.SnapshotVersionFilter; import org.junit.Test; public class SnapshotVersionFilterTest extends AbstractVersionFilterTest { @Test public void testFilterVersions() { SnapshotVersionFilter filter = new SnapshotVersionFilter(); VersionFilterContext ctx = newContext( "g:a:[1,9]", "1", "2-SNAPSHOT", "3.1", "4.0-SNAPSHOT", "5.0.0" ); filter.filterVersions( ctx ); assertVersions( ctx, "1", "3.1", "5.0.0" ); } @Test public void testDeriveChildFilter() { SnapshotVersionFilter filter = new SnapshotVersionFilter(); assertSame( filter, derive( filter, "g:a:1" ) ); } @Test public void testEquals() { SnapshotVersionFilter filter = new SnapshotVersionFilter(); assertFalse( filter.equals( null ) ); assertTrue( filter.equals( filter ) ); assertTrue( filter.equals( new SnapshotVersionFilter() ) ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/000077500000000000000000000000001245546356100302315ustar00rootroot00000000000000FilteringDependencyVisitorTest.java000066400000000000000000000036201245546356100371600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import static org.junit.Assert.*; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class FilteringDependencyVisitorTest { private DependencyNode parse( String resource ) throws Exception { return new DependencyGraphParser( "visitor/filtering/" ).parseResource( resource ); } @Test public void testFilterCalledWithProperParentStack() throws Exception { DependencyNode root = parse( "parents.txt" ); final StringBuilder buffer = new StringBuilder( 256 ); DependencyFilter filter = new DependencyFilter() { public boolean accept( DependencyNode node, List parents ) { for ( DependencyNode parent : parents ) { buffer.append( parent.getDependency().getArtifact().getArtifactId() ); } buffer.append( "," ); return false; } }; FilteringDependencyVisitor visitor = new FilteringDependencyVisitor( new PreorderNodeListGenerator(), filter ); root.accept( visitor ); assertEquals( ",a,ba,cba,a,ea,", buffer.toString() ); } } PathRecordingDependencyVisitorTest.java000066400000000000000000000114161245546356100377700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import static org.junit.Assert.*; import java.util.List; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class PathRecordingDependencyVisitorTest { private DependencyNode parse( String resource ) throws Exception { return new DependencyGraphParser( "visitor/path-recorder/" ).parseResource( resource ); } private void assertPath( List actual, String... expected ) { assertEquals( actual.toString(), expected.length, actual.size() ); for ( int i = 0; i < expected.length; i++ ) { DependencyNode node = actual.get( i ); assertEquals( actual.toString(), expected[i], node.getDependency().getArtifact().getArtifactId() ); } } @Test public void testGetPaths_RecordsMatchesBeneathUnmatchedParents() throws Exception { DependencyNode root = parse( "simple.txt" ); PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( new ArtifactMatcher() ); root.accept( visitor ); List> paths = visitor.getPaths(); assertEquals( paths.toString(), 2, paths.size() ); assertPath( paths.get( 0 ), "a", "b", "x" ); assertPath( paths.get( 1 ), "a", "x" ); } @Test public void testGetPaths_DoesNotRecordMatchesBeneathMatchedParents() throws Exception { DependencyNode root = parse( "nested.txt" ); PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( new ArtifactMatcher() ); root.accept( visitor ); List> paths = visitor.getPaths(); assertEquals( paths.toString(), 1, paths.size() ); assertPath( paths.get( 0 ), "x" ); } @Test public void testGetPaths_RecordsMatchesBeneathMatchedParentsIfRequested() throws Exception { DependencyNode root = parse( "nested.txt" ); PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( new ArtifactMatcher(), false ); root.accept( visitor ); List> paths = visitor.getPaths(); assertEquals( paths.toString(), 3, paths.size() ); assertPath( paths.get( 0 ), "x" ); assertPath( paths.get( 1 ), "x", "a", "y" ); assertPath( paths.get( 2 ), "x", "y" ); } @Test public void testFilterCalledWithProperParentStack() throws Exception { DependencyNode root = parse( "parents.txt" ); final StringBuilder buffer = new StringBuilder( 256 ); DependencyFilter filter = new DependencyFilter() { public boolean accept( DependencyNode node, List parents ) { for ( DependencyNode parent : parents ) { buffer.append( parent.getDependency().getArtifact().getArtifactId() ); } buffer.append( "," ); return false; } }; PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( filter ); root.accept( visitor ); assertEquals( ",a,ba,cba,a,ea,", buffer.toString() ); } @Test public void testGetPaths_HandlesCycles() throws Exception { DependencyNode root = parse( "cycle.txt" ); PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( new ArtifactMatcher(), false ); root.accept( visitor ); List> paths = visitor.getPaths(); assertEquals( paths.toString(), 4, paths.size() ); assertPath( paths.get( 0 ), "a", "b", "x" ); assertPath( paths.get( 1 ), "a", "x" ); assertPath( paths.get( 2 ), "a", "x", "b", "x" ); assertPath( paths.get( 3 ), "a", "x", "x" ); } private static class ArtifactMatcher implements DependencyFilter { public boolean accept( DependencyNode node, List parents ) { return node.getDependency() != null && node.getDependency().getArtifact().getGroupId().equals( "match" ); } } } PostorderNodeListGeneratorTest.java000066400000000000000000000040111245546356100371430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import static org.junit.Assert.*; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class PostorderNodeListGeneratorTest { private DependencyNode parse( String resource ) throws Exception { return new DependencyGraphParser( "visitor/ordered-list/" ).parseResource( resource ); } private void assertSequence( List actual, String... expected ) { assertEquals( actual.toString(), expected.length, actual.size() ); for ( int i = 0; i < expected.length; i++ ) { DependencyNode node = actual.get( i ); assertEquals( actual.toString(), expected[i], node.getDependency().getArtifact().getArtifactId() ); } } @Test public void testOrdering() throws Exception { DependencyNode root = parse( "simple.txt" ); PostorderNodeListGenerator visitor = new PostorderNodeListGenerator(); root.accept( visitor ); assertSequence( visitor.getNodes(), "c", "b", "e", "d", "a" ); } @Test public void testDuplicateSuppression() throws Exception { DependencyNode root = parse( "cycles.txt" ); PostorderNodeListGenerator visitor = new PostorderNodeListGenerator(); root.accept( visitor ); assertSequence( visitor.getNodes(), "c", "b", "e", "d", "a" ); } } PreorderNodeListGeneratorTest.java000066400000000000000000000040041245546356100367460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import static org.junit.Assert.*; import java.util.List; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class PreorderNodeListGeneratorTest { private DependencyNode parse( String resource ) throws Exception { return new DependencyGraphParser( "visitor/ordered-list/" ).parseResource( resource ); } private void assertSequence( List actual, String... expected ) { assertEquals( actual.toString(), expected.length, actual.size() ); for ( int i = 0; i < expected.length; i++ ) { DependencyNode node = actual.get( i ); assertEquals( actual.toString(), expected[i], node.getDependency().getArtifact().getArtifactId() ); } } @Test public void testOrdering() throws Exception { DependencyNode root = parse( "simple.txt" ); PreorderNodeListGenerator visitor = new PreorderNodeListGenerator(); root.accept( visitor ); assertSequence( visitor.getNodes(), "a", "b", "c", "d", "e" ); } @Test public void testDuplicateSuppression() throws Exception { DependencyNode root = parse( "cycles.txt" ); PreorderNodeListGenerator visitor = new PreorderNodeListGenerator(); root.accept( visitor ); assertSequence( visitor.getNodes(), "a", "b", "c", "d", "e" ); } } TreeDependencyVisitorTest.java000066400000000000000000000036721245546356100361430ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; import static org.junit.Assert.*; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.junit.Test; public class TreeDependencyVisitorTest { private DependencyNode parse( String resource ) throws Exception { return new DependencyGraphParser( "visitor/tree/" ).parseResource( resource ); } @Test public void testDuplicateSuppression() throws Exception { DependencyNode root = parse( "cycles.txt" ); RecordingVisitor rec = new RecordingVisitor(); TreeDependencyVisitor visitor = new TreeDependencyVisitor( rec ); root.accept( visitor ); assertEquals( ">a >b >c d ' ).append( node.getDependency().getArtifact().getArtifactId() ).append( ' ' ); return true; } public boolean visitLeave( DependencyNode node ) { buffer.append( '<' ).append( node.getDependency().getArtifact().getArtifactId() ).append( ' ' ); return true; } } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/listener/000077500000000000000000000000001245546356100272565ustar00rootroot00000000000000ChainedRepositoryListenerTest.java000066400000000000000000000023021245546356100360400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/listener/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.listener; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.eclipse.aether.RepositoryListener; import org.eclipse.aether.util.listener.ChainedRepositoryListener; import org.junit.Test; /** */ public class ChainedRepositoryListenerTest { @Test public void testAllEventTypesHandled() throws Exception { for ( Method method : RepositoryListener.class.getMethods() ) { assertNotNull( ChainedRepositoryListener.class.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); } } } ChainedTransferListenerTest.java000066400000000000000000000022771245546356100354600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/listener/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.listener; import static org.junit.Assert.*; import java.lang.reflect.Method; import org.eclipse.aether.transfer.TransferListener; import org.eclipse.aether.util.listener.ChainedTransferListener; import org.junit.Test; /** */ public class ChainedTransferListenerTest { @Test public void testAllEventTypesHandled() throws Exception { for ( Method method : TransferListener.class.getMethods() ) { assertNotNull( ChainedTransferListener.class.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); } } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/000077500000000000000000000000001245546356100276505ustar00rootroot00000000000000ComponentAuthenticationTest.java000066400000000000000000000066151245546356100361460ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Test; public class ComponentAuthenticationTest { private static class Component { } private RepositorySystemSession newSession() { return new DefaultRepositorySystemSession(); } private RemoteRepository newRepo( Authentication auth ) { return new RemoteRepository.Builder( "test", "default", "http://localhost" ).setAuthentication( auth ).build(); } private AuthenticationContext newContext( Authentication auth ) { return AuthenticationContext.forRepository( newSession(), newRepo( auth ) ); } private String newDigest( Authentication auth ) { return AuthenticationDigest.forRepository( newSession(), newRepo( auth ) ); } @Test public void testFill() { Component comp = new Component(); Authentication auth = new ComponentAuthentication( "key", comp ); AuthenticationContext context = newContext( auth ); assertEquals( null, context.get( "another-key" ) ); assertSame( comp, context.get( "key", Component.class ) ); } @Test public void testDigest() { Authentication auth1 = new ComponentAuthentication( "key", new Component() ); Authentication auth2 = new ComponentAuthentication( "key", new Component() ); String digest1 = newDigest( auth1 ); String digest2 = newDigest( auth2 ); assertEquals( digest1, digest2 ); Authentication auth3 = new ComponentAuthentication( "key", new Object() ); String digest3 = newDigest( auth3 ); assertFalse( digest3.equals( digest1 ) ); Authentication auth4 = new ComponentAuthentication( "Key", new Component() ); String digest4 = newDigest( auth4 ); assertFalse( digest4.equals( digest1 ) ); } @Test public void testEquals() { Authentication auth1 = new ComponentAuthentication( "key", new Component() ); Authentication auth2 = new ComponentAuthentication( "key", new Component() ); Authentication auth3 = new ComponentAuthentication( "key", new Object() ); assertEquals( auth1, auth2 ); assertFalse( auth1.equals( auth3 ) ); assertFalse( auth1.equals( null ) ); } @Test public void testHashCode() { Authentication auth1 = new ComponentAuthentication( "key", new Component() ); Authentication auth2 = new ComponentAuthentication( "key", new Component() ); assertEquals( auth1.hashCode(), auth2.hashCode() ); } } DefaultProxySelectorTest.java000066400000000000000000000043571245546356100354340ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2010, 2014 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import static org.junit.Assert.*; import org.eclipse.aether.util.repository.DefaultProxySelector; import org.junit.Test; /** */ public class DefaultProxySelectorTest { private boolean isNonProxyHost( String host, String nonProxyHosts ) { return new DefaultProxySelector.NonProxyHosts( nonProxyHosts ).isNonProxyHost( host ); } @Test public void testIsNonProxyHost_Blank() { assertFalse( isNonProxyHost( "www.eclipse.org", null ) ); assertFalse( isNonProxyHost( "www.eclipse.org", "" ) ); } @Test public void testIsNonProxyHost_Wildcard() { assertTrue( isNonProxyHost( "www.eclipse.org", "*" ) ); assertTrue( isNonProxyHost( "www.eclipse.org", "*.org" ) ); assertFalse( isNonProxyHost( "www.eclipse.org", "*.com" ) ); assertTrue( isNonProxyHost( "www.eclipse.org", "www.*" ) ); assertTrue( isNonProxyHost( "www.eclipse.org", "www.*.org" ) ); } @Test public void testIsNonProxyHost_Multiple() { assertTrue( isNonProxyHost( "eclipse.org", "eclipse.org|host2" ) ); assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org" ) ); assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org|host2" ) ); } @Test public void testIsNonProxyHost_Misc() { assertFalse( isNonProxyHost( "www.eclipse.org", "www.eclipse.com" ) ); assertFalse( isNonProxyHost( "www.eclipse.org", "eclipse.org" ) ); } @Test public void testIsNonProxyHost_CaseInsensitivity() { assertTrue( isNonProxyHost( "www.eclipse.org", "www.ECLIPSE.org" ) ); assertTrue( isNonProxyHost( "www.ECLIPSE.org", "www.eclipse.org" ) ); } } JreProxySelectorTest.java000066400000000000000000000137111245546356100345620ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import static org.junit.Assert.*; import java.io.IOException; import java.net.Authenticator; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.SocketAddress; import java.net.URI; import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; import org.junit.After; import org.junit.Before; import org.junit.Test; public class JreProxySelectorTest { private abstract class AbstractProxySelector extends java.net.ProxySelector { @Override public void connectFailed( URI uri, SocketAddress sa, IOException ioe ) { } } private ProxySelector selector = new JreProxySelector(); private java.net.ProxySelector original; @Before public void init() { original = java.net.ProxySelector.getDefault(); } @After public void exit() { java.net.ProxySelector.setDefault( original ); Authenticator.setDefault( null ); } @Test public void testGetProxy_InvalidUrl() throws Exception { RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "http://host:invalid" ).build(); assertNull( selector.getProxy( repo ) ); } @Test public void testGetProxy_OpaqueUrl() throws Exception { RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "classpath:base" ).build(); assertNull( selector.getProxy( repo ) ); } @Test public void testGetProxy_NullSelector() throws Exception { RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "http://repo.eclipse.org/" ).build(); java.net.ProxySelector.setDefault( null ); assertNull( selector.getProxy( repo ) ); } @Test public void testGetProxy_NoProxies() throws Exception { RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "http://repo.eclipse.org/" ).build(); java.net.ProxySelector.setDefault( new AbstractProxySelector() { @Override public List select( URI uri ) { return Collections.emptyList(); } } ); assertNull( selector.getProxy( repo ) ); } @Test public void testGetProxy_DirectProxy() throws Exception { RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "http://repo.eclipse.org/" ).build(); final InetSocketAddress addr = InetSocketAddress.createUnresolved( "proxy", 8080 ); java.net.ProxySelector.setDefault( new AbstractProxySelector() { @Override public List select( URI uri ) { return Arrays.asList( java.net.Proxy.NO_PROXY, new java.net.Proxy( java.net.Proxy.Type.HTTP, addr ) ); } } ); assertNull( selector.getProxy( repo ) ); } @Test public void testGetProxy_HttpProxy() throws Exception { final RemoteRepository repo = new RemoteRepository.Builder( "test", "default", "http://repo.eclipse.org/" ).build(); final URL url = new URL( repo.getUrl() ); final InetSocketAddress addr = InetSocketAddress.createUnresolved( "proxy", 8080 ); java.net.ProxySelector.setDefault( new AbstractProxySelector() { @Override public List select( URI uri ) { if ( repo.getHost().equalsIgnoreCase( uri.getHost() ) ) { return Arrays.asList( new java.net.Proxy( java.net.Proxy.Type.HTTP, addr ) ); } return Collections.emptyList(); } } ); Authenticator.setDefault( new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { if ( Authenticator.RequestorType.PROXY.equals( getRequestorType() ) && addr.getHostName().equals( getRequestingHost() ) && addr.getPort() == getRequestingPort() && url.equals( getRequestingURL() ) ) { return new PasswordAuthentication( "proxyuser", "proxypass".toCharArray() ); } return super.getPasswordAuthentication(); } } ); Proxy proxy = selector.getProxy( repo ); assertNotNull( proxy ); assertEquals( addr.getHostName(), proxy.getHost() ); assertEquals( addr.getPort(), proxy.getPort() ); assertEquals( Proxy.TYPE_HTTP, proxy.getType() ); RemoteRepository repo2 = new RemoteRepository.Builder( repo ).setProxy( proxy ).build(); Authentication auth = proxy.getAuthentication(); assertNotNull( auth ); AuthenticationContext authCtx = AuthenticationContext.forProxy( new DefaultRepositorySystemSession(), repo2 ); assertEquals( "proxyuser", authCtx.get( AuthenticationContext.USERNAME ) ); assertEquals( "proxypass", authCtx.get( AuthenticationContext.PASSWORD ) ); } } SecretAuthenticationTest.java000066400000000000000000000066501245546356100354300ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Test; public class SecretAuthenticationTest { private RepositorySystemSession newSession() { return new DefaultRepositorySystemSession(); } private RemoteRepository newRepo( Authentication auth ) { return new RemoteRepository.Builder( "test", "default", "http://localhost" ).setAuthentication( auth ).build(); } private AuthenticationContext newContext( Authentication auth ) { return AuthenticationContext.forRepository( newSession(), newRepo( auth ) ); } private String newDigest( Authentication auth ) { return AuthenticationDigest.forRepository( newSession(), newRepo( auth ) ); } @Test public void testConstructor_CopyChars() { char[] value = { 'v', 'a', 'l' }; new SecretAuthentication( "key", value ); assertArrayEquals( new char[] { 'v', 'a', 'l' }, value ); } @Test public void testFill() { Authentication auth = new SecretAuthentication( "key", "value" ); AuthenticationContext context = newContext( auth ); assertEquals( null, context.get( "another-key" ) ); assertEquals( "value", context.get( "key" ) ); } @Test public void testDigest() { Authentication auth1 = new SecretAuthentication( "key", "value" ); Authentication auth2 = new SecretAuthentication( "key", "value" ); String digest1 = newDigest( auth1 ); String digest2 = newDigest( auth2 ); assertEquals( digest1, digest2 ); Authentication auth3 = new SecretAuthentication( "key", "Value" ); String digest3 = newDigest( auth3 ); assertFalse( digest3.equals( digest1 ) ); Authentication auth4 = new SecretAuthentication( "Key", "value" ); String digest4 = newDigest( auth4 ); assertFalse( digest4.equals( digest1 ) ); } @Test public void testEquals() { Authentication auth1 = new SecretAuthentication( "key", "value" ); Authentication auth2 = new SecretAuthentication( "key", "value" ); Authentication auth3 = new SecretAuthentication( "key", "Value" ); assertEquals( auth1, auth2 ); assertFalse( auth1.equals( auth3 ) ); assertFalse( auth1.equals( null ) ); } @Test public void testHashCode() { Authentication auth1 = new SecretAuthentication( "key", "value" ); Authentication auth2 = new SecretAuthentication( "key", "value" ); assertEquals( auth1.hashCode(), auth2.hashCode() ); } } StringAuthenticationTest.java000066400000000000000000000063071245546356100354500ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/repository/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.repository; import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationContext; import org.eclipse.aether.repository.AuthenticationDigest; import org.eclipse.aether.repository.RemoteRepository; import org.junit.Test; public class StringAuthenticationTest { private RepositorySystemSession newSession() { return new DefaultRepositorySystemSession(); } private RemoteRepository newRepo( Authentication auth ) { return new RemoteRepository.Builder( "test", "default", "http://localhost" ).setAuthentication( auth ).build(); } private AuthenticationContext newContext( Authentication auth ) { return AuthenticationContext.forRepository( newSession(), newRepo( auth ) ); } private String newDigest( Authentication auth ) { return AuthenticationDigest.forRepository( newSession(), newRepo( auth ) ); } @Test public void testFill() { Authentication auth = new StringAuthentication( "key", "value" ); AuthenticationContext context = newContext( auth ); assertEquals( null, context.get( "another-key" ) ); assertEquals( "value", context.get( "key" ) ); } @Test public void testDigest() { Authentication auth1 = new StringAuthentication( "key", "value" ); Authentication auth2 = new StringAuthentication( "key", "value" ); String digest1 = newDigest( auth1 ); String digest2 = newDigest( auth2 ); assertEquals( digest1, digest2 ); Authentication auth3 = new StringAuthentication( "key", "Value" ); String digest3 = newDigest( auth3 ); assertFalse( digest3.equals( digest1 ) ); Authentication auth4 = new StringAuthentication( "Key", "value" ); String digest4 = newDigest( auth4 ); assertFalse( digest4.equals( digest1 ) ); } @Test public void testEquals() { Authentication auth1 = new StringAuthentication( "key", "value" ); Authentication auth2 = new StringAuthentication( "key", "value" ); Authentication auth3 = new StringAuthentication( "key", "Value" ); assertEquals( auth1, auth2 ); assertFalse( auth1.equals( auth3 ) ); assertFalse( auth1.equals( null ) ); } @Test public void testHashCode() { Authentication auth1 = new StringAuthentication( "key", "value" ); Authentication auth2 = new StringAuthentication( "key", "value" ); assertEquals( auth1.hashCode(), auth2.hashCode() ); } } aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/000077500000000000000000000000001245546356100271165ustar00rootroot00000000000000AbstractVersionTest.java000066400000000000000000000052011245546356100336510ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import static org.junit.Assert.assertEquals; import org.eclipse.aether.version.Version; /** */ abstract class AbstractVersionTest { protected static final int X_LT_Y = -1; protected static final int X_EQ_Y = 0; protected static final int X_GT_Y = 1; protected abstract Version newVersion( String version ); protected void assertOrder( int expected, String version1, String version2 ) { Version v1 = newVersion( version1 ); Version v2 = newVersion( version2 ); if ( expected > 0 ) { assertEquals( "expected " + v1 + " > " + v2, 1, Integer.signum( v1.compareTo( v2 ) ) ); assertEquals( "expected " + v2 + " < " + v1, -1, Integer.signum( v2.compareTo( v1 ) ) ); assertEquals( "expected " + v1 + " != " + v2, false, v1.equals( v2 ) ); assertEquals( "expected " + v2 + " != " + v1, false, v2.equals( v1 ) ); } else if ( expected < 0 ) { assertEquals( "expected " + v1 + " < " + v2, -1, Integer.signum( v1.compareTo( v2 ) ) ); assertEquals( "expected " + v2 + " > " + v1, 1, Integer.signum( v2.compareTo( v1 ) ) ); assertEquals( "expected " + v1 + " != " + v2, false, v1.equals( v2 ) ); assertEquals( "expected " + v2 + " != " + v1, false, v2.equals( v1 ) ); } else { assertEquals( "expected " + v1 + " == " + v2, 0, v1.compareTo( v2 ) ); assertEquals( "expected " + v2 + " == " + v1, 0, v2.compareTo( v1 ) ); assertEquals( "expected " + v1 + " == " + v2, true, v1.equals( v2 ) ); assertEquals( "expected " + v2 + " == " + v1, true, v2.equals( v1 ) ); assertEquals( "expected #(" + v1 + ") == #(" + v1 + ")", v1.hashCode(), v2.hashCode() ); } } protected void assertSequence( String... versions ) { for ( int i = 0; i < versions.length - 1; i++ ) { for ( int j = i + 1; j < versions.length; j++ ) { assertOrder( X_LT_Y, versions[i], versions[j] ); } } } } GenericVersionRangeTest.java000066400000000000000000000111531245546356100344420ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import static org.junit.Assert.*; import org.eclipse.aether.util.version.GenericVersion; import org.eclipse.aether.util.version.GenericVersionRange; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; import org.junit.Test; public class GenericVersionRangeTest { private Version newVersion( String version ) { return new GenericVersion( version ); } private VersionRange parseValid( String range ) { try { return new GenericVersionRange( range ); } catch ( InvalidVersionSpecificationException e ) { AssertionError error = new AssertionError( range + " should be valid but failed to parse due to: " + e.getMessage() ); error.initCause( e ); throw error; } } private void parseInvalid( String range ) { try { new GenericVersionRange( range ); fail( range + " should be invalid" ); } catch ( InvalidVersionSpecificationException e ) { assertTrue( true ); } } private void assertContains( VersionRange range, String version ) { assertTrue( range + " should contain " + version, range.containsVersion( newVersion( version ) ) ); } private void assertNotContains( VersionRange range, String version ) { assertFalse( range + " should not contain " + version, range.containsVersion( newVersion( version ) ) ); } @Test public void testLowerBoundInclusiveUpperBoundInclusive() { VersionRange range = parseValid( "[1,2]" ); assertContains( range, "1" ); assertContains( range, "1.1-SNAPSHOT" ); assertContains( range, "2" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testLowerBoundInclusiveUpperBoundExclusive() { VersionRange range = parseValid( "[1.2.3.4.5,1.2.3.4.6)" ); assertContains( range, "1.2.3.4.5" ); assertNotContains( range, "1.2.3.4.6" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testLowerBoundExclusiveUpperBoundInclusive() { VersionRange range = parseValid( "(1a,1b]" ); assertNotContains( range, "1a" ); assertContains( range, "1b" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testLowerBoundExclusiveUpperBoundExclusive() { VersionRange range = parseValid( "(1,3)" ); assertNotContains( range, "1" ); assertContains( range, "2-SNAPSHOT" ); assertNotContains( range, "3" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testSingleVersion() { VersionRange range = parseValid( "[1]" ); assertContains( range, "1" ); assertEquals( range, parseValid( range.toString() ) ); range = parseValid( "[1,1]" ); assertContains( range, "1" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testSingleWildcardVersion() { VersionRange range = parseValid( "[1.2.*]" ); assertContains( range, "1.2-alpha-1" ); assertContains( range, "1.2-SNAPSHOT" ); assertContains( range, "1.2" ); assertContains( range, "1.2.9999999" ); assertNotContains( range, "1.3-rc-1" ); assertEquals( range, parseValid( range.toString() ) ); } @Test public void testMissingOpenCloseDelimiter() { parseInvalid( "1.0" ); } @Test public void testMissingOpenDelimiter() { parseInvalid( "1.0]" ); parseInvalid( "1.0)" ); } @Test public void testMissingCloseDelimiter() { parseInvalid( "[1.0" ); parseInvalid( "(1.0" ); } @Test public void testTooManyVersions() { parseInvalid( "[1,2,3]" ); parseInvalid( "(1,2,3)" ); parseInvalid( "[1,2,3)" ); } } GenericVersionSchemeTest.java000066400000000000000000000065711245546356100346220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import static org.junit.Assert.*; import org.eclipse.aether.util.version.GenericVersion; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.VersionConstraint; import org.junit.Before; import org.junit.Test; /** */ public class GenericVersionSchemeTest { private GenericVersionScheme scheme; @Before public void setUp() throws Exception { scheme = new GenericVersionScheme(); } private InvalidVersionSpecificationException parseInvalid( String constraint ) { try { scheme.parseVersionConstraint( constraint ); fail( "expected exception for constraint " + constraint ); return null; } catch ( InvalidVersionSpecificationException e ) { return e; } } @Test public void testEnumeratedVersions() throws InvalidVersionSpecificationException { VersionConstraint c = scheme.parseVersionConstraint( "1.0" ); assertEquals( "1.0", c.getVersion().toString() ); assertTrue( c.containsVersion( new GenericVersion( "1.0" ) ) ); c = scheme.parseVersionConstraint( "[1.0]" ); assertEquals( null, c.getVersion() ); assertTrue( c.containsVersion( new GenericVersion( "1.0" ) ) ); c = scheme.parseVersionConstraint( "[1.0],[2.0]" ); assertTrue( c.containsVersion( new GenericVersion( "1.0" ) ) ); assertTrue( c.containsVersion( new GenericVersion( "2.0" ) ) ); c = scheme.parseVersionConstraint( "[1.0],[2.0],[3.0]" ); assertContains( c, "1.0", "2.0", "3.0" ); assertNotContains( c, "1.5" ); c = scheme.parseVersionConstraint( "[1,3),(3,5)" ); assertContains( c, "1", "2", "4" ); assertNotContains( c, "3", "5" ); c = scheme.parseVersionConstraint( "[1,3),(3,)" ); assertContains( c, "1", "2", "4" ); assertNotContains( c, "3" ); } private void assertNotContains( VersionConstraint c, String... versions ) { assertContains( String.format( "%s: %%s should not be contained\n", c.toString() ), c, false, versions ); } private void assertContains( String msg, VersionConstraint c, boolean b, String... versions ) { for ( String v : versions ) { assertEquals( String.format( msg, v ), b, c.containsVersion( new GenericVersion( v ) ) ); } } private void assertContains( VersionConstraint c, String... versions ) { assertContains( String.format( "%s: %%s should be contained\n", c.toString() ), c, true, versions ); } @Test public void testInvalid() { parseInvalid( "[1," ); parseInvalid( "[1,2],(3," ); parseInvalid( "[1,2],3" ); } } GenericVersionTest.java000066400000000000000000000267601245546356100334770ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2010, 2011 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import java.util.Locale; import org.eclipse.aether.util.version.GenericVersion; import org.eclipse.aether.version.Version; import org.junit.Test; /** */ public class GenericVersionTest extends AbstractVersionTest { protected Version newVersion( String version ) { return new GenericVersion( version ); } @Test public void testEmptyVersion() { assertOrder( X_EQ_Y, "0", "" ); } @Test public void testNumericOrdering() { assertOrder( X_LT_Y, "2", "10" ); assertOrder( X_LT_Y, "1.2", "1.10" ); assertOrder( X_LT_Y, "1.0.2", "1.0.10" ); assertOrder( X_LT_Y, "1.0.0.2", "1.0.0.10" ); assertOrder( X_LT_Y, "1.0.20101206.111434.1", "1.0.20101206.111435.1" ); assertOrder( X_LT_Y, "1.0.20101206.111434.2", "1.0.20101206.111434.10" ); } @Test public void testDelimiters() { assertOrder( X_EQ_Y, "1.0", "1-0" ); assertOrder( X_EQ_Y, "1.0", "1_0" ); assertOrder( X_EQ_Y, "1.a", "1a" ); } @Test public void testLeadingZerosAreSemanticallyIrrelevant() { assertOrder( X_EQ_Y, "1", "01" ); assertOrder( X_EQ_Y, "1.2", "1.002" ); assertOrder( X_EQ_Y, "1.2.3", "1.2.0003" ); assertOrder( X_EQ_Y, "1.2.3.4", "1.2.3.00004" ); } @Test public void testTrailingZerosAreSemanticallyIrrelevant() { assertOrder( X_EQ_Y, "1", "1.0.0.0.0.0.0.0.0.0.0.0.0.0" ); assertOrder( X_EQ_Y, "1", "1-0-0-0-0-0-0-0-0-0-0-0-0-0" ); assertOrder( X_EQ_Y, "1", "1.0-0.0-0.0-0.0-0.0-0.0-0.0" ); assertOrder( X_EQ_Y, "1", "1.0000000000000" ); assertOrder( X_EQ_Y, "1.0", "1.0.0" ); } @Test public void testTrailingZerosBeforeQualifierAreSemanticallyIrrelevant() { assertOrder( X_EQ_Y, "1.0-ga", "1.0.0-ga" ); assertOrder( X_EQ_Y, "1.0.ga", "1.0.0.ga" ); assertOrder( X_EQ_Y, "1.0ga", "1.0.0ga" ); assertOrder( X_EQ_Y, "1.0-alpha", "1.0.0-alpha" ); assertOrder( X_EQ_Y, "1.0.alpha", "1.0.0.alpha" ); assertOrder( X_EQ_Y, "1.0alpha", "1.0.0alpha" ); assertOrder( X_EQ_Y, "1.0-alpha-snapshot", "1.0.0-alpha-snapshot" ); assertOrder( X_EQ_Y, "1.0.alpha.snapshot", "1.0.0.alpha.snapshot" ); assertOrder( X_EQ_Y, "1.x.0-alpha", "1.x.0.0-alpha" ); assertOrder( X_EQ_Y, "1.x.0.alpha", "1.x.0.0.alpha" ); assertOrder( X_EQ_Y, "1.x.0-alpha-snapshot", "1.x.0.0-alpha-snapshot" ); assertOrder( X_EQ_Y, "1.x.0.alpha.snapshot", "1.x.0.0.alpha.snapshot" ); } @Test public void testTrailingDelimitersAreSemanticallyIrrelevant() { assertOrder( X_EQ_Y, "1", "1............." ); assertOrder( X_EQ_Y, "1", "1-------------" ); assertOrder( X_EQ_Y, "1.0", "1............." ); assertOrder( X_EQ_Y, "1.0", "1-------------" ); } @Test public void testInitialDelimiters() { assertOrder( X_EQ_Y, "0.1", ".1" ); assertOrder( X_EQ_Y, "0.0.1", "..1" ); assertOrder( X_EQ_Y, "0.1", "-1" ); assertOrder( X_EQ_Y, "0.0.1", "--1" ); } @Test public void testConsecutiveDelimiters() { assertOrder( X_EQ_Y, "1.0.1", "1..1" ); assertOrder( X_EQ_Y, "1.0.0.1", "1...1" ); assertOrder( X_EQ_Y, "1.0.1", "1--1" ); assertOrder( X_EQ_Y, "1.0.0.1", "1---1" ); } @Test public void testUnlimitedNumberOfVersionComponents() { assertOrder( X_GT_Y, "1.0.1.2.3.4.5.6.7.8.9.0.1.2.10", "1.0.1.2.3.4.5.6.7.8.9.0.1.2.3" ); } @Test public void testUnlimitedNumberOfDigitsInNumericComponent() { assertOrder( X_GT_Y, "1.1234567890123456789012345678901", "1.123456789012345678901234567891" ); } @Test public void testTransitionFromDigitToLetterAndViceVersaIsEqualivantToDelimiter() { assertOrder( X_EQ_Y, "1alpha10", "1.alpha.10" ); assertOrder( X_EQ_Y, "1alpha10", "1-alpha-10" ); assertOrder( X_GT_Y, "1.alpha10", "1.alpha2" ); assertOrder( X_GT_Y, "10alpha", "1alpha" ); } @Test public void testWellKnownQualifierOrdering() { assertOrder( X_EQ_Y, "1-alpha1", "1-a1" ); assertOrder( X_LT_Y, "1-alpha", "1-beta" ); assertOrder( X_EQ_Y, "1-beta1", "1-b1" ); assertOrder( X_LT_Y, "1-beta", "1-milestone" ); assertOrder( X_EQ_Y, "1-milestone1", "1-m1" ); assertOrder( X_LT_Y, "1-milestone", "1-rc" ); assertOrder( X_EQ_Y, "1-rc", "1-cr" ); assertOrder( X_LT_Y, "1-rc", "1-snapshot" ); assertOrder( X_LT_Y, "1-snapshot", "1" ); assertOrder( X_EQ_Y, "1", "1-ga" ); assertOrder( X_EQ_Y, "1", "1.ga.0.ga" ); assertOrder( X_EQ_Y, "1.0", "1-ga" ); assertOrder( X_EQ_Y, "1", "1-ga.ga" ); assertOrder( X_EQ_Y, "1", "1-ga-ga" ); assertOrder( X_EQ_Y, "A", "A.ga.ga" ); assertOrder( X_EQ_Y, "A", "A-ga-ga" ); assertOrder( X_EQ_Y, "1", "1-final" ); assertOrder( X_LT_Y, "1", "1-sp" ); assertOrder( X_LT_Y, "A.rc.1", "A.ga.1" ); assertOrder( X_GT_Y, "A.sp.1", "A.ga.1" ); assertOrder( X_LT_Y, "A.rc.x", "A.ga.x" ); assertOrder( X_GT_Y, "A.sp.x", "A.ga.x" ); } @Test public void testWellKnownQualifierVersusUnknownQualifierOrdering() { assertOrder( X_GT_Y, "1-abc", "1-alpha" ); assertOrder( X_GT_Y, "1-abc", "1-beta" ); assertOrder( X_GT_Y, "1-abc", "1-milestone" ); assertOrder( X_GT_Y, "1-abc", "1-rc" ); assertOrder( X_GT_Y, "1-abc", "1-snapshot" ); assertOrder( X_GT_Y, "1-abc", "1" ); assertOrder( X_GT_Y, "1-abc", "1-sp" ); } @Test public void testWellKnownSingleCharQualifiersOnlyRecognizedIfImmediatelyFollowedByNumber() { assertOrder( X_GT_Y, "1.0a", "1.0" ); assertOrder( X_GT_Y, "1.0-a", "1.0" ); assertOrder( X_GT_Y, "1.0.a", "1.0" ); assertOrder( X_GT_Y, "1.0b", "1.0" ); assertOrder( X_GT_Y, "1.0-b", "1.0" ); assertOrder( X_GT_Y, "1.0.b", "1.0" ); assertOrder( X_GT_Y, "1.0m", "1.0" ); assertOrder( X_GT_Y, "1.0-m", "1.0" ); assertOrder( X_GT_Y, "1.0.m", "1.0" ); assertOrder( X_LT_Y, "1.0a1", "1.0" ); assertOrder( X_LT_Y, "1.0-a1", "1.0" ); assertOrder( X_LT_Y, "1.0.a1", "1.0" ); assertOrder( X_LT_Y, "1.0b1", "1.0" ); assertOrder( X_LT_Y, "1.0-b1", "1.0" ); assertOrder( X_LT_Y, "1.0.b1", "1.0" ); assertOrder( X_LT_Y, "1.0m1", "1.0" ); assertOrder( X_LT_Y, "1.0-m1", "1.0" ); assertOrder( X_LT_Y, "1.0.m1", "1.0" ); assertOrder( X_GT_Y, "1.0a.1", "1.0" ); assertOrder( X_GT_Y, "1.0a-1", "1.0" ); assertOrder( X_GT_Y, "1.0b.1", "1.0" ); assertOrder( X_GT_Y, "1.0b-1", "1.0" ); assertOrder( X_GT_Y, "1.0m.1", "1.0" ); assertOrder( X_GT_Y, "1.0m-1", "1.0" ); } @Test public void testUnknownQualifierOrdering() { assertOrder( X_LT_Y, "1-abc", "1-abcd" ); assertOrder( X_LT_Y, "1-abc", "1-bcd" ); assertOrder( X_GT_Y, "1-abc", "1-aac" ); } @Test public void testCaseInsensitiveOrderingOfQualifiers() { assertOrder( X_EQ_Y, "1.alpha", "1.ALPHA" ); assertOrder( X_EQ_Y, "1.alpha", "1.Alpha" ); assertOrder( X_EQ_Y, "1.beta", "1.BETA" ); assertOrder( X_EQ_Y, "1.beta", "1.Beta" ); assertOrder( X_EQ_Y, "1.milestone", "1.MILESTONE" ); assertOrder( X_EQ_Y, "1.milestone", "1.Milestone" ); assertOrder( X_EQ_Y, "1.rc", "1.RC" ); assertOrder( X_EQ_Y, "1.rc", "1.Rc" ); assertOrder( X_EQ_Y, "1.cr", "1.CR" ); assertOrder( X_EQ_Y, "1.cr", "1.Cr" ); assertOrder( X_EQ_Y, "1.snapshot", "1.SNAPSHOT" ); assertOrder( X_EQ_Y, "1.snapshot", "1.Snapshot" ); assertOrder( X_EQ_Y, "1.ga", "1.GA" ); assertOrder( X_EQ_Y, "1.ga", "1.Ga" ); assertOrder( X_EQ_Y, "1.final", "1.FINAL" ); assertOrder( X_EQ_Y, "1.final", "1.Final" ); assertOrder( X_EQ_Y, "1.sp", "1.SP" ); assertOrder( X_EQ_Y, "1.sp", "1.Sp" ); assertOrder( X_EQ_Y, "1.unknown", "1.UNKNOWN" ); assertOrder( X_EQ_Y, "1.unknown", "1.Unknown" ); } @Test public void testCaseInsensitiveOrderingOfQualifiersIsLocaleIndependent() { Locale orig = Locale.getDefault(); try { Locale[] locales = { Locale.ENGLISH, new Locale( "tr" ) }; for ( Locale locale : locales ) { Locale.setDefault( locale ); assertOrder( X_EQ_Y, "1-abcdefghijklmnopqrstuvwxyz", "1-ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); } } finally { Locale.setDefault( orig ); } } @Test public void testQualifierVersusNumberOrdering() { assertOrder( X_LT_Y, "1-ga", "1-1" ); assertOrder( X_LT_Y, "1.ga", "1.1" ); assertOrder( X_EQ_Y, "1-ga", "1.0" ); assertOrder( X_EQ_Y, "1.ga", "1.0" ); assertOrder( X_LT_Y, "1-ga-1", "1-0-1" ); assertOrder( X_LT_Y, "1.ga.1", "1.0.1" ); assertOrder( X_GT_Y, "1.sp", "1.0" ); assertOrder( X_LT_Y, "1.sp", "1.1" ); assertOrder( X_LT_Y, "1-abc", "1-1" ); assertOrder( X_LT_Y, "1.abc", "1.1" ); assertOrder( X_LT_Y, "1-xyz", "1-1" ); assertOrder( X_LT_Y, "1.xyz", "1.1" ); } @Test public void testVersionEvolution() { assertSequence( "0.9.9-SNAPSHOT", "0.9.9", "0.9.10-SNAPSHOT", "0.9.10", "1.0-alpha-2-SNAPSHOT", "1.0-alpha-2", "1.0-alpha-10-SNAPSHOT", "1.0-alpha-10", "1.0-beta-1-SNAPSHOT", "1.0-beta-1", "1.0-rc-1-SNAPSHOT", "1.0-rc-1", "1.0-SNAPSHOT", "1.0", "1.0-sp-1-SNAPSHOT", "1.0-sp-1", "1.0.1-alpha-1-SNAPSHOT", "1.0.1-alpha-1", "1.0.1-beta-1-SNAPSHOT", "1.0.1-beta-1", "1.0.1-rc-1-SNAPSHOT", "1.0.1-rc-1", "1.0.1-SNAPSHOT", "1.0.1", "1.1-SNAPSHOT", "1.1" ); assertSequence( "1.0-alpha", "1.0", "1.0-1" ); assertSequence( "1.0.alpha", "1.0", "1.0-1" ); assertSequence( "1.0-alpha", "1.0", "1.0.1" ); assertSequence( "1.0.alpha", "1.0", "1.0.1" ); } @Test public void testMinimumSegment() { assertOrder( X_LT_Y, "1.min", "1.0-alpha-1" ); assertOrder( X_LT_Y, "1.min", "1.0-SNAPSHOT" ); assertOrder( X_LT_Y, "1.min", "1.0" ); assertOrder( X_LT_Y, "1.min", "1.9999999999" ); assertOrder( X_EQ_Y, "1.min", "1.MIN" ); assertOrder( X_GT_Y, "1.min", "0.99999" ); assertOrder( X_GT_Y, "1.min", "0.max" ); } @Test public void testMaximumSegment() { assertOrder( X_GT_Y, "1.max", "1.0-alpha-1" ); assertOrder( X_GT_Y, "1.max", "1.0-SNAPSHOT" ); assertOrder( X_GT_Y, "1.max", "1.0" ); assertOrder( X_GT_Y, "1.max", "1.9999999999" ); assertOrder( X_EQ_Y, "1.max", "1.MAX" ); assertOrder( X_LT_Y, "1.max", "2.0-alpha-1" ); assertOrder( X_LT_Y, "1.max", "2.min" ); } } UnionVersionRangeTest.java000066400000000000000000000064101245546356100341560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/java/org/eclipse/aether/util/version/******************************************************************************* * Copyright (c) 2012 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sonatype, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.aether.util.version; import static org.junit.Assert.*; import java.util.Collections; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.VersionRange; import org.junit.Test; public class UnionVersionRangeTest { private VersionRange newRange( String range ) { try { return new GenericVersionScheme().parseVersionRange( range ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( e ); } } private void assertBound( String version, boolean inclusive, VersionRange.Bound bound ) { if ( version == null ) { assertNull( bound ); } else { assertNotNull( bound ); assertNotNull( bound.getVersion() ); assertEquals( inclusive, bound.isInclusive() ); try { assertEquals( new GenericVersionScheme().parseVersion( version ), bound.getVersion() ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( e ); } } } @Test public void testGetLowerBound() { VersionRange range = UnionVersionRange.from( Collections. emptySet() ); assertBound( null, false, range.getLowerBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "[3,4]" ) ); assertBound( "1", true, range.getLowerBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "(,4]" ) ); assertBound( null, false, range.getLowerBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "(1,4]" ) ); assertBound( "1", true, range.getLowerBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "(0,4]" ) ); assertBound( "0", false, range.getLowerBound() ); } @Test public void testGetUpperBound() { VersionRange range = UnionVersionRange.from( Collections. emptySet() ); assertBound( null, false, range.getUpperBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "[3,4]" ) ); assertBound( "4", true, range.getUpperBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "[3,)" ) ); assertBound( null, false, range.getUpperBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "[1,2)" ) ); assertBound( "2", true, range.getUpperBound() ); range = UnionVersionRange.from( newRange( "[1,2]" ), newRange( "[1,3)" ) ); assertBound( "3", false, range.getUpperBound() ); } } aether-1.0.2.v20150114/aether-util/src/test/resources/000077500000000000000000000000001245546356100220625ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/000077500000000000000000000000001245546356100244245ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-id-sorter/000077500000000000000000000000001245546356100301335ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-id-sorter/cycle.txt000066400000000000000000000001131245546356100317660ustar00rootroot00000000000000(null) +- gid:aid:ver | \- gid2:aid:ver \- gid2:aid:ver \- gid:aid:ver aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-id-sorter/cycles.txt000066400000000000000000000003561245546356100321620ustar00rootroot00000000000000(null) +- gid1:aid:ver | \- gid2:aid:ver | \- gid:aid:ver +- gid2:aid:ver | \- gid1:aid:ver +- gid1:aid:ver | \- gid3:aid:ver +- gid3:aid:ver | \- gid1:aid:ver +- gid2:aid:ver | \- gid3:aid:ver \- gid3:aid:ver \- gid2:aid:ver no-conflicts.txt000066400000000000000000000001141245546356100332070ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-id-sorter(null) +- gid:aid:ver | \- gid2:aid:ver \- gid3:aid:ver \- gid4:aid:ver aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-id-sorter/simple.txt000066400000000000000000000001131245546356100321600ustar00rootroot00000000000000(null) +- gid:aid:ver | \- gid:aid2:ver \- gid2:aid:ver \- gid:aid:ver aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-marker/000077500000000000000000000000001245546356100275045ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-marker/relocation1.txt000066400000000000000000000000701245546356100324620ustar00rootroot00000000000000(null) +- test:a:1 \- test:a:1 relocations=test:reloc:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-marker/relocation2.txt000066400000000000000000000000701245546356100324630ustar00rootroot00000000000000(null) +- test:a:1 relocations=test:reloc:1 \- test:a:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-marker/relocation3.txt000066400000000000000000000001111245546356100324600ustar00rootroot00000000000000(null) +- test:a:1 +- test:b:1 \- test:c:1 relocations=test:a:1,test:b:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/conflict-marker/simple.txt000066400000000000000000000000371245546356100315360ustar00rootroot00000000000000(null) +- test:a:1 \- test:b:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/optionality-selector/000077500000000000000000000000001245546356100306155ustar00rootroot00000000000000conflict-direct-dep.txt000066400000000000000000000000671245546356100351210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/optionality-selector(null) +- test:a:1 | \- test:x:1 \- test:x:1 optional aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/optionality-selector/conflict.txt000066400000000000000000000001061245546356100331540ustar00rootroot00000000000000(null) +- test:a:1 optional | \- test:x:1 \- test:b:1 \- test:x:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/optionality-selector/derive.txt000066400000000000000000000001201245546356100326250ustar00rootroot00000000000000(null) +- test:a:1 optional | \- test:b:1 \- test:c:1 !optional \- test:d:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/000077500000000000000000000000001245546356100276645ustar00rootroot00000000000000conflict-and-inheritance.txt000066400000000000000000000006641245546356100352040ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator# Another scenario to check that scope inheritance considers the effective scopes of parent nodes as determined during # scope conflict resolution. In this example, gid:x:1 should end up in compile scope (and not runtime) because its # parent gid:c:2 will be promoted to compile scope due to a conflict with gid:c:1. gid:root:1 +- gid:a:1 compile | \- gid:c:2 runtime | \- gid:x:1 compile \- gid:b:1 compile \- gid:c:1 compile conflicting-direct-nodes.txt000066400000000000000000000000531245546356100352210ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator(null) +- gid:aid:ver %s \- gid:aid:ver %s aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/cycle-a.txt000066400000000000000000000004431245546356100317430ustar00rootroot00000000000000# Checks for graceful handling of cycles in the graph of conflict groups. Below, the group {a:1, a:2} depends on # {b:1, b:2} and vice versa. Additionally, each group contains a direct dependency. gid:root:1 +- gid:a:1 compile | \- gid:b:1 compile \- gid:b:2 runtime \- gid:a:2 runtime aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/cycle-b.txt000066400000000000000000000002561245546356100317460ustar00rootroot00000000000000# Variation of cycle-a where the order of direct dependencies has been changed. gid:root:1 +- gid:b:2 runtime | \- gid:a:2 runtime \- gid:a:1 compile \- gid:b:1 compile aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/cycle-c.txt000066400000000000000000000005301245546356100317420ustar00rootroot00000000000000# Checks for graceful handling of cycles in the graph of conflict groups. Below, the group {a:1} depends on # {b:1} and vice versa. The conflicting groups consist entirely of non-direct dependencies. gid:root:1 +- gid:x:1 runtime | \- gid:a:1 compile | \- gid:b:1 compile \- gid:y:1 runtime \- gid:b:1 compile \- gid:a:1 compile aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/cycle-d.txt000066400000000000000000000002631245546356100317460ustar00rootroot00000000000000# Checks for graceful handling of cycles in the graph of dependency nodes. gid:root:1 \- gid:a:1 compile \- gid:b:1 compile (b) \- gid:a:1 runtime \- ^b direct-nodes-winning.txt000066400000000000000000000002761245546356100344020ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator(null) +- gid:aid:ver %s +- gid:aid2:ver | \- gid:aid:ver provided +- gid:aid3:ver | \- gid:aid:ver runtime +- gid:aid4:ver | \- gid:aid:ver test \- gid:aid5:ver \- gid:aid:ver compiledirect-with-conflict-and-inheritance.txt000066400000000000000000000007701245546356100374230ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator# When a direct dependency scope conflicts with a transitive dependency scope, the direct dependency scope always wins. # When the scope of the transitive dependency is updated, this update needs to be considered by scope inheritance. # In the graph below gid:a:1 has a conflict, after its resolution to test scope, gid:x:1 should end up in # test scope as well, everywhere in the graph. gid:root:1 +- gid:a:1 test | \- gid:x:1 compile \- gid:b:1 compile \- gid:a:1 compile \- gid:x:1 compile dueling-scopes.txt000066400000000000000000000002071245546356100332660ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator# pattern to test scope mediation in conflict groups (null) +- gid:aid2:ver | \- gid:aid:ver %s \- gid:aid3:ver \- gid:aid:ver %s aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/inheritance.txt000066400000000000000000000000561245546356100327170ustar00rootroot00000000000000root:a:ver \- gid:b:ver %s \- gid:c:ver %s multiple-inheritance.txt000066400000000000000000000001261245546356100344670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator(null) +- gid:aid:ver %s | \- gid2:aid:ver compile (1) \- gid3:aid:ver %s \- ^1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/system-1.txt000066400000000000000000000000651245546356100321100ustar00rootroot00000000000000gid:aid:1 +- gid:aid2:2 compile \- gid:aid2:3 system aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/scope-calculator/system-2.txt000066400000000000000000000000651245546356100321110ustar00rootroot00000000000000gid:aid:1 +- gid:aid2:2 system \- gid:aid2:3 compile aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/000077500000000000000000000000001245546356100277505ustar00rootroot00000000000000conflict-id-cycle.txt000066400000000000000000000002171245546356100337220ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver# a graph which itself is acyclic but its conflict ids are cyclic (a <-> b) test:root:1 +- test:a:1 | \- test:b:1 \- test:b:2 \- test:a:2 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/cycle.txt000066400000000000000000000002411245546356100316050ustar00rootroot00000000000000cycle:root:1 +- cycle:a:1 | \- cycle:b:1 (b) | \- cycle:c:1 | \- cycle:a:1 (a) | \- ^b \- cycle:c:1 \- ^a dead-conflict-group.txt000066400000000000000000000002061245546356100342560ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolvertest:root:1 +- test:a:1 | \- test:b:1 | \- test:c:1 # conflict group c will completely vanish from resolved tree \- test:b:2 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/loop.txt000066400000000000000000000000231245546356100314550ustar00rootroot00000000000000gid:a:1 \- gid:a:1 nearest-underneath-loser-a.txt000066400000000000000000000003441245546356100355670ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolvertest:root:1 +- test:a:1 | \- test:b:1 # will be removed in favor of test:b:2 | \- test:j:1 # nearest version of j in dirty tree +- test:c:1 | \- test:d:1 | \- test:e:1 | \- test:j:1 \- test:b:2 nearest-underneath-loser-b.txt000066400000000000000000000003441245546356100355700ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolvertest:root:1 +- test:a:1 | \- test:b:1 # will be removed in favor of test:b:2 | \- test:j:1 # nearest version of j in dirty tree +- test:c:1 | \- test:d:1 | \- test:e:1 | \- test:j:2 \- test:b:2 overlapping-cycles.txt000066400000000000000000000002351245546356100342400ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolvercycle:root:1 +- cycle:a:1 (a) | \- cycle:b:1 | \- cycle:c:1 | \- ^a \- cycle:b:1 (b) \- cycle:c:1 \- ^b range-backtracking.txt000066400000000000000000000003551245546356100341520ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver(null) +- test:x:1 +- test:a:1 | \- test:b:1 | \- test:x:3 +- test:c:1 | \- test:x:2 \- test:d:1 \- test:e:1 \- test:x:2[2,) # forces rejection of x:1, should fallback to nearest and not first-seen, i.e. x:2 and not x:3 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/ranges.txt000066400000000000000000000001551245546356100317710ustar00rootroot00000000000000(null) +- test:b:1 | \- test:a:2[2] \- test:c:1 +- test:a:1[1,3] +- test:a:2[1,3] \- test:a:3[1,3] scope-vs-version.txt000066400000000000000000000015621245546356100336600ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver# This highlights a design flaw in the previous separation of JavaEffectiveScopeCalculator and NearestVersionConflictResolver: # scope conflicts can't be properly determined and resolved until ancestor dependencies got their version conflicts resolved. # Otherwise, dependencies can get promoted to a scope due to a scope conflict which actually no longer arises after conflicting # versions got removed. In the dirty graph below, the effective scope of test:y should be "test" and not "compile" (as suggested # by its test:x parent). test:root:1 +- test:a:1 compile | +- test:x:1 compile # (a) +- test:b:1 test | +- test:y:1 compile +- test:c:1 test +- test:x:1 compile # conflicts with (a), hence leaving scope as "compile" +- test:y:1 compile # since our parent gets removed in favor of (a), no need to promote y into scope "compile" sibling-versions.txt000066400000000000000000000003131245546356100337240ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver# multiple versions of the same GA beneath the same parent as seen after expansion of version ranges # versions neither in ascending nor descending order test:root:1 +- test:a:1 +- test:a:3 \- test:a:2 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/soft-vs-range.txt000066400000000000000000000002071245546356100332030ustar00rootroot00000000000000test:root:1 +- test:a:1 | \- test:c:2 # nearest occurrence of c but doesn't match range given below \- test:b:1 \- test:c:1[1] unsolvable-with-cycle.txt000066400000000000000000000005061245546356100346530ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver# Conflict id "a" will be resolved before "x" such that the cycle formed by "x" is still in place when processing "a". # So in order to report the conflicting paths to "a" the code better supports cyclic graphs. cycle:root:1 +- cycle:x:1 (x) | \- ^x +- cycle:a:1[1] \- cycle:b:1 \- cycle:a:2[2] \- cycle:x:1 aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/unsolvable.txt000066400000000000000000000001031245546356100326550ustar00rootroot00000000000000(null) +- test:b:1 | \- test:a:1[1] \- test:c:1 \- test:a:2[2] aether-1.0.2.v20150114/aether-util/src/test/resources/transformer/version-resolver/verbose.txt000066400000000000000000000002441245546356100321560ustar00rootroot00000000000000test:root:1 +- test:a:1 test | +- test:x:1 compile | \- test:x:2 compile \- test:b:1 test +- test:x:1 compile \- test:z:1 compile \- test:x:2 compile aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/000077500000000000000000000000001245546356100235615ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/filtering/000077500000000000000000000000001245546356100255445ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/filtering/parents.txt000066400000000000000000000001131245546356100277540ustar00rootroot00000000000000gid:a:1 +- gid:b:1 | \- gid:c:1 | \- gid:d:1 \- gid:e:1 \- gid:f:1 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/ordered-list/000077500000000000000000000000001245546356100261565ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/ordered-list/cycles.txt000066400000000000000000000001231245546356100301750ustar00rootroot00000000000000gid:a:1 +- gid:b:1 (1) | \- gid:c:1 | \- ^1 \- gid:d:1 +- ^1 \- gid:e:1 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/ordered-list/simple.txt000066400000000000000000000000721245546356100302070ustar00rootroot00000000000000gid:a:1 +- gid:b:1 | \- gid:c:1 \- gid:d:1 \- gid:e:1 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/path-recorder/000077500000000000000000000000001245546356100263205ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/path-recorder/cycle.txt000066400000000000000000000001271245546356100301600ustar00rootroot00000000000000gid:a:1 (a) +- gid:b:1 (b) | \- match:x:1 \- match:x:2 (x) +- ^a +- ^b \- ^x aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/path-recorder/nested.txt000066400000000000000000000000621245546356100303410ustar00rootroot00000000000000match:x:1 +- gid:a:1 | \- match:y:2 \- match:y:2 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/path-recorder/parents.txt000066400000000000000000000001131245546356100305300ustar00rootroot00000000000000gid:a:1 +- gid:b:1 | \- gid:c:1 | \- gid:d:1 \- gid:e:1 \- gid:f:1 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/path-recorder/simple.txt000066400000000000000000000000601245546356100303460ustar00rootroot00000000000000gid:a:1 +- gid:b:1 | \- match:x:1 \- match:x:2 aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/tree/000077500000000000000000000000001245546356100245205ustar00rootroot00000000000000aether-1.0.2.v20150114/aether-util/src/test/resources/visitor/tree/cycles.txt000066400000000000000000000001051245546356100265370ustar00rootroot00000000000000gid:a:1 +- gid:b:1 (1) | \- gid:c:1 | \- ^1 \- gid:d:1 \- ^1 aether-1.0.2.v20150114/class-overview.svg000066400000000000000000001660761245546356100175710ustar00rootroot00000000000000 RepositorySystemresolveVersionRange()resolveVersion()readArtifactDescriptor()collectDependencies()resolveDependencies()resolveArtifacts()resolveMetadata()install()deploy()RepositorySystemSessionoffline : booleansystemProperties : MapupdatePolicy : StringchecksumPolicy : String...AuthenticationProxyProxySelectorgetProxy()AuthenticationSelectorgetAuthentication()MirrorSelectorgetMirror()ArtifactRepsositoryid : StringcontentType : StringLocalRepositorybasedir : FileWorkspaceRepositoryRemoteRepositoryurl : StringLocalRepositoryManagergetPathForLocalArtifact()getPathForRemoteArtifact()getPathForLocalMetadata()getPathForRemoteMetadata()WorkspaceReaderfindArtifact()findVersions()RepositoryConnectorget()put()close()RepositoryConnectorFactorypriority : intTransferListenertransferStarted()transferProgressed()transferFailed()...RepositoryListenerartifactResolving()artifactResolved()artifactDeployed()...DependencyGraphTransformertransformGraph()DependencySelectorselectDependency() : booleanDependencyTraversertraverseDependency() : booleanDependencyManagermanageDependency()DependencyNodeDependencyscope : StringArtifactgroupId : StringartifactId : Stringextension : Stringclassifier : Stringversion : Stringfile : Fileproperties : MapScope Inheritance, Conflict ResolutionFat WARsExclusions, Optional Dependencies aether-1.0.2.v20150114/epl-v10.html000066400000000000000000000305361245546356100161400ustar00rootroot00000000000000 Eclipse Public License - Version 1.0

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and

b) in the case of each subsequent Contributor:

i) changes to the Program, and

ii) additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

"Contributor" means any person or entity that distributes the Program.

"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

"Program" means the Contributions distributed in accordance with this Agreement.

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.

d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

3. REQUIREMENTS

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

a) it complies with the terms and conditions of this Agreement; and

b) its license agreement:

i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and

iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

When the Program is made available in source code form:

a) it must be made available under this Agreement; and

b) a copy of this Agreement must be included with each copy of the Program.

Contributors may not remove or alter any copyright notices contained within the Program.

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

4. COMMERCIAL DISTRIBUTION

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

5. NO WARRANTY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

6. DISCLAIMER OF LIABILITY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. GENERAL

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

aether-1.0.2.v20150114/notice.html000066400000000000000000000214651245546356100162360ustar00rootroot00000000000000 Eclipse Foundation Software User Agreement

Eclipse Foundation Software User Agreement

April 9, 2014

Usage Of Content

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

Applicable Licenses

Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

  • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with that Feature.
  • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.

The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module including, but not limited to the following locations:

  • The top-level (root) directory
  • Plug-in and Fragment directories
  • Inside Plug-ins and Fragments packaged as JARs
  • Sub-directories of the directory named "src" of certain Plug-ins
  • Feature directories

Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in that directory.

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

Use of Provisioning Technology

The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").

You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

  1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based product.
  2. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be accessed and copied to the Target Machine.
  3. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.

Cryptography

Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted.

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

aether-1.0.2.v20150114/pom.xml000066400000000000000000000712461245546356100154060ustar00rootroot00000000000000 4.0.0 org.eclipse.aether aether 1.0.2.v20150114 pom Aether The parent and aggregator for the repository system. http://www.eclipse.org/aether/ 2010 The Eclipse Foundation http://www.eclipse.org/ Aether Developer List https://dev.eclipse.org/mailman/listinfo/aether-dev https://dev.eclipse.org/mailman/listinfo/aether-dev aether-dev@eclipse.org http://dev.eclipse.org/mhonarc/lists/aether-dev/ Aether User List https://dev.eclipse.org/mailman/listinfo/aether-users https://dev.eclipse.org/mailman/listinfo/aether-users aether-users@eclipse.org http://dev.eclipse.org/mhonarc/lists/aether-users/ Aether Commit Notification List https://dev.eclipse.org/mailman/listinfo/aether-commit https://dev.eclipse.org/mailman/listinfo/aether-commit http://dev.eclipse.org/mhonarc/lists/aether-commit/ Aether CI Notification List https://dev.eclipse.org/mailman/listinfo/aether-build https://dev.eclipse.org/mailman/listinfo/aether-build http://dev.eclipse.org/mhonarc/lists/aether-build/ scm:git:git://git.eclipse.org/gitroot/aether/aether-core.git scm:git:ssh://git.eclipse.org/gitroot/aether/aether-core.git http://git.eclipse.org/c/aether/aether-core.git/tree/ bugzilla https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&bug_status=__open__&product=Aether Hudson https://hudson.eclipse.org/aether/job/aether-core/ sonatype-nexus-staging https://oss.sonatype.org/service/local/staging/deploy/maven2/ ${sonatypeOssDistMgmtSnapshotsId} ${sonatypeOssDistMgmtSnapshotsUrl} Eclipse Public License, Version 1.0 http://www.eclipse.org/legal/epl-v10.html repo bbentmann Benjamin Bentmann Project Lead jvanzyl Jason Van Zyl Project Lead aether-api aether-spi aether-util aether-impl aether-test-util aether-connector-basic aether-transport-classpath aether-transport-file aether-transport-http aether-transport-wagon J2SE-1.5 Eclipse Aether UTF-8 UTF-8 true sonatype-nexus-snapshots https://oss.sonatype.org/content/repositories/snapshots/ org.eclipse.aether aether-api ${project.version} org.eclipse.aether aether-spi ${project.version} org.eclipse.aether aether-util ${project.version} org.eclipse.aether aether-impl ${project.version} org.eclipse.aether aether-connector-basic ${project.version} org.eclipse.aether aether-test-util ${project.version} test junit junit 4.11 test org.hamcrest hamcrest-core 1.3 test org.hamcrest hamcrest-library 1.3 test javax.inject javax.inject 1 provided org.codehaus.plexus plexus-component-annotations 1.5.5 provided org.eclipse.sisu org.eclipse.sisu.inject 0.1.1 org.eclipse.sisu org.eclipse.sisu.plexus 0.1.1 javax.enterprise cdi-api org.sonatype.sisu sisu-guice 3.1.6 no_aop aopalliance aopalliance com.google.code.findbugs jsr305 org.slf4j slf4j-api 1.6.2 org.apache.felix maven-bundle-plugin 2.4.0 ${project.url} ${project.name} ${bundle.env} ${bundle.symbolicName} ${bundle.vendor} ${bundle.osgiVersion} org.eclipse.aether.internal.*;x-internal:=true,org.eclipse.aether.* create-manifest process-test-classes manifest org.apache.maven.plugins maven-assembly-plugin 2.2.1 org.apache.maven.plugins maven-clean-plugin 2.5 org.apache.maven.plugins maven-compiler-plugin 2.5.1 1.5 1.5 org.apache.maven.plugins maven-deploy-plugin 2.5 org.apache.maven.plugins maven-enforcer-plugin 1.2 org.apache.maven.plugins maven-gpg-plugin 1.2 org.apache.maven.plugins maven-install-plugin 2.3.1 org.apache.maven.plugins maven-jar-plugin 2.3.2 ${project.build.outputDirectory}/META-INF/MANIFEST.MF org.apache.maven.plugins maven-javadoc-plugin 2.8.1 false http://download.oracle.com/javase/6/docs/api/ noextend a Restriction: noimplement a Restriction: noinstantiate a Restriction: nooverride a Restriction: noreference a Restriction: provisional a Provisional: API org.eclipse.aether* SPI org.eclipse.aether.spi* Utilities org.eclipse.aether.util* Repository Connectors org.eclipse.aether.connector* Transporters org.eclipse.aether.transport* Implementation org.eclipse.aether.impl* Internals org.eclipse.aether.internal* org.apache.maven.plugins maven-release-plugin 2.1 true forked-path false deploy javadoc:aggregate-jar assembly:attached -Psonatype-oss-release org.apache.maven.plugins maven-resources-plugin 2.6 org.apache.maven.plugins maven-site-plugin 3.0 org.apache.maven.plugins maven-source-plugin 2.1.2 2 ${project.name} Sources http://www.eclipse.org/legal/epl-v10.html ${bundle.env} ${bundle.symbolicName}.source ${bundle.vendor} ${bundle.osgiVersion} ${bundle.symbolicName};version="${bundle.osgiVersion}";roots:="." org.apache.maven.plugins maven-surefire-plugin 2.9 -Xmx128m ${surefire.redirectTestOutputToFile} ${project.build.directory}/surefire-tmp org.codehaus.mojo animal-sniffer-maven-plugin 1.9 org.codehaus.mojo.signature java15 1.0 check-java-1.5-compat process-classes check org.codehaus.mojo clirr-maven-plugin 2.3 org.codehaus.plexus plexus-component-metadata 1.5.5 generate-components-xml process-classes generate-metadata org.eclipse.sisu sisu-maven-plugin 0.0.0.M2 generate-index process-classes main-index org.apache.maven.plugins maven-enforcer-plugin qa verify enforce project.version [0-9]+\.[0-9]+\.[0-9]+((.*-SNAPSHOT)|(\.M[0-9]+)|(\.RC[0-9]+)|(\.v[0-9]{8})) Project version must be either X.Y.Z.M#, X.Y.Z.RC# or X.Y.Z.v######## true *:* org.eclipse.aether org.eclipse.sisu org.eclipse.jetty:*:*:*:test org.slf4j:slf4j-api:[1.6.2] org.codehaus.plexus:plexus-component-annotations:[1.5.5] org.codehaus.plexus:plexus-utils:[2.1] org.codehaus.plexus:plexus-classworlds:[2.4] org.apache.maven.wagon:wagon-provider-api:[1.0] org.sonatype.sisu:sisu-guice:[3.1.6] com.google.guava:guava:[11.0.2] javax.inject:javax.inject:[1] org.apache.httpcomponents:httpclient:[4.2.6] org.apache.httpcomponents:httpcore:[4.2.5] commons-codec:commons-codec:[1.6] org.slf4j:jcl-over-slf4j:[1.6.2] junit:junit:[4.11]:*:test org.hamcrest:hamcrest-core:[1.3]:*:test org.hamcrest:hamcrest-library:[1.3]:*:test com.googlecode.jmockit:jmockit:[1.3]:*:test ch.qos.logback:logback-core:[1.0.7]:*:test ch.qos.logback:logback-classic:[1.0.7]:*:test org.eclipse.jetty.orbit:javax.servlet:[2.5.0.v201103041518]:*:test org.codehaus.mojo build-helper-maven-plugin 1.7 osgi-timestamp initialize timestamp-property bundle.osgiTimestamp yyyyMMdd-HHmm UTC en osgi-version initialize regex-property bundle.osgiVersion ${project.version} -SNAPSHOT .${bundle.osgiTimestamp} false sonatype-oss-release org.apache.maven.plugins maven-source-plugin attach-sources package jar-no-fork org.apache.maven.plugins maven-javadoc-plugin attach-javadocs package jar default-cli false org.apache.maven.plugins maven-gpg-plugin sign-artifacts verify sign org.apache.maven.plugins maven-assembly-plugin org.apache.apache.resources apache-source-release-assembly-descriptor 1.0.2 attach-source-release-distro package single true source-release gnu default-cli false src/main/assembly/bin.xml snapshot-sources org.apache.maven.plugins maven-source-plugin attach-sources jar-no-fork clirr org.codehaus.mojo clirr-maven-plugin check-api-compat verify check-no-fork m2e m2e.version org.eclipse.m2e lifecycle-mapping 1.0.0 org.eclipse.sisu sisu-maven-plugin [0.0.0.M2,) test-index main-index org.codehaus.mojo build-helper-maven-plugin [1.7,) regex-property timestamp-property org.apache.felix maven-bundle-plugin $(replace;${project.version};-SNAPSHOT;.qualifier) aether-1.0.2.v20150114/src/000077500000000000000000000000001245546356100146465ustar00rootroot00000000000000aether-1.0.2.v20150114/src/main/000077500000000000000000000000001245546356100155725ustar00rootroot00000000000000aether-1.0.2.v20150114/src/main/assembly/000077500000000000000000000000001245546356100174115ustar00rootroot00000000000000aether-1.0.2.v20150114/src/main/assembly/bin.xml000066400000000000000000000074571245546356100207200ustar00rootroot00000000000000 bin-incubation zip aether-api/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-spi/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-util/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-impl/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-connector-basic/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-transport-classpath/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-transport-file/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-transport-http/target . *.jar *.jar.asc *-sources.* *-javadoc.* aether-transport-wagon/target . *.jar *.jar.asc *-sources.* *-javadoc.* target/apidocs apidocs . *.html