本文整理汇总了Java中org.apache.maven.artifact.versioning.VersionRange.hasRestrictions方法的典型用法代码示例。如果您正苦于以下问题:Java VersionRange.hasRestrictions方法的具体用法?Java VersionRange.hasRestrictions怎么用?Java VersionRange.hasRestrictions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.artifact.versioning.VersionRange
的用法示例。
在下文中一共展示了VersionRange.hasRestrictions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isVersionOverlap
import org.apache.maven.artifact.versioning.VersionRange; //导入方法依赖的package包/类
/**
* Checks if two versions or ranges have an overlap.
*
* @param leftVersionOrRange the 1st version number or range to test
* @param rightVersionOrRange the 2nd version number or range to test
* @return true if both versions have an overlap
* @throws InvalidVersionSpecificationException if the versions can't be parsed to a range
*/
public static boolean isVersionOverlap( String leftVersionOrRange, String rightVersionOrRange )
throws InvalidVersionSpecificationException
{
VersionRange pomVersionRange = createVersionRange( leftVersionOrRange );
if ( !pomVersionRange.hasRestrictions() )
{
return true;
}
VersionRange oldVersionRange = createVersionRange( rightVersionOrRange );
if ( !oldVersionRange.hasRestrictions() )
{
return true;
}
VersionRange result = oldVersionRange.restrict( pomVersionRange );
return result.hasRestrictions();
}
示例2: isVersionOverlap
import org.apache.maven.artifact.versioning.VersionRange; //导入方法依赖的package包/类
/**
* Checks if two versions or ranges have an overlap.
*
* @param leftVersionOrRange the 1st version number or range to test
* @param rightVersionOrRange the 2nd version number or range to test
* @return true if both versions have an overlap
* @throws InvalidVersionSpecificationException
* if the versions can't be parsed to a range
*/
public static boolean isVersionOverlap( String leftVersionOrRange, String rightVersionOrRange )
throws InvalidVersionSpecificationException
{
VersionRange pomVersionRange = createVersionRange( leftVersionOrRange );
if ( !pomVersionRange.hasRestrictions() )
{
return true;
}
VersionRange oldVersionRange = createVersionRange( rightVersionOrRange );
if ( !oldVersionRange.hasRestrictions() )
{
return true;
}
VersionRange result = oldVersionRange.restrict( pomVersionRange );
return result.hasRestrictions();
}
示例3: restrictToMinimalCompatible
import org.apache.maven.artifact.versioning.VersionRange; //导入方法依赖的package包/类
private VersionRange restrictToMinimalCompatible(VersionRange ivyVersionRange)
throws InvalidVersionSpecificationException, MojoExecutionException
{
VersionRange minimalCompatibleVersionRange = VersionRange.createFromVersionSpec("[" + AbstractEngineMojo.MINIMAL_COMPATIBLE_VERSION + ",)");
VersionRange restrictedIvyVersionRange = ivyVersionRange.restrict(minimalCompatibleVersionRange);
if (!restrictedIvyVersionRange.hasRestrictions())
{
throw new MojoExecutionException("The ivyVersion '"+ivyVersion+"' is lower than the minimal compatible version"
+ " '"+MINIMAL_COMPATIBLE_VERSION+"'.");
}
return restrictedIvyVersionRange;
}