当前位置: 首页>>代码示例>>Java>>正文


Java Model.getBuild方法代码示例

本文整理汇总了Java中org.apache.maven.model.Model.getBuild方法的典型用法代码示例。如果您正苦于以下问题:Java Model.getBuild方法的具体用法?Java Model.getBuild怎么用?Java Model.getBuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.model.Model的用法示例。


在下文中一共展示了Model.getBuild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPlugin

import org.apache.maven.model.Model; //导入方法依赖的package包/类
protected Plugin getPlugin(Model model, String groupId, String artifactId) {
    if (model.getBuild() == null) {
        return null;
    }
    if (model.getBuild().getPlugins() == null) {
        return null;
    }
    return getPluginInList(model.getBuild().getPlugins(), groupId, artifactId);
}
 
开发者ID:paypal,项目名称:butterfly,代码行数:10,代码来源:AbstractArtifactPomOperation.java

示例2: getManagedPlugin

import org.apache.maven.model.Model; //导入方法依赖的package包/类
protected Plugin getManagedPlugin(Model model, String groupId, String artifactId) {
    if (model.getBuild() == null) {
        return null;
    }
    if (model.getBuild().getPluginManagement().getPlugins() == null) {
        return null;
    }
    return getPluginInList(model.getBuild().getPluginManagement().getPlugins(), groupId, artifactId);
}
 
开发者ID:paypal,项目名称:butterfly,代码行数:10,代码来源:AbstractArtifactPomOperation.java

示例3: copySurefireReports

import org.apache.maven.model.Model; //导入方法依赖的package包/类
static void copySurefireReports(Model model) {
    Build build = model.getBuild();
    if (build != null && build.getDirectory() != null) {
        File targetDir = new File(build.getDirectory());
        if (targetDir.exists() && targetDir.isDirectory()) {
            File[] surefireReports =
                targetDir.listFiles(file -> file.isDirectory() && SUREFIRE_REPORTS_DIR_NAME.equals(file.getName()));
            if (surefireReports.length > 0) {
                copyReportsDirectory(model, surefireReports[0]);
            }
        }
    }
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:14,代码来源:SurefireReportStorage.java

示例4: checkContent

import org.apache.maven.model.Model; //导入方法依赖的package包/类
private void checkContent(Project prj, InstanceContent ic, AccessQueryImpl access, ForeignClassBundlerImpl bundler, RecommendedTemplates templates) {
    NbMavenProject nbprj = prj.getLookup().lookup(NbMavenProject.class);
    String effPackaging = nbprj.getPackagingType();
    
    boolean needToCheckFelixProjectTypes = true;
    if(!nbprj.isMavenProjectLoaded()) { 
        // issue #262646 
        // due to unfortunate ProjectManager.findPorjetc calls in awt, 
        // speed is essential during project init, so lets try to avoid
        // maven project loading if we can get the info faster from raw model.
        needToCheckFelixProjectTypes = false;
        Model model;
        try {
            model = nbprj.getRawModel();
        } catch (ModelBuildingException ex) {
            // whatever happend, we can't use the model, 
            // lets try to follow up with loading the maven project
            model = null;
            Logger.getLogger(OSGILookupProvider.class.getName()).log(Level.FINE, null, ex);
        }
        Build build = model != null ? model.getBuild() : null;
        List<Plugin> plugins = build != null ? build.getPlugins() : null;
        if(plugins != null) {
            for (Plugin plugin : plugins) {
                if(OSGiConstants.GROUPID_FELIX.equals(plugin.getGroupId()) && OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN.equals(plugin.getArtifactId())) {
                    needToCheckFelixProjectTypes = true;
                    break;
                }
            }
        } 
    }
    if(needToCheckFelixProjectTypes) {
        String[] types = PluginPropertyUtils.getPluginPropertyList(prj, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, "supportedProjectTypes", "supportedProjectType", /*"bundle" would not work for GlassFish parent POM*/null);
        if (types != null) {
            for (String type : types) {
                if (effPackaging.equals(type)) {
                    effPackaging = NbMavenProject.TYPE_OSGI;
                }
            }
        }
    }
    if (NbMavenProject.TYPE_OSGI.equals(effPackaging)) {
        ic.add(access);
        ic.add(bundler);
        ic.add(templates);
    } else {
        ic.remove(access);
        ic.remove(bundler);
        ic.remove(templates);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:52,代码来源:OSGILookupProvider.java


注:本文中的org.apache.maven.model.Model.getBuild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。