本文整理匯總了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);
}
示例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);
}
示例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]);
}
}
}
}
示例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);
}
}