本文整理了Java中org.apache.maven.model.Profile.getActivation()
方法的一些代码示例,展示了Profile.getActivation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.getActivation()
方法的具体详情如下:
包路径:org.apache.maven.model.Profile
类名称:Profile
方法名:getActivation
[英]Get the conditional logic which will automatically trigger the inclusion of this profile.
[中]获取将自动触发包含此配置文件的条件逻辑。
代码示例来源:origin: org.apache.maven/maven-project
public boolean canDetermineActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation() instanceof AlwaysOnActivation;
}
代码示例来源:origin: apache/maven
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation().getFile() != null;
}
代码示例来源:origin: org.apache.maven/maven-project
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation().getFile() != null;
}
代码示例来源:origin: org.apache.maven/maven-project
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation().getProperty() != null;
}
代码示例来源:origin: apache/maven
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation().getProperty() != null;
}
代码示例来源:origin: org.apache.maven/maven-project
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && StringUtils.isNotEmpty( profile.getActivation().getJdk() );
}
代码示例来源:origin: apache/maven
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && StringUtils.isNotEmpty( profile.getActivation().getJdk() );
}
代码示例来源:origin: apache/maven
public boolean canDetermineActivation( Profile profile )
{
Activation activation = profile.getActivation();
return activation != null && activation.getOs() != null;
}
代码示例来源:origin: org.apache.maven/maven-project
public boolean canDetermineActivation( Profile profile )
{
Activation activation = profile.getActivation();
return activation != null && activation.getOs() != null;
}
代码示例来源:origin: apache/maven
private boolean isActiveByDefault( Profile profile )
{
Activation activation = profile.getActivation();
return activation != null && activation.isActiveByDefault();
}
代码示例来源:origin: apache/maven
@Override
public boolean presentInConfig( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
return false;
}
ActivationProperty property = activation.getProperty();
if ( property == null )
{
return false;
}
return true;
}
代码示例来源:origin: apache/maven
@Override
public boolean presentInConfig( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
return false;
}
ActivationFile file = activation.getFile();
if ( file == null )
{
return false;
}
return true;
}
代码示例来源:origin: apache/maven
@Override
public boolean presentInConfig( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
return false;
}
ActivationOS os = activation.getOs();
if ( os == null )
{
return false;
}
return true;
}
代码示例来源:origin: apache/maven
@Override
public boolean presentInConfig( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
return false;
}
String jdk = activation.getJdk();
if ( jdk == null )
{
return false;
}
return true;
}
代码示例来源:origin: apache/maven
private Map<String, Activation> getProfileActivations( Model model, boolean clone )
{
Map<String, Activation> activations = new HashMap<>();
for ( Profile profile : model.getProfiles() )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
continue;
}
if ( clone )
{
activation = activation.clone();
}
activations.put( profile.getId(), activation );
}
return activations;
}
代码示例来源:origin: apache/maven
private void injectProfileActivations( Model model, Map<String, Activation> activations )
{
for ( Profile profile : model.getProfiles() )
{
Activation activation = profile.getActivation();
if ( activation == null )
{
continue;
}
// restore activation
profile.setActivation( activations.get( profile.getId() ) );
}
}
代码示例来源:origin: apache/maven
public void addProfile( Profile profile )
{
String profileId = profile.getId();
Profile existing = profilesById.get( profileId );
if ( existing != null )
{
logger.warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource()
+ ") with new instance from source: " + profile.getSource() );
}
profilesById.put( profile.getId(), profile );
Activation activation = profile.getActivation();
if ( activation != null && activation.isActiveByDefault() )
{
activateAsDefault( profileId );
}
}
代码示例来源:origin: org.apache.maven/maven-project
public void addProfile( Profile profile )
{
String profileId = profile.getId();
Profile existing = (Profile) profilesById.get( profileId );
if ( existing != null )
{
container.getLogger().warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() +
") with new instance from source: " + profile.getSource() );
}
profilesById.put( profile.getId(), profile );
Activation activation = profile.getActivation();
if ( activation != null && activation.isActiveByDefault() )
{
activateAsDefault( profileId );
}
}
代码示例来源:origin: org.apache.maven/maven-project
public static Profile cloneProfile( Profile src )
{
if ( src == null )
{
return null;
}
Profile result = new Profile();
cloneModelBaseFields( src, result );
result.setActivation( cloneActivation( src.getActivation() ) );
BuildBase resultBuild = null;
if ( src.getBuild() != null )
{
resultBuild = new BuildBase();
cloneBuildBaseFields( src.getBuild(), resultBuild );
}
result.setBuild( resultBuild );
result.setId( src.getId() );
result.setSource( src.getSource() );
return result;
}
代码示例来源:origin: org.apache.maven/maven-project
public boolean isActive( Profile profile )
{
Activation activation = profile.getActivation();
ActivationOS os = activation.getOs();
boolean result = ensureAtLeastOneNonNull( os );
if ( result && os.getFamily() != null )
{
result = determineFamilyMatch( os.getFamily() );
}
if ( result && os.getName() != null )
{
result = determineNameMatch( os.getName() );
}
if ( result && os.getArch() != null )
{
result = determineArchMatch( os.getArch() );
}
if ( result && os.getVersion() != null )
{
result = determineVersionMatch( os.getVersion() );
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!