本文整理汇总了Java中org.apache.maven.model.Activation.getJdk方法的典型用法代码示例。如果您正苦于以下问题:Java Activation.getJdk方法的具体用法?Java Activation.getJdk怎么用?Java Activation.getJdk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Activation
的用法示例。
在下文中一共展示了Activation.getJdk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeActivation
import org.apache.maven.model.Activation; //导入方法依赖的package包/类
private void writeActivation(Activation activation, String tagName, XmlSerializer serializer)
throws java.io.IOException {
serializer.startTag(NAMESPACE, tagName);
flush(serializer);
StringBuffer b = b(serializer);
int start = b.length();
if (activation.isActiveByDefault() != false) {
writeValue(serializer, "activeByDefault", String.valueOf(activation.isActiveByDefault()), activation);
}
if (activation.getJdk() != null) {
writeValue(serializer, "jdk", activation.getJdk(), activation);
}
if (activation.getOs() != null) {
writeActivationOS((ActivationOS) activation.getOs(), "os", serializer);
}
if (activation.getProperty() != null) {
writeActivationProperty((ActivationProperty) activation.getProperty(), "property", serializer);
}
if (activation.getFile() != null) {
writeActivationFile((ActivationFile) activation.getFile(), "file", serializer);
}
serializer.endTag(NAMESPACE, tagName).flush();
logLocation(activation, "", start, b.length());
}
示例2: isActive
import org.apache.maven.model.Activation; //导入方法依赖的package包/类
public boolean isActive( Profile profile )
throws ProfileActivationException
{
Activation activation = profile.getActivation();
String jdk = activation.getJdk();
// null case is covered by canDetermineActivation(), so we can do a straight startsWith() here.
if ( jdk.startsWith( "[" ) || jdk.startsWith( "(" ) )
{
try
{
return matchJdkVersionRange( jdk );
}
catch ( InvalidVersionSpecificationException e )
{
throw new ProfileActivationException( "Invalid JDK version in profile '" + profile.getId() + "': "
+ e.getMessage() );
}
}
boolean reverse = false;
if ( jdk.startsWith( "!" ) )
{
reverse = true;
jdk = jdk.substring( 1 );
}
if ( getJdkVersion().startsWith( jdk ) )
{
return !reverse;
}
else
{
return reverse;
}
}
示例3: isActive
import org.apache.maven.model.Activation; //导入方法依赖的package包/类
public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
return false;
}
String jdk = activation.getJdk();
if ( jdk == null )
{
return false;
}
String version = context.getSystemProperties().get( "java.version" );
if ( version == null || version.length() <= 0 )
{
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Failed to determine Java version for profile " + profile.getId() )
.setLocation(activation.getLocation( "jdk" ) ) );
return false;
}
if ( jdk.startsWith( "!" ) )
{
return !version.startsWith( jdk.substring( 1 ) );
}
else if ( isRange( jdk ) )
{
return isInRange( version, getRange( jdk ) );
}
else
{
return version.startsWith( jdk );
}
}