The following document contains the results of PMD's CPD 5.6.1.
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30ArtifactRepositoryAdapter.java | 48 |
org\apache\maven\shared\transfer\collection\internal\Maven31ArtifactRepositoryAdapter.java | 48 |
Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( LS ); sb.append( " url: " ).append( getUrl() ).append( LS ); sb.append( " layout: " ).append( "default" ).append( LS ); RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true ); sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() ); sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]" ).append( LS ); RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false ); sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() ); sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]" ).append( LS ); return sb.toString(); } @Override public int hashCode() { return remoteRepository.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30ArtifactRepositoryAdapter.java | 48 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31ArtifactRepositoryAdapter.java | 48 |
Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( "\n" ); sb.append( " url: " ).append( getUrl() ).append( "\n" ); sb.append( " layout: " ).append( "default" ).append( "\n" ); RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true ); sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() ); sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]\n" ); RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false ); sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() ); sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]\n" ); return sb.toString(); } @Override public int hashCode() { return remoteRepository.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30DependencyCollector.java | 58 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31DependencyCollector.java | 58 |
Maven30DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager, RepositorySystemSession session, List<RemoteRepository> aetherRepositories ) { super(); this.repositorySystem = repositorySystem; this.artifactHandlerManager = artifactHandlerManager; this.session = session; this.aetherRepositories = aetherRepositories; } private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency, ArtifactTypeRegistry typeRegistry ) throws DependencyCollectorException { Class<?>[] argClasses = new Class<?>[] {org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class}; Object[] args = new Object[] {mavenDependency, typeRegistry}; return Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses, args ); } @Override public CollectorResult collectDependencies( org.apache.maven.model.Dependency root ) throws DependencyCollectorException { ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); CollectRequest request = new CollectRequest(); request.setRoot( toDependency( root, typeRegistry ) ); return collectDependencies( request ); } @Override public CollectorResult collectDependencies( DependableCoordinate root ) throws DependencyCollectorException { ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(), extension, root.getVersion() ); CollectRequest request = new CollectRequest(); request.setRoot( new Dependency( aetherArtifact, null ) ); return collectDependencies( request ); } @Override public CollectorResult collectDependencies( Model root ) throws DependencyCollectorException { // Are there examples where packaging and type are NOT in sync ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension, root.getVersion() ); CollectRequest request = new CollectRequest(); request.setRoot( new Dependency( aetherArtifact, null ) ); ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() ) { aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setDependencies( aetherDependencies ); if ( root.getDependencyManagement() != null ) { List<Dependency> aetherManagerDependencies = new ArrayList<>( root.getDependencyManagement().getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() ) { aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setManagedDependencies( aetherManagerDependencies ); } return collectDependencies( request ); } private CollectorResult collectDependencies( CollectRequest request ) throws DependencyCollectorException { request.setRepositories( aetherRepositories ); try { return new Maven30CollectorResult( repositorySystem.collectDependencies( session, request ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30DependencyCollector.java | 59 |
org\apache\maven\shared\transfer\collection\internal\Maven31DependencyCollector.java | 59 |
Maven30DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager, RepositorySystemSession session, List<RemoteRepository> aetherRepositories ) { super(); this.repositorySystem = repositorySystem; this.artifactHandlerManager = artifactHandlerManager; this.session = session; this.aetherRepositories = aetherRepositories; } @Override public CollectResult collectDependencies( org.apache.maven.model.Dependency root ) throws DependencyCollectionException { ArtifactTypeRegistry typeRegistry = Invoker .invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); CollectRequest request = new CollectRequest(); request.setRoot( toDependency( root, typeRegistry ) ); return collectDependencies( request ); } @Override public CollectResult collectDependencies( DependableCoordinate root ) throws DependencyCollectionException { ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(), extension, root.getVersion() ); CollectRequest request = new CollectRequest(); request.setRoot( new Dependency( aetherArtifact, null ) ); return collectDependencies( request ); } @Override public CollectResult collectDependencies( Model root ) throws DependencyCollectionException { // Are there examples where packaging and type are NOT in sync ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension, root.getVersion() ); CollectRequest request = new CollectRequest(); request.setRoot( new Dependency( aetherArtifact, null ) ); ArtifactTypeRegistry typeRegistry = Invoker .invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() ) { aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setDependencies( aetherDependencies ); if ( root.getDependencyManagement() != null ) { List<Dependency> aetherManagerDependencies = new ArrayList<>( root.getDependencyManagement().getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() ) { aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setManagedDependencies( aetherManagerDependencies ); } return collectDependencies( request ); } private CollectResult collectDependencies( CollectRequest request ) throws DependencyCollectionException { request.setRepositories( aetherRepositories ); try { return new Maven30CollectResult( repositorySystem.collectDependencies( session, request ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30ArtifactRepositoryAdapter.java | 43 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30ArtifactRepositoryAdapter.java | 43 |
private RemoteRepository remoteRepository; /** * @param remoteRepository {@link RemoteRepository} */ Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( LS ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven31ArtifactRepositoryAdapter.java | 43 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31ArtifactRepositoryAdapter.java | 43 |
private RemoteRepository remoteRepository; /** * @param remoteRepository {@link RemoteRepository} */ Maven31ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( LS ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30ArtifactRepositoryAdapter.java | 48 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31ArtifactRepositoryAdapter.java | 48 |
Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( LS ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven31ArtifactRepositoryAdapter.java | 48 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30ArtifactRepositoryAdapter.java | 48 |
Maven31ArtifactRepositoryAdapter( RemoteRepository remoteRepository ) { this.remoteRepository = remoteRepository; } @Override public String pathOf( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException(); } @Override public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) { throw new UnsupportedOperationException(); } @Override public String getUrl() { return remoteRepository.getUrl(); } @Override public void setUrl( String url ) { throw new UnsupportedOperationException(); } @Override public String getBasedir() { throw new UnsupportedOperationException(); } @Override public String getProtocol() { throw new UnsupportedOperationException(); } @Override public String getId() { return remoteRepository.getId(); } @Override public void setId( String id ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getSnapshots() { throw new UnsupportedOperationException(); } @Override public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryPolicy getReleases() { throw new UnsupportedOperationException(); } @Override public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) { throw new UnsupportedOperationException(); } @Override public ArtifactRepositoryLayout getLayout() { throw new UnsupportedOperationException(); } @Override public void setLayout( ArtifactRepositoryLayout layout ) { throw new UnsupportedOperationException(); } @Override public String getKey() { throw new UnsupportedOperationException(); } @Override public boolean isUniqueVersion() { throw new UnsupportedOperationException(); } @Override public boolean isBlacklisted() { throw new UnsupportedOperationException(); } @Override public void setBlacklisted( boolean blackListed ) { throw new UnsupportedOperationException(); } @Override public Artifact find( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public List<String> findVersions( Artifact artifact ) { throw new UnsupportedOperationException(); } @Override public boolean isProjectAware() { throw new UnsupportedOperationException(); } @Override public void setAuthentication( Authentication authentication ) { throw new UnsupportedOperationException(); } @Override public Authentication getAuthentication() { throw new UnsupportedOperationException(); } @Override public void setProxy( Proxy proxy ) { throw new UnsupportedOperationException(); } @Override public Proxy getProxy() { throw new UnsupportedOperationException(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " id: " ).append( getId() ).append( LS ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\repository\internal\Maven30RepositoryManager.java | 52 |
org\apache\maven\shared\transfer\repository\internal\Maven31RepositoryManager.java | 52 |
Maven30RepositoryManager( RepositorySystem repositorySystem, RepositorySystemSession session ) { this.repositorySystem = repositorySystem; this.session = session; } @Override public String getPathForLocalArtifact( org.apache.maven.artifact.Artifact mavenArtifact ) { Artifact aetherArtifact; // LRM.getPathForLocalArtifact() won't throw an Exception, so translate reflection error to RuntimeException try { aetherArtifact = (Artifact) Invoker.invoke( RepositoryUtils.class, "toArtifact", org.apache.maven.artifact.Artifact.class, mavenArtifact ); } catch ( RepositoryManagerException e ) { throw new RuntimeException( e.getMessage(), e ); } return session.getLocalRepositoryManager().getPathForLocalArtifact( aetherArtifact ); } @Override public String getPathForLocalArtifact( ArtifactCoordinate coordinate ) { Artifact aetherArtifact = toArtifact( coordinate ); // LRM.getPathForLocalArtifact() won't throw an Exception, so translate reflection error to RuntimeException return session.getLocalRepositoryManager().getPathForLocalArtifact( aetherArtifact ); } @Override public String getPathForLocalMetadata( ArtifactMetadata metadata ) { Metadata aetherMetadata = new DefaultMetadata( metadata.getGroupId(), metadata.storedInGroupDirectory() ? null : metadata.getArtifactId(), metadata.storedInArtifactVersionDirectory() ? metadata.getBaseVersion() : null, "maven-metadata.xml", Nature.RELEASE_OR_SNAPSHOT ); return session.getLocalRepositoryManager().getPathForLocalMetadata( aetherMetadata ); } @Override public ProjectBuildingRequest setLocalRepositoryBasedir( ProjectBuildingRequest buildingRequest, File basedir ) { ProjectBuildingRequest newRequest = new DefaultProjectBuildingRequest( buildingRequest ); RepositorySystemSession session; try { session = Invoker.invoke( buildingRequest, "getRepositorySession" ); } catch ( RepositoryManagerException e ) { throw new RuntimeException( e.getMessage(), e ); } // "clone" session and replace localRepository DefaultRepositorySystemSession newSession = new DefaultRepositorySystemSession( session ); // Clear cache, since we're using a new local repository newSession.setCache( new DefaultRepositoryCache() ); // keep same repositoryType String repositoryType = resolveRepositoryType( session.getLocalRepository() ); LocalRepositoryManager localRepositoryManager = repositorySystem.newLocalRepositoryManager( new LocalRepository( basedir, repositoryType ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\deploy\internal\Maven30ArtifactDeployer.java | 52 |
org\apache\maven\shared\transfer\artifact\deploy\internal\Maven31ArtifactDeployer.java | 52 |
this.repositorySystem = repositorySystem; this.session = session; } @Override public void deploy( Collection<org.apache.maven.artifact.Artifact> mavenArtifacts ) throws ArtifactDeployerException { deploy( null, mavenArtifacts ); } @Override public void deploy( ArtifactRepository remoteRepository, Collection<org.apache.maven.artifact.Artifact> mavenArtifacts ) throws ArtifactDeployerException { // prepare request DeployRequest request = new DeployRequest(); RemoteRepository defaultRepository = null; if ( remoteRepository != null ) { defaultRepository = getRemoteRepository( session, remoteRepository ); } // transform artifacts for ( org.apache.maven.artifact.Artifact mavenArtifact : mavenArtifacts ) { Artifact aetherArtifact = Invoker.invoke( RepositoryUtils.class, "toArtifact", org.apache.maven.artifact.Artifact.class, mavenArtifact ); request.addArtifact( aetherArtifact ); RemoteRepository aetherRepository; if ( remoteRepository == null ) { aetherRepository = getRemoteRepository( session, mavenArtifact.getRepository() ); } else { aetherRepository = defaultRepository; } request.setRepository( aetherRepository ); for ( ArtifactMetadata metadata : mavenArtifact.getMetadataList() ) { if ( metadata instanceof ProjectArtifactMetadata ) { Artifact pomArtifact = new SubArtifact( aetherArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata || metadata instanceof ArtifactRepositoryMetadata ) { // eaten, handled by repo system } else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata ) { org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMedata = |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30DependencyNodeAdapter.java | 39 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30DependencyNodeAdapter.java | 39 |
class Maven30DependencyNodeAdapter implements DependencyNode { private org.sonatype.aether.graph.DependencyNode dependencyNode; /** * @param dependencyNode {@link org.sonatype.aether.graph.DependencyNode} */ Maven30DependencyNodeAdapter( org.sonatype.aether.graph.DependencyNode dependencyNode ) { this.dependencyNode = dependencyNode; } @Override public Artifact getArtifact() { return getArtifact( dependencyNode.getDependency().getArtifact() ); } @Override public List<DependencyNode> getChildren() { List<org.sonatype.aether.graph.DependencyNode> aetherChildren = dependencyNode.getChildren(); List<DependencyNode> children = new ArrayList<>( aetherChildren.size() ); for ( org.sonatype.aether.graph.DependencyNode aetherChild : aetherChildren ) { children.add( new Maven30DependencyNodeAdapter( aetherChild ) ); } return children; } @Override public List<ArtifactRepository> getRemoteRepositories() { List<RemoteRepository> aetherRepositories = dependencyNode.getRepositories(); List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() ); for ( RemoteRepository aetherRepository : aetherRepositories ) { mavenRepositories.add( new Maven30ArtifactRepositoryAdapter( aetherRepository ) ); } return mavenRepositories; } @Override public Boolean getOptional() { return dependencyNode.getDependency().isOptional(); } @Override public String getScope() { return dependencyNode.getDependency().getScope(); } @Override public boolean accept( DependencyVisitor visitor ) { if ( visitor.visitEnter( this ) ) { for ( org.sonatype.aether.graph.DependencyNode aetherNode : dependencyNode.getChildren() ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven31DependencyNodeAdapter.java | 39 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31DependencyNodeAdapter.java | 39 |
class Maven31DependencyNodeAdapter implements DependencyNode { private org.eclipse.aether.graph.DependencyNode dependencyNode; /** * @param dependencyNode {@link org.eclipse.aether.graph.DependencyNode} */ Maven31DependencyNodeAdapter( org.eclipse.aether.graph.DependencyNode dependencyNode ) { this.dependencyNode = dependencyNode; } @Override public Artifact getArtifact() { return getArtifact( dependencyNode.getArtifact() ); } @Override public List<DependencyNode> getChildren() { List<org.eclipse.aether.graph.DependencyNode> aetherChildren = dependencyNode.getChildren(); List<DependencyNode> children = new ArrayList<>( aetherChildren.size() ); for ( org.eclipse.aether.graph.DependencyNode aetherChild : aetherChildren ) { children.add( new Maven31DependencyNodeAdapter( aetherChild ) ); } return children; } @Override public List<ArtifactRepository> getRemoteRepositories() { List<RemoteRepository> aetherRepositories = dependencyNode.getRepositories(); List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() ); for ( RemoteRepository aetherRepository : aetherRepositories ) { mavenRepositories.add( new Maven31ArtifactRepositoryAdapter( aetherRepository ) ); } return mavenRepositories; } @Override public String getScope() { return dependencyNode.getDependency().getScope(); } @Override public Boolean getOptional() { return dependencyNode.getDependency().getOptional(); } @Override public boolean accept( DependencyVisitor visitor ) { if ( visitor.visitEnter( this ) ) { for ( org.eclipse.aether.graph.DependencyNode aetherNode : dependencyNode.getChildren() ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven30DependencyResolver.java | 98 |
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven31DependencyResolver.java | 99 |
Object[] args = new Object[] {mavenDependency, typeRegistry}; return Invoker.invoke( RepositoryUtils.class, "toDependency", ARG_CLASSES, args ); } @Override // CHECKSTYLE_OFF: LineLength public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( DependableCoordinate coordinate, TransformableFilter dependencyFilter ) // CHECKSTYLE_ON: LineLength throws DependencyResolverException { ArtifactTypeRegistry typeRegistry = createTypeRegistry(); Dependency aetherRoot = toDependency( coordinate, typeRegistry ); CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories ); return resolveDependencies( dependencyFilter, request ); } private ArtifactTypeRegistry createTypeRegistry() throws DependencyResolverException { return Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); } @Override // CHECKSTYLE_OFF: LineLength public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Model model, TransformableFilter dependencyFilter ) // CHECKSTYLE_ON: LineLength throws DependencyResolverException { // Are there examples where packaging and type are NOT in sync ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( model.getPackaging() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( model.getGroupId(), model.getArtifactId(), extension, model.getVersion() ); Dependency aetherRoot = new Dependency( aetherArtifact, null ); CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories ); request.setDependencies( resolveDependencies( model.getDependencies() ) ); DependencyManagement mavenDependencyManagement = model.getDependencyManagement(); if ( mavenDependencyManagement != null ) { request.setManagedDependencies( resolveDependencies( mavenDependencyManagement.getDependencies() ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30DependencyCollector.java | 103 |
org\apache\maven\shared\transfer\collection\internal\Maven31DependencyCollector.java | 103 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30DependencyCollector.java | 109 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31DependencyCollector.java | 109 |
{ // Are there examples where packaging and type are NOT in sync ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() ); String extension = artifactHandler != null ? artifactHandler.getExtension() : null; Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension, root.getVersion() ); CollectRequest request = new CollectRequest(); request.setRoot( new Dependency( aetherArtifact, null ) ); ArtifactTypeRegistry typeRegistry = Invoker .invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class, artifactHandlerManager ); List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() ) { aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setDependencies( aetherDependencies ); if ( root.getDependencyManagement() != null ) { List<Dependency> aetherManagerDependencies = new ArrayList<>( root.getDependencyManagement().getDependencies().size() ); for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() ) { aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } request.setManagedDependencies( aetherManagerDependencies ); } return collectDependencies( request ); } private CollectResult collectDependencies( CollectRequest request ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\resolve\internal\Maven30ArtifactResolver.java | 50 |
org\apache\maven\shared\transfer\artifact\resolve\internal\Maven31ArtifactResolver.java | 50 |
Maven30ArtifactResolver( RepositorySystem repositorySystem, List<RemoteRepository> aetherRepositories, RepositorySystemSession session ) { this.repositorySystem = repositorySystem; this.aetherRepositories = aetherRepositories; this.session = session; } @Override // CHECKSTYLE_OFF: LineLength public org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult resolveArtifact( org.apache.maven.artifact.Artifact mavenArtifact ) throws ArtifactResolverException // CHECKSTYLE_ON: LineLength { Artifact aetherArtifact = Invoker.invoke( RepositoryUtils.class, "toArtifact", org.apache.maven.artifact.Artifact.class, mavenArtifact ); return resolveArtifact( aetherArtifact ); } @Override // CHECKSTYLE_OFF: LineLength public org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult resolveArtifact( ArtifactCoordinate coordinate ) throws ArtifactResolverException // CHECKSTYLE_ON: LineLength { Artifact aetherArtifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(), coordinate.getClassifier(), coordinate.getExtension(), coordinate.getVersion() ); return resolveArtifact( aetherArtifact ); } // CHECKSTYLE_OFF: LineLength private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult resolveArtifact( Artifact aetherArtifact ) throws ArtifactResolverException // CHECKSTYLE_ON: LineLength { try { // use descriptor to respect relocation ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest( aetherArtifact, aetherRepositories, null ); ArtifactDescriptorResult descriptorResult = repositorySystem.readArtifactDescriptor( session, descriptorRequest ); ArtifactRequest request = new ArtifactRequest( descriptorResult.getArtifact(), aetherRepositories, null ); return new Maven30ArtifactResult( repositorySystem.resolveArtifact( session, request ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\DefaultDependencyCollector.java | 161 |
org\apache\maven\shared\transfer\dependencies\collect\internal\DefaultDependencyCollector.java | 163 |
{ ArtifactHandlerManager artifactHandlerManager = container.lookup( ArtifactHandlerManager.class ); if ( isMaven31() ) { org.eclipse.aether.RepositorySystem m31RepositorySystem = container.lookup( org.eclipse.aether.RepositorySystem.class ); org.eclipse.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest, "getRepositorySession" ); List<org.eclipse.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke( RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() ); return new Maven31DependencyCollector( m31RepositorySystem, artifactHandlerManager, session, aetherRepositories ); } else { org.sonatype.aether.RepositorySystem m30RepositorySystem = container.lookup( org.sonatype.aether.RepositorySystem.class ); org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest, "getRepositorySession" ); List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke( RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() ); return new Maven30DependencyCollector( m30RepositorySystem, artifactHandlerManager, session, aetherRepositories ); } } } |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\install\internal\Maven30ArtifactInstaller.java | 47 |
org\apache\maven\shared\transfer\artifact\install\internal\Maven31ArtifactInstaller.java | 47 |
Maven30ArtifactInstaller( RepositorySystem repositorySystem, RepositorySystemSession session ) { this.repositorySystem = repositorySystem; this.session = session; } @Override public void install( Collection<org.apache.maven.artifact.Artifact> mavenArtifacts ) throws ArtifactInstallerException { // prepare installRequest InstallRequest request = new InstallRequest(); // transform artifacts for ( org.apache.maven.artifact.Artifact mavenArtifact : mavenArtifacts ) { Artifact mainArtifact = Invoker.invoke( RepositoryUtils.class, "toArtifact", org.apache.maven.artifact.Artifact.class, mavenArtifact ); request.addArtifact( mainArtifact ); for ( ArtifactMetadata metadata : mavenArtifact.getMetadataList() ) { if ( metadata instanceof ProjectArtifactMetadata ) { Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata || metadata instanceof ArtifactRepositoryMetadata ) { // eaten, handled by repo system } else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata ) { org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMedata = |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30DependencyNodeAdapter.java | 104 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30DependencyNodeAdapter.java | 104 |
if ( !child.accept( visitor ) ) { break; } } } return visitor.visitLeave( this ); } @Override public int hashCode() { return dependencyNode.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } Maven30DependencyNodeAdapter other = (Maven30DependencyNodeAdapter) obj; if ( dependencyNode == null ) { if ( other.dependencyNode != null ) { return false; } } else if ( !dependencyNode.equals( other.dependencyNode ) ) { return false; } return true; } private Artifact getArtifact( org.sonatype.aether.artifact.Artifact aetherArtifact ) { try { return Invoker.invoke( RepositoryUtils.class, "toArtifact", org.sonatype.aether.artifact.Artifact.class, aetherArtifact ); } catch ( DependencyCollectionException e ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven31DependencyNodeAdapter.java | 104 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31DependencyNodeAdapter.java | 104 |
if ( !child.accept( visitor ) ) { break; } } } return visitor.visitLeave( this ); } @Override public int hashCode() { return dependencyNode.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } Maven31DependencyNodeAdapter other = (Maven31DependencyNodeAdapter) obj; if ( dependencyNode == null ) { if ( other.dependencyNode != null ) { return false; } } else if ( !dependencyNode.equals( other.dependencyNode ) ) { return false; } return true; } private Artifact getArtifact( org.eclipse.aether.artifact.Artifact aetherArtifact ) { try { return Invoker.invoke( RepositoryUtils.class, "toArtifact", org.eclipse.aether.artifact.Artifact.class, aetherArtifact ); } catch ( DependencyCollectionException e ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven30DependencyResolver.java | 149 |
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven31DependencyResolver.java | 150 |
request.setManagedDependencies( resolveDependencies( mavenDependencyManagement.getDependencies() ) ); } return resolveDependencies( dependencyFilter, request ); } /** * @param mavenDependencies {@link org.apache.maven.model.Dependency} can be {@code null}. * @return List of resolved dependencies. * @throws DependencyResolverException in case of a failure of the typeRegistry error. */ // CHECKSTYLE_OFF: LineLength private List<Dependency> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies ) throws DependencyResolverException // CHECKSTYLE_ON: LineLength { if ( mavenDependencies == null ) { return Collections.emptyList(); } ArtifactTypeRegistry typeRegistry = createTypeRegistry(); List<Dependency> aetherDependencies = new ArrayList<>( mavenDependencies.size() ); for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies ) { aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) ); } return aetherDependencies; } @Override // CHECKSTYLE_OFF: LineLength public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies, Collection<org.apache.maven.model.Dependency> managedMavenDependencies, TransformableFilter filter ) // CHECKSTYLE_ON: LineLength throws DependencyResolverException { List<Dependency> aetherDependencies = resolveDependencies( mavenDependencies ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven30DependencyResolver.java | 64 |
org\apache\maven\shared\transfer\dependencies\resolve\internal\Maven31DependencyResolver.java | 65 |
Maven30DependencyResolver( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager, RepositorySystemSession session, List<RemoteRepository> aetherRepositories ) { super(); this.repositorySystem = repositorySystem; this.artifactHandlerManager = artifactHandlerManager; this.session = session; this.aetherRepositories = aetherRepositories; } /** * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry) * * @param coordinate {@link DependableCoordinate} * @param stereotypes {@link org.eclipse.aether.artifact.ArtifactTypeRegistry * @return as Aether Dependency */ private static Dependency toDependency( DependableCoordinate coordinate, ArtifactTypeRegistry stereotypes ) { ArtifactType stereotype = stereotypes.get( coordinate.getType() ); if ( stereotype == null ) { stereotype = new DefaultArtifactType( coordinate.getType() ); } Artifact artifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(), coordinate.getClassifier(), null, coordinate.getVersion(), null, stereotype ); return new Dependency( artifact, null ); } private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency, |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\deploy\internal\DefaultArtifactDeployer.java | 73 |
org\apache\maven\shared\transfer\artifact\install\internal\DefaultArtifactInstaller.java | 90 |
throw new ArtifactDeployerException( e.getMessage(), e ); } } private void validateParameters( ProjectBuildingRequest request, Collection<Artifact> mavenArtifacts ) { if ( request == null ) { throw new IllegalArgumentException( "The parameter request is not allowed to be null." ); } if ( mavenArtifacts == null ) { throw new IllegalArgumentException( "The parameter mavenArtifacts is not allowed to be null." ); } if ( mavenArtifacts.isEmpty() ) { throw new IllegalArgumentException( "The collection mavenArtifacts is not allowed to be empty." ); } } /** * @return true if the current Maven version is Maven 3.1. */ private boolean isMaven31() { try { // Maven 3.1 specific Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.artifact.Artifact" ); return true; } catch ( ClassNotFoundException e ) { return false; } } /** * Injects the Plexus content. * * @param context Plexus context to inject. * @throws ContextException if the PlexusContainer could not be located. */ public void contextualize( Context context ) throws ContextException { container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); } private MavenArtifactDeployer getMavenArtifactDeployer( ProjectBuildingRequest buildingRequest ) |
File | Line |
---|---|
org\apache\maven\shared\transfer\metadata\internal\Maven30MetadataBridge.java | 40 |
org\apache\maven\shared\transfer\metadata\internal\Maven31MetadataBridge.java | 38 |
public Maven30MetadataBridge( ArtifactMetadata metadata ) { this.metadata = metadata; } @Override public String getGroupId() { return emptify( metadata.getGroupId() ); } @Override public String getArtifactId() { return metadata.storedInGroupDirectory() ? "" : emptify( metadata.getArtifactId() ); } @Override public String getVersion() { return metadata.storedInArtifactVersionDirectory() ? emptify( metadata.getBaseVersion() ) : ""; } @Override public String getType() { return metadata.getRemoteFilename(); } private String emptify( String string ) { return ( string != null ) ? string : ""; } @Override public File getFile() { return file; |
File | Line |
---|---|
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30CollectorResult.java | 47 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31CollectorResult.java | 47 |
Maven30CollectorResult( CollectResult collectResult ) { this.collectResult = collectResult; } @Override public List<ArtifactRepository> getRemoteRepositories() { final Set<RemoteRepository> aetherRepositories = new HashSet<>(); DependencyVisitor visitor = new DependencyVisitor() { @Override public boolean visitEnter( DependencyNode node ) { aetherRepositories.addAll( node.getRepositories() ); return true; } @Override public boolean visitLeave( DependencyNode node ) { return true; } }; collectResult.getRoot().accept( visitor ); List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() ); for ( RemoteRepository aetherRepository : aetherRepositories ) { mavenRepositories.add( new Maven30ArtifactRepositoryAdapter( aetherRepository ) ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven30ArtifactRepositoryAdapter.java | 224 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven30ArtifactRepositoryAdapter.java | 224 |
sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]" ).append( LS ); return sb.toString(); } @Override public int hashCode() { return remoteRepository.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } Maven30ArtifactRepositoryAdapter other = (Maven30ArtifactRepositoryAdapter) obj; if ( remoteRepository == null ) { if ( other.remoteRepository != null ) { return false; } } else if ( !remoteRepository.equals( other.remoteRepository ) ) { return false; } return true; } } |
File | Line |
---|---|
org\apache\maven\shared\transfer\collection\internal\Maven31ArtifactRepositoryAdapter.java | 224 |
org\apache\maven\shared\transfer\dependencies\collect\internal\Maven31ArtifactRepositoryAdapter.java | 224 |
sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]" ).append( LS ); return sb.toString(); } @Override public int hashCode() { return remoteRepository.hashCode(); } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } Maven31ArtifactRepositoryAdapter other = (Maven31ArtifactRepositoryAdapter) obj; if ( remoteRepository == null ) { if ( other.remoteRepository != null ) { return false; } } else if ( !remoteRepository.equals( other.remoteRepository ) ) { return false; } return true; } } |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\deploy\internal\Maven30ArtifactDeployer.java | 101 |
org\apache\maven\shared\transfer\artifact\install\internal\Maven30ArtifactInstaller.java | 71 |
Artifact pomArtifact = new SubArtifact( aetherArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata || metadata instanceof ArtifactRepositoryMetadata ) { // eaten, handled by repo system } else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata ) { org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMedata = ( org.apache.maven.shared.transfer.metadata.ArtifactMetadata ) metadata; request.addMetadata( new Maven30MetadataBridge( metadata ).setFile( transferMedata.getFile() ) ); } } } // deploy try { repositorySystem.deploy( session, request ); |
File | Line |
---|---|
org\apache\maven\shared\transfer\artifact\deploy\internal\Maven31ArtifactDeployer.java | 99 |
org\apache\maven\shared\transfer\artifact\install\internal\Maven31ArtifactInstaller.java | 72 |
Artifact pomArtifact = new SubArtifact( aetherArtifact, "", "pom" ); pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); request.addArtifact( pomArtifact ); } else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata || metadata instanceof ArtifactRepositoryMetadata ) { // eaten, handled by repo system } else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata ) { org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMetadata = (org.apache.maven.shared.transfer.metadata.ArtifactMetadata) metadata; request.addMetadata( new Maven31MetadataBridge( metadata ).setFile( transferMetadata.getFile() ) ); } } } // deploy try { repositorySystem.deploy( session, request ); |