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


Java Profile.getBuild方法代码示例

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


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

示例1: getSnapshotsFromManagement

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshotsFromManagement(Profile profile,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
  Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
  BuildBase build = profile.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;
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:21,代码来源:CheckPluginDependencyVersions.java

示例2: getSnapshots

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshots(Profile profile,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
  Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
  BuildBase build = profile.getBuild();
  if (build != null) {
    for (Plugin plugin : build.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;
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:18,代码来源:CheckPluginDependencyVersions.java

示例3: getResolvedProfilePlugins

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
/**
 * This method will scan the plugins 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>> getResolvedProfilePlugins( MavenSessionHandler session )
                throws ManipulationException
{
    if ( resolvedProfilePlugins == null )
    {
        resolvedProfilePlugins = new HashMap<>();

        for ( final Profile profile : ProfileUtils.getProfiles( session, model ) )
        {
            HashMap<ProjectVersionRef, Plugin> profileDeps = new HashMap<>();

            if ( profile.getBuild() != null )
            {
                resolvePlugins( session, profile.getBuild().getPlugins(), profileDeps );

            }
            resolvedProfilePlugins.put( profile, profileDeps );
        }
    }
    return resolvedProfilePlugins;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:32,代码来源:Project.java

示例4: getResolvedProfileManagedPlugins

import org.apache.maven.model.Profile; //导入方法依赖的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;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:35,代码来源:Project.java

示例5: apply

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private boolean apply( final Project project, final Model model )
{
    final PluginRemovalState state = session.getState( PluginRemovalState.class );

    logger.debug( "Applying plugin changes to: " + ga( project ) );

    boolean result = false;
    List<ProjectRef> pluginsToRemove = state.getPluginRemoval();
    if ( model.getBuild() != null )
    {
        result = scanPlugins( pluginsToRemove, model.getBuild().getPlugins() );
    }

    for ( final Profile profile : ProfileUtils.getProfiles( session, model) )
    {
        if ( profile.getBuild() != null && scanPlugins( pluginsToRemove, profile.getBuild().getPlugins() ) )
        {
            result = true;
        }
    }
    return result;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:23,代码来源:PluginRemovalManipulator.java

示例6: injectProfile

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
public void injectProfile( Model model, Profile profile, ModelBuildingRequest request,
                           ModelProblemCollector problems )
{
    if ( profile != null )
    {
        merger.mergeModelBase( model, profile );

        if ( profile.getBuild() != null )
        {
            if ( model.getBuild() == null )
            {
                model.setBuild( new Build() );
            }
            merger.mergeBuildBase( model.getBuild(), profile.getBuild() );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:18,代码来源:DefaultProfileInjector.java

示例7: getSnapshotsFromManagement

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
  BuildBase build = profile.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();
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:14,代码来源:CheckPluginVersions.java

示例8: getSnapshots

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private Set<ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
  BuildBase build = profile.getBuild();
  if (build != null) {
    Collection<Plugin> snapshots = Collections2.filter(build.getPlugins(), new IsSnapshotPlugin(propertyResolver));
    return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
  }
  return Collections.emptySet();
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:10,代码来源:CheckPluginVersions.java

示例9: convertProfiles

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private static List<MavenProfile> convertProfiles(List<Profile> profiles, File projectDir) {
  List<MavenProfile> result = new ArrayList<>();

  if (profiles != null) {
    for (Profile profile : profiles) {
      if (profile.getId() == null) {
        continue;
      }

      MavenProfile mavenProfile = new MavenProfile(profile.getId(), profile.getSource());
      List<String> modules = profile.getModules();
      if (modules == null) {
        mavenProfile.setModules(Collections.emptyList());
      } else {
        mavenProfile.setModules(modules);
      }

      mavenProfile.setActivation(convertActivation(profile.getActivation()));
      if (profile.getBuild() != null) {
        convertBaseBuild(profile.getBuild(), mavenProfile.getBuild(), projectDir);
      }
      result.add(mavenProfile);
    }
  }

  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:MavenModelUtil.java

示例10: assertSkip

import org.apache.maven.model.Profile; //导入方法依赖的package包/类
private void assertSkip( final Model model, final String profileId, final boolean deploy, final boolean state )
{
    BuildBase build = null;
    if ( profileId != null )
    {
        final List<Profile> profiles = model.getProfiles();
        if ( profiles != null )
        {
            for ( final Profile profile : profiles )
            {
                if ( profileId.equals( profile.getId() ) )
                {
                    build = profile.getBuild();
                }
            }
        }
    }
    else
    {
        build = model.getBuild();
    }

    assertThat( build, notNullValue() );

    final Plugin plugin =
        build.getPluginsAsMap()
             .get( ga( MAVEN_PLUGIN_GROUPID, deploy ? MAVEN_DEPLOY_ARTIFACTID : MAVEN_INSTALL_ARTIFACTID ) );

    assertThat( plugin, notNullValue() );

    assertThat( plugin.getConfiguration()
                      .toString()
                      .contains( "<skip>" + state + "</skip>" ), equalTo( true ) );
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:35,代码来源:DistributionEnforcingManipulatorTest.java


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