本文整理匯總了Java中org.apache.maven.project.MavenProject.getContextValue方法的典型用法代碼示例。如果您正苦於以下問題:Java MavenProject.getContextValue方法的具體用法?Java MavenProject.getContextValue怎麽用?Java MavenProject.getContextValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.project.MavenProject
的用法示例。
在下文中一共展示了MavenProject.getContextValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createEvaluator
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
/**
* Evaluator usable for interpolating variables in non resolved (interpolated) models.
* Should not be necessary when dealing with the project's <code>MavenProject</code> instance accessed via<code>NbMavenProject.getMavenProject()</code>
* Please NOTE that if you have access to <code>Project</code> instance, then
* the variant with <code>Project</code> as parameter is preferable. Faster and less prone to deadlock.
* @since 2.32
*/
public static @NonNull ExpressionEvaluator createEvaluator(@NonNull MavenProject prj) {
ExpressionEvaluator eval = (ExpressionEvaluator) prj.getContextValue(CONTEXT_EXPRESSION_EVALUATOR);
if (eval != null) {
return eval;
}
Map<? extends String,? extends String> sysprops = Collections.emptyMap();
Map<? extends String,? extends String> userprops = Collections.emptyMap();
File basedir = prj.getBasedir();
if (basedir != null) {
FileObject bsd = FileUtil.toFileObject(basedir);
if (bsd != null) {
Project p = FileOwnerQuery.getOwner(bsd);
if (p != null) {
NbMavenProjectImpl project = p.getLookup().lookup(NbMavenProjectImpl.class);
if (project != null) {
sysprops = project.createSystemPropsForPropertyExpressions();
userprops = project.createUserPropsForPropertyExpressions();
}
}
}
}
//ugly
Settings ss = EmbedderFactory.getProjectEmbedder().getSettings();
ss.setLocalRepository(EmbedderFactory.getProjectEmbedder().getLocalRepository().getBasedir());
eval = new NBPluginParameterExpressionEvaluator(
prj,
ss,
sysprops,
userprops);
prj.setContextValue(CONTEXT_EXPRESSION_EVALUATOR, eval);
return eval;
}
示例2: getExecutionResult
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public static MavenExecutionResult getExecutionResult(MavenProject project) {
return (MavenExecutionResult) project.getContextValue(CONTEXT_EXECUTION_RESULT);
}
示例3: unknownBuildParticipantObserved
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public static boolean unknownBuildParticipantObserved(MavenProject project) {
return project.getContextValue(CONTEXT_PARTICIPANTS) != null;
}
示例4: getUnknownBuildParticipantsClassNames
import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
/**
* list of class names of build participants in the project, null when none are present.
* @param project
* @return
*/
public static Collection<String> getUnknownBuildParticipantsClassNames(MavenProject project) {
return (Collection<String>) project.getContextValue(CONTEXT_PARTICIPANTS);
}