当前位置: 首页>>代码示例>>Java>>正文


Java OverConstrainedVersionException类代码示例

本文整理汇总了Java中org.apache.maven.artifact.versioning.OverConstrainedVersionException的典型用法代码示例。如果您正苦于以下问题:Java OverConstrainedVersionException类的具体用法?Java OverConstrainedVersionException怎么用?Java OverConstrainedVersionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OverConstrainedVersionException类属于org.apache.maven.artifact.versioning包,在下文中一共展示了OverConstrainedVersionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReplacement

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
private Artifact getReplacement(Artifact artifact) {
	String key = String.format("%s/%s", artifact.getGroupId(), artifact.getArtifactId());
	String bundle = null;
	for (VersionRange range : translations.get(key).keySet()) {
		try {
			if (range.containsVersion(artifact.getSelectedVersion())) {
				bundle = translations.get(key).get(range);
				break;
			}
		} catch (OverConstrainedVersionException e) {
			bundle = null;
		}
	}
	if (bundle != null) {
		String[] split = bundle.split("/");
		return factory.createArtifact(split[0], split[1], split[2], Artifact.SCOPE_PROVIDED, artifact.getArtifactHandler().getPackaging());
	} else {
		return null;
	}
}
 
开发者ID:hitakaken,项目名称:bigfoot-maven-plugins,代码行数:21,代码来源:GenerateFeaturesFileMojo.java

示例2: resolveConflict

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
{
    try
    {
        ArtifactVersion version1 = node1.getArtifact().getSelectedVersion();
        ArtifactVersion version2 = node2.getArtifact().getSelectedVersion();

        return version1.compareTo( version2 ) <= 0 ? node1 : node2;
    }
    catch ( OverConstrainedVersionException exception )
    {
        // TODO: log message or throw exception?

        return null;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:OldestConflictResolver.java

示例3: resolveConflict

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
{
    try
    {
        ArtifactVersion version1 = node1.getArtifact().getSelectedVersion();
        ArtifactVersion version2 = node2.getArtifact().getSelectedVersion();

        return version1.compareTo( version2 ) > 0 ? node1 : node2;
    }
    catch ( OverConstrainedVersionException exception )
    {
        // TODO: log message or throw exception?

        return null;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:NewestConflictResolver.java

示例4: testOverConstrainedVersionException

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public void testOverConstrainedVersionException()
    throws ArtifactResolutionException, InvalidVersionSpecificationException
{
    ArtifactSpec a = createArtifactSpec( "a", "1.0" );
    a.addDependency( "b", "[1.0, 2.0)" );
    a.addDependency( "c", "[3.3.0,4.0.0)" );

    ArtifactSpec b = createArtifactSpec( "b", "1.0.0" );
    b.addDependency( "c", "3.3.0-v3346" );

    ArtifactSpec c = createArtifactSpec( "c", "3.2.1-v3235e" );

    try
    {
        ArtifactResolutionResult res = collect( createSet( new Object[] { a.artifact } ) );
    }
    catch ( OverConstrainedVersionException e )
    {
        assertTrue( "Versions unordered", e.getMessage().indexOf( "[3.2.1-v3235e, 3.3.0-v3346]" ) != -1 );
        assertTrue( "DependencyTrail unresolved", e.getMessage().indexOf( "Path to dependency:" ) != -1 );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:DefaultArtifactCollectorTest.java

示例5: addDependencies

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public void addDependencies( Set<Artifact> artifacts, List<ArtifactRepository> remoteRepositories,
                             ArtifactFilter filter )
    throws CyclicDependencyException, OverConstrainedVersionException
{
    if ( artifacts != null && !artifacts.isEmpty() )
    {
        children = new ArrayList<ResolutionNode>( artifacts.size() );

        for ( Artifact a : artifacts )
        {
            if ( parents.contains( a.getDependencyConflictId() ) )
            {
                a.setDependencyTrail( getDependencyTrail() );

                throw new CyclicDependencyException( "A dependency has introduced a cycle", a );
            }

            children.add( new ResolutionNode( a, remoteRepositories, this ) );
        }
    }
    else
    {
        children = Collections.emptyList();
    }
    trail = null;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:27,代码来源:ResolutionNode.java

示例6: filterTrail

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public boolean filterTrail( ArtifactFilter filter )
    throws OverConstrainedVersionException
{
    boolean success = true;
    if ( filter != null )
    {
        for ( Artifact artifact : getTrail() )
        {
            if ( !filter.include( artifact ) )
            {
                success = false;
            }
        }
    }
    return success;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:ResolutionNode.java

示例7: getSelectedVersion

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
private static ArtifactVersion getSelectedVersion( Artifact artifact )
    throws MojoExecutionException
{
    try
    {
        return artifact.getSelectedVersion();
    }
    catch ( OverConstrainedVersionException ex )
    {
        throw new MojoExecutionException( ex.getMessage(), ex );
    }
}
 
开发者ID:mojohaus,项目名称:jaxws-maven-plugin,代码行数:13,代码来源:AbstractJaxwsMojo.java

示例8: getDependencyTrail

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
/**
 * @return {@link List} &lt; {@link String} > with artifact ids
 * @throws OverConstrainedVersionException
 */
public List<String> getDependencyTrail()
    throws OverConstrainedVersionException
{
    List<Artifact> trial = getTrail();

    List<String> ret = new ArrayList<String>( trial.size() );

    for ( Artifact artifact : trial )
    {
        ret.add( artifact.getId() );
    }

    return ret;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:ResolutionNode.java

示例9: getTrail

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
private List<Artifact> getTrail()
    throws OverConstrainedVersionException
{
    if ( trail == null )
    {
        List<Artifact> ids = new LinkedList<Artifact>();
        ResolutionNode node = this;
        while ( node != null )
        {
            Artifact artifact = node.getArtifact();
            if ( artifact.getVersion() == null )
            {
                // set the recommended version
                ArtifactVersion selected = artifact.getSelectedVersion();
                // MNG-2123: null is a valid response to getSelectedVersion, don't
                // assume it won't ever be.
                if ( selected != null )
                {
                    artifact.selectVersion( selected.toString() );
                }
                else
                {
                    throw new OverConstrainedVersionException( "Unable to get a selected Version for "
                        + artifact.getArtifactId(), artifact );
                }
            }

            ids.add( 0, artifact );
            node = node.parent;
        }
        trail = ids;
    }
    return trail;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:35,代码来源:ResolutionNode.java

示例10: getSelectedVersion

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
@Override
public ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException
{
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:ServerlessJavaMaven,项目名称:ServerlessJavaMaven,代码行数:7,代码来源:TestArtifact.java

示例11: isSelectedVersionKnown

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
@Override
public boolean isSelectedVersionKnown() throws OverConstrainedVersionException
{
	// TODO Auto-generated method stub
	return false;
}
 
开发者ID:ServerlessJavaMaven,项目名称:ServerlessJavaMaven,代码行数:7,代码来源:TestArtifact.java

示例12: getSelectedVersion

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException {
  return myWrapee.getSelectedVersion();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CustomMaven3Artifact.java

示例13: isSelectedVersionKnown

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public boolean isSelectedVersionKnown() throws OverConstrainedVersionException {
  return myWrapee.isSelectedVersionKnown();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CustomMaven3Artifact.java

示例14: getComparisonArtifact

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
private Artifact getComparisonArtifact()
    throws MojoFailureException, MojoExecutionException
{
    // Find the previous version JAR and resolve it, and it's dependencies
    VersionRange range;
    try
    {
        range = VersionRange.createFromVersionSpec( comparisonVersion );
    }
    catch ( InvalidVersionSpecificationException e )
    {
        throw new MojoFailureException( "Invalid comparison version: " + e.getMessage() );
    }

    Artifact previousArtifact;
    try
    {
        previousArtifact = factory.createDependencyArtifact( project.getGroupId(), project.getArtifactId(), range,
                                                             project.getPackaging(), null, Artifact.SCOPE_COMPILE );

        if ( !previousArtifact.getVersionRange().isSelectedVersionKnown( previousArtifact ) )
        {
            getLog().debug( "Searching for versions in range: " + previousArtifact.getVersionRange() );
            List availableVersions = metadataSource.retrieveAvailableVersions( previousArtifact, localRepository,
                                                                               project.getRemoteArtifactRepositories() );
            filterSnapshots( availableVersions );
            ArtifactVersion version = range.matchVersion( availableVersions );
            if ( version != null )
            {
                previousArtifact.selectVersion( version.toString() );
            }
        }
    }
    catch ( OverConstrainedVersionException e1 )
    {
        throw new MojoFailureException( "Invalid comparison version: " + e1.getMessage() );
    }
    catch ( ArtifactMetadataRetrievalException e11 )
    {
        throw new MojoExecutionException( "Error determining previous version: " + e11.getMessage(), e11 );
    }

    if ( previousArtifact.getVersion() == null )
    {
        getLog().info( "Unable to find a previous version of the project in the repository" );
    }

    return previousArtifact;
}
 
开发者ID:mojohaus,项目名称:clirr-maven-plugin,代码行数:50,代码来源:AbstractClirrMojo.java

示例15: getSelectedVersion

import org.apache.maven.artifact.versioning.OverConstrainedVersionException; //导入依赖的package包/类
public ArtifactVersion getSelectedVersion()
    throws OverConstrainedVersionException
{
    throw new RuntimeException( "Not implemented" );
}
 
开发者ID:mojohaus,项目名称:aspectj-maven-plugin,代码行数:6,代码来源:MockArtifact.java


注:本文中的org.apache.maven.artifact.versioning.OverConstrainedVersionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。