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


Java BuildBase类代码示例

本文整理汇总了Java中org.apache.maven.model.BuildBase的典型用法代码示例。如果您正苦于以下问题:Java BuildBase类的具体用法?Java BuildBase怎么用?Java BuildBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: updateBuildBase

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
/**
 * Method updateBuildBase
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateBuildBase( BuildBase value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "defaultGoal", value.getDefaultGoal(), null );
        iterateResource( innerCount, root, value.getResources(), "resources", "resource" );
        iterateResource( innerCount, root, value.getTestResources(), "testResources", "testResource" );
        findAndReplaceSimpleElement( innerCount, root, "directory", value.getDirectory(), null );
        findAndReplaceSimpleElement( innerCount, root, "finalName", value.getFinalName(), null );
        findAndReplaceSimpleLists( innerCount, root, value.getFilters(), "filters", "filter" );
        updatePluginManagement( value.getPluginManagement(), "pluginManagement", innerCount, root );
        iteratePlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" );
    }
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:26,代码来源:MavenJDOMWriter.java

示例2: getSnapshotsFromManagement

import org.apache.maven.model.BuildBase; //导入依赖的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

示例3: getSnapshots

import org.apache.maven.model.BuildBase; //导入依赖的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

示例4: getDefinedActiveBuilds

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
private Set<BuildBase> getDefinedActiveBuilds(MavenProject project) {
    HashSet<BuildBase> activeBuilds = new HashSet<>();
    final Model originalModel = project.getOriginalModel();
    final Build build = originalModel.getBuild();
    activeBuilds.add(build);

    final List<Profile> originalProfiles = originalModel.getProfiles();
    if (originalProfiles != null) {
        for (Profile profile : project.getActiveProfiles()) {
            // check active profile is defined in project
            for (Profile originalProfile : originalProfiles) {
                if (originalProfile.equals(profile)) {
                    activeBuilds.add(originalProfile.getBuild());
                }
            }
        }
    }
    // remove possible null entries
    activeBuilds.remove(null);
    return activeBuilds;
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:22,代码来源:AbstractRule.java

示例5: getPluginMap

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
public Map<String, Plugin> getPluginMap( final ModelBase base )
{
    final BuildBase build;
    if ( base instanceof Model )
    {
        build = ( (Model) base ).getBuild();
    }
    else
    {
        build = ( (Profile) base ).getBuild();
    }

    if ( build == null )
    {
        return Collections.emptyMap();
    }

    final Map<String, Plugin> result = build.getPluginsAsMap();
    if ( result == null )
    {
        return Collections.emptyMap();
    }

    return result;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:26,代码来源:Project.java

示例6: mergeBuildBase_Filters

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
@Override
protected void mergeBuildBase_Filters( BuildBase target, BuildBase source, boolean sourceDominant,
                                       Map<Object, Object> context )
{
    List<String> src = source.getFilters();
    if ( !src.isEmpty() )
    {
        List<String> tgt = target.getFilters();
        Set<String> excludes = new LinkedHashSet<String>( tgt );
        List<String> merged = new ArrayList<String>( tgt.size() + src.size() );
        merged.addAll( tgt );
        for ( String s : src )
        {
            if ( !excludes.contains( s ) )
            {
                merged.add( s );
            }
        }
        target.setFilters( merged );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:22,代码来源:MavenModelMerger.java

示例7: getSnapshotsFromManagement

import org.apache.maven.model.BuildBase; //导入依赖的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.BuildBase; //导入依赖的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: ruleDefinedInProject

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
private boolean ruleDefinedInProject(MavenProject project) {
    for (BuildBase activeBuild : getDefinedActiveBuilds(project)) {
        final Plugin plugin = activeBuild.getPluginsAsMap().get("org.apache.maven.plugins:maven-enforcer-plugin");
        if (plugin != null) {
            for (PluginExecution execution : plugin.getExecutions()) {
                if (isRuleInConfiguration(execution, this.getClass().getSimpleName())) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:14,代码来源:AbstractRule.java

示例10: convertBaseBuild

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
private static void convertBaseBuild(
    BuildBase build, MavenBuildBase mavenBuild, File projectDir) {
  mavenBuild.setDefaultGoal(build.getDefaultGoal());
  mavenBuild.setDirectory(relativize(projectDir, build.getDirectory()));
  mavenBuild.setFinalName(build.getFinalName());
  mavenBuild.setResources(convenrtResources(build.getResources(), projectDir));
  mavenBuild.setTestResources(convenrtResources(build.getTestResources(), projectDir));
  List<String> filters = build.getFilters();
  if (filters == null) {
    mavenBuild.setFilters(Collections.emptyList());
  } else {
    mavenBuild.setFilters(filters);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:15,代码来源:MavenModelUtil.java

示例11: convertToMavenBuildBase

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
private static void convertToMavenBuildBase(
    MavenBuildBase modelBuild, BuildBase build, File projectDir) {
  build.setFinalName(modelBuild.getFinalName());
  build.setDefaultGoal(modelBuild.getDefaultGoal());
  build.setDirectory(relativize(projectDir, modelBuild.getDirectory()));
  build.setFilters(modelBuild.getFilters());
  build.setResources(convertToMavenResources(modelBuild.getResources(), projectDir));
  build.setTestResources(convertToMavenResources(modelBuild.getTestResources(), projectDir));
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:MavenModelUtil.java

示例12: assertSkip

import org.apache.maven.model.BuildBase; //导入依赖的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

示例13: mergeBuildBase

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
protected void mergeBuildBase( BuildBase target, BuildBase source, boolean sourceDominant,
                               Map<Object, Object> context )
{
    mergePluginConfiguration( target, source, sourceDominant, context );
    mergeBuildBase_DefaultGoal( target, source, sourceDominant, context );
    mergeBuildBase_FinalName( target, source, sourceDominant, context );
    mergeBuildBase_Directory( target, source, sourceDominant, context );
    mergeBuildBase_Resources( target, source, sourceDominant, context );
    mergeBuildBase_TestResources( target, source, sourceDominant, context );
    mergeBuildBase_Filters( target, source, sourceDominant, context );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:12,代码来源:ModelMerger.java

示例14: mergeBuildBase_DefaultGoal

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
protected void mergeBuildBase_DefaultGoal( BuildBase target, BuildBase source, boolean sourceDominant,
                                           Map<Object, Object> context )
{
    String src = source.getDefaultGoal();
    if ( src != null )
    {
        if ( sourceDominant || target.getDefaultGoal() == null )
        {
            target.setDefaultGoal( src );
            target.setLocation( "defaultGoal", source.getLocation( "defaultGoal" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例15: mergeBuildBase_Directory

import org.apache.maven.model.BuildBase; //导入依赖的package包/类
protected void mergeBuildBase_Directory( BuildBase target, BuildBase source, boolean sourceDominant,
                                         Map<Object, Object> context )
{
    String src = source.getDirectory();
    if ( src != null )
    {
        if ( sourceDominant || target.getDirectory() == null )
        {
            target.setDirectory( src );
            target.setLocation( "directory", source.getLocation( "directory" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java


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