本文整理汇总了Java中org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException类的典型用法代码示例。如果您正苦于以下问题:Java ArtifactMetadataRetrievalException类的具体用法?Java ArtifactMetadataRetrievalException怎么用?Java ArtifactMetadataRetrievalException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArtifactMetadataRetrievalException类属于org.apache.maven.artifact.metadata包,在下文中一共展示了ArtifactMetadataRetrievalException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useNextSnapshots( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useNextSnapshots( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例2: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( isProcessingParent() && getProject().hasParent() ) {
useReactor( pom, getProject().getParent() );
}
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useReactor( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useReactor( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例3: useReactor
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
private void useReactor( ModifiedPomXMLEventReader pom, MavenProject parent )
throws XMLStreamException, MojoExecutionException, ArtifactMetadataRetrievalException
{
for ( Object reactorProject : reactorProjects )
{
MavenProject project = (MavenProject) reactorProject;
if ( StringUtils.equals( project.getGroupId(), parent.getGroupId() )
&& StringUtils.equals( project.getArtifactId(), parent.getArtifactId() )
&& !StringUtils.equals( project.getVersion(), parent.getVersion() ) )
{
if ( PomHelper.setProjectParentVersion( pom, project.getVersion() ) )
{
getLog().info( "Updated parent " + toString( parent ) + " to version " + project.getVersion() );
}
}
}
}
示例4: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useReleases( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useReleases( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例5: findLatestVersion
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* Finds the latest version of the specified artifact that matches the version range.
*
* @param artifact The artifact.
* @param versionRange The version range.
* @param allowingSnapshots <code>null</code> for no override, otherwise the local override to apply.
* @param usePluginRepositories
* @return The latest version of the specified artifact that matches the specified version range or
* <code>null</code> if no matching version could be found.
* @throws ArtifactMetadataRetrievalException If the artifact metadata could not be found.
* @since 1.0-alpha-1
*/
protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange,
Boolean allowingSnapshots, boolean usePluginRepositories )
throws ArtifactMetadataRetrievalException, MojoExecutionException
{
boolean includeSnapshots = this.allowSnapshots;
if ( Boolean.TRUE.equals( allowingSnapshots ) )
{
includeSnapshots = true;
}
if ( Boolean.FALSE.equals( allowingSnapshots ) )
{
includeSnapshots = false;
}
final ArtifactVersions artifactVersions = getHelper().lookupArtifactVersions( artifact, usePluginRepositories );
return artifactVersions.getNewestVersion( versionRange, includeSnapshots );
}
示例6: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
@Override
protected void update(ModifiedPomXMLEventReader pom) throws MojoExecutionException, MojoFailureException, XMLStreamException, ArtifactMetadataRetrievalException
{
try
{
Model model = PomHelper.getRawModel( pom );
Scm scm = model.getScm();
if (scm == null)
{
throw new MojoFailureException( "No <scm> was present" );
}
getLog().info( "Updating from tag " + scm.getTag() + " > " + newTag );
boolean success = PomHelper.setProjectValue(pom, "/project/scm/tag", newTag );
if ( !success )
{
throw new MojoFailureException( "Could not update the SCM tag" );
}
}
catch ( IOException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例7: findLatestVersion
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* Finds the latest version of the specified artifact that matches the version range.
*
* @param artifact The artifact.
* @param versionRange The version range.
* @param allowingSnapshots <code>null</code> for no override, otherwise the local override to apply.
* @return The latest version of the specified artifact that matches the specified version range or
* <code>null</code> if no matching version could be found.
* @throws MojoExecutionException If the artifact metadata could not be found.
* @since 1.0-alpha-1
*/
protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange,
boolean allowingSnapshots, boolean usePluginRepositories )
throws MavenReportException
{
boolean includeSnapshots = this.allowSnapshots;
if ( allowingSnapshots )
{
includeSnapshots = true;
}
if ( allowingSnapshots )
{
includeSnapshots = false;
}
try
{
final ArtifactVersions artifactVersions =
getHelper().lookupArtifactVersions( artifact, usePluginRepositories );
return artifactVersions.getNewestVersion( versionRange, includeSnapshots );
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MavenReportException( e.getMessage(), e );
}
}
示例8: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getParent() != null && isProcessingParent() )
{
useReleases( pom, getProject().getParent() );
}
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useReleases( pom, PomHelper.readImportedPOMsFromDependencyManagementSection( pom ) );
useReleases( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useReleases( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例9: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useLatestReleases( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useLatestReleases( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例10: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useLatestSnapshots( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useLatestSnapshots( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例11: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException when things go wrong with XML streaming
* @see org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useNextVersions( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( getProject().getDependencies() != null && isProcessingDependencies() )
{
useNextVersions( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例12: update
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* @param pom the pom to update.
* @throws org.apache.maven.plugin.MojoExecutionException
* when things go wrong
* @throws org.apache.maven.plugin.MojoFailureException
* when things go wrong in a very bad way
* @throws javax.xml.stream.XMLStreamException
* when things go wrong with XML streaming
* @see org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo#update(org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader)
*/
protected void update( ModifiedPomXMLEventReader pom )
throws MojoExecutionException, MojoFailureException, XMLStreamException
{
try
{
if ( getProject().getDependencyManagement() != null && isProcessingDependencyManagement() )
{
useNextSnapshots( pom, getProject().getDependencyManagement().getDependencies() );
}
if ( isProcessingDependencies() )
{
useNextSnapshots( pom, getProject().getDependencies() );
}
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
示例13: findLatestVersion
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* Finds the latest version of the specified artifact that matches the version range.
*
* @param artifact The artifact.
* @param versionRange The version range.
* @param allowingSnapshots <code>null</code> for no override, otherwise the local override to apply.
* @param usePluginRepositories
* @return The latest version of the specified artifact that matches the specified version range or
* <code>null</code> if no matching version could be found.
* @throws ArtifactMetadataRetrievalException
* If the artifact metadata could not be found.
* @since 1.0-alpha-1
*/
protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange,
Boolean allowingSnapshots, boolean usePluginRepositories )
throws ArtifactMetadataRetrievalException, MojoExecutionException
{
boolean includeSnapshots = Boolean.TRUE.equals( this.allowSnapshots );
if ( Boolean.TRUE.equals( allowingSnapshots ) )
{
includeSnapshots = true;
}
if ( Boolean.FALSE.equals( allowingSnapshots ) )
{
includeSnapshots = false;
}
final ArtifactVersions artifactVersions = getHelper().lookupArtifactVersions( artifact, usePluginRepositories );
return artifactVersions.getNewestVersion( versionRange, includeSnapshots );
}
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:30,代码来源:AbstractVersionsUpdaterMojo.java
示例14: findLatestVersion
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* Finds the latest version of the specified artifact that matches the version range.
*
* @param artifact The artifact.
* @param versionRange The version range.
* @param allowingSnapshots <code>null</code> for no override, otherwise the local override to apply.
* @return The latest version of the specified artifact that matches the specified version range or
* <code>null</code> if no matching version could be found.
* @throws MojoExecutionException If the artifact metadata could not be found.
* @since 1.0-alpha-1
*/
protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange,
Boolean allowingSnapshots, boolean usePluginRepositories )
throws MavenReportException
{
boolean includeSnapshots = Boolean.TRUE.equals( this.allowSnapshots );
if ( Boolean.TRUE.equals( allowingSnapshots ) )
{
includeSnapshots = true;
}
if ( Boolean.FALSE.equals( allowingSnapshots ) )
{
includeSnapshots = false;
}
try
{
final ArtifactVersions artifactVersions =
getHelper().lookupArtifactVersions( artifact, usePluginRepositories );
return artifactVersions.getNewestVersion( versionRange, includeSnapshots );
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new MavenReportException( e.getMessage(), e );
}
}
示例15: lookupDependenciesUpdates
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Map<Dependency, ArtifactVersions> lookupDependenciesUpdates( Set dependencies,
boolean usePluginRepositories )
throws ArtifactMetadataRetrievalException, InvalidVersionSpecificationException
{
Map<Dependency, ArtifactVersions> dependencyUpdates =
new TreeMap<Dependency, ArtifactVersions>( new DependencyComparator() );
for ( Object dependency1 : dependencies )
{
Dependency dependency = (Dependency) dependency1;
ArtifactVersions details = lookupDependencyUpdates( dependency, usePluginRepositories );
dependencyUpdates.put( dependency, details );
}
return dependencyUpdates;
}