diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver')
11 files changed, 1413 insertions, 0 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java new file mode 100644 index 00000000..5ef86022 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java @@ -0,0 +1,42 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; + +@Deprecated +public interface ArtifactCollector + extends org.apache.maven.repository.legacy.resolver.LegacyArtifactCollector +{ + + @Deprecated + ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact, + ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter, + List<ResolutionListener> listeners ) + throws ArtifactResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java new file mode 100644 index 00000000..0ca940a1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java @@ -0,0 +1,108 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.wagon.events.TransferListener; + +/** + * @author Jason van Zyl + */ +// Just hide the one method we want behind the RepositorySystem interface. +public interface ArtifactResolver +{ + + ArtifactResolutionResult resolve( ArtifactResolutionRequest request ); + + // The rest is deprecated + + // USED BY MAVEN ASSEMBLY PLUGIN 2.2-beta-2 + @Deprecated + String ROLE = ArtifactResolver.class.getName(); + + // USED BY SUREFIRE, DEPENDENCY PLUGIN + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + // USED BY MAVEN ASSEMBLY PLUGIN + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + // USED BY MAVEN ASSEMBLY PLUGIN + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository, ArtifactMetadataSource source ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter, + List<ResolutionListener> listeners ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + @Deprecated + ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository, ArtifactMetadataSource source, + List<ResolutionListener> listeners ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + // USED BY REMOTE RESOURCES PLUGIN, DEPENDENCY PLUGIN + @Deprecated + void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + // USED BY REMOTE RESOURCES PLUGIN + @Deprecated + void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, + TransferListener downloadMonitor ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + // USED BY DEPENDENCY PLUGIN, ARCHETYPE DOWNLOADER + @Deprecated + void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository ) + throws ArtifactResolutionException, ArtifactNotFoundException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java new file mode 100644 index 00000000..b066e4c0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java @@ -0,0 +1,167 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.HashSet; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.versioning.VersionRange; +import org.codehaus.plexus.logging.Logger; + +/** + * Send resolution events to the debug log. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class DebugResolutionListener + implements ResolutionListener, ResolutionListenerForDepMgmt +{ + private Logger logger; + + private String indent = ""; + + private static Set<Artifact> ignoredArtifacts = new HashSet<Artifact>(); + + public DebugResolutionListener( Logger logger ) + { + this.logger = logger; + } + + public void testArtifact( Artifact node ) + { + } + + public void startProcessChildren( Artifact artifact ) + { + indent += " "; + } + + public void endProcessChildren( Artifact artifact ) + { + indent = indent.substring( 2 ); + } + + public void includeArtifact( Artifact artifact ) + { + logger.debug( indent + artifact + " (selected for " + artifact.getScope() + ")" ); + } + + public void omitForNearer( Artifact omitted, Artifact kept ) + { + String omittedVersion = omitted.getVersion(); + String keptVersion = kept.getVersion(); + + if ( omittedVersion != null ? !omittedVersion.equals( keptVersion ) : keptVersion != null ) + { + logger.debug( indent + omitted + " (removed - nearer found: " + kept.getVersion() + ")" ); + } + } + + public void omitForCycle( Artifact omitted ) + { + logger.debug( indent + omitted + " (removed - causes a cycle in the graph)" ); + } + + public void updateScopeCurrentPom( Artifact artifact, String ignoredScope ) + { + logger.debug( indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope " + + artifact.getScope() + " wins)" ); + + // TODO: better way than static? this might hide messages in a reactor + if ( !ignoredArtifacts.contains( artifact ) ) + { + logger.warn( "\n\tArtifact " + artifact + " retains local artifactScope '" + artifact.getScope() + + "' overriding broader artifactScope '" + ignoredScope + "'\n" + + "\tgiven by a dependency. If this is not intended, modify or remove the local artifactScope.\n" ); + ignoredArtifacts.add( artifact ); + } + } + + public void updateScope( Artifact artifact, String scope ) + { + logger.debug( indent + artifact + " (setting artifactScope to: " + scope + ")" ); + } + + public void selectVersionFromRange( Artifact artifact ) + { + logger.debug( indent + artifact + " (setting version to: " + artifact.getVersion() + " from range: " + + artifact.getVersionRange() + ")" ); + } + + public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange ) + { + logger.debug( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: " + + replacement.getVersionRange() + " to: " + newRange + " )" ); + } + + /** + * The logic used here used to be a copy of the logic used in the DefaultArtifactCollector, and this method was + * called right before the actual version/artifactScope changes were done. However, a different set of conditionals (and + * more information) is needed to be able to determine when and if the version and/or artifactScope changes. See the two + * added methods, manageArtifactVersion and manageArtifactScope. + */ + public void manageArtifact( Artifact artifact, Artifact replacement ) + { + String msg = indent + artifact; + msg += " ("; + if ( replacement.getVersion() != null ) + { + msg += "applying version: " + replacement.getVersion() + ";"; + } + if ( replacement.getScope() != null ) + { + msg += "applying artifactScope: " + replacement.getScope(); + } + msg += ")"; + logger.debug( msg ); + } + + public void manageArtifactVersion( Artifact artifact, Artifact replacement ) + { + // only show msg if a change is actually taking place + if ( !replacement.getVersion().equals( artifact.getVersion() ) ) + { + String msg = indent + artifact + " (applying version: " + replacement.getVersion() + ")"; + logger.debug( msg ); + } + } + + public void manageArtifactScope( Artifact artifact, Artifact replacement ) + { + // only show msg if a change is actually taking place + if ( !replacement.getScope().equals( artifact.getScope() ) ) + { + String msg = indent + artifact + " (applying artifactScope: " + replacement.getScope() + ")"; + logger.debug( msg ); + } + } + + public void manageArtifactSystemPath( Artifact artifact, Artifact replacement ) + { + // only show msg if a change is actually taking place + if ( !replacement.getScope().equals( artifact.getScope() ) ) + { + String msg = indent + artifact + " (applying system path: " + replacement.getFile() + ")"; + logger.debug( msg ); + } + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java new file mode 100644 index 00000000..cefb9e28 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java @@ -0,0 +1,30 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.codehaus.plexus.component.annotations.Component; + +@Deprecated +@Component( role = ArtifactCollector.class ) +public class DefaultArtifactCollector + extends org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector + implements ArtifactCollector +{ +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java new file mode 100644 index 00000000..1631a013 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java @@ -0,0 +1,643 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.regex.Matcher; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.metadata.ResolutionGroup; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.LegacyLocalRepositoryManager; +import org.apache.maven.artifact.repository.RepositoryRequest; +import org.apache.maven.artifact.repository.metadata.Snapshot; +import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.repository.legacy.metadata.DefaultMetadataResolutionRequest; +import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; +import org.apache.maven.repository.legacy.resolver.conflict.ConflictResolver; +import org.apache.maven.wagon.events.TransferListener; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResult; + +/** + * @author Jason van Zyl + */ +@Component( role = ArtifactResolver.class ) +public class DefaultArtifactResolver + implements ArtifactResolver, Disposable +{ + @Requirement + private Logger logger; + + @Requirement + protected ArtifactFactory artifactFactory; + + @Requirement + private ArtifactCollector artifactCollector; + + @Requirement + private ResolutionErrorHandler resolutionErrorHandler; + + @Requirement + private ArtifactMetadataSource source; + + @Requirement + private PlexusContainer container; + + @Requirement + private LegacySupport legacySupport; + + @Requirement + private RepositorySystem repoSystem; + + private final Executor executor; + + public DefaultArtifactResolver() + { + int threads = Integer.getInteger( "maven.artifact.threads", 5 ); + if ( threads <= 1 ) + { + executor = new Executor() + { + public void execute( Runnable command ) + { + command.run(); + } + }; + } + else + { + executor = + new ThreadPoolExecutor( threads, threads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), + new DaemonThreadCreator() ); + } + } + + private RepositorySystemSession getSession( ArtifactRepository localRepository ) + { + return LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem ); + } + + private void injectSession1( RepositoryRequest request, MavenSession session ) + { + if ( session != null ) + { + request.setOffline( session.isOffline() ); + request.setForceUpdate( session.getRequest().isUpdateSnapshots() ); + } + } + + private void injectSession2( ArtifactResolutionRequest request, MavenSession session ) + { + injectSession1( request, session ); + + if ( session != null ) + { + request.setServers( session.getRequest().getServers() ); + request.setMirrors( session.getRequest().getMirrors() ); + request.setProxies( session.getRequest().getProxies() ); + } + } + + public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository, TransferListener resolutionListener ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + resolve( artifact, remoteRepositories, getSession( localRepository ) ); + } + + public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + resolve( artifact, remoteRepositories, getSession( localRepository ) ); + } + + private void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, + RepositorySystemSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + if ( artifact == null ) + { + return; + } + + if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) + { + File systemFile = artifact.getFile(); + + if ( systemFile == null ) + { + throw new ArtifactNotFoundException( "System artifact: " + artifact + " has no file attached", artifact ); + } + + if ( !systemFile.exists() ) + { + throw new ArtifactNotFoundException( "System artifact: " + artifact + " not found in path: " + systemFile, artifact ); + } + + if ( !systemFile.isFile() ) + { + throw new ArtifactNotFoundException( "System artifact: " + artifact + " is not a file: " + systemFile, artifact ); + } + + artifact.setResolved( true ); + + return; + } + + if ( !artifact.isResolved() ) + { + ArtifactResult result; + + try + { + ArtifactRequest artifactRequest = new ArtifactRequest(); + artifactRequest.setArtifact( RepositoryUtils.toArtifact( artifact ) ); + artifactRequest.setRepositories( RepositoryUtils.toRepos( remoteRepositories ) ); + + // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not + LocalRepositoryManager lrm = session.getLocalRepositoryManager(); + String path = lrm.getPathForLocalArtifact( artifactRequest.getArtifact() ); + artifact.setFile( new File( lrm.getRepository().getBasedir(), path ) ); + + result = repoSystem.resolveArtifact( session, artifactRequest ); + } + catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) + { + if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException ) + { + throw new ArtifactNotFoundException( e.getMessage(), artifact, remoteRepositories, e ); + } + else + { + throw new ArtifactResolutionException( e.getMessage(), artifact, remoteRepositories, e ); + } + } + + artifact.selectVersion( result.getArtifact().getVersion() ); + artifact.setFile( result.getArtifact().getFile() ); + artifact.setResolved( true ); + + if ( artifact.isSnapshot() ) + { + Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() ); + if ( matcher.matches() ) + { + Snapshot snapshot = new Snapshot(); + snapshot.setTimestamp( matcher.group( 2 ) ); + try + { + snapshot.setBuildNumber( Integer.parseInt( matcher.group( 3 ) ) ); + artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) ); + } + catch ( NumberFormatException e ) + { + logger.warn( "Invalid artifact version " + artifact.getVersion() + ": " + e.getMessage() ); + } + } + } + } + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, + remoteRepositories, source, filter ); + + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, + remoteRepositories, source, null ); + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, + remoteRepositories, source, filter, null ); + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository, + ArtifactMetadataSource source ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, localRepository, remoteRepositories, source, null ); + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + List<ArtifactRepository> remoteRepositories, + ArtifactRepository localRepository, + ArtifactMetadataSource source, + List<ResolutionListener> listeners ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, + remoteRepositories, source, null, listeners ); + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter, + List<ResolutionListener> listeners ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, + remoteRepositories, source, filter, listeners, null ); + } + + public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, + Map managedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, + ArtifactMetadataSource source, ArtifactFilter filter, + List<ResolutionListener> listeners, + List<ConflictResolver> conflictResolvers ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + ArtifactResolutionRequest request = new ArtifactResolutionRequest() + .setArtifact( originatingArtifact ) + .setResolveRoot( false ) + // This is required by the surefire plugin + .setArtifactDependencies( artifacts ) + .setManagedVersionMap( managedVersions ) + .setLocalRepository( localRepository ) + .setRemoteRepositories( remoteRepositories ) + .setCollectionFilter( filter ) + .setListeners( listeners ); + + injectSession2( request, legacySupport.getSession() ); + + return resolveWithExceptions( request ); + } + + public ArtifactResolutionResult resolveWithExceptions( ArtifactResolutionRequest request ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + ArtifactResolutionResult result = resolve( request ); + + // We have collected all the problems so let's mimic the way the old code worked and just blow up right here. + // That's right lets just let it rip right here and send a big incomprehensible blob of text at unsuspecting + // users. Bad dog! + + resolutionErrorHandler.throwErrors( request, result ); + + return result; + } + + // ------------------------------------------------------------------------ + // + // ------------------------------------------------------------------------ + + public ArtifactResolutionResult resolve( ArtifactResolutionRequest request ) + { + Artifact rootArtifact = request.getArtifact(); + Set<Artifact> artifacts = request.getArtifactDependencies(); + Map<String, Artifact> managedVersions = request.getManagedVersionMap(); + List<ResolutionListener> listeners = request.getListeners(); + ArtifactFilter collectionFilter = request.getCollectionFilter(); + ArtifactFilter resolutionFilter = request.getResolutionFilter(); + RepositorySystemSession session = getSession( request.getLocalRepository() ); + + //TODO: hack because metadata isn't generated in m2e correctly and i want to run the maven i have in the workspace + if ( source == null ) + { + try + { + source = container.lookup( ArtifactMetadataSource.class ); + } + catch ( ComponentLookupException e ) + { + // won't happen + } + } + + if ( listeners == null ) + { + listeners = new ArrayList<ResolutionListener>(); + + if ( logger.isDebugEnabled() ) + { + listeners.add( new DebugResolutionListener( logger ) ); + } + + listeners.add( new WarningResolutionListener( logger ) ); + } + + ArtifactResolutionResult result = new ArtifactResolutionResult(); + + // The root artifact may, or may not be resolved so we need to check before we attempt to resolve. + // This is often an artifact like a POM that is taken from disk and we already have hold of the + // file reference. But this may be a Maven Plugin that we need to resolve from a remote repository + // as well as its dependencies. + + if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ ) + { + try + { + resolve( rootArtifact, request.getRemoteRepositories(), session ); + } + catch ( ArtifactResolutionException e ) + { + result.addErrorArtifactException( e ); + return result; + } + catch ( ArtifactNotFoundException e ) + { + result.addMissingArtifact( request.getArtifact() ); + return result; + } + } + + ArtifactResolutionRequest collectionRequest = request; + + if ( request.isResolveTransitively() ) + { + MetadataResolutionRequest metadataRequest = new DefaultMetadataResolutionRequest( request ); + + metadataRequest.setArtifact( rootArtifact ); + metadataRequest.setResolveManagedVersions( managedVersions == null ); + + try + { + ResolutionGroup resolutionGroup = source.retrieve( metadataRequest ); + + if ( managedVersions == null ) + { + managedVersions = resolutionGroup.getManagedVersions(); + } + + Set<Artifact> directArtifacts = resolutionGroup.getArtifacts(); + + if ( artifacts == null || artifacts.isEmpty() ) + { + artifacts = directArtifacts; + } + else + { + List<Artifact> allArtifacts = new ArrayList<Artifact>(); + allArtifacts.addAll( artifacts ); + allArtifacts.addAll( directArtifacts ); + + Map<String, Artifact> mergedArtifacts = new LinkedHashMap<String, Artifact>(); + for ( Artifact artifact : allArtifacts ) + { + String conflictId = artifact.getDependencyConflictId(); + if ( !mergedArtifacts.containsKey( conflictId ) ) + { + mergedArtifacts.put( conflictId, artifact ); + } + } + + artifacts = new LinkedHashSet<Artifact>( mergedArtifacts.values() ); + } + + collectionRequest = new ArtifactResolutionRequest( request ); + collectionRequest.setServers( request.getServers() ); + collectionRequest.setMirrors( request.getMirrors() ); + collectionRequest.setProxies( request.getProxies() ); + collectionRequest.setRemoteRepositories( resolutionGroup.getResolutionRepositories() ); + } + catch ( ArtifactMetadataRetrievalException e ) + { + ArtifactResolutionException are = + new ArtifactResolutionException( "Unable to get dependency information for " + rootArtifact.getId() + + ": " + e.getMessage(), rootArtifact, metadataRequest.getRemoteRepositories(), e ); + result.addMetadataResolutionException( are ); + return result; + } + } + + if ( artifacts == null || artifacts.isEmpty() ) + { + if ( request.isResolveRoot() ) + { + result.addArtifact( rootArtifact ); + } + return result; + } + + // After the collection we will have the artifact object in the result but they will not be resolved yet. + result = + artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source, + collectionFilter, listeners, null ); + + // We have metadata retrieval problems, or there are cycles that have been detected + // so we give this back to the calling code and let them deal with this information + // appropriately. + + if ( result.hasMetadataResolutionExceptions() || result.hasVersionRangeViolations() || result.hasCircularDependencyExceptions() ) + { + return result; + } + + if ( result.getArtifactResolutionNodes() != null ) + { + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + + CountDownLatch latch = new CountDownLatch( result.getArtifactResolutionNodes().size() ); + + for ( ResolutionNode node : result.getArtifactResolutionNodes() ) + { + Artifact artifact = node.getArtifact(); + + if ( resolutionFilter == null || resolutionFilter.include( artifact ) ) + { + executor.execute( new ResolveTask( classLoader, latch, artifact, session, + node.getRemoteRepositories(), result ) ); + } + else + { + latch.countDown(); + } + } + try + { + latch.await(); + } + catch ( InterruptedException e ) + { + result.addErrorArtifactException( new ArtifactResolutionException( "Resolution interrupted", + rootArtifact, e ) ); + } + } + + // We want to send the root artifact back in the result but we need to do this after the other dependencies + // have been resolved. + if ( request.isResolveRoot() ) + { + // Add the root artifact (as the first artifact to retain logical order of class path!) + Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>(); + allArtifacts.add( rootArtifact ); + allArtifacts.addAll( result.getArtifacts() ); + result.setArtifacts( allArtifacts ); + } + + return result; + } + + public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + resolve( artifact, remoteRepositories, localRepository, null ); + } + + /** + * ThreadCreator for creating daemon threads with fixed ThreadGroup-name. + */ + static final class DaemonThreadCreator + implements ThreadFactory + { + static final String THREADGROUP_NAME = "org.apache.maven.artifact.resolver.DefaultArtifactResolver"; + + static final ThreadGroup GROUP = new ThreadGroup( THREADGROUP_NAME ); + + static final AtomicInteger THREAD_NUMBER = new AtomicInteger( 1 ); + + public Thread newThread( Runnable r ) + { + Thread newThread = new Thread( GROUP, r, "resolver-" + THREAD_NUMBER.getAndIncrement() ); + newThread.setDaemon( true ); + newThread.setContextClassLoader( null ); + return newThread; + } + } + + private class ResolveTask + implements Runnable + { + + private final ClassLoader classLoader; + + private final CountDownLatch latch; + + private final Artifact artifact; + + private final RepositorySystemSession session; + + private final List<ArtifactRepository> remoteRepositories; + + private final ArtifactResolutionResult result; + + public ResolveTask( ClassLoader classLoader, CountDownLatch latch, Artifact artifact, RepositorySystemSession session, + List<ArtifactRepository> remoteRepositories, ArtifactResolutionResult result ) + { + this.classLoader = classLoader; + this.latch = latch; + this.artifact = artifact; + this.session = session; + this.remoteRepositories = remoteRepositories; + this.result = result; + } + + public void run() + { + ClassLoader old = Thread.currentThread().getContextClassLoader(); + try + { + Thread.currentThread().setContextClassLoader( classLoader ); + resolve( artifact, remoteRepositories, session ); + } + catch ( ArtifactNotFoundException anfe ) + { + // These are cases where the artifact just isn't present in any of the remote repositories + // because it wasn't deployed, or it was deployed in the wrong place. + + synchronized ( result ) + { + result.addMissingArtifact( artifact ); + } + } + catch ( ArtifactResolutionException e ) + { + // This is really a wagon TransferFailedException so something went wrong after we successfully + // retrieved the metadata. + + synchronized ( result ) + { + result.addErrorArtifactException( e ); + } + } + finally + { + latch.countDown(); + Thread.currentThread().setContextClassLoader( old ); + + } + } + + } + + @Override + public void dispose() + { + if ( executor instanceof ExecutorService ) + { + ( (ExecutorService) executor ).shutdownNow(); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java new file mode 100644 index 00000000..06da7e3e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java @@ -0,0 +1,43 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; + +/** + * Do not use! + * <p/> + * Should only be implmemented by DebugResolutionListener. Remove this + * when the ResolutionListener interface deprecation of the manageArtifact + * method (and the [yet to be done] addition of these methods to that + * interface) has had a chance to propagate to all interested plugins. + */ +@Deprecated +public interface ResolutionListenerForDepMgmt +{ + void manageArtifactVersion( Artifact artifact, + Artifact replacement ); + + void manageArtifactScope( Artifact artifact, + Artifact replacement ); + + void manageArtifactSystemPath( Artifact artifact, + Artifact replacement ); +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java new file mode 100644 index 00000000..b9ccf706 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java @@ -0,0 +1,66 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; + +/** + * A simple recording of the Artifacts that could not be resolved for a given resolution request, along with + * the remote repositories where attempts were made to resolve the artifacts. + * + * @author Jason van Zyl + */ +public class UnresolvedArtifacts +{ + private Artifact originatingArtifact; + + private List<Artifact> artifacts; + + private List<ArtifactRepository> remoteRepositories; + + public UnresolvedArtifacts( Artifact originatingArtifact, + List<Artifact> artifacts, + List<ArtifactRepository> remoteRepositories ) + { + this.originatingArtifact = originatingArtifact; + + this.artifacts = artifacts; + + this.remoteRepositories = remoteRepositories; + } + + public Artifact getOriginatingArtifact() + { + return originatingArtifact; + } + + public List<Artifact> getArtifacts() + { + return artifacts; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return remoteRepositories; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java new file mode 100644 index 00000000..825d595a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java @@ -0,0 +1,90 @@ +package org.apache.maven.artifact.resolver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.versioning.VersionRange; +import org.codehaus.plexus.logging.Logger; + +/** + * Send resolution warning events to the warning log. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class WarningResolutionListener + implements ResolutionListener +{ + private Logger logger; + + public WarningResolutionListener( Logger logger ) + { + this.logger = logger; + } + + public void testArtifact( Artifact node ) + { + } + + public void startProcessChildren( Artifact artifact ) + { + } + + public void endProcessChildren( Artifact artifact ) + { + } + + public void includeArtifact( Artifact artifact ) + { + } + + public void omitForNearer( Artifact omitted, + Artifact kept ) + { + } + + public void omitForCycle( Artifact omitted ) + { + } + + public void updateScopeCurrentPom( Artifact artifact, + String scope ) + { + } + + public void updateScope( Artifact artifact, + String scope ) + { + } + + public void manageArtifact( Artifact artifact, + Artifact replacement ) + { + } + + public void selectVersionFromRange( Artifact artifact ) + { + } + + public void restrictRange( Artifact artifact, + Artifact replacement, + VersionRange newRange ) + { + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java new file mode 100644 index 00000000..0499db51 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java @@ -0,0 +1,65 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; + +public class InversionArtifactFilter + implements ArtifactFilter +{ + private final ArtifactFilter toInvert; + + public InversionArtifactFilter( ArtifactFilter toInvert ) + { + this.toInvert = toInvert; + } + + public boolean include( Artifact artifact ) + { + return !toInvert.include( artifact ); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + toInvert.hashCode(); + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof InversionArtifactFilter ) ) + { + return false; + } + + InversionArtifactFilter other = (InversionArtifactFilter) obj; + + return toInvert.equals( other.toInvert ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.java new file mode 100644 index 00000000..8cd02ccf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.java @@ -0,0 +1,93 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; + +/** + * Apply multiple filters, accepting an artifact if at least one of the filters accepts it. + * + * @author Benjamin Bentmann + */ +public class OrArtifactFilter + implements ArtifactFilter +{ + + private Set<ArtifactFilter> filters; + + public OrArtifactFilter() + { + this.filters = new LinkedHashSet<ArtifactFilter>(); + } + + public OrArtifactFilter( Collection<ArtifactFilter> filters ) + { + this.filters = new LinkedHashSet<ArtifactFilter>( filters ); + } + + public boolean include( Artifact artifact ) + { + for ( ArtifactFilter filter : filters ) + { + if ( filter.include( artifact ) ) + { + return true; + } + } + + return false; + } + + public void add( ArtifactFilter artifactFilter ) + { + filters.add( artifactFilter ); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + filters.hashCode(); + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof OrArtifactFilter ) ) + { + return false; + } + + OrArtifactFilter other = (OrArtifactFilter) obj; + + return filters.equals( other.filters ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java new file mode 100644 index 00000000..76c39ec3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java @@ -0,0 +1,66 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; + +/** Artifact Filter which filters on artifact type */ +public class TypeArtifactFilter + implements ArtifactFilter +{ + private String type = "jar"; + + public TypeArtifactFilter( String type ) + { + this.type = type; + } + + public boolean include( Artifact artifact ) + { + return type.equals( artifact.getType() ); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + type.hashCode(); + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof TypeArtifactFilter ) ) + { + return false; + } + + TypeArtifactFilter other = (TypeArtifactFilter) obj; + + return type.equals( other.type ); + } + +} |