當前位置: 首頁>>代碼示例>>Java>>正文


Java MavenProject.getContextValue方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:41,代碼來源:PluginPropertyUtils.java

示例2: getExecutionResult

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public static MavenExecutionResult getExecutionResult(MavenProject project) {
    return (MavenExecutionResult) project.getContextValue(CONTEXT_EXECUTION_RESULT);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:MavenProjectCache.java

示例3: unknownBuildParticipantObserved

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public static boolean unknownBuildParticipantObserved(MavenProject project) {
    return project.getContextValue(CONTEXT_PARTICIPANTS) != null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:MavenProjectCache.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MavenProjectCache.java


注:本文中的org.apache.maven.project.MavenProject.getContextValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。