本文整理汇总了Java中org.apache.maven.model.ReportPlugin.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ReportPlugin.getConfiguration方法的具体用法?Java ReportPlugin.getConfiguration怎么用?Java ReportPlugin.getConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.ReportPlugin
的用法示例。
在下文中一共展示了ReportPlugin.getConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expandPluginConfiguration
import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
public void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
Reporting reporting = model.getReporting();
if ( reporting != null )
{
for ( ReportPlugin reportPlugin : reporting.getPlugins() )
{
Xpp3Dom parentDom = (Xpp3Dom) reportPlugin.getConfiguration();
if ( parentDom != null )
{
for ( ReportSet execution : reportPlugin.getReportSets() )
{
Xpp3Dom childDom = (Xpp3Dom) execution.getConfiguration();
childDom = Xpp3Dom.mergeXpp3Dom( childDom, new Xpp3Dom( parentDom ) );
execution.setConfiguration( childDom );
}
}
}
}
}
示例2: writeReportPlugin
import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
private void writeReportPlugin(ReportPlugin reportPlugin, String tagName, XmlSerializer serializer)
throws java.io.IOException {
serializer.startTag(NAMESPACE, tagName);
flush(serializer);
StringBuffer b = b(serializer);
int start = b.length();
if ((reportPlugin.getGroupId() != null) && !reportPlugin.getGroupId().equals("org.apache.maven.plugins")) {
writeValue(serializer, "groupId", reportPlugin.getGroupId(), reportPlugin);
}
if (reportPlugin.getArtifactId() != null) {
writeValue(serializer, "artifactId", reportPlugin.getArtifactId(), reportPlugin);
}
if (reportPlugin.getVersion() != null) {
writeValue(serializer, "version", reportPlugin.getVersion(), reportPlugin);
}
if ((reportPlugin.getReportSets() != null) && (reportPlugin.getReportSets().size() > 0)) {
serializer.startTag(NAMESPACE, "reportSets");
for (Iterator iter = reportPlugin.getReportSets().iterator(); iter.hasNext();) {
ReportSet o = (ReportSet) iter.next();
writeReportSet(o, "reportSet", serializer);
}
serializer.endTag(NAMESPACE, "reportSets");
}
if (reportPlugin.getInherited() != null) {
writeValue(serializer, "inherited", reportPlugin.getInherited(), reportPlugin);
}
if (reportPlugin.getConfiguration() != null) {
writeXpp3DOM(serializer, (Xpp3Dom)reportPlugin.getConfiguration(), reportPlugin);
}
serializer.endTag(NAMESPACE, tagName).flush();
logLocation(reportPlugin, "", start, b.length());
}
示例3: getPlugin
import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
/**
* Returns a plugin from a pom based on its group id and artifact id
* <p>
* It searches in the build section, then the reporting section and finally the pluginManagement section
* </p>
*
* @param pom the project pom
* @param groupId the plugin group id
* @param artifactId the plugin artifact id
* @return the plugin if it exists, null otherwise
*/
@CheckForNull
public static MavenPlugin getPlugin(MavenProject pom, String groupId, String artifactId) {
Object pluginConfiguration = null;
// look for plugin in <build> section
Plugin plugin = getPlugin(pom.getBuildPlugins(), groupId, artifactId);
if (plugin != null) {
pluginConfiguration = plugin.getConfiguration();
} else {
// look for plugin in reporting
Reporting reporting = pom.getModel().getReporting();
if (reporting != null) {
ReportPlugin reportPlugin = getReportPlugin(reporting.getPlugins(), groupId, artifactId);
if (reportPlugin != null) {
pluginConfiguration = reportPlugin.getConfiguration();
}
}
}
// look for plugin in <pluginManagement> section
PluginManagement pluginManagement = pom.getPluginManagement();
if (pluginManagement != null) {
Plugin pluginFromManagement = getPlugin(pluginManagement.getPlugins(), groupId, artifactId);
if (pluginFromManagement != null) {
Object pluginConfigFromManagement = pluginFromManagement.getConfiguration();
if (pluginConfiguration == null) {
pluginConfiguration = pluginConfigFromManagement;
} else if (pluginConfigFromManagement != null) {
Xpp3Dom.mergeXpp3Dom((Xpp3Dom) pluginConfiguration, (Xpp3Dom) pluginConfigFromManagement);
}
}
}
if (pluginConfiguration != null) {
return new MavenPlugin(pluginConfiguration);
}
return null;
}