diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact')
34 files changed, 0 insertions, 4123 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactScopeEnum.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactScopeEnum.java deleted file mode 100644 index 7051e3bf..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactScopeEnum.java +++ /dev/null @@ -1,133 +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. - */ - -/** - * Type safe reincarnation of Artifact scope. Also supplies the <code>DEFAULT_SCOPE<code> as well - * as convenience method to deal with scope relationships. - * - * @author <a href="oleg@codehaus.org">Oleg Gusakov</a> - * - */ - -public enum ArtifactScopeEnum -{ - compile( 1 ), test( 2 ), runtime( 3 ), provided( 4 ), system( 5 ), runtime_plus_system( 6 ); - - public static final ArtifactScopeEnum DEFAULT_SCOPE = compile; - - private int id; - - // Constructor - ArtifactScopeEnum( int id ) - { - this.id = id; - } - - int getId() - { - return id; - } - - - /** - * Helper method to simplify null processing - * - * @return - */ - public static final ArtifactScopeEnum checkScope( ArtifactScopeEnum scope ) - { - return scope == null ? DEFAULT_SCOPE : scope; - } - - /** - * - * @return unsafe String representation of this scope. - */ - public String getScope() - { - if ( id == 1 ) - { - return Artifact.SCOPE_COMPILE; - } - else if ( id == 2 ) - { - return Artifact.SCOPE_TEST; - - } - else if ( id == 3 ) - { - return Artifact.SCOPE_RUNTIME; - - } - else if ( id == 4 ) - { - return Artifact.SCOPE_PROVIDED; - } - else if ( id == 5 ) - { - return Artifact.SCOPE_SYSTEM; - } - else - { - return Artifact.SCOPE_RUNTIME_PLUS_SYSTEM; - } - } - - private static final ArtifactScopeEnum [][][] COMPLIANCY_SETS = { - { { compile }, { compile, provided, system } } - , { { test }, { compile, test, provided, system } } - , { { runtime }, { compile, runtime, system } } - , { { provided }, { compile, test, provided } } - }; - - /** - * scope relationship function. Used by the graph conflict resolution policies - * - * @param scope - * @return true is supplied scope is an inclusive sub-scope of current one. - */ - public boolean encloses( ArtifactScopeEnum scope ) - { - final ArtifactScopeEnum s = checkScope( scope ); - - // system scope is historic only - and simple - if ( id == system.id ) - { - return scope.id == system.id; - } - - for ( ArtifactScopeEnum[][] set : COMPLIANCY_SETS ) - { - if ( id == set[0][0].id ) - { - for ( ArtifactScopeEnum ase : set[1] ) - { - if ( s.id == ase.id ) - { - return true; - } - } - break; - } - } - return false; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactStatus.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactStatus.java deleted file mode 100644 index 3bd1e341..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/ArtifactStatus.java +++ /dev/null @@ -1,124 +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.util.HashMap; -import java.util.Map; - -/** - * Type safe enumeration for the artifact status field. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public final class ArtifactStatus - implements Comparable<ArtifactStatus> -{ - /** - * No trust - no information about status. - */ - public static final ArtifactStatus NONE = new ArtifactStatus( "none", 0 ); - - /** - * No trust - information was generated with defaults. - */ - public static final ArtifactStatus GENERATED = new ArtifactStatus( "generated", 1 ); - - /** - * Low trust - was converted from the Maven 1.x repository. - */ - public static final ArtifactStatus CONVERTED = new ArtifactStatus( "converted", 2 ); - - /** - * Moderate trust - it was deployed directly from a partner. - */ - public static final ArtifactStatus PARTNER = new ArtifactStatus( "partner", 3 ); - - /** - * Moderate trust - it was deployed directly by a user. - */ - public static final ArtifactStatus DEPLOYED = new ArtifactStatus( "deployed", 4 ); - - /** - * Trusted, as it has had its data verified by hand. - */ - public static final ArtifactStatus VERIFIED = new ArtifactStatus( "verified", 5 ); - - private final int rank; - - private final String key; - - private static Map<String, ArtifactStatus> map; - - private ArtifactStatus( String key, int rank ) - { - this.rank = rank; - this.key = key; - - if ( map == null ) - { - map = new HashMap<String, ArtifactStatus>(); - } - map.put( key, this ); - } - - public static ArtifactStatus valueOf( String status ) - { - ArtifactStatus retVal = null; - - if ( status != null ) - { - retVal = map.get( status ); - } - - return retVal != null ? retVal : NONE; - } - - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - if ( o == null || getClass() != o.getClass() ) - { - return false; - } - - final ArtifactStatus that = (ArtifactStatus) o; - - return rank == that.rank; - - } - - public int hashCode() - { - return rank; - } - - public String toString() - { - return key; - } - - public int compareTo( ArtifactStatus s ) - { - return rank - s.rank; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/UnknownRepositoryLayoutException.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/UnknownRepositoryLayoutException.java deleted file mode 100644 index 5abe1105..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/UnknownRepositoryLayoutException.java +++ /dev/null @@ -1,54 +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 org.codehaus.plexus.component.repository.exception.ComponentLookupException; - -/** - * Exception which is meant to occur when a layout specified for a particular - * repository doesn't have a corresponding {@link ArtifactRepositoryLayout} - * component in the current container. - * - * @author jdcasey - */ -public class UnknownRepositoryLayoutException - extends InvalidRepositoryException -{ - - private final String layoutId; - - public UnknownRepositoryLayoutException( String repositoryId, String layoutId ) - { - super( "Cannot find ArtifactRepositoryLayout instance for: " + layoutId, repositoryId ); - this.layoutId = layoutId; - } - - public UnknownRepositoryLayoutException( String repositoryId, String layoutId, ComponentLookupException e ) - { - super( "Cannot find ArtifactRepositoryLayout instance for: " + layoutId, repositoryId, e ); - this.layoutId = layoutId; - } - - public String getLayoutId() - { - return layoutId; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeployer.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeployer.java deleted file mode 100644 index 072552cc..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeployer.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.apache.maven.artifact.deployer; - -/* - * 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 org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; - -public interface ArtifactDeployer -{ - String ROLE = ArtifactDeployer.class.getName(); - - /** - * Deploy an artifact from a particular directory. The artifact handler is used to determine the - * filename of the source file. - * - * @param basedir the directory where the artifact is stored - * @param finalName the name of the artifact without extension - * @param artifact the artifact definition - * @param deploymentRepository the repository to deploy to - * @param localRepository the local repository to install into - * @throws ArtifactDeploymentException if an error occurred deploying the artifact - * @deprecated to be removed before 2.0 after the install/deploy plugins use the alternate - * method - */ - @Deprecated - void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository, - ArtifactRepository localRepository ) - throws ArtifactDeploymentException; - - /** - * Deploy an artifact from a particular file. - * - * @param source the file to deploy - * @param artifact the artifact definition - * @param deploymentRepository the repository to deploy to - * @param localRepository the local repository to install into - * @throws ArtifactDeploymentException if an error occurred deploying the artifact - */ - void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository, - ArtifactRepository localRepository ) - throws ArtifactDeploymentException; -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeploymentException.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeploymentException.java deleted file mode 100644 index 6e44ed3c..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/ArtifactDeploymentException.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.artifact.deployer; - -/* - * 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 Jason van Zyl - */ -public class ArtifactDeploymentException - extends Exception -{ - public ArtifactDeploymentException( String message ) - { - super( message ); - } - - public ArtifactDeploymentException( Throwable cause ) - { - super( cause ); - } - - public ArtifactDeploymentException( String message, - Throwable cause ) - { - super( message, cause ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java deleted file mode 100644 index abbab821..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.apache.maven.artifact.deployer; - -/* - * 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.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.maven.RepositoryUtils; -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.DefaultArtifactRepository; -import org.apache.maven.artifact.repository.LegacyLocalRepositoryManager; -import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; -import org.apache.maven.artifact.repository.metadata.MetadataBridge; -import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; -import org.apache.maven.plugin.LegacySupport; -import org.apache.maven.project.artifact.ProjectArtifactMetadata; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.eclipse.aether.RepositorySystem; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.RequestTrace; -import org.eclipse.aether.deployment.DeployRequest; -import org.eclipse.aether.deployment.DeployResult; -import org.eclipse.aether.deployment.DeploymentException; -import org.eclipse.aether.metadata.MergeableMetadata; -import org.eclipse.aether.repository.RemoteRepository; -import org.eclipse.aether.util.artifact.SubArtifact; - -@Component( role = ArtifactDeployer.class, instantiationStrategy = "per-lookup" ) -public class DefaultArtifactDeployer - extends AbstractLogEnabled - implements ArtifactDeployer -{ - - @Requirement - private RepositorySystem repoSystem; - - @Requirement - private LegacySupport legacySupport; - - private Map<Object, MergeableMetadata> relatedMetadata = new ConcurrentHashMap<Object, MergeableMetadata>(); - - /** - * @deprecated we want to use the artifact method only, and ensure artifact.file is set - * correctly. - */ - @Deprecated - public void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository, - ArtifactRepository localRepository ) - throws ArtifactDeploymentException - { - String extension = artifact.getArtifactHandler().getExtension(); - File source = new File( basedir, finalName + "." + extension ); - deploy( source, artifact, deploymentRepository, localRepository ); - } - - public void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository, - ArtifactRepository localRepository ) - throws ArtifactDeploymentException - { - RepositorySystemSession session = - LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem ); - - DeployRequest request = new DeployRequest(); - - request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); - - org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); - mainArtifact = mainArtifact.setFile( source ); - request.addArtifact( mainArtifact ); - - String versionKey = artifact.getGroupId() + ':' + artifact.getArtifactId(); - String snapshotKey = null; - if ( artifact.isSnapshot() ) - { - snapshotKey = versionKey + ':' + artifact.getBaseVersion(); - request.addMetadata( relatedMetadata.get( snapshotKey ) ); - } - request.addMetadata( relatedMetadata.get( versionKey ) ); - - for ( ArtifactMetadata metadata : artifact.getMetadataList() ) - { - if ( metadata instanceof ProjectArtifactMetadata ) - { - org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); - pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); - request.addArtifact( pomArtifact ); - } - else if ( metadata instanceof SnapshotArtifactRepositoryMetadata - || metadata instanceof ArtifactRepositoryMetadata ) - { - // eaten, handled by repo system - } - else - { - request.addMetadata( new MetadataBridge( metadata ) ); - } - } - - RemoteRepository remoteRepo = RepositoryUtils.toRepo( deploymentRepository ); - /* - * NOTE: This provides backward-compat with maven-deploy-plugin:2.4 which bypasses the repository factory when - * using an alternative deployment location. - */ - if ( deploymentRepository instanceof DefaultArtifactRepository - && deploymentRepository.getAuthentication() == null ) - { - RemoteRepository.Builder builder = new RemoteRepository.Builder( remoteRepo ); - builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) ); - builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) ); - remoteRepo = builder.build(); - } - request.setRepository( remoteRepo ); - - DeployResult result; - try - { - result = repoSystem.deploy( session, request ); - } - catch ( DeploymentException e ) - { - throw new ArtifactDeploymentException( e.getMessage(), e ); - } - - for ( Object metadata : result.getMetadata() ) - { - if ( metadata.getClass().getName().endsWith( ".internal.VersionsMetadata" ) ) - { - relatedMetadata.put( versionKey, (MergeableMetadata) metadata ); - } - if ( snapshotKey != null && metadata.getClass().getName().endsWith( ".internal.RemoteSnapshotMetadata" ) ) - { - relatedMetadata.put( snapshotKey, (MergeableMetadata) metadata ); - } - } - - artifact.setResolvedVersion( result.getArtifacts().iterator().next().getVersion() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstallationException.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstallationException.java deleted file mode 100644 index 9f1e45b9..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstallationException.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.artifact.installer; - -/* - * 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 <a href="mailto:jason@maven.org">Jason van Zyl</a> - */ -public class ArtifactInstallationException - extends Exception -{ - public ArtifactInstallationException( String message ) - { - super( message ); - } - - public ArtifactInstallationException( Throwable cause ) - { - super( cause ); - } - - public ArtifactInstallationException( String message, - Throwable cause ) - { - super( message, cause ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstaller.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstaller.java deleted file mode 100644 index 376eba20..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/ArtifactInstaller.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.apache.maven.artifact.installer; - -/* - * 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 org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; - -/** - * @author <a href="michal@codehaus.org">Michal Maczka</a> - */ -public interface ArtifactInstaller -{ - String ROLE = ArtifactInstaller.class.getName(); - - /** - * Install an artifact from a particular directory. The artifact handler is used to determine - * the filename of the source file. - * - * @param basedir the directory where the artifact is stored - * @param finalName the name of the artifact sans extension - * @param artifact the artifact definition - * @param localRepository the local repository to install into - * @throws ArtifactInstallationException if an error occurred installing the artifact - * @deprecated to be removed before 2.0 after the instlal/deploy plugins use the alternate - * method - */ - @Deprecated - void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository ) - throws ArtifactInstallationException; - - /** - * Install an artifact from a particular file. - * - * @param source the file to install - * @param artifact the artifact definition - * @param localRepository the local repository to install into - * @throws ArtifactInstallationException if an error occurred installing the artifact - */ - void install( File source, Artifact artifact, ArtifactRepository localRepository ) - throws ArtifactInstallationException; -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java deleted file mode 100644 index a2529757..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.apache.maven.artifact.installer; - -/* - * 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 org.apache.maven.RepositoryUtils; -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.LegacyLocalRepositoryManager; -import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; -import org.apache.maven.artifact.repository.metadata.MetadataBridge; -import org.apache.maven.artifact.repository.metadata.Snapshot; -import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; -import org.apache.maven.artifact.repository.metadata.Versioning; -import org.apache.maven.plugin.LegacySupport; -import org.apache.maven.project.artifact.ProjectArtifactMetadata; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.eclipse.aether.RepositorySystem; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.RequestTrace; -import org.eclipse.aether.installation.InstallRequest; -import org.eclipse.aether.installation.InstallationException; -import org.eclipse.aether.util.artifact.SubArtifact; - -/** - * @author Jason van Zyl - */ -@Component( role = ArtifactInstaller.class ) -public class DefaultArtifactInstaller - extends AbstractLogEnabled - implements ArtifactInstaller -{ - - @Requirement - private RepositorySystem repoSystem; - - @Requirement - private LegacySupport legacySupport; - - /** @deprecated we want to use the artifact method only, and ensure artifact.file is set correctly. */ - @Deprecated - public void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository ) - throws ArtifactInstallationException - { - String extension = artifact.getArtifactHandler().getExtension(); - File source = new File( basedir, finalName + "." + extension ); - - install( source, artifact, localRepository ); - } - - public void install( File source, Artifact artifact, ArtifactRepository localRepository ) - throws ArtifactInstallationException - { - RepositorySystemSession session = - LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem ); - - InstallRequest request = new InstallRequest(); - - request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) ); - - org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); - mainArtifact = mainArtifact.setFile( source ); - request.addArtifact( mainArtifact ); - - for ( ArtifactMetadata metadata : artifact.getMetadataList() ) - { - if ( metadata instanceof ProjectArtifactMetadata ) - { - org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" ); - pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); - request.addArtifact( pomArtifact ); - } - else if ( metadata instanceof SnapshotArtifactRepositoryMetadata - || metadata instanceof ArtifactRepositoryMetadata ) - { - // eaten, handled by repo system - } - else - { - request.addMetadata( new MetadataBridge( metadata ) ); - } - } - - try - { - repoSystem.install( session, request ); - } - catch ( InstallationException e ) - { - throw new ArtifactInstallationException( e.getMessage(), e ); - } - - /* - * NOTE: Not used by Maven core, only here to provide backward-compat with plugins like the Install Plugin. - */ - - if ( artifact.isSnapshot() ) - { - Snapshot snapshot = new Snapshot(); - snapshot.setLocalCopy( true ); - artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) ); - } - - Versioning versioning = new Versioning(); - versioning.updateTimestamp(); - versioning.addVersion( artifact.getBaseVersion() ); - if ( artifact.isRelease() ) - { - versioning.setRelease( artifact.getBaseVersion() ); - } - artifact.addMetadata( new ArtifactRepositoryMetadata( artifact, versioning ) ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java deleted file mode 100644 index 29876e24..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java +++ /dev/null @@ -1,182 +0,0 @@ -package org.apache.maven.artifact.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.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; -import org.apache.maven.execution.MavenExecutionRequest; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.LegacySupport; -import org.apache.maven.repository.MirrorSelector; -import org.apache.maven.settings.Mirror; -import org.apache.maven.settings.Proxy; -import org.apache.maven.settings.Server; -import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest; -import org.apache.maven.settings.crypto.SettingsDecrypter; -import org.apache.maven.settings.crypto.SettingsDecryptionResult; -import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.wagon.TransferFailedException; -import org.apache.maven.wagon.authentication.AuthenticationInfo; -import org.apache.maven.wagon.proxy.ProxyInfo; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.logging.Logger; - -@Component( role = WagonManager.class ) -public class DefaultWagonManager - extends org.apache.maven.repository.legacy.DefaultWagonManager - implements WagonManager -{ - - // NOTE: This must use a different field name than in the super class or IoC has no chance to inject the loggers - @Requirement - private Logger log; - - @Requirement - private LegacySupport legacySupport; - - @Requirement - private SettingsDecrypter settingsDecrypter; - - @Requirement - private MirrorSelector mirrorSelector; - - @Requirement - private ArtifactRepositoryFactory artifactRepositoryFactory; - - public AuthenticationInfo getAuthenticationInfo( String id ) - { - MavenSession session = legacySupport.getSession(); - - if ( session != null && id != null ) - { - MavenExecutionRequest request = session.getRequest(); - - if ( request != null ) - { - List<Server> servers = request.getServers(); - - if ( servers != null ) - { - for ( Server server : servers ) - { - if ( id.equalsIgnoreCase( server.getId() ) ) - { - SettingsDecryptionResult result = - settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( server ) ); - server = result.getServer(); - - AuthenticationInfo authInfo = new AuthenticationInfo(); - authInfo.setUserName( server.getUsername() ); - authInfo.setPassword( server.getPassword() ); - authInfo.setPrivateKey( server.getPrivateKey() ); - authInfo.setPassphrase( server.getPassphrase() ); - - return authInfo; - } - } - } - } - } - - // empty one to prevent NPE - return new AuthenticationInfo(); - } - - public ProxyInfo getProxy( String protocol ) - { - MavenSession session = legacySupport.getSession(); - - if ( session != null && protocol != null ) - { - MavenExecutionRequest request = session.getRequest(); - - if ( request != null ) - { - List<Proxy> proxies = request.getProxies(); - - if ( proxies != null ) - { - for ( Proxy proxy : proxies ) - { - if ( proxy.isActive() && protocol.equalsIgnoreCase( proxy.getProtocol() ) ) - { - SettingsDecryptionResult result = - settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( proxy ) ); - proxy = result.getProxy(); - - ProxyInfo proxyInfo = new ProxyInfo(); - proxyInfo.setHost( proxy.getHost() ); - proxyInfo.setType( proxy.getProtocol() ); - proxyInfo.setPort( proxy.getPort() ); - proxyInfo.setNonProxyHosts( proxy.getNonProxyHosts() ); - proxyInfo.setUserName( proxy.getUsername() ); - proxyInfo.setPassword( proxy.getPassword() ); - - return proxyInfo; - } - } - } - } - } - - return null; - } - - public void getArtifact( Artifact artifact, ArtifactRepository repository ) - throws TransferFailedException, ResourceDoesNotExistException - { - getArtifact( artifact, repository, null, false ); - } - - public void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories ) - throws TransferFailedException, ResourceDoesNotExistException - { - getArtifact( artifact, remoteRepositories, null, false ); - } - - @Deprecated - public ArtifactRepository getMirrorRepository( ArtifactRepository repository ) - { - - Mirror mirror = mirrorSelector.getMirror( repository, legacySupport.getSession().getSettings().getMirrors() ); - - if ( mirror != null ) - { - String id = mirror.getId(); - if ( id == null ) - { - // TODO: this should be illegal in settings.xml - id = repository.getId(); - } - - log.debug( "Using mirror: " + mirror.getUrl() + " (id: " + id + ")" ); - - repository = artifactRepositoryFactory.createArtifactRepository( id, mirror.getUrl(), - repository.getLayout(), repository.getSnapshots(), - repository.getReleases() ); - } - return repository; - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonConfigurationException.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonConfigurationException.java deleted file mode 100644 index 8065116f..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonConfigurationException.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.apache.maven.artifact.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. - */ - -/** - * @author Olivier Lamy - */ -@Deprecated -public class WagonConfigurationException - extends org.apache.maven.repository.legacy.WagonConfigurationException -{ - public WagonConfigurationException( String repositoryId, String message, Throwable cause ) - { - super( repositoryId, message, cause ); - } - - public WagonConfigurationException( String repositoryId, String message ) - { - super( repositoryId, message ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java deleted file mode 100644 index fb7ca8b6..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.maven.artifact.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.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.wagon.TransferFailedException; -import org.apache.maven.wagon.authentication.AuthenticationInfo; -import org.apache.maven.wagon.proxy.ProxyInfo; - -/** - * Manages <a href="http://maven.apache.org/wagon">Wagon</a> related operations in Maven. - * - * @author <a href="michal.maczka@dimatics.com">Michal Maczka </a> - */ -@Deprecated -public interface WagonManager - extends org.apache.maven.repository.legacy.WagonManager -{ - /** - * this method is only here for backward compat (project-info-reports:dependencies) - * the default implementation will return an empty AuthenticationInfo - */ - AuthenticationInfo getAuthenticationInfo( String id ); - - ProxyInfo getProxy( String protocol ); - - void getArtifact( Artifact artifact, ArtifactRepository repository ) - throws TransferFailedException, ResourceDoesNotExistException; - - void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories ) - throws TransferFailedException, ResourceDoesNotExistException; - - ArtifactRepository getMirrorRepository( ArtifactRepository repository ); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java deleted file mode 100644 index ac18b3ad..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java +++ /dev/null @@ -1,55 +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 org.apache.maven.artifact.UnknownRepositoryLayoutException; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; - -/** @author jdcasey */ -public interface ArtifactRepositoryFactory -{ - String ROLE = ArtifactRepositoryFactory.class.getName(); - - String DEFAULT_LAYOUT_ID = "default"; - - String LOCAL_REPOSITORY_ID = "local"; - - @Deprecated - ArtifactRepositoryLayout getLayout( String layoutId ) - throws UnknownRepositoryLayoutException; - - @Deprecated - ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId, boolean uniqueVersion ) - throws UnknownRepositoryLayoutException; - - ArtifactRepository createDeploymentArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, - boolean uniqueVersion ); - - ArtifactRepository createArtifactRepository( String id, String url, String layoutId, - ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ) - throws UnknownRepositoryLayoutException; - - ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, - ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ); - - void setGlobalUpdatePolicy( String snapshotPolicy ); - - void setGlobalChecksumPolicy( String checksumPolicy ); -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java deleted file mode 100644 index e0a55879..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java +++ /dev/null @@ -1,267 +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; -import org.apache.maven.wagon.repository.Repository; - -/** - * This class is an abstraction of the location from/to resources can be - * transfered. - * - * @author <a href="michal.maczka@dimatics.com">Michal Maczka </a> - */ -@Deprecated -public class DefaultArtifactRepository - extends Repository - implements ArtifactRepository -{ - private ArtifactRepositoryLayout layout; - - private ArtifactRepositoryPolicy snapshots; - - private ArtifactRepositoryPolicy releases; - - private boolean blacklisted; - - private Authentication authentication; - - private Proxy proxy; - - private List<ArtifactRepository> mirroredRepositories = Collections.emptyList(); - - /** - * Create a local repository or a test repository. - * - * @param id the unique identifier of the repository - * @param url the URL of the repository - * @param layout the layout of the repository - */ - public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout ) - { - this( id, url, layout, null, null ); - } - - /** - * Create a remote deployment repository. - * - * @param id the unique identifier of the repository - * @param url the URL of the repository - * @param layout the layout of the repository - * @param uniqueVersion whether to assign each snapshot a unique version - */ - public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, boolean uniqueVersion ) - { - super( id, url ); - this.layout = layout; - } - - /** - * 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 DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, - ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ) - { - super( id, url ); - - this.layout = layout; - - if ( snapshots == null ) - { - snapshots = new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, - ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE ); - } - - this.snapshots = snapshots; - - if ( releases == null ) - { - releases = new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, - ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE ); - } - - this.releases = releases; - } - - 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 boolean isBlacklisted() - { - return blacklisted; - } - - public void setBlacklisted( boolean blacklisted ) - { - this.blacklisted = blacklisted; - } - - 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 ( 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 ); - - if ( artifactFile.exists() ) - { - artifact.setResolved( true ); - } - - return artifact; - } - - public List<String> findVersions( Artifact artifact ) - { - return Collections.emptyList(); - } - - public boolean isProjectAware() - { - return false; - } - - 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 isUniqueVersion() - { - return true; - } - - 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-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java deleted file mode 100644 index 658dbdac..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java +++ /dev/null @@ -1,124 +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.Arrays; -import java.util.List; - -import org.apache.maven.artifact.UnknownRepositoryLayoutException; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.plugin.LegacySupport; -import org.apache.maven.repository.RepositorySystem; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.eclipse.aether.RepositorySystemSession; - -/** - * @author jdcasey - */ -@Component( role = ArtifactRepositoryFactory.class ) -public class DefaultArtifactRepositoryFactory - implements ArtifactRepositoryFactory -{ - - @Requirement - private org.apache.maven.repository.legacy.repository.ArtifactRepositoryFactory factory; - - @Requirement - private LegacySupport legacySupport; - - @Requirement - private RepositorySystem repositorySystem; - - public ArtifactRepositoryLayout getLayout( String layoutId ) - throws UnknownRepositoryLayoutException - { - return factory.getLayout( layoutId ); - } - - public ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId, - boolean uniqueVersion ) - throws UnknownRepositoryLayoutException - { - return injectSession( factory.createDeploymentArtifactRepository( id, url, layoutId, uniqueVersion ), false ); - } - - public ArtifactRepository createDeploymentArtifactRepository( String id, String url, - ArtifactRepositoryLayout repositoryLayout, - boolean uniqueVersion ) - { - return injectSession( factory.createDeploymentArtifactRepository( id, url, repositoryLayout, uniqueVersion ), - false ); - } - - public ArtifactRepository createArtifactRepository( String id, String url, String layoutId, - ArtifactRepositoryPolicy snapshots, - ArtifactRepositoryPolicy releases ) - throws UnknownRepositoryLayoutException - { - return injectSession( factory.createArtifactRepository( id, url, layoutId, snapshots, releases ), true ); - } - - public ArtifactRepository createArtifactRepository( String id, String url, - ArtifactRepositoryLayout repositoryLayout, - ArtifactRepositoryPolicy snapshots, - ArtifactRepositoryPolicy releases ) - { - return injectSession( factory.createArtifactRepository( id, url, repositoryLayout, snapshots, releases ), true ); - } - - public void setGlobalUpdatePolicy( String updatePolicy ) - { - factory.setGlobalUpdatePolicy( updatePolicy ); - } - - public void setGlobalChecksumPolicy( String checksumPolicy ) - { - factory.setGlobalChecksumPolicy( checksumPolicy ); - } - - private ArtifactRepository injectSession( ArtifactRepository repository, boolean mirrors ) - { - RepositorySystemSession session = legacySupport.getRepositorySession(); - - if ( session != null && repository != null && !isLocalRepository( repository ) ) - { - List<ArtifactRepository> repositories = Arrays.asList( repository ); - - if ( mirrors ) - { - repositorySystem.injectMirror( session, repositories ); - } - - repositorySystem.injectProxy( session, repositories ); - - repositorySystem.injectAuthentication( session, repositories ); - } - - return repository; - } - - private boolean isLocalRepository( ArtifactRepository repository ) - { - // unfortunately, the API doesn't allow to tell a remote repo and the local repo apart... - return "local".equals( repository.getId() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/layout/FlatRepositoryLayout.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/layout/FlatRepositoryLayout.java deleted file mode 100644 index 8553a312..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/layout/FlatRepositoryLayout.java +++ /dev/null @@ -1,92 +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; - -/** - * The code in this class is taken from DefaultRepositorylayout, located at: - * http://svn.apache.org/viewvc/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java - * - */ -@Component( role = ArtifactRepositoryLayout.class, hint = "flat" ) -public class FlatRepositoryLayout - implements ArtifactRepositoryLayout -{ - private static final char ARTIFACT_SEPARATOR = '-'; - - private static final char GROUP_SEPARATOR = '.'; - - public String getId() - { - return "flat"; - } - - public String pathOf( Artifact artifact ) - { - ArtifactHandler artifactHandler = artifact.getArtifactHandler(); - - StringBuilder path = new StringBuilder( 128 ); - - 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.getLocalFilename( repository ) ); - } - - private String pathOfRepositoryMetadata( String filename ) - { - StringBuilder path = new StringBuilder( 128 ); - - path.append( filename ); - - return path.toString(); - } - - public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata ) - { - return pathOfRepositoryMetadata( metadata.getRemoteFilename() ); - } - - @Override - public String toString() - { - return getId(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java deleted file mode 100644 index e7937134..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java +++ /dev/null @@ -1,558 +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.FileNotFoundException; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -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.DefaultRepositoryRequest; -import org.apache.maven.artifact.repository.RepositoryRequest; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer; -import org.apache.maven.repository.legacy.UpdateCheckManager; -import org.apache.maven.repository.legacy.WagonManager; -import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.wagon.TransferFailedException; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.logging.AbstractLogEnabled; -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; - -/** - * @author Jason van Zyl - */ -@Component( role = RepositoryMetadataManager.class ) -public class DefaultRepositoryMetadataManager - extends AbstractLogEnabled - implements RepositoryMetadataManager -{ - @Requirement - private WagonManager wagonManager; - - @Requirement - private UpdateCheckManager updateCheckManager; - - public void resolve( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository ) - throws RepositoryMetadataResolutionException - { - RepositoryRequest request = new DefaultRepositoryRequest(); - request.setLocalRepository( localRepository ); - request.setRemoteRepositories( remoteRepositories ); - resolve( metadata, request ); - } - - public void resolve( RepositoryMetadata metadata, RepositoryRequest request ) - throws RepositoryMetadataResolutionException - { - ArtifactRepository localRepo = request.getLocalRepository(); - List<ArtifactRepository> remoteRepositories = request.getRemoteRepositories(); - - if ( !request.isOffline() ) - { - Date localCopyLastModified = null; - if ( metadata.getBaseVersion() != null ) - { - localCopyLastModified = getLocalCopyLastModified( localRepo, metadata ); - } - - for ( ArtifactRepository repository : remoteRepositories ) - { - ArtifactRepositoryPolicy policy = metadata.getPolicy( repository ); - - File file = - new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, repository ) ); - boolean update; - - if ( !policy.isEnabled() ) - { - update = false; - - if ( getLogger().isDebugEnabled() ) - { - getLogger().debug( - "Skipping update check for " + metadata.getKey() + " (" + file - + ") from disabled repository " + repository.getId() + " (" - + repository.getUrl() + ")" ); - } - } - else if ( request.isForceUpdate() ) - { - update = true; - } - else if ( localCopyLastModified != null && !policy.checkOutOfDate( localCopyLastModified ) ) - { - update = false; - - if ( getLogger().isDebugEnabled() ) - { - getLogger().debug( - "Skipping update check for " + metadata.getKey() + " (" + file - + ") from repository " + repository.getId() + " (" + repository.getUrl() - + ") in favor of local copy" ); - } - } - else - { - update = updateCheckManager.isUpdateRequired( metadata, repository, file ); - } - - if ( update ) - { - getLogger().info( metadata.getKey() + ": checking for updates from " + repository.getId() ); - try - { - wagonManager.getArtifactMetadata( metadata, repository, file, policy.getChecksumPolicy() ); - } - catch ( ResourceDoesNotExistException e ) - { - getLogger().debug( metadata + " could not be found on repository: " + repository.getId() ); - - // delete the local copy so the old details aren't used. - if ( file.exists() ) - { - if ( !file.delete() ) - { - // sleep for 10ms just in case this is windows holding a file lock - try - { - Thread.sleep( 10 ); - } - catch ( InterruptedException ie ) - { - // ignore - } - file.delete(); // if this fails, forget about it - } - } - } - catch ( TransferFailedException e ) - { - getLogger().warn( metadata + " could not be retrieved from repository: " + repository.getId() - + " due to an error: " + e.getMessage() ); - getLogger().debug( "Exception", e ); - } - finally - { - updateCheckManager.touch( metadata, repository, file ); - } - } - - // TODO: should this be inside the above check? - // touch file so that this is not checked again until interval has passed - if ( file.exists() ) - { - file.setLastModified( System.currentTimeMillis() ); - } - } - } - - try - { - mergeMetadata( metadata, remoteRepositories, localRepo ); - } - catch ( RepositoryMetadataStoreException e ) - { - throw new RepositoryMetadataResolutionException( "Unable to store local copy of metadata: " - + e.getMessage(), e ); - } - } - - private Date getLocalCopyLastModified( ArtifactRepository localRepository, RepositoryMetadata metadata ) - { - String metadataPath = localRepository.pathOfLocalRepositoryMetadata( metadata, localRepository ); - File metadataFile = new File( localRepository.getBasedir(), metadataPath ); - return metadataFile.isFile() ? new Date( metadataFile.lastModified() ) : null; - } - - private void mergeMetadata( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository ) - throws RepositoryMetadataStoreException - { - // TODO: currently this is first wins, but really we should take the latest by comparing either the - // snapshot timestamp, or some other timestamp later encoded into the metadata. - // TODO: this needs to be repeated here so the merging doesn't interfere with the written metadata - // - we'd be much better having a pristine input, and an ongoing metadata for merging instead - - Map<ArtifactRepository, Metadata> previousMetadata = new HashMap<ArtifactRepository, Metadata>(); - ArtifactRepository selected = null; - for ( ArtifactRepository repository : remoteRepositories ) - { - ArtifactRepositoryPolicy policy = metadata.getPolicy( repository ); - - if ( policy.isEnabled() && loadMetadata( metadata, repository, localRepository, previousMetadata ) ) - { - metadata.setRepository( repository ); - selected = repository; - } - } - if ( loadMetadata( metadata, localRepository, localRepository, previousMetadata ) ) - { - metadata.setRepository( null ); - selected = localRepository; - } - - updateSnapshotMetadata( metadata, previousMetadata, selected, localRepository ); - } - - private void updateSnapshotMetadata( RepositoryMetadata metadata, - Map<ArtifactRepository, Metadata> previousMetadata, - ArtifactRepository selected, ArtifactRepository localRepository ) - throws RepositoryMetadataStoreException - { - // TODO: this could be a lot nicer... should really be in the snapshot transformation? - if ( metadata.isSnapshot() ) - { - Metadata prevMetadata = metadata.getMetadata(); - - for ( ArtifactRepository repository : previousMetadata.keySet() ) - { - Metadata m = previousMetadata.get( repository ); - if ( repository.equals( selected ) ) - { - if ( m.getVersioning() == null ) - { - m.setVersioning( new Versioning() ); - } - - if ( m.getVersioning().getSnapshot() == null ) - { - m.getVersioning().setSnapshot( new Snapshot() ); - } - } - else - { - if ( ( m.getVersioning() != null ) && ( m.getVersioning().getSnapshot() != null ) - && m.getVersioning().getSnapshot().isLocalCopy() ) - { - m.getVersioning().getSnapshot().setLocalCopy( false ); - metadata.setMetadata( m ); - metadata.storeInLocalRepository( localRepository, repository ); - } - } - } - - metadata.setMetadata( prevMetadata ); - } - } - - private boolean loadMetadata( RepositoryMetadata repoMetadata, ArtifactRepository remoteRepository, - ArtifactRepository localRepository, Map<ArtifactRepository, - Metadata> previousMetadata ) - { - boolean setRepository = false; - - File metadataFile = - new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( repoMetadata, - remoteRepository ) ); - - if ( metadataFile.exists() ) - { - Metadata metadata; - - try - { - metadata = readMetadata( metadataFile ); - } - catch ( RepositoryMetadataReadException e ) - { - if ( getLogger().isDebugEnabled() ) - { - getLogger().warn( e.getMessage(), e ); - } - else - { - getLogger().warn( e.getMessage() ); - } - return setRepository; - } - - if ( repoMetadata.isSnapshot() && ( previousMetadata != null ) ) - { - previousMetadata.put( remoteRepository, metadata ); - } - - if ( repoMetadata.getMetadata() != null ) - { - setRepository = repoMetadata.getMetadata().merge( metadata ); - } - else - { - repoMetadata.setMetadata( metadata ); - setRepository = true; - } - } - return setRepository; - } - - /** @todo share with DefaultPluginMappingManager. */ - protected Metadata readMetadata( File mappingFile ) - throws RepositoryMetadataReadException - { - Metadata result; - - Reader reader = null; - try - { - reader = ReaderFactory.newXmlReader( mappingFile ); - - MetadataXpp3Reader mappingReader = new MetadataXpp3Reader(); - - result = mappingReader.read( reader, false ); - } - catch ( FileNotFoundException e ) - { - throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "'", e ); - } - catch ( IOException e ) - { - throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': " - + e.getMessage(), e ); - } - catch ( XmlPullParserException e ) - { - throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': " - + e.getMessage(), e ); - } - finally - { - IOUtil.close( reader ); - } - - return result; - } - - /** - * Ensures the last updated timestamp of the specified metadata does not refer to the future and fixes the local - * metadata if necessary to allow proper merging/updating of metadata during deployment. - */ - private void fixTimestamp( File metadataFile, Metadata metadata, Metadata reference ) - { - boolean changed = false; - - if ( metadata != null && reference != null ) - { - Versioning versioning = metadata.getVersioning(); - Versioning versioningRef = reference.getVersioning(); - if ( versioning != null && versioningRef != null ) - { - String lastUpdated = versioning.getLastUpdated(); - String now = versioningRef.getLastUpdated(); - if ( lastUpdated != null && now != null && now.compareTo( lastUpdated ) < 0 ) - { - getLogger().warn( - "The last updated timestamp in " + metadataFile + " refers to the future (now = " - + now + ", lastUpdated = " + lastUpdated - + "). Please verify that the clocks of all" - + " deploying machines are reasonably synchronized." ); - versioning.setLastUpdated( now ); - changed = true; - } - } - } - - if ( changed ) - { - getLogger().debug( "Repairing metadata in " + metadataFile ); - - Writer writer = null; - try - { - writer = WriterFactory.newXmlWriter( metadataFile ); - new MetadataXpp3Writer().write( writer, metadata ); - } - catch ( IOException e ) - { - String msg = "Could not write fixed metadata to " + metadataFile + ": " + e.getMessage(); - if ( getLogger().isDebugEnabled() ) - { - getLogger().warn( msg, e ); - } - else - { - getLogger().warn( msg ); - } - } - finally - { - IOUtil.close( writer ); - } - } - } - - public void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository, - ArtifactRepository remoteRepository ) - throws RepositoryMetadataResolutionException - { - File file; - try - { - file = getArtifactMetadataFromDeploymentRepository( metadata, localRepository, remoteRepository ); - } - catch ( TransferFailedException e ) - { - throw new RepositoryMetadataResolutionException( metadata + " could not be retrieved from repository: " - + remoteRepository.getId() + " due to an error: " + e.getMessage(), e ); - } - - try - { - if ( file.exists() ) - { - Metadata prevMetadata = readMetadata( file ); - metadata.setMetadata( prevMetadata ); - } - } - catch ( RepositoryMetadataReadException e ) - { - throw new RepositoryMetadataResolutionException( e.getMessage(), e ); - } - } - - private File getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, - ArtifactRepository localRepo, - ArtifactRepository remoteRepository ) - throws TransferFailedException - { - File file = - new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, remoteRepository ) ); - - try - { - wagonManager.getArtifactMetadataFromDeploymentRepository( metadata, remoteRepository, file, - ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN ); - } - catch ( ResourceDoesNotExistException e ) - { - getLogger().info( metadata + " could not be found on repository: " + remoteRepository.getId() - + ", so will be created" ); - - // delete the local copy so the old details aren't used. - if ( file.exists() ) - { - if ( !file.delete() ) - { - // sleep for 10ms just in case this is windows holding a file lock - try - { - Thread.sleep( 10 ); - } - catch ( InterruptedException ie ) - { - // ignore - } - file.delete(); // if this fails, forget about it - } - } - } - finally - { - if ( metadata instanceof RepositoryMetadata ) - { - updateCheckManager.touch( (RepositoryMetadata) metadata, remoteRepository, file ); - } - } - return file; - } - - public void deploy( ArtifactMetadata metadata, ArtifactRepository localRepository, - ArtifactRepository deploymentRepository ) - throws RepositoryMetadataDeploymentException - { - File file; - if ( metadata instanceof RepositoryMetadata ) - { - getLogger().info( "Retrieving previous metadata from " + deploymentRepository.getId() ); - try - { - file = getArtifactMetadataFromDeploymentRepository( metadata, localRepository, deploymentRepository ); - } - catch ( TransferFailedException e ) - { - throw new RepositoryMetadataDeploymentException( metadata + " could not be retrieved from repository: " - + deploymentRepository.getId() + " due to an error: " + e.getMessage(), e ); - } - - if ( file.isFile() ) - { - try - { - fixTimestamp( file, readMetadata( file ), ( (RepositoryMetadata) metadata ).getMetadata() ); - } - catch ( RepositoryMetadataReadException e ) - { - // will be reported via storeInlocalRepository - } - } - } - else - { - // It's a POM - we don't need to retrieve it first - file = - new File( localRepository.getBasedir(), - localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) ); - } - - try - { - metadata.storeInLocalRepository( localRepository, deploymentRepository ); - } - catch ( RepositoryMetadataStoreException e ) - { - throw new RepositoryMetadataDeploymentException( "Error installing metadata: " + e.getMessage(), e ); - } - - try - { - wagonManager.putArtifactMetadata( file, metadata, deploymentRepository ); - } - catch ( TransferFailedException e ) - { - throw new RepositoryMetadataDeploymentException( "Error while deploying metadata: " + e.getMessage(), e ); - } - } - - public void install( ArtifactMetadata metadata, ArtifactRepository localRepository ) - throws RepositoryMetadataInstallationException - { - try - { - metadata.storeInLocalRepository( localRepository, localRepository ); - } - catch ( RepositoryMetadataStoreException e ) - { - throw new RepositoryMetadataInstallationException( "Error installing metadata: " + e.getMessage(), e ); - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/GroupRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/GroupRepositoryMetadata.java deleted file mode 100644 index 490b47f3..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/GroupRepositoryMetadata.java +++ /dev/null @@ -1,119 +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 java.util.Iterator; -import java.util.List; - -/** - * Metadata for the group directory of the repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class GroupRepositoryMetadata - extends AbstractRepositoryMetadata -{ - private final String groupId; - - public GroupRepositoryMetadata( String groupId ) - { - super( new Metadata() ); - this.groupId = groupId; - } - - public boolean storedInGroupDirectory() - { - return true; - } - - public boolean storedInArtifactVersionDirectory() - { - return false; - } - - public String getGroupId() - { - return groupId; - } - - public String getArtifactId() - { - return null; - } - - public String getBaseVersion() - { - return null; - } - - public void addPluginMapping( String goalPrefix, - String artifactId ) - { - addPluginMapping( goalPrefix, artifactId, artifactId ); - } - - public void addPluginMapping( String goalPrefix, - String artifactId, - String name ) - { - List plugins = getMetadata().getPlugins(); - boolean found = false; - for ( Iterator i = plugins.iterator(); i.hasNext() && !found; ) - { - Plugin plugin = (Plugin) i.next(); - if ( plugin.getPrefix().equals( goalPrefix ) ) - { - found = true; - } - } - if ( !found ) - { - Plugin plugin = new Plugin(); - plugin.setPrefix( goalPrefix ); - plugin.setArtifactId( artifactId ); - plugin.setName( name ); - - - getMetadata().addPlugin( plugin ); - } - } - - public Object getKey() - { - return groupId; - } - - public boolean isSnapshot() - { - return false; - } - - public ArtifactRepository getRepository() - { - return null; - } - - public void setRepository( ArtifactRepository remoteRepository ) - { - // intentionally blank - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java deleted file mode 100644 index bf199218..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataBridge.java +++ /dev/null @@ -1,172 +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.util.Collections; -import java.util.Map; - -import org.apache.maven.artifact.metadata.ArtifactMetadata; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.DefaultArtifactRepository; -import org.codehaus.plexus.util.FileUtils; -import org.eclipse.aether.RepositoryException; -import org.eclipse.aether.metadata.AbstractMetadata; -import org.eclipse.aether.metadata.MergeableMetadata; -import org.eclipse.aether.metadata.Metadata; - -/** - * <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 final class MetadataBridge - extends AbstractMetadata - implements MergeableMetadata -{ - - private ArtifactMetadata metadata; - - private boolean merged; - - public MetadataBridge( ArtifactMetadata metadata ) - { - this.metadata = metadata; - } - - public void merge( File current, File result ) - throws RepositoryException - { - try - { - if ( current.exists() ) - { - FileUtils.copyFile( current, result ); - } - ArtifactRepository localRepo = new MetadataRepository( result ); - metadata.storeInLocalRepository( localRepo, localRepo ); - merged = true; - } - catch ( Exception e ) - { - throw new RepositoryException( e.getMessage(), e ); - } - } - - public boolean isMerged() - { - return merged; - } - - public String getGroupId() - { - return emptify( metadata.getGroupId() ); - } - - public String getArtifactId() - { - return metadata.storedInGroupDirectory() ? "" : emptify( metadata.getArtifactId() ); - } - - public String getVersion() - { - return metadata.storedInArtifactVersionDirectory() ? emptify( metadata.getBaseVersion() ) : ""; - } - - public String getType() - { - return metadata.getRemoteFilename(); - } - - private String emptify( String string ) - { - return ( string != null ) ? string : ""; - } - - public File getFile() - { - return null; - } - - public MetadataBridge setFile( File file ) - { - return this; - } - - public Nature getNature() - { - if ( metadata instanceof RepositoryMetadata ) - { - switch ( ( (RepositoryMetadata) metadata ).getNature() ) - { - case RepositoryMetadata.RELEASE_OR_SNAPSHOT: - return Nature.RELEASE_OR_SNAPSHOT; - case RepositoryMetadata.SNAPSHOT: - return Nature.SNAPSHOT; - default: - return Nature.RELEASE; - } - } - else - { - return Nature.RELEASE; - } - } - - public Map<String, String> getProperties() - { - return Collections.emptyMap(); - } - - @Override - public Metadata setProperties( Map<String, String> properties ) - { - return this; - } - - @SuppressWarnings( "deprecation" ) - static class MetadataRepository - extends DefaultArtifactRepository - { - - private File metadataFile; - - public MetadataRepository( File metadataFile ) - { - super( "local", "", null ); - this.metadataFile = metadataFile; - } - - @Override - public String getBasedir() - { - return metadataFile.getParent(); - } - - @Override - public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) - { - return metadataFile.getName(); - } - - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataUtils.java deleted file mode 100644 index bdc4a795..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataUtils.java +++ /dev/null @@ -1,39 +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. - */ - -/** - * Assists in handling repository metadata. - * - * @author Benjamin Bentmann - */ -class MetadataUtils -{ - - public static Metadata cloneMetadata( Metadata src ) - { - if ( src == null ) - { - return null; - } - return src.clone(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataReadException.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataReadException.java deleted file mode 100644 index 23e59841..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataReadException.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. - */ - -/** - * Problem storing the repository metadata in the local repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class RepositoryMetadataReadException - extends Exception -{ - public RepositoryMetadataReadException( String message ) - { - super( message ); - } - - public RepositoryMetadataReadException( String message, - Exception e ) - { - super( message, e ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/SnapshotArtifactRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/SnapshotArtifactRepositoryMetadata.java deleted file mode 100644 index 359ab2ce..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/SnapshotArtifactRepositoryMetadata.java +++ /dev/null @@ -1,98 +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.repository.ArtifactRepository; - -/** - * Metadata for the artifact version directory of the repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @todo split instantiation (versioning, plugin mappings) from definition - */ -public class SnapshotArtifactRepositoryMetadata - extends AbstractRepositoryMetadata -{ - private Artifact artifact; - - public SnapshotArtifactRepositoryMetadata( Artifact artifact ) - { - super( createMetadata( artifact, null ) ); - this.artifact = artifact; - } - - public SnapshotArtifactRepositoryMetadata( Artifact artifact, - Snapshot snapshot ) - { - super( createMetadata( artifact, createVersioning( snapshot ) ) ); - this.artifact = artifact; - } - - public boolean storedInGroupDirectory() - { - return false; - } - - public boolean storedInArtifactVersionDirectory() - { - return true; - } - - public String getGroupId() - { - return artifact.getGroupId(); - } - - public String getArtifactId() - { - return artifact.getArtifactId(); - } - - public String getBaseVersion() - { - return artifact.getBaseVersion(); - } - - public Object getKey() - { - return "snapshot " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getBaseVersion(); - } - - public boolean isSnapshot() - { - return artifact.isSnapshot(); - } - - public int getNature() - { - return isSnapshot() ? SNAPSHOT : RELEASE; - } - - public ArtifactRepository getRepository() - { - return artifact.getRepository(); - } - - public void setRepository( ArtifactRepository remoteRepository ) - { - artifact.setRepository( remoteRepository ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java deleted file mode 100644 index 5ef86022..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactCollector.java +++ /dev/null @@ -1,42 +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.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.metadata.ArtifactMetadataSource; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; - -@Deprecated -public interface ArtifactCollector - extends org.apache.maven.repository.legacy.resolver.LegacyArtifactCollector -{ - - @Deprecated - ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact, - ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter, - List<ResolutionListener> listeners ) - throws ArtifactResolutionException; - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java deleted file mode 100644 index 0ca940a1..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolver.java +++ /dev/null @@ -1,108 +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.List; -import java.util.Map; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.metadata.ArtifactMetadataSource; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; -import org.apache.maven.wagon.events.TransferListener; - -/** - * @author Jason van Zyl - */ -// Just hide the one method we want behind the RepositorySystem interface. -public interface ArtifactResolver -{ - - ArtifactResolutionResult resolve( ArtifactResolutionRequest request ); - - // The rest is deprecated - - // USED BY MAVEN ASSEMBLY PLUGIN 2.2-beta-2 - @Deprecated - String ROLE = ArtifactResolver.class.getName(); - - // USED BY SUREFIRE, DEPENDENCY PLUGIN - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - // USED BY MAVEN ASSEMBLY PLUGIN - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - // USED BY MAVEN ASSEMBLY PLUGIN - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository, ArtifactMetadataSource source ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter, - List<ResolutionListener> listeners ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - @Deprecated - ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository, ArtifactMetadataSource source, - List<ResolutionListener> listeners ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - // USED BY REMOTE RESOURCES PLUGIN, DEPENDENCY PLUGIN - @Deprecated - void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - // USED BY REMOTE RESOURCES PLUGIN - @Deprecated - void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, - TransferListener downloadMonitor ) - throws ArtifactResolutionException, ArtifactNotFoundException; - - // USED BY DEPENDENCY PLUGIN, ARCHETYPE DOWNLOADER - @Deprecated - void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository ) - throws ArtifactResolutionException, ArtifactNotFoundException; -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java deleted file mode 100644 index b066e4c0..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java +++ /dev/null @@ -1,167 +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.HashSet; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.versioning.VersionRange; -import org.codehaus.plexus.logging.Logger; - -/** - * Send resolution events to the debug log. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class DebugResolutionListener - implements ResolutionListener, ResolutionListenerForDepMgmt -{ - private Logger logger; - - private String indent = ""; - - private static Set<Artifact> ignoredArtifacts = new HashSet<Artifact>(); - - public DebugResolutionListener( Logger logger ) - { - this.logger = logger; - } - - public void testArtifact( Artifact node ) - { - } - - public void startProcessChildren( Artifact artifact ) - { - indent += " "; - } - - public void endProcessChildren( Artifact artifact ) - { - indent = indent.substring( 2 ); - } - - public void includeArtifact( Artifact artifact ) - { - logger.debug( indent + artifact + " (selected for " + artifact.getScope() + ")" ); - } - - public void omitForNearer( Artifact omitted, Artifact kept ) - { - String omittedVersion = omitted.getVersion(); - String keptVersion = kept.getVersion(); - - if ( omittedVersion != null ? !omittedVersion.equals( keptVersion ) : keptVersion != null ) - { - logger.debug( indent + omitted + " (removed - nearer found: " + kept.getVersion() + ")" ); - } - } - - public void omitForCycle( Artifact omitted ) - { - logger.debug( indent + omitted + " (removed - causes a cycle in the graph)" ); - } - - public void updateScopeCurrentPom( Artifact artifact, String ignoredScope ) - { - logger.debug( indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope " - + artifact.getScope() + " wins)" ); - - // TODO: better way than static? this might hide messages in a reactor - if ( !ignoredArtifacts.contains( artifact ) ) - { - logger.warn( "\n\tArtifact " + artifact + " retains local artifactScope '" + artifact.getScope() - + "' overriding broader artifactScope '" + ignoredScope + "'\n" - + "\tgiven by a dependency. If this is not intended, modify or remove the local artifactScope.\n" ); - ignoredArtifacts.add( artifact ); - } - } - - public void updateScope( Artifact artifact, String scope ) - { - logger.debug( indent + artifact + " (setting artifactScope to: " + scope + ")" ); - } - - public void selectVersionFromRange( Artifact artifact ) - { - logger.debug( indent + artifact + " (setting version to: " + artifact.getVersion() + " from range: " - + artifact.getVersionRange() + ")" ); - } - - public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange ) - { - logger.debug( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: " - + replacement.getVersionRange() + " to: " + newRange + " )" ); - } - - /** - * The logic used here used to be a copy of the logic used in the DefaultArtifactCollector, and this method was - * called right before the actual version/artifactScope changes were done. However, a different set of conditionals (and - * more information) is needed to be able to determine when and if the version and/or artifactScope changes. See the two - * added methods, manageArtifactVersion and manageArtifactScope. - */ - public void manageArtifact( Artifact artifact, Artifact replacement ) - { - String msg = indent + artifact; - msg += " ("; - if ( replacement.getVersion() != null ) - { - msg += "applying version: " + replacement.getVersion() + ";"; - } - if ( replacement.getScope() != null ) - { - msg += "applying artifactScope: " + replacement.getScope(); - } - msg += ")"; - logger.debug( msg ); - } - - public void manageArtifactVersion( Artifact artifact, Artifact replacement ) - { - // only show msg if a change is actually taking place - if ( !replacement.getVersion().equals( artifact.getVersion() ) ) - { - String msg = indent + artifact + " (applying version: " + replacement.getVersion() + ")"; - logger.debug( msg ); - } - } - - public void manageArtifactScope( Artifact artifact, Artifact replacement ) - { - // only show msg if a change is actually taking place - if ( !replacement.getScope().equals( artifact.getScope() ) ) - { - String msg = indent + artifact + " (applying artifactScope: " + replacement.getScope() + ")"; - logger.debug( msg ); - } - } - - public void manageArtifactSystemPath( Artifact artifact, Artifact replacement ) - { - // only show msg if a change is actually taking place - if ( !replacement.getScope().equals( artifact.getScope() ) ) - { - String msg = indent + artifact + " (applying system path: " + replacement.getFile() + ")"; - logger.debug( msg ); - } - } - -}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java deleted file mode 100644 index cefb9e28..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java +++ /dev/null @@ -1,30 +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.codehaus.plexus.component.annotations.Component; - -@Deprecated -@Component( role = ArtifactCollector.class ) -public class DefaultArtifactCollector - extends org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector - implements ArtifactCollector -{ -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java deleted file mode 100644 index 1631a013..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java +++ /dev/null @@ -1,643 +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.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.regex.Matcher; - -import org.apache.maven.RepositoryUtils; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.factory.ArtifactFactory; -import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; -import org.apache.maven.artifact.metadata.ArtifactMetadataSource; -import org.apache.maven.artifact.metadata.ResolutionGroup; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.LegacyLocalRepositoryManager; -import org.apache.maven.artifact.repository.RepositoryRequest; -import org.apache.maven.artifact.repository.metadata.Snapshot; -import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.LegacySupport; -import org.apache.maven.repository.legacy.metadata.DefaultMetadataResolutionRequest; -import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; -import org.apache.maven.repository.legacy.resolver.conflict.ConflictResolver; -import org.apache.maven.wagon.events.TransferListener; -import org.codehaus.plexus.PlexusContainer; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.codehaus.plexus.logging.Logger; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; -import org.eclipse.aether.RepositorySystem; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.repository.LocalRepositoryManager; -import org.eclipse.aether.resolution.ArtifactRequest; -import org.eclipse.aether.resolution.ArtifactResult; - -/** - * @author Jason van Zyl - */ -@Component( role = ArtifactResolver.class ) -public class DefaultArtifactResolver - implements ArtifactResolver, Disposable -{ - @Requirement - private Logger logger; - - @Requirement - protected ArtifactFactory artifactFactory; - - @Requirement - private ArtifactCollector artifactCollector; - - @Requirement - private ResolutionErrorHandler resolutionErrorHandler; - - @Requirement - private ArtifactMetadataSource source; - - @Requirement - private PlexusContainer container; - - @Requirement - private LegacySupport legacySupport; - - @Requirement - private RepositorySystem repoSystem; - - private final Executor executor; - - public DefaultArtifactResolver() - { - int threads = Integer.getInteger( "maven.artifact.threads", 5 ); - if ( threads <= 1 ) - { - executor = new Executor() - { - public void execute( Runnable command ) - { - command.run(); - } - }; - } - else - { - executor = - new ThreadPoolExecutor( threads, threads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), - new DaemonThreadCreator() ); - } - } - - private RepositorySystemSession getSession( ArtifactRepository localRepository ) - { - return LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem ); - } - - private void injectSession1( RepositoryRequest request, MavenSession session ) - { - if ( session != null ) - { - request.setOffline( session.isOffline() ); - request.setForceUpdate( session.getRequest().isUpdateSnapshots() ); - } - } - - private void injectSession2( ArtifactResolutionRequest request, MavenSession session ) - { - injectSession1( request, session ); - - if ( session != null ) - { - request.setServers( session.getRequest().getServers() ); - request.setMirrors( session.getRequest().getMirrors() ); - request.setProxies( session.getRequest().getProxies() ); - } - } - - public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository, TransferListener resolutionListener ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - resolve( artifact, remoteRepositories, getSession( localRepository ) ); - } - - public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - resolve( artifact, remoteRepositories, getSession( localRepository ) ); - } - - private void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, - RepositorySystemSession session ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - if ( artifact == null ) - { - return; - } - - if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) - { - File systemFile = artifact.getFile(); - - if ( systemFile == null ) - { - throw new ArtifactNotFoundException( "System artifact: " + artifact + " has no file attached", artifact ); - } - - if ( !systemFile.exists() ) - { - throw new ArtifactNotFoundException( "System artifact: " + artifact + " not found in path: " + systemFile, artifact ); - } - - if ( !systemFile.isFile() ) - { - throw new ArtifactNotFoundException( "System artifact: " + artifact + " is not a file: " + systemFile, artifact ); - } - - artifact.setResolved( true ); - - return; - } - - if ( !artifact.isResolved() ) - { - ArtifactResult result; - - try - { - ArtifactRequest artifactRequest = new ArtifactRequest(); - artifactRequest.setArtifact( RepositoryUtils.toArtifact( artifact ) ); - artifactRequest.setRepositories( RepositoryUtils.toRepos( remoteRepositories ) ); - - // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not - LocalRepositoryManager lrm = session.getLocalRepositoryManager(); - String path = lrm.getPathForLocalArtifact( artifactRequest.getArtifact() ); - artifact.setFile( new File( lrm.getRepository().getBasedir(), path ) ); - - result = repoSystem.resolveArtifact( session, artifactRequest ); - } - catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) - { - if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException ) - { - throw new ArtifactNotFoundException( e.getMessage(), artifact, remoteRepositories, e ); - } - else - { - throw new ArtifactResolutionException( e.getMessage(), artifact, remoteRepositories, e ); - } - } - - artifact.selectVersion( result.getArtifact().getVersion() ); - artifact.setFile( result.getArtifact().getFile() ); - artifact.setResolved( true ); - - if ( artifact.isSnapshot() ) - { - Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() ); - if ( matcher.matches() ) - { - Snapshot snapshot = new Snapshot(); - snapshot.setTimestamp( matcher.group( 2 ) ); - try - { - snapshot.setBuildNumber( Integer.parseInt( matcher.group( 3 ) ) ); - artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) ); - } - catch ( NumberFormatException e ) - { - logger.warn( "Invalid artifact version " + artifact.getVersion() + ": " + e.getMessage() ); - } - } - } - } - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, - remoteRepositories, source, filter ); - - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, - remoteRepositories, source, null ); - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, - remoteRepositories, source, filter, null ); - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository, - ArtifactMetadataSource source ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, localRepository, remoteRepositories, source, null ); - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - List<ArtifactRepository> remoteRepositories, - ArtifactRepository localRepository, - ArtifactMetadataSource source, - List<ResolutionListener> listeners ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, - remoteRepositories, source, null, listeners ); - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter, - List<ResolutionListener> listeners ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, - remoteRepositories, source, filter, listeners, null ); - } - - public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, - Map managedVersions, ArtifactRepository localRepository, - List<ArtifactRepository> remoteRepositories, - ArtifactMetadataSource source, ArtifactFilter filter, - List<ResolutionListener> listeners, - List<ConflictResolver> conflictResolvers ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - ArtifactResolutionRequest request = new ArtifactResolutionRequest() - .setArtifact( originatingArtifact ) - .setResolveRoot( false ) - // This is required by the surefire plugin - .setArtifactDependencies( artifacts ) - .setManagedVersionMap( managedVersions ) - .setLocalRepository( localRepository ) - .setRemoteRepositories( remoteRepositories ) - .setCollectionFilter( filter ) - .setListeners( listeners ); - - injectSession2( request, legacySupport.getSession() ); - - return resolveWithExceptions( request ); - } - - public ArtifactResolutionResult resolveWithExceptions( ArtifactResolutionRequest request ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - ArtifactResolutionResult result = resolve( request ); - - // We have collected all the problems so let's mimic the way the old code worked and just blow up right here. - // That's right lets just let it rip right here and send a big incomprehensible blob of text at unsuspecting - // users. Bad dog! - - resolutionErrorHandler.throwErrors( request, result ); - - return result; - } - - // ------------------------------------------------------------------------ - // - // ------------------------------------------------------------------------ - - public ArtifactResolutionResult resolve( ArtifactResolutionRequest request ) - { - Artifact rootArtifact = request.getArtifact(); - Set<Artifact> artifacts = request.getArtifactDependencies(); - Map<String, Artifact> managedVersions = request.getManagedVersionMap(); - List<ResolutionListener> listeners = request.getListeners(); - ArtifactFilter collectionFilter = request.getCollectionFilter(); - ArtifactFilter resolutionFilter = request.getResolutionFilter(); - RepositorySystemSession session = getSession( request.getLocalRepository() ); - - //TODO: hack because metadata isn't generated in m2e correctly and i want to run the maven i have in the workspace - if ( source == null ) - { - try - { - source = container.lookup( ArtifactMetadataSource.class ); - } - catch ( ComponentLookupException e ) - { - // won't happen - } - } - - if ( listeners == null ) - { - listeners = new ArrayList<ResolutionListener>(); - - if ( logger.isDebugEnabled() ) - { - listeners.add( new DebugResolutionListener( logger ) ); - } - - listeners.add( new WarningResolutionListener( logger ) ); - } - - ArtifactResolutionResult result = new ArtifactResolutionResult(); - - // The root artifact may, or may not be resolved so we need to check before we attempt to resolve. - // This is often an artifact like a POM that is taken from disk and we already have hold of the - // file reference. But this may be a Maven Plugin that we need to resolve from a remote repository - // as well as its dependencies. - - if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ ) - { - try - { - resolve( rootArtifact, request.getRemoteRepositories(), session ); - } - catch ( ArtifactResolutionException e ) - { - result.addErrorArtifactException( e ); - return result; - } - catch ( ArtifactNotFoundException e ) - { - result.addMissingArtifact( request.getArtifact() ); - return result; - } - } - - ArtifactResolutionRequest collectionRequest = request; - - if ( request.isResolveTransitively() ) - { - MetadataResolutionRequest metadataRequest = new DefaultMetadataResolutionRequest( request ); - - metadataRequest.setArtifact( rootArtifact ); - metadataRequest.setResolveManagedVersions( managedVersions == null ); - - try - { - ResolutionGroup resolutionGroup = source.retrieve( metadataRequest ); - - if ( managedVersions == null ) - { - managedVersions = resolutionGroup.getManagedVersions(); - } - - Set<Artifact> directArtifacts = resolutionGroup.getArtifacts(); - - if ( artifacts == null || artifacts.isEmpty() ) - { - artifacts = directArtifacts; - } - else - { - List<Artifact> allArtifacts = new ArrayList<Artifact>(); - allArtifacts.addAll( artifacts ); - allArtifacts.addAll( directArtifacts ); - - Map<String, Artifact> mergedArtifacts = new LinkedHashMap<String, Artifact>(); - for ( Artifact artifact : allArtifacts ) - { - String conflictId = artifact.getDependencyConflictId(); - if ( !mergedArtifacts.containsKey( conflictId ) ) - { - mergedArtifacts.put( conflictId, artifact ); - } - } - - artifacts = new LinkedHashSet<Artifact>( mergedArtifacts.values() ); - } - - collectionRequest = new ArtifactResolutionRequest( request ); - collectionRequest.setServers( request.getServers() ); - collectionRequest.setMirrors( request.getMirrors() ); - collectionRequest.setProxies( request.getProxies() ); - collectionRequest.setRemoteRepositories( resolutionGroup.getResolutionRepositories() ); - } - catch ( ArtifactMetadataRetrievalException e ) - { - ArtifactResolutionException are = - new ArtifactResolutionException( "Unable to get dependency information for " + rootArtifact.getId() - + ": " + e.getMessage(), rootArtifact, metadataRequest.getRemoteRepositories(), e ); - result.addMetadataResolutionException( are ); - return result; - } - } - - if ( artifacts == null || artifacts.isEmpty() ) - { - if ( request.isResolveRoot() ) - { - result.addArtifact( rootArtifact ); - } - return result; - } - - // After the collection we will have the artifact object in the result but they will not be resolved yet. - result = - artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source, - collectionFilter, listeners, null ); - - // We have metadata retrieval problems, or there are cycles that have been detected - // so we give this back to the calling code and let them deal with this information - // appropriately. - - if ( result.hasMetadataResolutionExceptions() || result.hasVersionRangeViolations() || result.hasCircularDependencyExceptions() ) - { - return result; - } - - if ( result.getArtifactResolutionNodes() != null ) - { - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - - CountDownLatch latch = new CountDownLatch( result.getArtifactResolutionNodes().size() ); - - for ( ResolutionNode node : result.getArtifactResolutionNodes() ) - { - Artifact artifact = node.getArtifact(); - - if ( resolutionFilter == null || resolutionFilter.include( artifact ) ) - { - executor.execute( new ResolveTask( classLoader, latch, artifact, session, - node.getRemoteRepositories(), result ) ); - } - else - { - latch.countDown(); - } - } - try - { - latch.await(); - } - catch ( InterruptedException e ) - { - result.addErrorArtifactException( new ArtifactResolutionException( "Resolution interrupted", - rootArtifact, e ) ); - } - } - - // We want to send the root artifact back in the result but we need to do this after the other dependencies - // have been resolved. - if ( request.isResolveRoot() ) - { - // Add the root artifact (as the first artifact to retain logical order of class path!) - Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>(); - allArtifacts.add( rootArtifact ); - allArtifacts.addAll( result.getArtifacts() ); - result.setArtifacts( allArtifacts ); - } - - return result; - } - - public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) - throws ArtifactResolutionException, ArtifactNotFoundException - { - resolve( artifact, remoteRepositories, localRepository, null ); - } - - /** - * ThreadCreator for creating daemon threads with fixed ThreadGroup-name. - */ - static final class DaemonThreadCreator - implements ThreadFactory - { - static final String THREADGROUP_NAME = "org.apache.maven.artifact.resolver.DefaultArtifactResolver"; - - static final ThreadGroup GROUP = new ThreadGroup( THREADGROUP_NAME ); - - static final AtomicInteger THREAD_NUMBER = new AtomicInteger( 1 ); - - public Thread newThread( Runnable r ) - { - Thread newThread = new Thread( GROUP, r, "resolver-" + THREAD_NUMBER.getAndIncrement() ); - newThread.setDaemon( true ); - newThread.setContextClassLoader( null ); - return newThread; - } - } - - private class ResolveTask - implements Runnable - { - - private final ClassLoader classLoader; - - private final CountDownLatch latch; - - private final Artifact artifact; - - private final RepositorySystemSession session; - - private final List<ArtifactRepository> remoteRepositories; - - private final ArtifactResolutionResult result; - - public ResolveTask( ClassLoader classLoader, CountDownLatch latch, Artifact artifact, RepositorySystemSession session, - List<ArtifactRepository> remoteRepositories, ArtifactResolutionResult result ) - { - this.classLoader = classLoader; - this.latch = latch; - this.artifact = artifact; - this.session = session; - this.remoteRepositories = remoteRepositories; - this.result = result; - } - - public void run() - { - ClassLoader old = Thread.currentThread().getContextClassLoader(); - try - { - Thread.currentThread().setContextClassLoader( classLoader ); - resolve( artifact, remoteRepositories, session ); - } - catch ( ArtifactNotFoundException anfe ) - { - // These are cases where the artifact just isn't present in any of the remote repositories - // because it wasn't deployed, or it was deployed in the wrong place. - - synchronized ( result ) - { - result.addMissingArtifact( artifact ); - } - } - catch ( ArtifactResolutionException e ) - { - // This is really a wagon TransferFailedException so something went wrong after we successfully - // retrieved the metadata. - - synchronized ( result ) - { - result.addErrorArtifactException( e ); - } - } - finally - { - latch.countDown(); - Thread.currentThread().setContextClassLoader( old ); - - } - } - - } - - @Override - public void dispose() - { - if ( executor instanceof ExecutorService ) - { - ( (ExecutorService) executor ).shutdownNow(); - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java deleted file mode 100644 index 06da7e3e..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListenerForDepMgmt.java +++ /dev/null @@ -1,43 +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; - -/** - * Do not use! - * <p/> - * Should only be implmemented by DebugResolutionListener. Remove this - * when the ResolutionListener interface deprecation of the manageArtifact - * method (and the [yet to be done] addition of these methods to that - * interface) has had a chance to propagate to all interested plugins. - */ -@Deprecated -public interface ResolutionListenerForDepMgmt -{ - void manageArtifactVersion( Artifact artifact, - Artifact replacement ); - - void manageArtifactScope( Artifact artifact, - Artifact replacement ); - - void manageArtifactSystemPath( Artifact artifact, - Artifact replacement ); -}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java deleted file mode 100644 index b9ccf706..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/UnresolvedArtifacts.java +++ /dev/null @@ -1,66 +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.List; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; - -/** - * A simple recording of the Artifacts that could not be resolved for a given resolution request, along with - * the remote repositories where attempts were made to resolve the artifacts. - * - * @author Jason van Zyl - */ -public class UnresolvedArtifacts -{ - private Artifact originatingArtifact; - - private List<Artifact> artifacts; - - private List<ArtifactRepository> remoteRepositories; - - public UnresolvedArtifacts( Artifact originatingArtifact, - List<Artifact> artifacts, - List<ArtifactRepository> remoteRepositories ) - { - this.originatingArtifact = originatingArtifact; - - this.artifacts = artifacts; - - this.remoteRepositories = remoteRepositories; - } - - public Artifact getOriginatingArtifact() - { - return originatingArtifact; - } - - public List<Artifact> getArtifacts() - { - return artifacts; - } - - public List<ArtifactRepository> getRemoteRepositories() - { - return remoteRepositories; - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java deleted file mode 100644 index 825d595a..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/WarningResolutionListener.java +++ /dev/null @@ -1,90 +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; -import org.codehaus.plexus.logging.Logger; - -/** - * Send resolution warning events to the warning log. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class WarningResolutionListener - implements ResolutionListener -{ - private Logger logger; - - public WarningResolutionListener( Logger logger ) - { - this.logger = logger; - } - - public void testArtifact( Artifact node ) - { - } - - public void startProcessChildren( Artifact artifact ) - { - } - - public void endProcessChildren( Artifact artifact ) - { - } - - public void includeArtifact( Artifact artifact ) - { - } - - public void omitForNearer( Artifact omitted, - Artifact kept ) - { - } - - public void omitForCycle( Artifact omitted ) - { - } - - public void updateScopeCurrentPom( Artifact artifact, - String scope ) - { - } - - public void updateScope( Artifact artifact, - String scope ) - { - } - - public void manageArtifact( Artifact artifact, - Artifact replacement ) - { - } - - public void selectVersionFromRange( Artifact artifact ) - { - } - - public void restrictRange( Artifact artifact, - Artifact replacement, - VersionRange newRange ) - { - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java deleted file mode 100644 index 0499db51..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/InversionArtifactFilter.java +++ /dev/null @@ -1,65 +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; - -public class InversionArtifactFilter - implements ArtifactFilter -{ - private final ArtifactFilter toInvert; - - public InversionArtifactFilter( ArtifactFilter toInvert ) - { - this.toInvert = toInvert; - } - - public boolean include( Artifact artifact ) - { - return !toInvert.include( artifact ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + toInvert.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof InversionArtifactFilter ) ) - { - return false; - } - - InversionArtifactFilter other = (InversionArtifactFilter) obj; - - return toInvert.equals( other.toInvert ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.java deleted file mode 100644 index 8cd02ccf..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilter.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.Collection; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * Apply multiple filters, accepting an artifact if at least one of the filters accepts it. - * - * @author Benjamin Bentmann - */ -public class OrArtifactFilter - implements ArtifactFilter -{ - - private Set<ArtifactFilter> filters; - - public OrArtifactFilter() - { - this.filters = new LinkedHashSet<ArtifactFilter>(); - } - - public OrArtifactFilter( Collection<ArtifactFilter> filters ) - { - this.filters = new LinkedHashSet<ArtifactFilter>( filters ); - } - - public boolean include( Artifact artifact ) - { - for ( ArtifactFilter filter : filters ) - { - if ( filter.include( artifact ) ) - { - return true; - } - } - - return false; - } - - public void add( ArtifactFilter artifactFilter ) - { - filters.add( artifactFilter ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + filters.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof OrArtifactFilter ) ) - { - return false; - } - - OrArtifactFilter other = (OrArtifactFilter) obj; - - return filters.equals( other.filters ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java deleted file mode 100644 index 76c39ec3..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/filter/TypeArtifactFilter.java +++ /dev/null @@ -1,66 +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; - -/** Artifact Filter which filters on artifact type */ -public class TypeArtifactFilter - implements ArtifactFilter -{ - private String type = "jar"; - - public TypeArtifactFilter( String type ) - { - this.type = type; - } - - public boolean include( Artifact artifact ) - { - return type.equals( artifact.getType() ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + type.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof TypeArtifactFilter ) ) - { - return false; - } - - TypeArtifactFilter other = (TypeArtifactFilter) obj; - - return type.equals( other.type ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java b/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java deleted file mode 100644 index 86b49499..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.maven.artifact.versioning; - -/* - * 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.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.apache.maven.artifact.Artifact; - -@Deprecated -public class ManagedVersionMap - extends HashMap<String, Artifact> -{ - public ManagedVersionMap( Map<String, Artifact> map ) - { - super(); - if ( map != null ) - { - putAll( map ); - } - } - - public String toString() - { - StringBuilder buffer = new StringBuilder( "ManagedVersionMap (" + size() + " entries)\n" ); - Iterator<String> iter = keySet().iterator(); - while ( iter.hasNext() ) - { - String key = iter.next(); - buffer.append( key ).append( "=" ).append( get( key ) ); - if ( iter.hasNext() ) - { - buffer.append( "\n" ); - } - } - return buffer.toString(); - } -} |