com.marvelution.maven.components.dependency.resolver.DependencyResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-dependency-resolver Show documentation
Show all versions of maven-dependency-resolver Show documentation
Maven 2.x Plexus component to resolve dependencies from jar files
The newest version!
/*
* Licensed to Marvelution under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Marvelution 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.
*/
package com.marvelution.maven.components.dependency.resolver;
import java.io.File;
import java.util.List;
import org.apache.maven.model.Dependency;
import com.marvelution.maven.components.dependency.resolver.environment.ResolveEnvironment;
import com.marvelution.maven.components.dependency.resolver.exception.DependencyResolverExecutionException;
import com.marvelution.maven.components.dependency.resolver.exception.DependencyResolverFailureException;
/**
* Dependency Resolver Plexus component interface
*
* @author Mark Rekveld
*/
public interface DependencyResolver {
/**
* The Plexus role.
*/
String ROLE = DependencyResolver.class.getName();
/**
* Resolve a Library dependency to a Maven 2.x dependency. If the library cannot be resolve once Artifact
* information is gathered, the SystemPath of the Dependency will be set to full path of the library file.
*
* @param library the library {@link File} to resolve
* @param environment the artifact repositories, proxy settings, artifact factory/resolver, etc. to use during
* resolve
* @return the Maven 2.x {@link Dependency}, may be null
* @throws DependencyResolverExecutionException in case of resolve exceptions
* @throws DependencyResolverFailureException in case of resolve failures
*/
Dependency resolve(final File library, final ResolveEnvironment environment)
throws DependencyResolverExecutionException, DependencyResolverFailureException;
/**
* Resolve a Library dependency to a Maven 2.x dependency. If the library cannot be resolve once Artifact
* information is gathered, the SystemPath of the Dependency will be set to full path of the library file.
*
* @param library array of {@link File} to resolve
* @param environment the artifact repositories, proxy settings, artifact factory/resolver, etc. to use during
* resolve
* @return Array of Maven 2.x {@link Dependency}, may be null
* @throws DependencyResolverExecutionException in case of resolve exceptions
* @throws DependencyResolverFailureException in case of resolve failures
*/
Dependency[] resolve(final File[] library, final ResolveEnvironment environment)
throws DependencyResolverExecutionException, DependencyResolverFailureException;
/**
* Resolve a Library dependency to a Maven 2.x dependency. If the library cannot be resolve once Artifact
* information is gathered, the SystemPath of the Dependency will be set to full path of the library file.
*
* @param library {@link List} of {@link File} to resolve
* @param environment the artifact repositories, proxy settings, artifact factory/resolver, etc. to use during
* resolve
* @return {@link List} of Maven 2.x {@link Dependency}, may be null
* @throws DependencyResolverExecutionException in case of resolve exceptions
* @throws DependencyResolverFailureException in case of resolve failures
*/
List resolve(final List library, final ResolveEnvironment environment)
throws DependencyResolverExecutionException, DependencyResolverFailureException;
}