本文整理汇总了Java中org.apache.maven.model.Build.getPluginManagement方法的典型用法代码示例。如果您正苦于以下问题:Java Build.getPluginManagement方法的具体用法?Java Build.getPluginManagement怎么用?Java Build.getPluginManagement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Build
的用法示例。
在下文中一共展示了Build.getPluginManagement方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSnapshotsFromManagement
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
PomPropertyResolver propertyResolver) {
this.log.debug("\t\tChecking managed plugins");
Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
Build build = project.getBuild();
if (build != null) {
PluginManagement pluginManagement = build.getPluginManagement();
if (pluginManagement != null) {
for (Plugin plugin : pluginManagement.getPlugins()) {
Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(),
new IsSnapshotDependency(propertyResolver));
if (!snapshots.isEmpty()) {
result.putAll(PluginToCoordinates.INSTANCE.apply(plugin),
Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
}
}
}
}
return result;
}
示例2: getRuleConfigurations
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Returns the rule configurations from the <tt>pluginManagement</tt> as well
* as the <tt>plugins</tt> section.
*
* @param build the build to inspect.
* @return configuration of the rules, may be an empty list.
*/
final List<Xpp3Dom> getRuleConfigurations( final Build build )
{
@SuppressWarnings( "unchecked" )
final Map<String, Plugin> plugins = build.getPluginsAsMap();
final List<Xpp3Dom> ruleConfigurationsForPlugins = getRuleConfigurations( plugins );
final PluginManagement pluginManagement = build.getPluginManagement();
if ( pluginManagement != null )
{
@SuppressWarnings( "unchecked" )
final Map<String, Plugin> pluginsFromManagementAsMap = pluginManagement.getPluginsAsMap();
List<Xpp3Dom> ruleConfigurationsFromManagement = getRuleConfigurations( pluginsFromManagementAsMap );
ruleConfigurationsForPlugins.addAll( ruleConfigurationsFromManagement );
}
return ruleConfigurationsForPlugins;
}
示例3: extractPluginDependenciesFromPluginsInPluginManagement
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private static Set<Dependency> extractPluginDependenciesFromPluginsInPluginManagement( Build build )
{
Set<Dependency> result = new TreeSet<>( new DependencyComparator() );
if ( build.getPluginManagement() != null )
{
for ( Plugin plugin : build.getPluginManagement().getPlugins() )
{
if ( plugin.getDependencies() != null && !plugin.getDependencies().isEmpty() )
{
for ( Dependency pluginDependency : plugin.getDependencies() )
{
result.add( pluginDependency );
}
}
}
}
return result;
}
示例4: resolveFromProject
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private PluginPrefixResult resolveFromProject( PluginPrefixRequest request )
{
PluginPrefixResult result = null;
if ( request.getPom() != null && request.getPom().getBuild() != null )
{
Build build = request.getPom().getBuild();
result = resolveFromProject( request, build.getPlugins() );
if ( result == null && build.getPluginManagement() != null )
{
result = resolveFromProject( request, build.getPluginManagement().getPlugins() );
}
}
return result;
}
示例5: resolveFromProject
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private PluginVersionResult resolveFromProject( PluginVersionRequest request )
{
PluginVersionResult result = null;
if ( request.getPom() != null && request.getPom().getBuild() != null )
{
Build build = request.getPom().getBuild();
result = resolveFromProject( request, build.getPlugins() );
if ( result == null && build.getPluginManagement() != null )
{
result = resolveFromProject( request, build.getPluginManagement().getPlugins() );
}
}
return result;
}
示例6: expandPluginConfiguration
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
Build build = model.getBuild();
if ( build != null )
{
expand( build.getPlugins() );
PluginManagement pluginManagement = build.getPluginManagement();
if ( pluginManagement != null )
{
expand( pluginManagement.getPlugins() );
}
}
}
示例7: getSnapshotsFromManagement
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
PomPropertyResolver propertyResolver) {
this.log.debug("\t\tChecking managed plugins");
Build build = project.getBuild();
if (build != null) {
PluginManagement pluginManagement = build.getPluginManagement();
if (pluginManagement != null) {
Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(),
new IsSnapshotPlugin(propertyResolver));
return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
}
}
return Collections.emptySet();
}
示例8: getManagedPluginMap
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public Map<String, Plugin> getManagedPluginMap( final ModelBase base )
{
if ( base instanceof Model )
{
final Build build = ( (Model) base ).getBuild();
if ( build == null )
{
return Collections.emptyMap();
}
final PluginManagement pm = build.getPluginManagement();
if ( pm == null )
{
return Collections.emptyMap();
}
final Map<String, Plugin> result = pm.getPluginsAsMap();
if ( result == null )
{
return Collections.emptyMap();
}
return result;
}
return Collections.emptyMap();
}
示例9: getPluginManagement
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public PluginManagement getPluginManagement()
{
PluginManagement pluginMgmt = null;
Build build = getModel().getBuild();
if ( build != null )
{
pluginMgmt = build.getPluginManagement();
}
return pluginMgmt;
}
示例10: mergeManagedBuildPlugins
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void mergeManagedBuildPlugins( Model model )
{
Build build = model.getBuild();
if ( build != null )
{
PluginManagement pluginManagement = build.getPluginManagement();
if ( pluginManagement != null )
{
mergePluginContainer_Plugins( build, pluginManagement );
}
}
}
示例11: assembleBuildInheritance
import org.apache.maven.model.Build; //导入方法依赖的package包/类
@SuppressWarnings( "unchecked" )
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
{
// The build has been set but we want to step in here and fill in
// values that have not been set by the child.
if ( childBuild.getSourceDirectory() == null )
{
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
}
if ( childBuild.getScriptSourceDirectory() == null )
{
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
}
if ( childBuild.getTestSourceDirectory() == null )
{
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
}
if ( childBuild.getOutputDirectory() == null )
{
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
}
if ( childBuild.getTestOutputDirectory() == null )
{
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
}
// Extensions are accumulated
mergeExtensionLists( childBuild, parentBuild );
if ( childBuild.getDirectory() == null )
{
childBuild.setDirectory( parentBuild.getDirectory() );
}
if ( childBuild.getDefaultGoal() == null )
{
childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
}
if ( childBuild.getFinalName() == null )
{
childBuild.setFinalName( parentBuild.getFinalName() );
}
ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );
List<Resource> resources = childBuild.getResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setResources( parentBuild.getResources() );
}
resources = childBuild.getTestResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setTestResources( parentBuild.getTestResources() );
}
// Plugins are aggregated if Plugin.inherit != false
ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance );
// Plugin management :: aggregate
PluginManagement dominantPM = childBuild.getPluginManagement();
PluginManagement recessivePM = parentBuild.getPluginManagement();
if ( ( dominantPM == null ) && ( recessivePM != null ) )
{
// FIXME: Filter out the inherited == false stuff!
childBuild.setPluginManagement( recessivePM );
}
else
{
ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
}
}