本文整理匯總了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();
}
示例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);
}
示例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();
}
示例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();
}
示例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 );
}
}
示例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();
}
示例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();
}
示例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());
}
示例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());
}