本文整理汇总了Java中org.apache.maven.model.PluginManagement.getPlugins方法的典型用法代码示例。如果您正苦于以下问题:Java PluginManagement.getPlugins方法的具体用法?Java PluginManagement.getPlugins怎么用?Java PluginManagement.getPlugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.PluginManagement
的用法示例。
在下文中一共展示了PluginManagement.getPlugins方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writePluginManagement
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
private void writePluginManagement(PluginManagement pluginManagement, String tagName, XmlSerializer serializer)
throws java.io.IOException {
serializer.startTag(NAMESPACE, tagName);
flush(serializer);
StringBuffer b = b(serializer);
int start = b.length();
if ((pluginManagement.getPlugins() != null) && (pluginManagement.getPlugins().size() > 0)) {
serializer.startTag(NAMESPACE, "plugins");
for (Iterator iter = pluginManagement.getPlugins().iterator(); iter.hasNext();) {
Plugin o = (Plugin) iter.next();
writePlugin(o, "plugin", serializer);
}
serializer.endTag(NAMESPACE, "plugins");
}
serializer.endTag(NAMESPACE, tagName).flush();
logLocation(pluginManagement, "", start, b.length());
}
示例2: collectManaged
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
private Map<String, String> collectManaged(Project prj) {
NbMavenProject project = prj.getLookup().lookup(NbMavenProject.class);
Map<String, String> toRet = new HashMap<String, String>();
if (project == null) { //#154462
return toRet;
}
PluginManagement pluginManagement = project.getMavenProject().getPluginManagement();
if (pluginManagement == null) { // #189404
return toRet;
}
for (org.apache.maven.model.Plugin plg : pluginManagement.getPlugins()) {
if (plg.getGroupId().equals(Constants.GROUP_APACHE_PLUGINS)) {
continue; // #189261 - might be from superpom
}
toRet.put(plg.getKey(), plg.getVersion());
}
return toRet;
}
示例3: getSnapshotsFromManagement
import org.apache.maven.model.PluginManagement; //导入方法依赖的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;
}
示例4: visitBuildPluginManagement
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
private void visitBuildPluginManagement( ModelVisitor visitor, PluginManagement pluginManagement )
{
List<Plugin> plugins = pluginManagement.getPlugins();
if ( plugins != null )
{
ListIterator<Plugin> pluginIterator = plugins.listIterator();
while ( pluginIterator.hasNext() )
{
Plugin plugin = pluginIterator.next();
visitor.visitBuildPluginManagementPlugin( plugin );
visitBuildPluginManagementPlugin( visitor, plugin );
plugin = visitor.replaceBuildPluginManagementPlugin( plugin );
if ( plugin == null )
pluginIterator.remove();
else
pluginIterator.set( plugin );
}
}
}
示例5: visitProfileBuildPluginManagement
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
private void visitProfileBuildPluginManagement( ModelVisitor visitor, PluginManagement pluginManagement )
{
List<Plugin> plugins = pluginManagement.getPlugins();
if ( plugins != null )
{
ListIterator<Plugin> pluginIterator = plugins.listIterator();
while ( pluginIterator.hasNext() )
{
Plugin plugin = pluginIterator.next();
visitor.visitProfileBuildPluginManagementPlugin( plugin );
visitProfileBuildPluginManagementPlugin( visitor, plugin );
plugin = visitor.replaceProfileBuildPluginManagementPlugin( plugin );
if ( plugin == null )
pluginIterator.remove();
else
pluginIterator.set( plugin );
}
}
}
示例6: getResolvedManagedPlugins
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
/**
* This method will scan the plugins in the pluginManagement section of this project and return a fully
* resolved list. Note that while updating the {@link Plugin} reference returned will be reflected in
* the Model as it is the same object, if you wish to remove or add items to the Model then you must
* use {@link #getModel()}
*
* @param session MavenSessionHandler, used by {@link PropertyResolver}
* @return a list of fully resolved {@link ProjectVersionRef} to the original {@link Plugin}
* @throws ManipulationException if an error occurs
*/
public HashMap<ProjectVersionRef, Plugin> getResolvedManagedPlugins ( MavenSessionHandler session) throws ManipulationException
{
if ( resolvedManagedPlugins == null )
{
resolvedManagedPlugins = new HashMap<>( );
if ( getModel().getBuild() != null )
{
final PluginManagement pm = getModel().getBuild().getPluginManagement();
if ( !( pm == null || pm.getPlugins() == null ) )
{
resolvePlugins( session, pm.getPlugins(), resolvedManagedPlugins );
}
}
}
return resolvedManagedPlugins;
}
示例7: getResolvedProfileManagedPlugins
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
/**
* This method will scan the plugins in the pluginManagement section in the potentially active Profiles
* in this project and return a fully resolved list. Note that while updating the {@link Plugin}
* reference returned will be reflected in the Model as it is the same object, if you wish to remove
* or add items to the Model then you must use {@link #getModel()}
*
* @param session MavenSessionHandler, used by {@link PropertyResolver}
* @return a list of fully resolved {@link ProjectVersionRef} to the original {@link Plugin}
* @throws ManipulationException if an error occurs
*/
public HashMap<Profile,HashMap<ProjectVersionRef,Plugin>> getResolvedProfileManagedPlugins( MavenSessionHandler session )
throws ManipulationException
{
if ( resolvedProfileManagedPlugins == null )
{
resolvedProfileManagedPlugins = new HashMap<>();
for ( final Profile profile : ProfileUtils.getProfiles( session, model ) )
{
HashMap<ProjectVersionRef, Plugin> profileDeps = new HashMap<>();
if ( profile.getBuild() != null )
{
final PluginManagement pm = profile.getBuild().getPluginManagement();
if ( !( pm == null || pm.getPlugins() == null ) )
{
resolvePlugins( session, pm.getPlugins(), profileDeps );
}
}
resolvedProfileManagedPlugins.put( profile, profileDeps );
}
}
return resolvedProfileManagedPlugins;
}
示例8: getProjectPluginManagement
import org.apache.maven.model.PluginManagement; //导入方法依赖的package包/类
/**
* Returns all dependencies defined in dependency management of the root pom.
*
* @return
*/
private Set<Artifact> getProjectPluginManagement() {
Set<Artifact> result = new LinkedHashSet<Artifact>();
PluginManagement pluginManagement = getProject().getPluginManagement();
if (pluginManagement != null) {
for (Plugin plugin : pluginManagement.getPlugins()) {
result.add(toArtifact(plugin));
}
}
return result;
}