diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository')
15 files changed, 0 insertions, 1489 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java deleted file mode 100644 index 296f4ea5..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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. - */ - -public class ArtifactDoesNotExistException - extends Exception -{ - public ArtifactDoesNotExistException( final String message ) - { - super( message ); - } - - public ArtifactDoesNotExistException( final String message, final Throwable cause ) - { - super( message, cause ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java deleted file mode 100644 index 80189e7b..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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.EventObject; - -/** - * TransferEvent is used to notify TransferListeners about progress - * in transfer of resources form/to the repository - * - * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a> - */ -public class ArtifactTransferEvent - extends EventObject -{ - /** - * A transfer was attempted, but has not yet commenced. - */ - public static final int TRANSFER_INITIATED = 0; - - /** - * A transfer was started. - */ - public static final int TRANSFER_STARTED = 1; - - /** - * A transfer is completed. - */ - public static final int TRANSFER_COMPLETED = 2; - - /** - * A transfer is in progress. - */ - public static final int TRANSFER_PROGRESS = 3; - - /** - * An error occurred during transfer - */ - public static final int TRANSFER_ERROR = 4; - - /** - * Indicates GET transfer (from the repository) - */ - public static final int REQUEST_GET = 5; - - /** - * Indicates PUT transfer (to the repository) - */ - public static final int REQUEST_PUT = 6; - - private int eventType; - - private int requestType; - - private Exception exception; - - private File localFile; - - private ArtifactTransferResource artifact; - - private long transferredBytes; - - private byte[] dataBuffer; - - private int dataOffset; - - private int dataLength; - - public ArtifactTransferEvent( String wagon, final int eventType, final int requestType, - ArtifactTransferResource artifact ) - { - super( wagon ); - - setEventType( eventType ); - - setRequestType( requestType ); - - this.artifact = artifact; - } - - public ArtifactTransferEvent( String wagon, final Exception exception, final int requestType, - ArtifactTransferResource artifact ) - { - this( wagon, TRANSFER_ERROR, requestType, artifact ); - - this.exception = exception; - } - - public ArtifactTransferResource getResource() - { - return artifact; - } - - /** - * @return Returns the exception. - */ - public Exception getException() - { - return exception; - } - - /** - * Returns the request type. - * - * @return Returns the request type. The Request type is one of - * <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code> - */ - public int getRequestType() - { - return requestType; - } - - /** - * Sets the request type - * - * @param requestType The requestType to set. - * The Request type value should be either - * <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code>. - * @throws IllegalArgumentException when - */ - public void setRequestType( final int requestType ) - { - switch ( requestType ) - { - - case REQUEST_PUT: - break; - case REQUEST_GET: - break; - - default : - throw new IllegalArgumentException( "Illegal request type: " + requestType ); - } - - this.requestType = requestType; - } - - /** - * @return Returns the eventType. - */ - public int getEventType() - { - return eventType; - } - - /** - * @param eventType The eventType to set. - */ - public void setEventType( final int eventType ) - { - switch ( eventType ) - { - - case TRANSFER_INITIATED: - break; - case TRANSFER_STARTED: - break; - case TRANSFER_COMPLETED: - break; - case TRANSFER_PROGRESS: - break; - case TRANSFER_ERROR: - break; - default : - throw new IllegalArgumentException( "Illegal event type: " + eventType ); - } - - this.eventType = eventType; - } - - /** - * @return Returns the local file. - */ - public File getLocalFile() - { - return localFile; - } - - /** - * @param localFile The local file to set. - */ - public void setLocalFile( File localFile ) - { - this.localFile = localFile; - } - - public long getTransferredBytes() - { - return transferredBytes; - } - - public void setTransferredBytes( long transferredBytes ) - { - this.transferredBytes = transferredBytes; - } - - public byte[] getDataBuffer() - { - return dataBuffer; - } - - public void setDataBuffer( byte[] dataBuffer ) - { - this.dataBuffer = dataBuffer; - } - - public int getDataOffset() - { - return dataOffset; - } - - public void setDataOffset( int dataOffset ) - { - this.dataOffset = dataOffset; - } - - public int getDataLength() - { - return dataLength; - } - - public void setDataLength( int dataLength ) - { - this.dataLength = dataLength; - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - sb.append( "TransferEvent[" ); - - switch ( this.getRequestType() ) - { - case REQUEST_GET: - sb.append( "GET" ); - break; - case REQUEST_PUT: - sb.append( "PUT" ); - break; - default: - sb.append( this.getRequestType() ); - break; - } - - sb.append( "|" ); - switch ( this.getEventType() ) - { - case TRANSFER_COMPLETED: - sb.append( "COMPLETED" ); - break; - case TRANSFER_ERROR: - sb.append( "ERROR" ); - break; - case TRANSFER_INITIATED: - sb.append( "INITIATED" ); - break; - case TRANSFER_PROGRESS: - sb.append( "PROGRESS" ); - break; - case TRANSFER_STARTED: - sb.append( "STARTED" ); - break; - default: - sb.append( this.getEventType() ); - break; - } - - sb.append( "|" ); - sb.append( this.getLocalFile() ).append( "|" ); - sb.append( "]" ); - - return sb.toString(); - } - - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + eventType; - result = prime * result + ( ( exception == null ) ? 0 : exception.hashCode() ); - result = prime * result + ( ( localFile == null ) ? 0 : localFile.hashCode() ); - result = prime * result + requestType; - return result; - } - - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - if ( ( obj == null ) || ( getClass() != obj.getClass() ) ) - { - return false; - } - final ArtifactTransferEvent other = (ArtifactTransferEvent) obj; - if ( eventType != other.eventType ) - { - return false; - } - if ( exception == null ) - { - if ( other.exception != null ) - { - return false; - } - } - else if ( !exception.getClass().equals( other.exception.getClass() ) ) - { - return false; - } - if ( requestType != other.requestType ) - { - return false; - } - else if ( !source.equals( other.source ) ) - { - return false; - } - return true; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java deleted file mode 100644 index 9315f4c7..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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. - */ - -public class ArtifactTransferFailedException - extends Exception -{ - public ArtifactTransferFailedException( final String message ) - { - super( message ); - } - - public ArtifactTransferFailedException( final String message, final Throwable cause ) - { - super( message, cause ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java deleted file mode 100644 index 72a56cf0..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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. - */ - -public interface ArtifactTransferListener -{ - boolean isShowChecksumEvents(); - - void setShowChecksumEvents( boolean showChecksumEvents ); - - void transferInitiated( ArtifactTransferEvent transferEvent ); - - void transferStarted( ArtifactTransferEvent transferEvent ); - - void transferProgress( ArtifactTransferEvent transferEvent ); - - void transferCompleted( ArtifactTransferEvent transferEvent ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java deleted file mode 100644 index 8ed081ff..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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. - */ - -/** - * Describes a resource being uploaded or downloaded by the repository system. - * - * @author Benjamin Bentmann - */ -public interface ArtifactTransferResource -{ - - /** - * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be - * terminated by a trailing slash. - * - * @return The base URL of the repository or an empty string if unknown, never {@code null}. - */ - String getRepositoryUrl(); - - /** - * The path of the artifact relative to the repository's base URL. - * - * @return The path of the artifact, never {@code null}. - */ - String getName(); - - /** - * Gets the full URL of the artifact. - * - * @return The full URL of the artifact, never {@code null}. - */ - String getUrl(); - - /** - * The size of the artifact in bytes. - * - * @return The of the artifact in bytes or a negative value if unknown. - */ - long getContentLength(); - - /** - * Gets the timestamp when the transfer of this artifact was started. - * - * @return The timestamp when the transfer of this artifact was started. - */ - long getTransferStartTime(); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java deleted file mode 100644 index f47cb4b1..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java +++ /dev/null @@ -1,195 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; -import org.apache.maven.artifact.repository.MavenArtifactRepository; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; - -/** - * Delegating local artifact repository chains the reactor, IDE workspace - * and user local repository. - */ -@Deprecated -public class DelegatingLocalArtifactRepository - extends MavenArtifactRepository -{ - private LocalArtifactRepository buildReactor; - - private LocalArtifactRepository ideWorkspace; - - private ArtifactRepository userLocalArtifactRepository; - - public DelegatingLocalArtifactRepository( ArtifactRepository artifactRepository ) - { - this.userLocalArtifactRepository = artifactRepository; - } - - public void setBuildReactor( LocalArtifactRepository localRepository ) - { - this.buildReactor = localRepository; - } - - public void setIdeWorkspace( LocalArtifactRepository localRepository ) - { - this.ideWorkspace = localRepository; - } - - public LocalArtifactRepository getIdeWorspace() - { - return ideWorkspace; - } - - @Override - public Artifact find( Artifact artifact ) - { - if ( !artifact.isRelease() && buildReactor != null ) - { - artifact = buildReactor.find( artifact ); - } - - if ( !artifact.isResolved() && ideWorkspace != null ) - { - artifact = ideWorkspace.find( artifact ); - } - - if ( !artifact.isResolved() ) - { - artifact = userLocalArtifactRepository.find( artifact ); - } - - return artifact; - } - - @Override - public List<String> findVersions( Artifact artifact ) - { - Collection<String> versions = new LinkedHashSet<String>(); - - if ( buildReactor != null ) - { - versions.addAll( buildReactor.findVersions( artifact ) ); - } - - if ( ideWorkspace != null ) - { - versions.addAll( ideWorkspace.findVersions( artifact ) ); - } - - versions.addAll( userLocalArtifactRepository.findVersions( artifact ) ); - - return Collections.unmodifiableList( new ArrayList<String>( versions ) ); - } - - public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) - { - return userLocalArtifactRepository.pathOfLocalRepositoryMetadata( metadata, repository ); - } - - public String getId() - { - return userLocalArtifactRepository.getId(); - } - - @Override - public String pathOf( Artifact artifact ) - { - return userLocalArtifactRepository.pathOf( artifact ); - } - - @Override - public String getBasedir() - { - return ( userLocalArtifactRepository != null ) ? userLocalArtifactRepository.getBasedir() : null; - } - - @Override - public ArtifactRepositoryLayout getLayout() - { - return userLocalArtifactRepository.getLayout(); - } - - @Override - public ArtifactRepositoryPolicy getReleases() - { - return userLocalArtifactRepository.getReleases(); - } - - @Override - public ArtifactRepositoryPolicy getSnapshots() - { - return userLocalArtifactRepository.getSnapshots(); - } - - @Override - public String getKey() - { - return userLocalArtifactRepository.getKey(); - } - - @Override - public String getUrl() - { - return userLocalArtifactRepository.getUrl(); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + ( buildReactor == null ? 0 : buildReactor.hashCode() ); - hash = hash * 31 + ( ideWorkspace == null ? 0 : ideWorkspace.hashCode() ); - hash = hash * 31 + ( userLocalArtifactRepository == null ? 0 : userLocalArtifactRepository.hashCode() ); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - if ( obj == null ) - { - return false; - } - if ( getClass() != obj.getClass() ) - { - return false; - } - - DelegatingLocalArtifactRepository other = (DelegatingLocalArtifactRepository) obj; - - return eq( buildReactor, other.buildReactor ) - && eq( ideWorkspace, other.ideWorkspace ) - && eq( userLocalArtifactRepository, other.userLocalArtifactRepository ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java deleted file mode 100644 index e33789e3..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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.repository.MavenArtifactRepository; - -public abstract class LocalArtifactRepository - extends MavenArtifactRepository -{ - public static final String IDE_WORKSPACE = "ide-workspace"; - - public abstract Artifact find( Artifact artifact ); - - public abstract boolean hasLocalMetadata(); -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java deleted file mode 100644 index 54e4ef4b..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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.IOException; - -/** - * Signals a failure to store files within the local repository. - * - * @author Benjamin Bentmann - */ -public class LocalRepositoryNotAccessibleException - extends IOException -{ - - public LocalRepositoryNotAccessibleException( String message, Throwable cause ) - { - super( message ); - initCause( cause ); - } - - public LocalRepositoryNotAccessibleException( String message ) - { - super( message ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java deleted file mode 100644 index fcc0f777..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.apache.maven.repository; - -/* - * 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.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.InvalidRepositoryException; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; -import org.apache.maven.artifact.resolver.ArtifactResolutionResult; -import org.apache.maven.model.Dependency; -import org.apache.maven.model.Plugin; -import org.apache.maven.model.Repository; -import org.apache.maven.settings.Mirror; -import org.apache.maven.settings.Server; -import org.eclipse.aether.RepositorySystemSession; - -/** - * @author Jason van Zyl - * @since 3.0-alpha - */ -public interface RepositorySystem -{ - String DEFAULT_LOCAL_REPO_ID = "local"; - - String userHome = System.getProperty( "user.home" ); - - File userMavenConfigurationHome = new File( userHome, ".m2" ); - - File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" ); - - String DEFAULT_REMOTE_REPO_ID = "central"; - - String DEFAULT_REMOTE_REPO_URL = "https://repo.maven.apache.org/maven2"; - - Artifact createArtifact( String groupId, String artifactId, String version, String packaging ); - - Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ); - - Artifact createProjectArtifact( String groupId, String artifactId, String version ); - - Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, - String classifier ); - - Artifact createPluginArtifact( Plugin plugin ); - - Artifact createDependencyArtifact( Dependency dependency ); - - ArtifactRepository buildArtifactRepository( Repository repository ) - throws InvalidRepositoryException; - - ArtifactRepository createDefaultRemoteRepository() - throws InvalidRepositoryException; - - ArtifactRepository createDefaultLocalRepository() - throws InvalidRepositoryException; - - ArtifactRepository createLocalRepository( File localRepository ) - throws InvalidRepositoryException; - - ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, - ArtifactRepositoryPolicy snapshots, - ArtifactRepositoryPolicy releases ); - - /** - * Calculates the effective repositories for the given input repositories which are assumed to be already mirrored - * (if applicable). This process will essentially remove duplicate repositories by merging them into one equivalent - * repository. It is worth to point out that merging does not simply choose one of the input repositories and - * discards the others but actually combines their possibly different policies. - * - * @param repositories The original repositories, may be {@code null}. - * @return The effective repositories or {@code null} if the input was {@code null}. - */ - List<ArtifactRepository> getEffectiveRepositories( List<ArtifactRepository> repositories ); - - /** - * Determines the mirror for the specified repository. - * - * @param repository The repository to determine the mirror for, must not be {@code null}. - * @param mirrors The available mirrors, may be {@code null}. - * @return The mirror specification for the repository or {@code null} if no mirror matched. - */ - Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors ); - - /** - * Injects the mirroring information into the specified repositories. For each repository that is matched by a - * mirror, its URL and ID will be updated to match the values from the mirror specification. Repositories without a - * matching mirror will pass through unchanged. <em>Note:</em> This method must be called before - * {@link #injectAuthentication(List, List)} or the repositories will end up with the wrong credentials. - * - * @param repositories The repositories into which to inject the mirror information, may be {@code null}. - * @param mirrors The available mirrors, may be {@code null}. - */ - void injectMirror( List<ArtifactRepository> repositories, List<Mirror> mirrors ); - - /** - * Injects the proxy information into the specified repositories. For each repository that is matched by a proxy, - * its proxy data will be set accordingly. Repositories without a matching proxy will have their proxy cleared. - * <em>Note:</em> This method must be called after {@link #injectMirror(List, List)} or the repositories will end up - * with the wrong proxies. - * - * @param repositories The repositories into which to inject the proxy information, may be {@code null}. - * @param proxies The available proxies, may be {@code null}. - */ - void injectProxy( List<ArtifactRepository> repositories, List<org.apache.maven.settings.Proxy> proxies ); - - /** - * Injects the authentication information into the specified repositories. For each repository that is matched by a - * server, its credentials will be updated to match the values from the server specification. Repositories without a - * matching server will have their credentials cleared. <em>Note:</em> This method must be called after - * {@link #injectMirror(List, List)} or the repositories will end up with the wrong credentials. - * - * @param repositories The repositories into which to inject the authentication information, may be {@code null}. - * @param servers The available servers, may be {@code null}. - */ - void injectAuthentication( List<ArtifactRepository> repositories, List<Server> servers ); - - void injectMirror( RepositorySystemSession session, List<ArtifactRepository> repositories ); - - void injectProxy( RepositorySystemSession session, List<ArtifactRepository> repositories ); - - void injectAuthentication( RepositorySystemSession session, List<ArtifactRepository> repositories ); - - ArtifactResolutionResult resolve( ArtifactResolutionRequest request ); - - // Install - - // Deploy - - // Map types of artifacts - - // - // Raw file transfers - // - void publish( ArtifactRepository repository, File source, String remotePath, - ArtifactTransferListener transferListener ) - throws ArtifactTransferFailedException; - - void retrieve( ArtifactRepository repository, File destination, String remotePath, - ArtifactTransferListener transferListener ) - throws ArtifactTransferFailedException, ArtifactDoesNotExistException; - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java deleted file mode 100644 index 352e5bbb..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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; - -/** - * Common elements of artifact metadata. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public abstract class AbstractArtifactMetadata - implements ArtifactMetadata -{ - protected Artifact artifact; - - protected AbstractArtifactMetadata( Artifact artifact ) - { - this.artifact = artifact; - } - - public boolean storedInGroupDirectory() - { - return false; - } - - public String getGroupId() - { - return artifact.getGroupId(); - } - - public String getArtifactId() - { - return artifact.getArtifactId(); - } - - public String extendedToString() - { - StringBuilder buffer = new StringBuilder(); - - buffer.append( "\nArtifact Metadata\n--------------------------" ); - buffer.append( "\nGroupId: " ).append( getGroupId() ); - buffer.append( "\nArtifactId: " ).append( getArtifactId() ); - buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); - - return buffer.toString(); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java deleted file mode 100644 index 67b4080b..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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; - -/** - * Error while retrieving repository metadata from the repository. - * - * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> - */ -public class ArtifactMetadataRetrievalException - extends Exception -{ - private Artifact artifact; - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( String message ) - { - this( message, null, null ); - } - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( Throwable cause ) - { - this( null, cause, null ); - } - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( String message, - Throwable cause ) - { - this( message, cause, null ); - } - - public ArtifactMetadataRetrievalException( String message, - Throwable cause, - Artifact artifact ) - { - super( message, cause ); - this.artifact = artifact; - } - - public Artifact getArtifact() - { - return artifact; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java deleted file mode 100644 index aaa0ee34..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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; -import org.apache.maven.artifact.versioning.ArtifactVersion; - -/** - * Provides some metadata operations, like querying the remote repository for a list of versions available for an - * artifact. - * - * @author <a href="mailto:jason@maven.org">Jason van Zyl </a> - */ -public interface ArtifactMetadataSource -{ - - ResolutionGroup retrieve( MetadataResolutionRequest request ) - throws ArtifactMetadataRetrievalException; - - ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories ) - throws ArtifactMetadataRetrievalException; - - /** - * Get a list of available versions for an artifact in the remote repository - * - * @param artifact artifact we are interested in. Only <code>groupid</code> and <code>artifactId</code> - * are needed, for instance the following code will work - * <code>artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )</code> - * @param localRepository local repository - * @param remoteRepositories remote repositories, {@link List} $lt; {@link ArtifactRepository} > - * @return {@link List} $lt; {@link ArtifactVersion} > - * @throws ArtifactMetadataRetrievalException - * in case of error while retrieving repository metadata from the repository. - */ - List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories ) - throws ArtifactMetadataRetrievalException; - - /** - * Get a list of available versions for an artifact in the remote deployment repository. This ignores any update - * policy checks and mirrors and always retrieves the latest information from the given repository. - * - * @param artifact artifact we are interested in. Only <code>groupid</code> and <code>artifactId</code> are - * needed, for instance the following code will work - * <code>artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )</code> - * @param localRepository local repository - * @param remoteRepository remote repository - * @return {@link List} $lt; {@link ArtifactVersion} > - * @throws ArtifactMetadataRetrievalException - * in case of error while retrieving repository metadata from the repository. - */ - List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact, - ArtifactRepository localRepository, - ArtifactRepository remoteRepository ) - throws ArtifactMetadataRetrievalException; - -}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java deleted file mode 100644 index 93b9d5da..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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; -import org.apache.maven.artifact.repository.DefaultRepositoryRequest; -import org.apache.maven.artifact.repository.RepositoryRequest; -import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; - -/** - * Forms a request to retrieve artifact metadata. - * - * @author Benjamin Bentmann - */ -public class DefaultMetadataResolutionRequest - implements MetadataResolutionRequest -{ - - private Artifact artifact; - - private boolean resolveManagedVersions; - - private RepositoryRequest repositoryRequest; - - public DefaultMetadataResolutionRequest() - { - repositoryRequest = new DefaultRepositoryRequest(); - } - - public DefaultMetadataResolutionRequest( RepositoryRequest repositoryRequest ) - { - this.repositoryRequest = new DefaultRepositoryRequest( repositoryRequest ); - } - - public DefaultMetadataResolutionRequest( ArtifactResolutionRequest resolutionRequest ) - { - this.repositoryRequest = new DefaultRepositoryRequest( resolutionRequest ); - } - - public Artifact getArtifact() - { - return artifact; - } - - public DefaultMetadataResolutionRequest setArtifact( Artifact artifact ) - { - this.artifact = artifact; - - return this; - } - - public ArtifactRepository getLocalRepository() - { - return repositoryRequest.getLocalRepository(); - } - - public DefaultMetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository ) - { - repositoryRequest.setLocalRepository( localRepository ); - - return this; - } - - public List<ArtifactRepository> getRemoteRepositories() - { - return repositoryRequest.getRemoteRepositories(); - } - - public DefaultMetadataResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) - { - repositoryRequest.setRemoteRepositories( remoteRepositories ); - - return this; - } - - public boolean isResolveManagedVersions() - { - return resolveManagedVersions; - } - - public DefaultMetadataResolutionRequest setResolveManagedVersions( boolean resolveManagedVersions ) - { - this.resolveManagedVersions = resolveManagedVersions; - - return this; - } - - public boolean isOffline() - { - return repositoryRequest.isOffline(); - } - - public DefaultMetadataResolutionRequest setOffline( boolean offline ) - { - repositoryRequest.setOffline( offline ); - - return this; - } - - public boolean isForceUpdate() - { - return repositoryRequest.isForceUpdate(); - } - - public DefaultMetadataResolutionRequest setForceUpdate( boolean forceUpdate ) - { - repositoryRequest.setForceUpdate( forceUpdate ); - - return this; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java deleted file mode 100644 index a652c977..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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; -import org.apache.maven.artifact.repository.RepositoryRequest; - -/** - * Forms a request to retrieve artifact metadata. - * - * @author Benjamin Bentmann - */ -public interface MetadataResolutionRequest - extends RepositoryRequest -{ - - /** - * Indicates whether network access to remote repositories has been disabled. - * - * @return {@code true} if remote access has been disabled, {@code false} otherwise. - */ - boolean isOffline(); - - /** - * Enables/disables network access to remote repositories. - * - * @param offline {@code true} to disable remote access, {@code false} to allow network access. - * @return This request, never {@code null}. - */ - MetadataResolutionRequest setOffline( boolean offline ); - - /** - * Gets the artifact to resolve metadata for. - * - * @return The artifact to resolve metadata for or {@code null} if not set. - */ - Artifact getArtifact(); - - /** - * Sets the artifact for which to resolve metadata. - * - * @param artifact The artifact for which to resolve metadata. - * @return This request, never {@code null}. - */ - MetadataResolutionRequest setArtifact( Artifact artifact ); - - /** - * Gets the local repository to use for the resolution. - * - * @return The local repository to use for the resolution or {@code null} if not set. - */ - ArtifactRepository getLocalRepository(); - - /** - * Sets the local repository to use for the resolution. - * - * @param localRepository The local repository to use for the resolution. - * @return This request, never {@code null}. - */ - MetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository ); - - /** - * Gets the remote repositories to use for the resolution. - * - * @return The remote repositories to use for the resolution, never {@code null}. - */ - List<ArtifactRepository> getRemoteRepositories(); - - /** - * Sets the remote repositories to use for the resolution. - * - * @param remoteRepositories The remote repositories to use for the resolution. - * @return This request, never {@code null}. - */ - MetadataResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); - - /** - * Determines whether the managed version information should be retrieved. - * - * @return {@code true} if the dependency management information should be retrieved, {@code false} otherwise. - */ - boolean isResolveManagedVersions(); - - /** - * Enables/disables resolution of the dependency manageemnt information. - * - * @param resolveManagedVersions {@code true} if the dependency management information should be retrieved, {@code - * false} otherwise. - * @return This request, never {@code null}. - */ - MetadataResolutionRequest setResolveManagedVersions( boolean resolveManagedVersions ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java deleted file mode 100644 index e942f70a..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.apache.maven.repository.legacy.metadata; - -/* - * 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.repository.ArtifactRepository; - -public class ResolutionGroup -{ - - private final Set<Artifact> artifacts; - - private final List<ArtifactRepository> resolutionRepositories; - - private final Artifact pomArtifact; - - private final Artifact relocatedArtifact; - - private final Map<String, Artifact> managedVersions; - - public ResolutionGroup( Artifact pomArtifact, Set<Artifact> artifacts, - List<ArtifactRepository> resolutionRepositories ) - { - this( pomArtifact, null, artifacts, null, resolutionRepositories ); - } - - public ResolutionGroup( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts, - Map<String, Artifact> managedVersions, List<ArtifactRepository> resolutionRepositories ) - { - this.pomArtifact = pomArtifact; - this.relocatedArtifact = relocatedArtifact; - this.artifacts = artifacts; - this.managedVersions = managedVersions; - this.resolutionRepositories = resolutionRepositories; - } - - public Artifact getPomArtifact() - { - return pomArtifact; - } - - public Artifact getRelocatedArtifact() - { - return relocatedArtifact; - } - - public Set<Artifact> getArtifacts() - { - return artifacts; - } - - public List<ArtifactRepository> getResolutionRepositories() - { - return resolutionRepositories; - } - - public Map<String, Artifact> getManagedVersions() - { - return managedVersions; - } - -} |