diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact')
40 files changed, 0 insertions, 4733 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java deleted file mode 100644 index b54ba070..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.apache.maven.artifact; - -/* - * 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. - */ - -/** - * Exception that occurs when an artifact file is used, but has not been resolved. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @todo it may be better for artifact.getFile() to throw it - perhaps it is a runtime exception? - */ -public class DependencyResolutionRequiredException - extends Exception -{ - public DependencyResolutionRequiredException( Artifact artifact ) - { - super( "Attempted to access the artifact " + artifact + "; which has not yet been resolved" ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java deleted file mode 100644 index 62991f11..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.apache.maven.artifact; - -/* - * 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.net.MalformedURLException; - -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; - -/** - * Error constructing an artifact repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class InvalidRepositoryException - extends Exception -{ - private final String repositoryId; - - public InvalidRepositoryException( String message, String repositoryId, MalformedURLException cause ) - { - super( message, cause ); - this.repositoryId = repositoryId; - } - - protected InvalidRepositoryException( String message, String repositoryId, ComponentLookupException cause ) - { - super( message, cause ); - this.repositoryId = repositoryId; - } - - @Deprecated - public InvalidRepositoryException( String message, Throwable t ) - { - super( message, t ); - this.repositoryId = null; - } - - public InvalidRepositoryException( String message, String repositoryId ) - { - super( message ); - this.repositoryId = repositoryId; - } - - public String getRepositoryId() - { - return repositoryId; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java deleted file mode 100644 index a16f64f6..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.apache.maven.artifact.factory; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.versioning.VersionRange; - -@Deprecated -public interface ArtifactFactory -{ - @Deprecated - String ROLE = ArtifactFactory.class.getName(); - - Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ); - - Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, - String classifier ); - - Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope ); - - Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope, boolean optional ); - - Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope, String inheritedScope ); - - Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope, String inheritedScope, boolean optional ); - - Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ); - - Artifact createProjectArtifact( String groupId, String artifactId, String version ); - - Artifact createParentArtifact( String groupId, String artifactId, String version ); - - Artifact createPluginArtifact( String groupId, String artifactId, VersionRange versionRange ); - - Artifact createProjectArtifact( String groupId, String artifactId, String version, String scope ); - - Artifact createExtensionArtifact( String groupId, String artifactId, VersionRange versionRange ); -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java deleted file mode 100644 index dfcac019..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.apache.maven.artifact.factory; - -/* - * 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.DefaultArtifact; -import org.apache.maven.artifact.handler.ArtifactHandler; -import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; -import org.apache.maven.artifact.versioning.VersionRange; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; - -@Component( role = ArtifactFactory.class ) -public class DefaultArtifactFactory - implements ArtifactFactory -{ - @Requirement - private ArtifactHandlerManager artifactHandlerManager; - - public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ) - { - return createArtifact( groupId, artifactId, version, scope, type, null, null ); - } - - public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, - String classifier ) - { - return createArtifact( groupId, artifactId, version, null, type, classifier, null ); - } - - public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, - String type, String classifier, String scope ) - { - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, null ); - } - - public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, - String type, String classifier, String scope, boolean optional ) - { - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, null, optional ); - } - - public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, - String type, String classifier, String scope, String inheritedScope ) - { - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); - } - - public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, - String type, String classifier, String scope, String inheritedScope, - boolean optional ) - { - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, optional ); - } - - public Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ) - { - return createArtifact( groupId, artifactId, version, null, packaging, null, null ); - } - - public Artifact createProjectArtifact( String groupId, String artifactId, String version ) - { - return createProjectArtifact( groupId, artifactId, version, null ); - } - - public Artifact createParentArtifact( String groupId, String artifactId, String version ) - { - return createProjectArtifact( groupId, artifactId, version ); - } - - public Artifact createPluginArtifact( String groupId, String artifactId, VersionRange versionRange ) - { - return createArtifact( groupId, artifactId, versionRange, "maven-plugin", null, Artifact.SCOPE_RUNTIME, null ); - } - - public Artifact createProjectArtifact( String groupId, String artifactId, String version, String scope ) - { - return createArtifact( groupId, artifactId, version, scope, "pom" ); - } - - public Artifact createExtensionArtifact( String groupId, String artifactId, VersionRange versionRange ) - { - return createArtifact( groupId, artifactId, versionRange, "jar", null, Artifact.SCOPE_RUNTIME, null ); - } - - private Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type, - String classifier, String inheritedScope ) - { - VersionRange versionRange = null; - if ( version != null ) - { - versionRange = VersionRange.createFromVersion( version ); - } - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); - } - - private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope, String inheritedScope ) - { - return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, false ); - } - - private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String classifier, String scope, String inheritedScope, boolean optional ) - { - String desiredScope = Artifact.SCOPE_RUNTIME; - - if ( inheritedScope == null ) - { - desiredScope = scope; - } - else if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_PROVIDED.equals( scope ) ) - { - return null; - } - else if ( Artifact.SCOPE_COMPILE.equals( scope ) && Artifact.SCOPE_COMPILE.equals( inheritedScope ) ) - { - // added to retain compile artifactScope. Remove if you want compile inherited as runtime - desiredScope = Artifact.SCOPE_COMPILE; - } - - if ( Artifact.SCOPE_TEST.equals( inheritedScope ) ) - { - desiredScope = Artifact.SCOPE_TEST; - } - - if ( Artifact.SCOPE_PROVIDED.equals( inheritedScope ) ) - { - desiredScope = Artifact.SCOPE_PROVIDED; - } - - if ( Artifact.SCOPE_SYSTEM.equals( scope ) ) - { - // system scopes come through unchanged... - desiredScope = Artifact.SCOPE_SYSTEM; - } - - ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type ); - - return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler, - optional ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java deleted file mode 100644 index 628f38bc..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.apache.maven.artifact.handler; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.codehaus.plexus.component.annotations.Component; - -/** - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @author Jason van Zyl - */ -@Component( role = ArtifactHandler.class ) -public class DefaultArtifactHandler - implements ArtifactHandler -{ - private String extension; - - private String type; - - private String classifier; - - private String directory; - - private String packaging; - - private boolean includesDependencies; - - private String language; - - private boolean addedToClasspath; - - public DefaultArtifactHandler() - { - } - - public DefaultArtifactHandler( String type ) - { - this.type = type; - } - - public String getExtension() - { - if ( extension == null ) - { - extension = type; - } - return extension; - } - - public void setExtension( String extension ) - { - this.extension = extension; - } - - public String getType() - { - return type; - } - - public String getClassifier() - { - return classifier; - } - - public String getDirectory() - { - if ( directory == null ) - { - directory = getPackaging() + "s"; - } - return directory; - } - - public String getPackaging() - { - if ( packaging == null ) - { - packaging = type; - } - return packaging; - } - - public boolean isIncludesDependencies() - { - return includesDependencies; - } - - public void setIncludesDependencies( boolean includesDependencies ) - { - this.includesDependencies = includesDependencies; - } - - public String getLanguage() - { - if ( language == null ) - { - language = "none"; - } - - return language; - } - - public void setLanguage( String language ) - { - this.language = language; - } - - public boolean isAddedToClasspath() - { - return addedToClasspath; - } - - public void setAddedToClasspath( boolean addedToClasspath ) - { - this.addedToClasspath = addedToClasspath; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java deleted file mode 100644 index cada9e93..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.apache.maven.artifact.handler.manager; - -/* - * 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.Map; - -import org.apache.maven.artifact.handler.ArtifactHandler; - -/** - * @author Jason van Zyl - */ -public interface ArtifactHandlerManager -{ - String ROLE = ArtifactHandlerManager.class.getName(); - - ArtifactHandler getArtifactHandler( String type ); - - @Deprecated - void addHandlers( Map<String, ArtifactHandler> handlers ); -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java deleted file mode 100644 index 6be636b0..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.apache.maven.artifact.handler.manager; - -/* - * 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.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.maven.artifact.handler.ArtifactHandler; -import org.apache.maven.artifact.handler.DefaultArtifactHandler; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; - -/** - * @author Jason van Zyl - */ -@Component( role = ArtifactHandlerManager.class ) -public class DefaultArtifactHandlerManager - implements ArtifactHandlerManager -{ - - @Requirement( role = ArtifactHandler.class ) - private Map<String, ArtifactHandler> artifactHandlers; - - private Map<String, ArtifactHandler> unmanagedHandlers = new ConcurrentHashMap<String, ArtifactHandler>(); - - public ArtifactHandler getArtifactHandler( String type ) - { - ArtifactHandler handler = unmanagedHandlers.get( type ); - - if ( handler == null ) - { - handler = artifactHandlers.get( type ); - - if ( handler == null ) - { - handler = new DefaultArtifactHandler( type ); - } - } - - return handler; - } - - public void addHandlers( Map<String, ArtifactHandler> handlers ) - { - // legacy support for maven-gpg-plugin:1.0 - unmanagedHandlers.putAll( handlers ); - } - - @Deprecated - public Set<String> getHandlerTypes() - { - return artifactHandlers.keySet(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java deleted file mode 100644 index 5ef3a980..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.apache.maven.artifact.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; - -@Deprecated -public abstract class AbstractArtifactMetadata - extends org.apache.maven.repository.legacy.metadata.AbstractArtifactMetadata - implements org.apache.maven.artifact.metadata.ArtifactMetadata -{ - protected AbstractArtifactMetadata( Artifact artifact ) - { - super( artifact ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java deleted file mode 100644 index e419ef9e..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.apache.maven.artifact.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; - -@Deprecated -public class ArtifactMetadataRetrievalException - extends org.apache.maven.repository.legacy.metadata.ArtifactMetadataRetrievalException -{ - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( String message ) - { - super( message, null, null ); - } - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( Throwable cause ) - { - super( null, cause, null ); - } - - /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ - @Deprecated - public ArtifactMetadataRetrievalException( String message, - Throwable cause ) - { - super( message, cause, null ); - } - - public ArtifactMetadataRetrievalException( String message, Throwable cause, Artifact artifact ) - { - super( message, cause, artifact ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java deleted file mode 100644 index ccd58363..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.artifact.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; -import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; - -@Deprecated -public interface ArtifactMetadataSource - extends org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource -{ - - ResolutionGroup retrieve( MetadataResolutionRequest request ) - throws ArtifactMetadataRetrievalException; - - ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories ) - throws ArtifactMetadataRetrievalException; - - List<ArtifactVersion> retrieveAvailableVersions( MetadataResolutionRequest request ) - throws ArtifactMetadataRetrievalException; - - List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories ) - throws ArtifactMetadataRetrievalException; - - 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/artifact/metadata/ResolutionGroup.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ResolutionGroup.java deleted file mode 100644 index c219b24e..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ResolutionGroup.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.apache.maven.artifact.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; - -@Deprecated -public class ResolutionGroup - extends org.apache.maven.repository.legacy.metadata.ResolutionGroup -{ - - public ResolutionGroup( Artifact pomArtifact, Set<Artifact> artifacts, - List<ArtifactRepository> resolutionRepositories ) - { - super( pomArtifact, artifacts, resolutionRepositories ); - } - - public ResolutionGroup( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts, - Map<String, Artifact> managedVersions, List<ArtifactRepository> resolutionRepositories ) - { - super( pomArtifact, relocatedArtifact, artifacts, managedVersions, resolutionRepositories ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java deleted file mode 100644 index 6b18789d..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.apache.maven.artifact.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.List; - -import org.apache.maven.execution.MavenSession; -import org.apache.maven.project.MavenProject; - -/** - * Collects basic settings to access the repository system. - * - * @author Benjamin Bentmann - */ -public class DefaultRepositoryRequest - implements RepositoryRequest -{ - - private boolean offline; - - private boolean forceUpdate; - - private ArtifactRepository localRepository; - - private List<ArtifactRepository> remoteRepositories; - - /** - * Creates an empty repository request. - */ - public DefaultRepositoryRequest() - { - // enables no-arg constructor - } - - /** - * Creates a shallow copy of the specified repository request. - * - * @param repositoryRequest The repository request to copy from, must not be {@code null}. - */ - public DefaultRepositoryRequest( RepositoryRequest repositoryRequest ) - { - setLocalRepository( repositoryRequest.getLocalRepository() ); - setRemoteRepositories( repositoryRequest.getRemoteRepositories() ); - setOffline( repositoryRequest.isOffline() ); - setForceUpdate( repositoryRequest.isForceUpdate() ); - } - - public static RepositoryRequest getRepositoryRequest( MavenSession session, MavenProject project ) - { - RepositoryRequest request = new DefaultRepositoryRequest(); - - request.setLocalRepository( session.getLocalRepository() ); - if ( project != null ) - { - request.setRemoteRepositories( project.getPluginArtifactRepositories() ); - } - request.setOffline( session.isOffline() ); - request.setForceUpdate( session.getRequest().isUpdateSnapshots() ); - - return request; - } - - public boolean isOffline() - { - return offline; - } - - public DefaultRepositoryRequest setOffline( boolean offline ) - { - this.offline = offline; - - return this; - } - - public boolean isForceUpdate() - { - return forceUpdate; - } - - public DefaultRepositoryRequest setForceUpdate( boolean forceUpdate ) - { - this.forceUpdate = forceUpdate; - - return this; - } - - public ArtifactRepository getLocalRepository() - { - return localRepository; - } - - public DefaultRepositoryRequest setLocalRepository( ArtifactRepository localRepository ) - { - this.localRepository = localRepository; - - return this; - } - - public List<ArtifactRepository> getRemoteRepositories() - { - if ( remoteRepositories == null ) - { - remoteRepositories = new ArrayList<ArtifactRepository>(); - } - - return remoteRepositories; - } - - public DefaultRepositoryRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) - { - this.remoteRepositories = remoteRepositories; - - return this; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java deleted file mode 100644 index f56fb459..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java +++ /dev/null @@ -1,435 +0,0 @@ -package org.apache.maven.artifact.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.Collections; -import java.util.List; - -import org.apache.maven.RepositoryUtils; -import org.apache.maven.artifact.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; -import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; -import org.apache.maven.repository.Proxy; -import org.eclipse.aether.DefaultRepositorySystemSession; -import org.eclipse.aether.RepositorySystem; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.metadata.Metadata; -import org.eclipse.aether.repository.LocalArtifactRegistration; -import org.eclipse.aether.repository.LocalArtifactRequest; -import org.eclipse.aether.repository.LocalArtifactResult; -import org.eclipse.aether.repository.LocalMetadataRegistration; -import org.eclipse.aether.repository.LocalMetadataRequest; -import org.eclipse.aether.repository.LocalMetadataResult; -import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.repository.LocalRepositoryManager; -import org.eclipse.aether.repository.RemoteRepository; - -/** - * <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part - * of the public API. In particular, this class can be changed or deleted without prior notice. - * - * @author Benjamin Bentmann - */ -public class LegacyLocalRepositoryManager - implements LocalRepositoryManager -{ - - private final ArtifactRepository delegate; - - private final LocalRepository repo; - - private final boolean realLocalRepo; - - public static RepositorySystemSession overlay( ArtifactRepository repository, RepositorySystemSession session, - RepositorySystem system ) - { - if ( repository == null || repository.getBasedir() == null ) - { - return session; - } - - if ( session != null ) - { - LocalRepositoryManager lrm = session.getLocalRepositoryManager(); - if ( lrm != null && lrm.getRepository().getBasedir().equals( new File( repository.getBasedir() ) ) ) - { - return session; - } - } - else - { - session = new DefaultRepositorySystemSession(); - } - - final LocalRepositoryManager llrm = new LegacyLocalRepositoryManager( repository ); - - return new DefaultRepositorySystemSession( session ).setLocalRepositoryManager( llrm ); - } - - private LegacyLocalRepositoryManager( ArtifactRepository delegate ) - { - if ( delegate == null ) - { - throw new IllegalArgumentException( "local repository delegate missing" ); - } - this.delegate = delegate; - - ArtifactRepositoryLayout layout = delegate.getLayout(); - repo = - new LocalRepository( new File( delegate.getBasedir() ), - ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" ); - - /* - * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact - * into a repository. In the first case, the result needs to be a proper local repository that one can use for - * local artifact resolution. In the second case, the result needs to precisely obey the path information of the - * repository's layout to allow pointing at artifacts within the repository. Unfortunately, - * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote - * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a - * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path - * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This - * transformation however contradicts the other use case of precisely obeying the repository's layout. The below - * flag tries to detect which use case applies to make both plugins happy. - */ - realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() ); - } - - public LocalRepository getRepository() - { - return repo; - } - - public String getPathForLocalArtifact( Artifact artifact ) - { - if ( realLocalRepo ) - { - return delegate.pathOf( RepositoryUtils.toArtifact( artifact.setVersion( artifact.getBaseVersion() ) ) ); - } - return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); - } - - public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) - { - return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); - } - - public String getPathForLocalMetadata( Metadata metadata ) - { - return delegate.pathOfLocalRepositoryMetadata( new ArtifactMetadataAdapter( metadata ), delegate ); - } - - public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) - { - return delegate.pathOfLocalRepositoryMetadata( new ArtifactMetadataAdapter( metadata ), - new ArtifactRepositoryAdapter( repository ) ); - } - - public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) - { - String path = getPathForLocalArtifact( request.getArtifact() ); - File file = new File( getRepository().getBasedir(), path ); - - LocalArtifactResult result = new LocalArtifactResult( request ); - if ( file.isFile() ) - { - result.setFile( file ); - result.setAvailable( true ); - } - - return result; - } - - public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) - { - Metadata metadata = request.getMetadata(); - - String path; - if ( request.getRepository() == null ) - { - path = getPathForLocalMetadata( metadata ); - } - else - { - path = getPathForRemoteMetadata( metadata, request.getRepository(), request.getContext() ); - } - - File file = new File( getRepository().getBasedir(), path ); - - LocalMetadataResult result = new LocalMetadataResult( request ); - if ( file.isFile() ) - { - result.setFile( file ); - } - - return result; - } - - public void add( RepositorySystemSession session, LocalArtifactRegistration request ) - { - // noop - } - - public void add( RepositorySystemSession session, LocalMetadataRegistration request ) - { - // noop - } - - static class ArtifactMetadataAdapter - implements ArtifactMetadata - { - - private final Metadata metadata; - - public ArtifactMetadataAdapter( Metadata metadata ) - { - this.metadata = metadata; - } - - public boolean storedInArtifactVersionDirectory() - { - return metadata.getVersion().length() > 0; - } - - public boolean storedInGroupDirectory() - { - return metadata.getArtifactId().length() <= 0; - } - - public String getGroupId() - { - return nullify( metadata.getGroupId() ); - } - - public String getArtifactId() - { - return nullify( metadata.getArtifactId() ); - } - - public String getBaseVersion() - { - return nullify( metadata.getVersion() ); - } - - private String nullify( String str ) - { - return ( str == null || str.length() <= 0 ) ? null : str; - } - - public Object getKey() - { - return metadata.toString(); - } - - public String getRemoteFilename() - { - return metadata.getType(); - } - - public String getLocalFilename( ArtifactRepository repository ) - { - return insertRepositoryKey( getRemoteFilename(), repository.getKey() ); - } - - private String insertRepositoryKey( String filename, String repositoryKey ) - { - String result; - int idx = filename.indexOf( '.' ); - if ( idx < 0 ) - { - result = filename + '-' + repositoryKey; - } - else - { - result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); - } - return result; - } - - public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) - { - // not used - } - - public void merge( ArtifactMetadata metadata ) - { - // not used - } - - public void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository ) - throws RepositoryMetadataStoreException - { - // not used - } - - public String extendedToString() - { - return metadata.toString(); - } - - } - - static class ArtifactRepositoryAdapter - implements ArtifactRepository - { - - private final RemoteRepository repository; - - public ArtifactRepositoryAdapter( RemoteRepository repository ) - { - this.repository = repository; - } - - public String pathOf( org.apache.maven.artifact.Artifact artifact ) - { - return null; - } - - public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) - { - return null; - } - - public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) - { - return null; - } - - public String getUrl() - { - return repository.getUrl(); - } - - public void setUrl( String url ) - { - } - - public String getBasedir() - { - return null; - } - - public String getProtocol() - { - return repository.getProtocol(); - } - - public String getId() - { - return repository.getId(); - } - - public void setId( String id ) - { - } - - public ArtifactRepositoryPolicy getSnapshots() - { - return null; - } - - public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) - { - } - - public ArtifactRepositoryPolicy getReleases() - { - return null; - } - - public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) - { - } - - public ArtifactRepositoryLayout getLayout() - { - return null; - } - - public void setLayout( ArtifactRepositoryLayout layout ) - { - } - - public String getKey() - { - return getId(); - } - - public boolean isUniqueVersion() - { - return true; - } - - public boolean isBlacklisted() - { - return false; - } - - public void setBlacklisted( boolean blackListed ) - { - } - - public org.apache.maven.artifact.Artifact find( org.apache.maven.artifact.Artifact artifact ) - { - return null; - } - - public List<String> findVersions( org.apache.maven.artifact.Artifact artifact ) - { - return Collections.emptyList(); - } - - public boolean isProjectAware() - { - return false; - } - - public void setAuthentication( Authentication authentication ) - { - } - - public Authentication getAuthentication() - { - return null; - } - - public void setProxy( Proxy proxy ) - { - } - - public Proxy getProxy() - { - return null; - } - - public List<ArtifactRepository> getMirroredRepositories() - { - return Collections.emptyList(); - } - - public void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories ) - { - } - - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java deleted file mode 100644 index 8e45b203..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java +++ /dev/null @@ -1,412 +0,0 @@ -package org.apache.maven.artifact.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.Collections; -import java.util.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.repository.Proxy; - -//TODO: completely separate local and remote artifact repositories -public class MavenArtifactRepository - implements ArtifactRepository -{ - private String id; - - private String url; - - private String basedir; - - private String protocol; - - private ArtifactRepositoryLayout layout; - - private ArtifactRepositoryPolicy snapshots; - - private ArtifactRepositoryPolicy releases; - - private Authentication authentication; - - private Proxy proxy; - - private List<ArtifactRepository> mirroredRepositories = Collections.emptyList(); - - public MavenArtifactRepository() - { - } - - /** - * Create a remote download repository. - * - * @param id the unique identifier of the repository - * @param url the URL of the repository - * @param layout the layout of the repository - * @param snapshots the policies to use for snapshots - * @param releases the policies to use for releases - */ - public MavenArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, - ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ) - { - this.id = id; - this.url = url; - this.layout = layout; - this.snapshots = snapshots; - this.releases = releases; - // - // Derive these from the URL - // - this.protocol = protocol( url ); - this.basedir = basedir( url ); - } - - public String pathOf( Artifact artifact ) - { - return layout.pathOf( artifact ); - } - - public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) - { - return layout.pathOfRemoteRepositoryMetadata( artifactMetadata ); - } - - public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) - { - return layout.pathOfLocalRepositoryMetadata( metadata, repository ); - } - - public void setLayout( ArtifactRepositoryLayout layout ) - { - this.layout = layout; - } - - public ArtifactRepositoryLayout getLayout() - { - return layout; - } - - public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy snapshots ) - { - this.snapshots = snapshots; - } - - public ArtifactRepositoryPolicy getSnapshots() - { - return snapshots; - } - - public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy releases ) - { - this.releases = releases; - } - - public ArtifactRepositoryPolicy getReleases() - { - return releases; - } - - public String getKey() - { - return getId(); - } - - 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( layout != null ? layout : "none" ).append( "\n" ); - - if ( proxy != null ) - { - sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" ); - } - - if ( snapshots != null ) - { - sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() ); - sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" ); - } - - if ( releases != null ) - { - sb.append( " releases: [enabled => " ).append( releases.isEnabled() ); - sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]\n" ); - } - - return sb.toString(); - } - - public Artifact find( Artifact artifact ) - { - File artifactFile = new File( getBasedir(), pathOf( artifact ) ); - - // We need to set the file here or the resolver will fail with an NPE, not fully equipped to deal - // with multiple local repository implementations yet. - artifact.setFile( artifactFile ); - - return artifact; - } - - public List<String> findVersions( Artifact artifact ) - { - return Collections.emptyList(); - } - - public String getId() - { - return id; - } - - public String getUrl() - { - return url; - } - - public String getBasedir() - { - return basedir; - } - - public String getProtocol() - { - return protocol; - } - - public void setId( String id ) - { - this.id = id; - } - - public void setUrl( String url ) - { - this.url = url; - - this.protocol = protocol( url ); - this.basedir = basedir( url ); - } - - // Path Utils - - /** - * Return the protocol name. - * <br/> - * E.g: for input - * <code>http://www.codehause.org</code> this method will return <code>http</code> - * - * @param url the url - * @return the host name - */ - private static String protocol( final String url ) - { - final int pos = url.indexOf( ":" ); - - if ( pos == -1 ) - { - return ""; - } - return url.substring( 0, pos ).trim(); - } - - /** - * Derive the path portion of the given URL. - * - * @param url the repository URL - * @return the basedir of the repository - * @todo need to URL decode for spaces? - */ - private String basedir( String url ) - { - String retValue = null; - - if ( protocol.equalsIgnoreCase( "file" ) ) - { - retValue = url.substring( protocol.length() + 1 ); - retValue = decode( retValue ); - // special case: if omitted // on protocol, keep path as is - if ( retValue.startsWith( "//" ) ) - { - retValue = retValue.substring( 2 ); - - if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) - { - // special case: if there is a windows drive letter, then keep the original return value - retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); - } - else - { - // Now we expect the host - int index = retValue.indexOf( "/" ); - if ( index >= 0 ) - { - retValue = retValue.substring( index + 1 ); - } - - // special case: if there is a windows drive letter, then keep the original return value - if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) - { - retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); - } - else if ( index >= 0 ) - { - // leading / was previously stripped - retValue = "/" + retValue; - } - } - } - - // special case: if there is a windows drive letter using |, switch to : - if ( retValue.length() >= 2 && retValue.charAt( 1 ) == '|' ) - { - retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); - } - - // normalize separators - retValue = new File( retValue ).getPath(); - } - - if ( retValue == null ) - { - retValue = "/"; - } - return retValue.trim(); - } - - /** - * Decodes the specified (portion of a) URL. <strong>Note:</strong> This decoder assumes that ISO-8859-1 is used to - * convert URL-encoded bytes to characters. - * - * @param url The URL to decode, may be <code>null</code>. - * @return The decoded URL or <code>null</code> if the input was <code>null</code>. - */ - private static String decode( String url ) - { - String decoded = url; - if ( url != null ) - { - int pos = -1; - while ( ( pos = decoded.indexOf( '%', pos + 1 ) ) >= 0 ) - { - if ( pos + 2 < decoded.length() ) - { - String hexStr = decoded.substring( pos + 1, pos + 3 ); - char ch = (char) Integer.parseInt( hexStr, 16 ); - decoded = decoded.substring( 0, pos ) + ch + decoded.substring( pos + 3 ); - } - } - } - return decoded; - } - - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + ( ( getId() == null ) ? 0 : getId().hashCode() ); - return result; - } - - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - if ( obj == null ) - { - return false; - } - if ( getClass() != obj.getClass() ) - { - return false; - } - - ArtifactRepository other = (ArtifactRepository) obj; - - return eq( getId(), other.getId() ); - } - - protected static <T> boolean eq( T s1, T s2 ) - { - return s1 != null ? s1.equals( s2 ) : s2 == null; - } - - public Authentication getAuthentication() - { - return authentication; - } - - public void setAuthentication( Authentication authentication ) - { - this.authentication = authentication; - } - - public Proxy getProxy() - { - return proxy; - } - - public void setProxy( Proxy proxy ) - { - this.proxy = proxy; - } - - public boolean isBlacklisted() - { - return false; - } - - public void setBlacklisted( boolean blackListed ) - { - // no op - } - - public boolean isUniqueVersion() - { - return true; - } - - public boolean isProjectAware() - { - return false; - } - - public List<ArtifactRepository> getMirroredRepositories() - { - return mirroredRepositories; - } - - public void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories ) - { - if ( mirroredRepositories != null ) - { - this.mirroredRepositories = mirroredRepositories; - } - else - { - this.mirroredRepositories = Collections.emptyList(); - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java deleted file mode 100644 index bf79d698..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.apache.maven.artifact.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. - */ - -/** - * Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant - * for exclusive consumption by the repository system and is opaque to the cache implementation. - * - * @author Benjamin Bentmann - */ -@Deprecated -// -// Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave -// this here, possibly indefinitely. -// -public interface RepositoryCache -{ - - /** - * Puts the specified data into the cache. <strong>Warning:</strong> The cache will directly save the provided - * reference. If the cached data is mutable, i.e. could be modified after being put into the cache, the caller is - * responsible for creating a copy of the original data and store the copy in the cache. - * - * @param request The repository request from which this cache was retrieved, must not be {@code null}. - * @param key The key to use associate the data with, must not be {@code null}. - * @param data The data to store in the cache, may be {@code null}. - */ - void put( RepositoryRequest request, Object key, Object data ); - - /** - * Gets the specified data from the cache. <strong>Warning:</strong> The cache will directly return the saved - * reference. If the cached data is to be modified after its retrieval, the caller is responsible to create a copy - * of the returned data and use this instead of the cache record. - * - * @param request The repository request from which this cache was retrieved, must not be {@code null}. - * @param key The key to use for lookup of the data, must not be {@code null}. - * @return The requested data or {@code null} if none was present in the cache. - */ - Object get( RepositoryRequest request, Object key ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java deleted file mode 100644 index 55f60686..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.apache.maven.artifact.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.List; - -/** - * Collects basic settings to access the repository system. - * - * @author Benjamin Bentmann - */ -public interface 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}. - */ - RepositoryRequest setOffline( boolean offline ); - - /** - * Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their - * configured update policy. - * - * @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false} - * otherwise. - */ - boolean isForceUpdate(); - - /** - * Enables/disabled forced checks for updated artifacts/metadata on remote repositories. - * - * @param forceUpdate {@code true} to forcibly check the remote repositories for updated artifacts/metadata, {@code - * false} to use the update policy configured on each repository. - * @return This request, never {@code null}. - */ - RepositoryRequest setForceUpdate( boolean forceUpdate ); - - /** - * Gets the local repository to use. - * - * @return The local repository to use or {@code null} if not set. - */ - ArtifactRepository getLocalRepository(); - - /** - * Sets the local repository to use. - * - * @param localRepository The local repository to use. - * @return This request, never {@code null}. - */ - RepositoryRequest setLocalRepository( ArtifactRepository localRepository ); - - /** - * Gets the remote repositories to use. - * - * @return The remote repositories to use, never {@code null}. - */ - List<ArtifactRepository> getRemoteRepositories(); - - /** - * Sets the remote repositories to use. - * - * @param remoteRepositories The remote repositories to use. - * @return This request, never {@code null}. - */ - RepositoryRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java deleted file mode 100644 index 70c0b14c..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.apache.maven.artifact.repository.layout; - -/* - * 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.handler.ArtifactHandler; -import org.apache.maven.artifact.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.codehaus.plexus.component.annotations.Component; - -/** - * @author jdcasey - */ -@Component( role = ArtifactRepositoryLayout.class, hint = "default" ) -public class DefaultRepositoryLayout - implements ArtifactRepositoryLayout -{ - private static final char PATH_SEPARATOR = '/'; - - private static final char GROUP_SEPARATOR = '.'; - - private static final char ARTIFACT_SEPARATOR = '-'; - - public String getId() - { - return "default"; - } - - public String pathOf( Artifact artifact ) - { - ArtifactHandler artifactHandler = artifact.getArtifactHandler(); - - StringBuilder path = new StringBuilder( 128 ); - - path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); - path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); - path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); - path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); - - if ( artifact.hasClassifier() ) - { - path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); - } - - if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) - { - path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() ); - } - - return path.toString(); - } - - public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) - { - return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) ); - } - - private String pathOfRepositoryMetadata( ArtifactMetadata metadata, - String filename ) - { - StringBuilder path = new StringBuilder( 128 ); - - path.append( formatAsDirectory( metadata.getGroupId() ) ).append( PATH_SEPARATOR ); - if ( !metadata.storedInGroupDirectory() ) - { - path.append( metadata.getArtifactId() ).append( PATH_SEPARATOR ); - - if ( metadata.storedInArtifactVersionDirectory() ) - { - path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR ); - } - } - - path.append( filename ); - - return path.toString(); - } - - public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata ) - { - return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() ); - } - - private String formatAsDirectory( String directory ) - { - return directory.replace( GROUP_SEPARATOR, PATH_SEPARATOR ); - } - - @Override - public String toString() - { - return getId(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java deleted file mode 100644 index e1e5fe3f..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.apache.maven.artifact.repository.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.io.File; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; - -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.metadata.io.xpp3.MetadataXpp3Reader; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.ReaderFactory; -import org.codehaus.plexus.util.WriterFactory; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -/** - * Shared methods of the repository metadata handling. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public abstract class AbstractRepositoryMetadata - implements RepositoryMetadata -{ - private Metadata metadata; - - protected AbstractRepositoryMetadata( Metadata metadata ) - { - this.metadata = metadata; - } - - public String getRemoteFilename() - { - return "maven-metadata.xml"; - } - - public String getLocalFilename( ArtifactRepository repository ) - { - return "maven-metadata-" + repository.getKey() + ".xml"; - } - - public void storeInLocalRepository( ArtifactRepository localRepository, - ArtifactRepository remoteRepository ) - throws RepositoryMetadataStoreException - { - try - { - updateRepositoryMetadata( localRepository, remoteRepository ); - } - catch ( IOException e ) - { - throw new RepositoryMetadataStoreException( "Error updating group repository metadata", e ); - } - catch ( XmlPullParserException e ) - { - throw new RepositoryMetadataStoreException( "Error updating group repository metadata", e ); - } - } - - protected void updateRepositoryMetadata( ArtifactRepository localRepository, - ArtifactRepository remoteRepository ) - throws IOException, XmlPullParserException - { - MetadataXpp3Reader mappingReader = new MetadataXpp3Reader(); - - Metadata metadata = null; - - File metadataFile = new File( localRepository.getBasedir(), - localRepository.pathOfLocalRepositoryMetadata( this, remoteRepository ) ); - - if ( metadataFile.length() == 0 ) - { - if ( !metadataFile.delete() ) - { - // sleep for 10ms just in case this is windows holding a file lock - try - { - Thread.sleep( 10 ); - } - catch ( InterruptedException e ) - { - // ignore - } - metadataFile.delete(); // if this fails, forget about it, we'll try to overwrite it anyway so no need - // to delete on exit - } - } - else if ( metadataFile.exists() ) - { - Reader reader = null; - - try - { - reader = ReaderFactory.newXmlReader( metadataFile ); - - metadata = mappingReader.read( reader, false ); - } - finally - { - IOUtil.close( reader ); - } - } - - boolean changed; - - // If file could not be found or was not valid, start from scratch - if ( metadata == null ) - { - metadata = this.metadata; - - changed = true; - } - else - { - changed = metadata.merge( this.metadata ); - } - - // beware meta-versions! - String version = metadata.getVersion(); - if ( version != null && ( Artifact.LATEST_VERSION.equals( version ) || Artifact.RELEASE_VERSION.equals( - version ) ) ) - { - // meta-versions are not valid <version/> values...don't write them. - metadata.setVersion( null ); - } - - if ( changed || !metadataFile.exists() ) - { - Writer writer = null; - try - { - metadataFile.getParentFile().mkdirs(); - writer = WriterFactory.newXmlWriter( metadataFile ); - - MetadataXpp3Writer mappingWriter = new MetadataXpp3Writer(); - - mappingWriter.write( writer, metadata ); - } - finally - { - IOUtil.close( writer ); - } - } - else - { - metadataFile.setLastModified( System.currentTimeMillis() ); - } - } - - public String toString() - { - return "repository metadata for: \'" + getKey() + "\'"; - } - - protected static Metadata createMetadata( Artifact artifact, - Versioning versioning ) - { - Metadata metadata = new Metadata(); - metadata.setGroupId( artifact.getGroupId() ); - metadata.setArtifactId( artifact.getArtifactId() ); - metadata.setVersion( artifact.getVersion() ); - metadata.setVersioning( versioning ); - return metadata; - } - - protected static Versioning createVersioning( Snapshot snapshot ) - { - Versioning versioning = new Versioning(); - versioning.setSnapshot( snapshot ); - versioning.updateTimestamp(); - return versioning; - } - - public void setMetadata( Metadata metadata ) - { - this.metadata = metadata; - } - - public Metadata getMetadata() - { - return metadata; - } - - public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) - { - // TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces? - AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; - this.metadata.merge( repoMetadata.getMetadata() ); - } - - public void merge( ArtifactMetadata metadata ) - { - // TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces? - AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; - this.metadata.merge( repoMetadata.getMetadata() ); - } - - public String extendedToString() - { - StringBuilder buffer = new StringBuilder(); - - buffer.append( "\nRepository Metadata\n--------------------------" ); - buffer.append( "\nGroupId: " ).append( getGroupId() ); - buffer.append( "\nArtifactId: " ).append( getArtifactId() ); - buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); - - return buffer.toString(); - } - - public int getNature() - { - return RELEASE; - } - - public ArtifactRepositoryPolicy getPolicy( ArtifactRepository repository ) - { - int nature = getNature(); - if ( ( nature & RepositoryMetadata.RELEASE_OR_SNAPSHOT ) == RepositoryMetadata.RELEASE_OR_SNAPSHOT ) - { - ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy( repository.getReleases() ); - policy.merge( repository.getSnapshots() ); - return policy; - } - else if ( ( nature & RepositoryMetadata.SNAPSHOT ) != 0 ) - { - return repository.getSnapshots(); - } - else - { - return repository.getReleases(); - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java deleted file mode 100644 index 85fc6018..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.apache.maven.artifact.repository.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; -import org.apache.maven.artifact.ArtifactUtils; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.versioning.ArtifactVersion; -import org.apache.maven.artifact.versioning.Restriction; -import org.apache.maven.artifact.versioning.VersionRange; - -/** - * Metadata for the artifact directory of the repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class ArtifactRepositoryMetadata - extends AbstractRepositoryMetadata -{ - private Artifact artifact; - - public ArtifactRepositoryMetadata( Artifact artifact ) - { - this( artifact, null ); - } - - public ArtifactRepositoryMetadata( Artifact artifact, - Versioning versioning ) - { - super( createMetadata( artifact, versioning ) ); - this.artifact = artifact; - } - - public boolean storedInGroupDirectory() - { - return false; - } - - public boolean storedInArtifactVersionDirectory() - { - return false; - } - - public String getGroupId() - { - return artifact.getGroupId(); - } - - public String getArtifactId() - { - return artifact.getArtifactId(); - } - - public String getBaseVersion() - { - // Don't want the artifact's version in here, as this is stored in the directory above that - return null; - } - - public Object getKey() - { - return "artifact " + artifact.getGroupId() + ":" + artifact.getArtifactId(); - } - - public boolean isSnapshot() - { - // Don't consider the artifact's version in here, as this is stored in the directory above that - return false; - } - - public int getNature() - { - if ( artifact.getVersion() != null ) - { - return artifact.isSnapshot() ? SNAPSHOT : RELEASE; - } - - VersionRange range = artifact.getVersionRange(); - if ( range != null ) - { - for ( Restriction restriction : range.getRestrictions() ) - { - if ( isSnapshot( restriction.getLowerBound() ) || isSnapshot( restriction.getUpperBound() ) ) - { - return RELEASE_OR_SNAPSHOT; - } - } - } - - return RELEASE; - } - - private boolean isSnapshot( ArtifactVersion version ) - { - return version != null && ArtifactUtils.isSnapshot( version.getQualifier() ); - } - - public ArtifactRepository getRepository() - { - return null; - } - - public void setRepository( ArtifactRepository remoteRepository ) - { - /* - * NOTE: Metadata at the g:a level contains a collection of available versions. After merging, we can't tell - * which repository provides which version so the metadata manager must not restrict the artifact resolution to - * the repository with the most recent updates. - */ - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java deleted file mode 100644 index 22e3ade8..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.apache.maven.artifact.repository.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.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; - -/** - * Describes repository directory metadata. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @todo not happy about the store method - they use "this" - */ -public interface RepositoryMetadata - extends org.apache.maven.artifact.metadata.ArtifactMetadata -{ - - int RELEASE = 1; - - int SNAPSHOT = 2; - - int RELEASE_OR_SNAPSHOT = RELEASE | SNAPSHOT; - - /** - * Get the repository the metadata was located in. - * - * @return the repository - */ - ArtifactRepository getRepository(); - - /** - * Set the repository the metadata was located in. - * - * @param remoteRepository the repository - */ - void setRepository( ArtifactRepository remoteRepository ); - - /** - * Get the repository metadata associated with this marker. - * - * @return the metadata, or <code>null</code> if none loaded - */ - Metadata getMetadata(); - - /** - * Set the metadata contents. - * - * @param metadata the metadata - */ - void setMetadata( Metadata metadata ); - - /** - * Whether this represents a snapshot. - * - * @return if it is a snapshot - */ - boolean isSnapshot(); - - /** - * Gets the artifact quality this metadata refers to. One of {@link #RELEASE}, {@link #SNAPSHOT} or - * {@link #RELEASE_OR_SNAPSHOT}. - * - * @return The artifact quality this metadata refers to. - */ - int getNature(); - - /** - * Gets the policy that applies to this metadata regarding the specified repository. - * - * @param repository The repository for which to determine the policy, must not be {@code null}. - * @return The policy, never {@code null}. - */ - ArtifactRepositoryPolicy getPolicy( ArtifactRepository repository ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java deleted file mode 100644 index 94545650..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.artifact.repository.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. - */ - -/** - * Error while deploying repository metadata. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class RepositoryMetadataDeploymentException - extends Throwable -{ - public RepositoryMetadataDeploymentException( String message ) - { - super( message ); - } - - public RepositoryMetadataDeploymentException( String message, - Exception e ) - { - super( message, e ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java deleted file mode 100644 index 55bb57ed..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.artifact.repository.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. - */ - -/** - * Error while installing repository metadata. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class RepositoryMetadataInstallationException - extends Throwable -{ - public RepositoryMetadataInstallationException( String message ) - { - super( message ); - } - - public RepositoryMetadataInstallationException( String message, - Exception e ) - { - super( message, e ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java deleted file mode 100644 index 35626e58..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.apache.maven.artifact.repository.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.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.RepositoryRequest; - -public interface RepositoryMetadataManager -{ - - void resolve( RepositoryMetadata repositoryMetadata, RepositoryRequest repositoryRequest ) - throws RepositoryMetadataResolutionException; - - void resolve( RepositoryMetadata repositoryMetadata, List<ArtifactRepository> repositories, - ArtifactRepository localRepository ) - throws RepositoryMetadataResolutionException; - - void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository, - ArtifactRepository remoteRepository ) - throws RepositoryMetadataResolutionException; - - /** - * Deploy metadata to the remote repository. - * - * @param metadata the metadata to deploy - * @param localRepository the local repository to install to first - * @param deploymentRepository the remote repository to deploy to - */ - void deploy( ArtifactMetadata metadata, ArtifactRepository localRepository, - ArtifactRepository deploymentRepository ) - throws RepositoryMetadataDeploymentException; - - /** - * Install the metadata in the local repository. - * - * @param metadata the metadata - * @param localRepository the local repository - */ - void install( ArtifactMetadata metadata, ArtifactRepository localRepository ) - throws RepositoryMetadataInstallationException; -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java deleted file mode 100644 index 8a6f38d4..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.artifact.repository.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. - */ - -/** - * Error while retrieving repository metadata from the repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class RepositoryMetadataResolutionException - extends Exception -{ - public RepositoryMetadataResolutionException( String message ) - { - super( message ); - } - - public RepositoryMetadataResolutionException( String message, - Exception e ) - { - super( message, e ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java deleted file mode 100644 index 6a1578d8..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.apache.maven.artifact.repository.metadata.io; - -/* - * 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.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import java.util.Map; - -import org.apache.maven.artifact.repository.metadata.Metadata; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.ReaderFactory; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -/** - * Handles deserialization of metadata from some kind of textual format like XML. - * - * @author Benjamin Bentmann - */ -@Component( role = MetadataReader.class ) -public class DefaultMetadataReader - implements MetadataReader -{ - - public Metadata read( File input, Map<String, ?> options ) - throws IOException - { - if ( input == null ) - { - throw new IllegalArgumentException( "input file missing" ); - } - - Metadata metadata = read( ReaderFactory.newXmlReader( input ), options ); - - return metadata; - } - - public Metadata read( Reader input, Map<String, ?> options ) - throws IOException - { - if ( input == null ) - { - throw new IllegalArgumentException( "input reader missing" ); - } - - try - { - MetadataXpp3Reader r = new MetadataXpp3Reader(); - return r.read( input, isStrict( options ) ); - } - catch ( XmlPullParserException e ) - { - throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); - } - finally - { - IOUtil.close( input ); - } - } - - public Metadata read( InputStream input, Map<String, ?> options ) - throws IOException - { - if ( input == null ) - { - throw new IllegalArgumentException( "input stream missing" ); - } - - try - { - MetadataXpp3Reader r = new MetadataXpp3Reader(); - return r.read( input, isStrict( options ) ); - } - catch ( XmlPullParserException e ) - { - throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); - } - finally - { - IOUtil.close( input ); - } - } - - private boolean isStrict( Map<String, ?> options ) - { - Object value = ( options != null ) ? options.get( IS_STRICT ) : null; - return value == null || Boolean.parseBoolean( value.toString() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java deleted file mode 100644 index e3e141b1..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.apache.maven.artifact.repository.metadata.io; - -/* - * 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 parse the metadata due to invalid syntax (e.g. non-wellformed XML or unknown elements). - * - * @author Benjamin Bentmann - */ -public class MetadataParseException - extends IOException -{ - - /** - * The one-based index of the line containing the error. - */ - private final int lineNumber; - - /** - * The one-based index of the column containing the error. - */ - private final int columnNumber; - - /** - * Creates a new parser exception with the specified details. - * - * @param message The error message, may be {@code null}. - * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. - * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. - */ - public MetadataParseException( String message, int lineNumber, int columnNumber ) - { - super( message ); - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - } - - /** - * Creates a new parser exception with the specified details. - * - * @param message The error message, may be {@code null}. - * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. - * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. - * @param cause The nested cause of this error, may be {@code null}. - */ - public MetadataParseException( String message, int lineNumber, int columnNumber, Throwable cause ) - { - super( message ); - initCause( cause ); - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - } - - /** - * Gets the one-based index of the line containing the error. - * - * @return The one-based index of the line containing the error or a non-positive value if unknown. - */ - public int getLineNumber() - { - return lineNumber; - } - - /** - * Gets the one-based index of the column containing the error. - * - * @return The one-based index of the column containing the error or non-positive value if unknown. - */ - public int getColumnNumber() - { - return columnNumber; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java deleted file mode 100644 index 232246fd..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.apache.maven.artifact.repository.metadata.io; - -/* - * 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.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import java.util.Map; - -import org.apache.maven.artifact.repository.metadata.Metadata; - -/** - * Handles deserialization of metadata from some kind of textual format like XML. - * - * @author Benjamin Bentmann - */ -public interface MetadataReader -{ - - /** - * The key for the option to enable strict parsing. This option is of type {@link Boolean} and defaults to {@code - * true}. If {@code false}, unknown elements will be ignored instead of causing a failure. - */ - String IS_STRICT = "org.apache.maven.artifact.repository.metadata.io.isStrict"; - - /** - * Reads the metadata from the specified file. - * - * @param input The file to deserialize the metadata from, must not be {@code null}. - * @param options The options to use for deserialization, may be {@code null} to use the default values. - * @return The deserialized metadata, never {@code null}. - * @throws IOException If the metadata could not be deserialized. - * @throws MetadataParseException If the input format could not be parsed. - */ - Metadata read( File input, Map<String, ?> options ) - throws IOException, MetadataParseException; - - /** - * Reads the metadata from the specified character reader. The reader will be automatically closed before the method - * returns. - * - * @param input The reader to deserialize the metadata from, must not be {@code null}. - * @param options The options to use for deserialization, may be {@code null} to use the default values. - * @return The deserialized metadata, never {@code null}. - * @throws IOException If the metadata could not be deserialized. - * @throws MetadataParseException If the input format could not be parsed. - */ - Metadata read( Reader input, Map<String, ?> options ) - throws IOException, MetadataParseException; - - /** - * Reads the metadata from the specified byte stream. The stream will be automatically closed before the method - * returns. - * - * @param input The stream to deserialize the metadata from, must not be {@code null}. - * @param options The options to use for deserialization, may be {@code null} to use the default values. - * @return The deserialized metadata, never {@code null}. - * @throws IOException If the metadata could not be deserialized. - * @throws MetadataParseException If the input format could not be parsed. - */ - Metadata read( InputStream input, Map<String, ?> options ) - throws IOException, MetadataParseException; - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java deleted file mode 100644 index 050ec478..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java +++ /dev/null @@ -1,329 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -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; -import org.apache.maven.artifact.repository.RepositoryCache; -import org.apache.maven.artifact.repository.RepositoryRequest; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; -import org.apache.maven.settings.Mirror; -import org.apache.maven.settings.Proxy; -import org.apache.maven.settings.Server; - -/** - * A resolution request allows you to either use an existing MavenProject, or a coordinate (gid:aid:version) - * to process a POMs dependencies. - * - * @author Jason van Zyl - */ -public class ArtifactResolutionRequest - implements RepositoryRequest -{ - - private Artifact artifact; - - // Needs to go away - // These are really overrides now, projects defining dependencies for a plugin that override what is - // specified in the plugin itself. - private Set<Artifact> artifactDependencies; - - private ArtifactRepository localRepository; - - private List<ArtifactRepository> remoteRepositories; - - private ArtifactFilter collectionFilter; - - private ArtifactFilter resolutionFilter; - - // Needs to go away - private List<ResolutionListener> listeners = new ArrayList<ResolutionListener>(); - - // This is like a filter but overrides all transitive versions - private Map<String, Artifact> managedVersionMap; - - private boolean resolveRoot = true; - - private boolean resolveTransitively = false; - - private boolean offline; - - private boolean forceUpdate; - - private List<Server> servers; - - private List<Mirror> mirrors; - - private List<Proxy> proxies; - - public ArtifactResolutionRequest() - { - // nothing here - } - - public ArtifactResolutionRequest( RepositoryRequest request ) - { - setLocalRepository( request.getLocalRepository() ); - setRemoteRepositories( request.getRemoteRepositories() ); - setOffline( request.isOffline() ); - setForceUpdate( request.isForceUpdate() ); - } - - public Artifact getArtifact() - { - return artifact; - } - - public ArtifactResolutionRequest setArtifact( Artifact artifact ) - { - this.artifact = artifact; - - return this; - } - - public ArtifactResolutionRequest setArtifactDependencies( Set<Artifact> artifactDependencies ) - { - this.artifactDependencies = artifactDependencies; - - return this; - } - - public Set<Artifact> getArtifactDependencies() - { - return artifactDependencies; - } - - public ArtifactRepository getLocalRepository() - { - return localRepository; - } - - public ArtifactResolutionRequest setLocalRepository( ArtifactRepository localRepository ) - { - this.localRepository = localRepository; - - return this; - } - - public List<ArtifactRepository> getRemoteRepositories() - { - return remoteRepositories; - } - - public ArtifactResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) - { - this.remoteRepositories = remoteRepositories; - - return this; - } - - /** - * Gets the artifact filter that controls traversal of the dependency graph. - * - * @return The filter used to determine which of the artifacts in the dependency graph should be traversed or - * {@code null} to collect all transitive dependencies. - */ - public ArtifactFilter getCollectionFilter() - { - return collectionFilter; - } - - public ArtifactResolutionRequest setCollectionFilter( ArtifactFilter filter ) - { - this.collectionFilter = filter; - - return this; - } - - /** - * Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts - * that have been included by the {@link #getCollectionFilter()}. - * - * @return The filter used to determine which of the artifacts should have their files resolved or {@code null} to - * resolve the files for all collected artifacts. - */ - public ArtifactFilter getResolutionFilter() - { - return resolutionFilter; - } - - public ArtifactResolutionRequest setResolutionFilter( ArtifactFilter filter ) - { - this.resolutionFilter = filter; - - return this; - } - - public List<ResolutionListener> getListeners() - { - return listeners; - } - - public ArtifactResolutionRequest setListeners( List<ResolutionListener> listeners ) - { - this.listeners = listeners; - - return this; - } - - public ArtifactResolutionRequest addListener( ResolutionListener listener ) - { - listeners.add( listener ); - - return this; - } - - public Map<String, Artifact> getManagedVersionMap() - { - return managedVersionMap; - } - - public ArtifactResolutionRequest setManagedVersionMap( Map<String, Artifact> managedVersionMap ) - { - this.managedVersionMap = managedVersionMap; - - return this; - } - - public ArtifactResolutionRequest setResolveRoot( boolean resolveRoot ) - { - this.resolveRoot = resolveRoot; - - return this; - } - - public boolean isResolveRoot() - { - return resolveRoot; - } - - public ArtifactResolutionRequest setResolveTransitively( boolean resolveDependencies ) - { - this.resolveTransitively = resolveDependencies; - - return this; - } - - public boolean isResolveTransitively() - { - return resolveTransitively; - } - - public String toString() - { - StringBuilder sb = new StringBuilder() - .append( "REQUEST: " ).append( "\n" ) - .append( "artifact: " ).append( artifact ).append( "\n" ) - .append( artifactDependencies ).append( "\n" ) - .append( "localRepository: " ).append( localRepository ).append( "\n" ) - .append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" ); - - return sb.toString(); - } - - public boolean isOffline() - { - return offline; - } - - public ArtifactResolutionRequest setOffline( boolean offline ) - { - this.offline = offline; - - return this; - } - - public boolean isForceUpdate() - { - return forceUpdate; - } - - public ArtifactResolutionRequest setForceUpdate( boolean forceUpdate ) - { - this.forceUpdate = forceUpdate; - - return this; - } - - public ArtifactResolutionRequest setServers( List<Server> servers ) - { - this.servers = servers; - - return this; - } - - public List<Server> getServers() - { - if ( servers == null ) - { - servers = new ArrayList<Server>(); - } - - return servers; - } - - public ArtifactResolutionRequest setMirrors( List<Mirror> mirrors ) - { - this.mirrors = mirrors; - - return this; - } - - public List<Mirror> getMirrors() - { - if ( mirrors == null ) - { - mirrors = new ArrayList<Mirror>(); - } - - return mirrors; - } - - public ArtifactResolutionRequest setProxies( List<Proxy> proxies ) - { - this.proxies = proxies; - - return this; - } - - public List<Proxy> getProxies() - { - if ( proxies == null ) - { - proxies = new ArrayList<Proxy>(); - } - - return proxies; - } - - // - // Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave - // this here, possibly indefinitely. - // - public ArtifactResolutionRequest setCache( RepositoryCache cache ) - { - return this; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java deleted file mode 100644 index 86bfdb60..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java +++ /dev/null @@ -1,358 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.versioning.OverConstrainedVersionException; - -/** - * Specific problems during resolution that we want to account for: - * <p/> - * - missing metadata - version range violations - version circular dependencies - missing artifacts - * - network/transfer errors - file system errors: permissions - * - * @author Jason van Zyl - * @TODO carlos: all these possible has*Exceptions and get*Exceptions methods make the clients too - * complex requiring a long list of checks, need to create a parent/interfact/encapsulation - * for the types of exceptions - */ -public class ArtifactResolutionResult -{ - private Artifact originatingArtifact; - - private List<Artifact> missingArtifacts; - - // Exceptions - - private List<Exception> exceptions; - - private List<Exception> versionRangeViolations; - - private List<ArtifactResolutionException> metadataResolutionExceptions; - - private List<CyclicDependencyException> circularDependencyExceptions; - - private List<ArtifactResolutionException> errorArtifactExceptions; - - // file system errors - - private List<ArtifactRepository> repositories; - - private Set<Artifact> artifacts; - - private Set<ResolutionNode> resolutionNodes; - - public Artifact getOriginatingArtifact() - { - return originatingArtifact; - } - - public ArtifactResolutionResult setOriginatingArtifact( final Artifact originatingArtifact ) - { - this.originatingArtifact = originatingArtifact; - - return this; - } - - public void addArtifact( Artifact artifact ) - { - if ( artifacts == null ) - { - artifacts = new LinkedHashSet<Artifact>(); - } - - artifacts.add( artifact ); - } - - public Set<Artifact> getArtifacts() - { - if ( artifacts == null ) - { - artifacts = new LinkedHashSet<Artifact>(); - } - - return artifacts; - } - - public void setArtifacts( Set<Artifact> artifacts ) - { - this.artifacts = artifacts; - } - - public Set<ResolutionNode> getArtifactResolutionNodes() - { - if ( resolutionNodes == null ) - { - resolutionNodes = new LinkedHashSet<ResolutionNode>(); - } - - return resolutionNodes; - } - - public void setArtifactResolutionNodes( Set<ResolutionNode> resolutionNodes ) - { - this.resolutionNodes = resolutionNodes; - } - - public boolean hasMissingArtifacts() - { - return missingArtifacts != null && !missingArtifacts.isEmpty(); - } - - public List<Artifact> getMissingArtifacts() - { - return missingArtifacts == null ? Collections.<Artifact>emptyList() : missingArtifacts; - } - - public ArtifactResolutionResult addMissingArtifact( Artifact artifact ) - { - missingArtifacts = initList( missingArtifacts ); - - missingArtifacts.add( artifact ); - - return this; - } - - public ArtifactResolutionResult setUnresolvedArtifacts( final List<Artifact> unresolvedArtifacts ) - { - this.missingArtifacts = unresolvedArtifacts; - - return this; - } - - public boolean isSuccess() - { - return !( hasMissingArtifacts() || hasExceptions() ); - } - - // ------------------------------------------------------------------------ - // Exceptions - // ------------------------------------------------------------------------ - - public boolean hasExceptions() - { - return exceptions != null && !exceptions.isEmpty(); - } - - public List<Exception> getExceptions() - { - return exceptions == null ? Collections.<Exception>emptyList() : exceptions; - } - - // ------------------------------------------------------------------------ - // Version Range Violations - // ------------------------------------------------------------------------ - - public boolean hasVersionRangeViolations() - { - return versionRangeViolations != null; - } - - /** - * @TODO this needs to accept a {@link OverConstrainedVersionException} as returned by - * {@link #getVersionRangeViolation(int)} but it's not used like that in - * {@link DefaultLegacyArtifactCollector} - */ - public ArtifactResolutionResult addVersionRangeViolation( Exception e ) - { - versionRangeViolations = initList( versionRangeViolations ); - - versionRangeViolations.add( e ); - - exceptions = initList( exceptions ); - - exceptions.add( e ); - - return this; - } - - public OverConstrainedVersionException getVersionRangeViolation( int i ) - { - return (OverConstrainedVersionException) versionRangeViolations.get( i ); - } - - public List<Exception> getVersionRangeViolations() - { - return versionRangeViolations == null ? Collections.<Exception>emptyList() : versionRangeViolations; - } - - // ------------------------------------------------------------------------ - // Metadata Resolution Exceptions: ArtifactResolutionExceptions - // ------------------------------------------------------------------------ - - public boolean hasMetadataResolutionExceptions() - { - return metadataResolutionExceptions != null; - } - - public ArtifactResolutionResult addMetadataResolutionException( ArtifactResolutionException e ) - { - metadataResolutionExceptions = initList( metadataResolutionExceptions ); - - metadataResolutionExceptions.add( e ); - - exceptions = initList( exceptions ); - - exceptions.add( e ); - - return this; - } - - public ArtifactResolutionException getMetadataResolutionException( int i ) - { - return metadataResolutionExceptions.get( i ); - } - - public List<ArtifactResolutionException> getMetadataResolutionExceptions() - { - return metadataResolutionExceptions == null ? Collections.<ArtifactResolutionException>emptyList() - : metadataResolutionExceptions; - } - - // ------------------------------------------------------------------------ - // ErrorArtifactExceptions: ArtifactResolutionExceptions - // ------------------------------------------------------------------------ - - public boolean hasErrorArtifactExceptions() - { - return errorArtifactExceptions != null; - } - - public ArtifactResolutionResult addErrorArtifactException( ArtifactResolutionException e ) - { - errorArtifactExceptions = initList( errorArtifactExceptions ); - - errorArtifactExceptions.add( e ); - - exceptions = initList( exceptions ); - - exceptions.add( e ); - - return this; - } - - public List<ArtifactResolutionException> getErrorArtifactExceptions() - { - if ( errorArtifactExceptions == null ) - { - return Collections.emptyList(); - } - - return errorArtifactExceptions; - } - - // ------------------------------------------------------------------------ - // Circular Dependency Exceptions - // ------------------------------------------------------------------------ - - public boolean hasCircularDependencyExceptions() - { - return circularDependencyExceptions != null; - } - - public ArtifactResolutionResult addCircularDependencyException( CyclicDependencyException e ) - { - circularDependencyExceptions = initList( circularDependencyExceptions ); - - circularDependencyExceptions.add( e ); - - exceptions = initList( exceptions ); - - exceptions.add( e ); - - return this; - } - - public CyclicDependencyException getCircularDependencyException( int i ) - { - return circularDependencyExceptions.get( i ); - } - - public List<CyclicDependencyException> getCircularDependencyExceptions() - { - if ( circularDependencyExceptions == null ) - { - return Collections.emptyList(); - } - - return circularDependencyExceptions; - } - - // ------------------------------------------------------------------------ - // Repositories - // ------------------------------------------------------------------------ - - public List<ArtifactRepository> getRepositories() - { - if ( repositories == null ) - { - return Collections.emptyList(); - } - - return repositories; - } - - public ArtifactResolutionResult setRepositories( final List<ArtifactRepository> repositories ) - { - this.repositories = repositories; - - return this; - } - - // - // Internal - // - - private <T> List<T> initList( final List<T> l ) - { - if ( l == null ) - { - return new ArrayList<T>(); - } - return l; - } - - public String toString() - { - StringBuilder sb = new StringBuilder(); - - if ( artifacts != null ) - { - int i = 1; - sb.append( "---------" ).append( "\n" ); - sb.append( artifacts.size() ).append( "\n" ); - for ( Artifact a : artifacts ) - { - sb.append( i ).append( " " ).append( a ).append( "\n" ); - i++; - } - sb.append( "---------" ).append( "\n" ); - } - - return sb.toString(); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java deleted file mode 100644 index a8caa79b..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.codehaus.plexus.component.annotations.Component; - -/** - * @author Benjamin Bentmann - */ -@Component( role = ResolutionErrorHandler.class ) -public class DefaultResolutionErrorHandler - implements ResolutionErrorHandler -{ - - public void throwErrors( ArtifactResolutionRequest request, ArtifactResolutionResult result ) - throws ArtifactResolutionException - { - // Metadata cannot be found - - if ( result.hasMetadataResolutionExceptions() ) - { - throw result.getMetadataResolutionException( 0 ); - } - - // Metadata cannot be retrieved - - // Cyclic Dependency Error - - if ( result.hasCircularDependencyExceptions() ) - { - throw result.getCircularDependencyException( 0 ); - } - - // Version Range Violation - - if ( result.hasVersionRangeViolations() ) - { - throw result.getVersionRangeViolation( 0 ); - } - - // Transfer Error - - if ( result.hasErrorArtifactExceptions() ) - { - throw result.getErrorArtifactExceptions().get( 0 ); - } - - if ( result.hasMissingArtifacts() ) - { - throw new MultipleArtifactsNotFoundException( request.getArtifact(), toList( result.getArtifacts() ), - result.getMissingArtifacts(), - request.getRemoteRepositories() ); - } - - // this should never happen since we checked all possible error sources before but better be sure - if ( result.hasExceptions() ) - { - throw new ArtifactResolutionException( "Unknown error during artifact resolution, " + request + ", " - + result.getExceptions(), request.getArtifact(), request.getRemoteRepositories() ); - } - } - - private static <T> List<T> toList( Collection<T> items ) - { - return ( items != null ) ? new ArrayList<T>( items ) : null; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java deleted file mode 100644 index c54e5b6c..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * @author Benjamin Bentmann - */ -public interface ResolutionErrorHandler -{ - - void throwErrors( ArtifactResolutionRequest request, ArtifactResolutionResult result ) - throws ArtifactResolutionException; - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java deleted file mode 100644 index 97687de2..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.versioning.VersionRange; - -/** - * Listens to the resolution process and handles events. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public interface ResolutionListener -{ - String ROLE = ResolutionListener.class.getName(); - - int TEST_ARTIFACT = 1; - - int PROCESS_CHILDREN = 2; - - int FINISH_PROCESSING_CHILDREN = 3; - - int INCLUDE_ARTIFACT = 4; - - int OMIT_FOR_NEARER = 5; - - int UPDATE_SCOPE = 6; - - @Deprecated - int MANAGE_ARTIFACT = 7; - - int OMIT_FOR_CYCLE = 8; - - /** - * this event means that the artifactScope has NOT been updated to a farther node artifactScope because current - * node is in the first level pom - */ - int UPDATE_SCOPE_CURRENT_POM = 9; - - int SELECT_VERSION_FROM_RANGE = 10; - - int RESTRICT_RANGE = 11; - - int MANAGE_ARTIFACT_VERSION = 12; - - int MANAGE_ARTIFACT_SCOPE = 13; - - int MANAGE_ARTIFACT_SYSTEM_PATH = 14; - - void testArtifact( Artifact node ); - - void startProcessChildren( Artifact artifact ); - - void endProcessChildren( Artifact artifact ); - - void includeArtifact( Artifact artifact ); - - void omitForNearer( Artifact omitted, - Artifact kept ); - - void updateScope( Artifact artifact, - String scope ); - - @Deprecated - void manageArtifact( Artifact artifact, - Artifact replacement ); - - // TODO Use the following two instead of manageArtifact - // TODO Remove ResolutionListenerDM interface - - //void manageArtifactVersion( Artifact artifact, Artifact replacement ); - - //void manageArtifactScope( Artifact artifact, Artifact replacement ); - - void omitForCycle( Artifact artifact ); - - /** - * This event means that the artifactScope has NOT been updated to a farther node artifactScope because current - * node is in the first level pom - * - * @param artifact current node artifact, the one in the first level pom - * @param ignoredScope artifactScope that was ignored because artifact was in first level pom - */ - void updateScopeCurrentPom( Artifact artifact, - String ignoredScope ); - - void selectVersionFromRange( Artifact artifact ); - - void restrictRange( Artifact artifact, - Artifact replacement, - VersionRange newRange ); -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java deleted file mode 100644 index ae6c9214..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.apache.maven.artifact.resolver; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; -import org.apache.maven.artifact.versioning.ArtifactVersion; -import org.apache.maven.artifact.versioning.OverConstrainedVersionException; - -public class ResolutionNode -{ - private Artifact artifact; - - private List<ResolutionNode> children; - - private final List<Object> parents; - - private final int depth; - - private final ResolutionNode parent; - - private final List<ArtifactRepository> remoteRepositories; - - private boolean active = true; - - private List<Artifact> trail; - - public ResolutionNode( Artifact artifact, List<ArtifactRepository> remoteRepositories ) - { - this.artifact = artifact; - this.remoteRepositories = remoteRepositories; - depth = 0; - parents = Collections.emptyList(); - parent = null; - } - - public ResolutionNode( Artifact artifact, List<ArtifactRepository> remoteRepositories, ResolutionNode parent ) - { - this.artifact = artifact; - this.remoteRepositories = remoteRepositories; - depth = parent.depth + 1; - parents = new ArrayList<Object>(); - parents.addAll( parent.parents ); - parents.add( parent.getKey() ); - this.parent = parent; - } - - public Artifact getArtifact() - { - return artifact; - } - - public Object getKey() - { - return artifact.getDependencyConflictId(); - } - - public void addDependencies( Set<Artifact> artifacts, List<ArtifactRepository> remoteRepositories, - ArtifactFilter filter ) - throws CyclicDependencyException, OverConstrainedVersionException - { - if ( artifacts != null && !artifacts.isEmpty() ) - { - children = new ArrayList<ResolutionNode>( artifacts.size() ); - - for ( Artifact a : artifacts ) - { - if ( parents.contains( a.getDependencyConflictId() ) ) - { - a.setDependencyTrail( getDependencyTrail() ); - - throw new CyclicDependencyException( "A dependency has introduced a cycle", a ); - } - - children.add( new ResolutionNode( a, remoteRepositories, this ) ); - } - } - else - { - children = Collections.emptyList(); - } - trail = null; - } - - /** - * @return {@link List} < {@link String} > with artifact ids - * @throws OverConstrainedVersionException - */ - public List<String> getDependencyTrail() - throws OverConstrainedVersionException - { - List<Artifact> trial = getTrail(); - - List<String> ret = new ArrayList<String>( trial.size() ); - - for ( Artifact artifact : trial ) - { - ret.add( artifact.getId() ); - } - - return ret; - } - - private List<Artifact> getTrail() - throws OverConstrainedVersionException - { - if ( trail == null ) - { - List<Artifact> ids = new LinkedList<Artifact>(); - ResolutionNode node = this; - while ( node != null ) - { - Artifact artifact = node.getArtifact(); - if ( artifact.getVersion() == null ) - { - // set the recommended version - ArtifactVersion selected = artifact.getSelectedVersion(); - // MNG-2123: null is a valid response to getSelectedVersion, don't - // assume it won't ever be. - if ( selected != null ) - { - artifact.selectVersion( selected.toString() ); - } - else - { - throw new OverConstrainedVersionException( "Unable to get a selected Version for " - + artifact.getArtifactId(), artifact ); - } - } - - ids.add( 0, artifact ); - node = node.parent; - } - trail = ids; - } - return trail; - } - - public boolean isResolved() - { - return children != null; - } - - /** - * Test whether the node is direct or transitive dependency. - */ - public boolean isChildOfRootNode() - { - return parent != null && parent.parent == null; - } - - public Iterator<ResolutionNode> getChildrenIterator() - { - return children.iterator(); - } - - public int getDepth() - { - return depth; - } - - public List<ArtifactRepository> getRemoteRepositories() - { - return remoteRepositories; - } - - public boolean isActive() - { - return active; - } - - public void enable() - { - active = true; - - // TODO: if it was null, we really need to go find them now... or is this taken care of by the ordering? - if ( children != null ) - { - for ( ResolutionNode node : children ) - { - node.enable(); - } - } - } - - public void disable() - { - active = false; - if ( children != null ) - { - for ( ResolutionNode node : children ) - { - node.disable(); - } - } - } - - public boolean filterTrail( ArtifactFilter filter ) - throws OverConstrainedVersionException - { - boolean success = true; - if ( filter != null ) - { - for ( Artifact artifact : getTrail() ) - { - if ( !filter.include( artifact ) ) - { - success = false; - } - } - } - return success; - } - - @Override - public String toString() - { - return artifact.toString() + " (" + depth + "; " + ( active ? "enabled" : "disabled" ) + ")"; - } - - public void setArtifact( Artifact artifact ) - { - this.artifact = artifact; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java deleted file mode 100644 index 95872dbb..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to only retain objects in the given artifactScope or better. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -abstract class AbstractScopeArtifactFilter - implements ArtifactFilter -{ - - private boolean compileScope; - - private boolean runtimeScope; - - private boolean testScope; - - private boolean providedScope; - - private boolean systemScope; - - void addScopeInternal( String scope ) - { - if ( Artifact.SCOPE_COMPILE.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - } - else if ( Artifact.SCOPE_RUNTIME.equals( scope ) ) - { - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( scope ) ) - { - systemScope = true; - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_TEST.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - runtimeScope = true; - testScope = true; - } - } - - public boolean include( Artifact artifact ) - { - if ( Artifact.SCOPE_COMPILE.equals( artifact.getScope() ) ) - { - return compileScope; - } - else if ( Artifact.SCOPE_RUNTIME.equals( artifact.getScope() ) ) - { - return runtimeScope; - } - else if ( Artifact.SCOPE_TEST.equals( artifact.getScope() ) ) - { - return testScope; - } - else if ( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) - { - return providedScope; - } - else if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) - { - return systemScope; - } - else - { - return true; - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java deleted file mode 100644 index 5c6689de..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * Apply multiple filters. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class AndArtifactFilter - implements ArtifactFilter -{ - private Set<ArtifactFilter> filters; - - public AndArtifactFilter() - { - this.filters = new LinkedHashSet<ArtifactFilter>(); - } - - public AndArtifactFilter( List<ArtifactFilter> filters ) - { - this.filters = new LinkedHashSet<ArtifactFilter>( filters ); - } - - public boolean include( Artifact artifact ) - { - boolean include = true; - for ( Iterator<ArtifactFilter> i = filters.iterator(); i.hasNext() && include; ) - { - ArtifactFilter filter = i.next(); - if ( !filter.include( artifact ) ) - { - include = false; - } - } - return include; - } - - public void add( ArtifactFilter artifactFilter ) - { - filters.add( artifactFilter ); - } - - public List<ArtifactFilter> getFilters() - { - return new ArrayList<ArtifactFilter>( filters ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + filters.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof AndArtifactFilter ) ) - { - return false; - } - - AndArtifactFilter other = (AndArtifactFilter) obj; - - return filters.equals( other.filters ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java deleted file mode 100644 index fb0afcfb..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -/** - * Filter to only retain objects in the given scope or better. This implementation allows the accumulation of multiple - * scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a - * single step. This should be a more efficient implementation of multiple standard {@link ScopeArtifactFilter} - * instances ORed together. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @author jdcasey - */ -public class CumulativeScopeArtifactFilter - extends AbstractScopeArtifactFilter -{ - - private Set<String> scopes; - - /** - * Create a new filter with the specified scopes and their implied scopes enabled. - * - * @param scopes The scopes to enable, along with all implied scopes, may be {@code null}. - */ - public CumulativeScopeArtifactFilter( Collection<String> scopes ) - { - this.scopes = new HashSet<String>(); - - addScopes( scopes ); - } - - /** - * Creates a new filter that combines the specified filters. - * - * @param filters The filters to combine, may be {@code null}. - */ - public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters ) - { - this.scopes = new HashSet<String>(); - - if ( filters != null ) - { - for ( CumulativeScopeArtifactFilter filter : filters ) - { - addScopes( filter.getScopes() ); - } - } - } - - private void addScopes( Collection<String> scopes ) - { - if ( scopes != null ) - { - for ( String scope : scopes ) - { - addScope( scope ); - } - } - } - - private void addScope( String scope ) - { - this.scopes.add( scope ); - - addScopeInternal( scope ); - } - - public Set<String> getScopes() - { - return scopes; - } - - @Override - public int hashCode() - { - int hash = 17; - - hash = hash * 31 + scopes.hashCode(); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof CumulativeScopeArtifactFilter ) ) - { - return false; - } - - CumulativeScopeArtifactFilter that = (CumulativeScopeArtifactFilter) obj; - - return scopes.equals( that.scopes ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java deleted file mode 100644 index b6ef02e5..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.List; - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to exclude from a list of artifact patterns. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @todo I think this is equiv. to exclusion set filter in maven-core - */ -public class ExcludesArtifactFilter - extends IncludesArtifactFilter -{ - public ExcludesArtifactFilter( List<String> patterns ) - { - super( patterns ); - } - - public boolean include( Artifact artifact ) - { - return !super.include( artifact ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java deleted file mode 100644 index c3dc9812..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> - */ -public class ExclusionSetFilter - implements ArtifactFilter -{ - private Set<String> excludes; - - public ExclusionSetFilter( String[] excludes ) - { - this.excludes = new LinkedHashSet<String>( Arrays.asList( excludes ) ); - } - - public ExclusionSetFilter( Set<String> excludes ) - { - this.excludes = excludes; - } - - public boolean include( Artifact artifact ) - { - String id = artifact.getArtifactId(); - - if ( excludes.contains( id ) ) - { - return false; - } - - id = artifact.getGroupId() + ':' + id; - - return !excludes.contains( id ); - - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + excludes.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof ExclusionSetFilter ) ) - { - return false; - } - - ExclusionSetFilter other = (ExclusionSetFilter) obj; - - return excludes.equals( other.excludes ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java deleted file mode 100644 index 403e1251..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to include from a list of artifact patterns. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class IncludesArtifactFilter - implements ArtifactFilter -{ - private final Set<String> patterns; - - public IncludesArtifactFilter( List<String> patterns ) - { - this.patterns = new LinkedHashSet<String>( patterns ); - } - - public boolean include( Artifact artifact ) - { - String id = artifact.getGroupId() + ":" + artifact.getArtifactId(); - - boolean matched = false; - for ( Iterator<String> i = patterns.iterator(); i.hasNext() & !matched; ) - { - // TODO: what about wildcards? Just specifying groups? versions? - if ( id.equals( i.next() ) ) - { - matched = true; - } - } - return matched; - } - - public List<String> getPatterns() - { - return new ArrayList<String>( patterns ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + patterns.hashCode(); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - // make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter! - if ( obj == null || getClass() != obj.getClass() ) - { - return false; - } - - IncludesArtifactFilter other = (IncludesArtifactFilter) obj; - - return patterns.equals( other.patterns ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java deleted file mode 100644 index 1d131b71..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Filter to only retain objects in the given artifactScope or better. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class ScopeArtifactFilter - extends AbstractScopeArtifactFilter -{ - - private final String scope; - - public ScopeArtifactFilter( String scope ) - { - this.scope = scope; - - addScopeInternal( scope ); - } - - public String getScope() - { - return scope; - } - - @Override - public int hashCode() - { - int hash = 17; - - hash = hash * 31 + ( scope != null ? scope.hashCode() : 0 ); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof ScopeArtifactFilter ) ) - { - return false; - } - - ScopeArtifactFilter other = (ScopeArtifactFilter) obj; - - return equals( scope, other.scope ); - } - - private static <T> boolean equals( T str1, T str2 ) - { - return str1 != null ? str1.equals( str2 ) : str2 == null; - } - -} |