當前位置: 首頁>>代碼示例>>Java>>正文


Java ArtifactResolutionException.getMessage方法代碼示例

本文整理匯總了Java中org.eclipse.aether.resolution.ArtifactResolutionException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java ArtifactResolutionException.getMessage方法的具體用法?Java ArtifactResolutionException.getMessage怎麽用?Java ArtifactResolutionException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.aether.resolution.ArtifactResolutionException的用法示例。


在下文中一共展示了ArtifactResolutionException.getMessage方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fetchDependency

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
private Path fetchDependency(final String artifactIdentifier) throws MojoExecutionException {
    ArtifactRequest request = new ArtifactRequest();
    final DefaultArtifact artifact = new DefaultArtifact(artifactIdentifier);
    request.setArtifact(artifact);
    request.setRepositories(remoteRepos);

    LogProvider.debug("Resolving artifact " + artifact + " from " + remoteRepos);

    ArtifactResult result;
    try {
        result = repoSystem.resolveArtifact(repoSession, request);
    } catch (ArtifactResolutionException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    }

    LogProvider.debug("Resolved artifact " + artifact + " to " + result.getArtifact().getFile() + " from " + result.getRepository());
    return result.getArtifact().getFile().toPath();
}
 
開發者ID:sdaschner,項目名稱:jaxrs-analyzer-maven-plugin,代碼行數:19,代碼來源:JAXRSAnalyzerMojo.java

示例2: resolveModel

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
@Override
public ModelSource resolveModel(String groupId, String artifactId, String version)
         throws UnresolvableModelException
{
   Artifact pomArtifact = new DefaultArtifact(groupId, artifactId, "", "pom", version);
   try
   {
      final ArtifactRequest request = new ArtifactRequest(pomArtifact, repositories, null);
      pomArtifact = system.resolveArtifact(session, request).getArtifact();

   }
   catch (ArtifactResolutionException e)
   {
      throw new UnresolvableModelException("Failed to resolve POM for " + groupId + ":" + artifactId + ":"
               + version + " due to " + e.getMessage(), groupId, artifactId, version, e);
   }

   final File pomFile = pomArtifact.getFile();

   return new FileModelSource(pomFile);

}
 
開發者ID:forge,項目名稱:furnace,代碼行數:23,代碼來源:MavenModelResolver.java

示例3: resolve

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
/**
 * Resolves the specified artifact (using its GAV, classifier and packaging).
 *
 * @param mojo       the mojo
 * @param groupId    the groupId of the artifact to resolve
 * @param artifactId the artifactId of the artifact to resolve
 * @param version    the version
 * @param type       the type
 * @param classifier the classifier
 * @return the artifact's file if it can be revolved. The file is located in the local maven repository.
 * @throws MojoExecutionException if the artifact cannot be resolved
 */
public static File resolve(AbstractWisdomMojo mojo, String groupId, String artifactId, String version,
                           String type, String classifier) throws MojoExecutionException {
    ArtifactRequest request = new ArtifactRequest();
    request.setArtifact(
            new DefaultArtifact(groupId, artifactId, classifier, type, version));
    request.setRepositories(mojo.remoteRepos);

    mojo.getLog().info("Resolving artifact " + artifactId +
            " from " + mojo.remoteRepos);

    ArtifactResult result;
    try {
        result = mojo.repoSystem.resolveArtifact(mojo.repoSession, request);
    } catch (ArtifactResolutionException e) {
        mojo.getLog().error("Cannot resolve " + groupId + ":" + artifactId + ":" + version + ":" + type);
        throw new MojoExecutionException(e.getMessage(), e);
    }

    mojo.getLog().info("Resolved artifact " + artifactId + " to " +
            result.getArtifact().getFile() + " from "
            + result.getRepository());

    return result.getArtifact().getFile();
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:37,代碼來源:DependencyFinder.java

示例4: resolve

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
@Override
public File resolve(final MavenProject project, final String artifact) {
    final ArtifactResult result;
    try {
        final ProjectBuildingRequest projectBuildingRequest = project.getProjectBuildingRequest();

        final ArtifactRequest request = new ArtifactRequest();
        final ArtifactNameSplitter splitter = ArtifactNameSplitter.of(artifact).split();
        final Artifact defaultArtifact = new DefaultArtifact(splitter.getGroupId(), splitter.getArtifactId(), splitter.getClassifier(), splitter.getPackaging(), splitter.getVersion());
        request.setArtifact(defaultArtifact);
        final List<RemoteRepository> repos = project.getRemoteProjectRepositories();
        request.setRepositories(repos);
        result = repoSystem.resolveArtifact(projectBuildingRequest.getRepositorySession(), request);
    } catch (ArtifactResolutionException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
    return result.getArtifact().getFile();
}
 
開發者ID:wildfly,項目名稱:wildfly-maven-plugin,代碼行數:19,代碼來源:EclipseAetherArtifactResolver.java

示例5: downloadAndInstallArtifact

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
protected ArtifactResult downloadAndInstallArtifact(String artifact) throws MojoExecutionException {
    ArtifactResult result;

    ArtifactRequest request = new ArtifactRequest();
    request.setArtifact( new DefaultArtifact( artifact ) );
    request.setRepositories( remoteRepos );

    getLog().info( "Resolving artifact " + artifact + " from " + remoteRepos );
    try {
        result = repoSystem.resolveArtifact( repoSession, request );
        return result;
    } catch ( ArtifactResolutionException e ) {
        throw new MojoExecutionException( e.getMessage(), e );
    }
}
 
開發者ID:syndesisio,項目名稱:syndesis,代碼行數:16,代碼來源:RepackageExtensionMojo.java

示例6: resolveArtifact

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
protected File resolveArtifact(Artifact artifact) throws MojoExecutionException, DependencyCollectionException {
   ArtifactRequest request = new ArtifactRequest();
   request.setArtifact(artifact);
   request.setRepositories(remoteRepos);

   ArtifactResult result;
   try {
      result = repositorySystem.resolveArtifact(repoSession, request);
   } catch (ArtifactResolutionException e) {
      throw new MojoExecutionException(e.getMessage(), e);
   }

   return result.getArtifact().getFile();
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:15,代碼來源:ArtemisAbstractPlugin.java

示例7: resolveArtifact

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
/**
 * Resolves an Artifact from the repositories.
 * 
 * @param coordinates The artifact coordinates
 * @return The local file resolved/downloaded for the given coordinates
 * @throws ResolutionException If the artifact cannot be resolved
 */
public File resolveArtifact(String coordinates) throws ResolutionException
{
    ArtifactRequest request = new ArtifactRequest();
    Artifact artifact = new DefaultArtifact(coordinates);
    request.setArtifact(artifact);
    request.setRepositories(remoteRepositories);

    log.debug(String.format("Resolving artifact %s from %s", artifact, remoteRepositories));

    ArtifactResult result;
    try
    {
        result = repositorySystem.resolveArtifact(repositorySession, request);
    }
    catch (ArtifactResolutionException e)
    {
        throw new ResolutionException(e.getMessage(), e);
    }

    log.debug(String.format("Resolved artifact %s to %s from %s",
            artifact,
            result.getArtifact().getFile(),
            result.getRepository()));

    return result.getArtifact().getFile();
}
 
開發者ID:alexcojocaru,項目名稱:elasticsearch-maven-plugin,代碼行數:34,代碼來源:MyArtifactResolver.java

示例8: resolveArtifact

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
/**
 * Retreive the extended artifact definition of the given artifact.
 * @param mavenArtifact - the artifact to resolve
 * @return the artifact definition.
 * @throws MojoExecutionException on error.
 */
public final Artifact resolveArtifact(Artifact mavenArtifact) throws MojoExecutionException {
	final org.eclipse.aether.artifact.Artifact aetherArtifact = createArtifact(mavenArtifact);
	final ArtifactRequest request = new ArtifactRequest();
	request.setArtifact(aetherArtifact);
	request.setRepositories(getRemoteRepositoryList());
	final ArtifactResult result;
	try {
		result = getRepositorySystem().resolveArtifact(getRepositorySystemSession(), request);
	} catch (ArtifactResolutionException e) {
		throw new MojoExecutionException(e.getMessage(), e);
	}
	return createArtifact(result.getArtifact());
}
 
開發者ID:gallandarakhneorg,項目名稱:afc,代碼行數:20,代碼來源:AbstractArakhneMojo.java

示例9: DependencyCollectionException

import org.eclipse.aether.resolution.ArtifactResolutionException; //導入方法依賴的package包/類
public DependencyCollectionException(ArtifactResolutionException e) {
    super(e.getMessage());
    this.remoteRepositories = e.getResult().getRequest().getRepositories();
    getSource(e.getMessage(), e.getResult());
}
 
開發者ID:atomist-attic,項目名稱:rug-resolver,代碼行數:6,代碼來源:DependencyCollectionException.java


注:本文中的org.eclipse.aether.resolution.ArtifactResolutionException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。