Package org.apache.maven.model

Examples of org.apache.maven.model.Build


   private List<MavenPlugin> listConfiguredPlugins(boolean managedPlugin)
   {
      List<MavenPlugin> plugins = new ArrayList<MavenPlugin>();
      MavenCoreFacet mavenCoreFacet = project.getFacet(MavenCoreFacet.class);
      Build build = mavenCoreFacet.getPOM().getBuild();
      List<org.apache.maven.model.Plugin> pomPlugins = getPluginsPOM(build, managedPlugin);
      for (org.apache.maven.model.Plugin plugin : pomPlugins)
      {
         MavenPluginAdapter adapter = new MavenPluginAdapter(plugin);
         MavenPluginBuilder pluginBuilder = MavenPluginBuilder
View Full Code Here


   private void addPlugin(final MavenPlugin plugin, boolean managedPlugin)
   {
      MavenCoreFacet mavenCoreFacet = project.getFacet(MavenCoreFacet.class);
      Model pom = mavenCoreFacet.getPOM();
      Build build = pom.getBuild();
      if (build == null)
         build = new Build();
      if (managedPlugin)
      {
         PluginManagement pluginManagement = build.getPluginManagement();
         if (pluginManagement == null)
         {
            pluginManagement = new PluginManagement();
            build.setPluginManagement(pluginManagement);
         }
         pluginManagement.addPlugin(new MavenPluginAdapter(plugin));
      }
      else
      {
         build.addPlugin(new MavenPluginAdapter(plugin));
      }
      pom.setBuild(build);
      mavenCoreFacet.setPOM(pom);
   }
View Full Code Here

   private void removePlugin(final Dependency dependency, boolean managedPlugin)
   {
      MavenCoreFacet mavenCoreFacet = project.getFacet(MavenCoreFacet.class);
      Model pom = mavenCoreFacet.getPOM();
      Build build = pom.getBuild();
      List<org.apache.maven.model.Plugin> pomPlugins = getPluginsPOM(build, managedPlugin);
      Iterator<Plugin> it = pomPlugins.iterator();
      while (it.hasNext())
      {
         org.apache.maven.model.Plugin pomPlugin = it.next();
View Full Code Here

   private void updatePlugin(final MavenPlugin plugin, boolean managedPlugin)
   {
      MavenCoreFacet mavenCoreFacet = project.getFacet(MavenCoreFacet.class);
      Model pom = mavenCoreFacet.getPOM();
      Build build = pom.getBuild();
      List<org.apache.maven.model.Plugin> pomPlugins = getPluginsPOM(build, managedPlugin);
      for (org.apache.maven.model.Plugin pomPlugin : pomPlugins)
      {
         Dependency pluginDep = DependencyBuilder.create().setGroupId(pomPlugin.getGroupId())
                  .setArtifactId(pomPlugin.getArtifactId());
View Full Code Here

    public PluginManagement getPluginManagement()
    {
        PluginManagement pluginMgmt = null;

        Build build = getModel().getBuild();
        if ( build != null )
        {
            pluginMgmt = build.getPluginManagement();
        }

        return pluginMgmt;
    }
View Full Code Here

        return pluginMgmt;
    }

    private Build getModelBuild()
    {
        Build build = getModel().getBuild();

        if ( build == null )
        {
            build = new Build();

            getModel().setBuild( build );
        }

        return build;
View Full Code Here

        return hash;
    }

    public List<Extension> getBuildExtensions()
    {
        Build build = getBuild();
        if ( ( build == null ) || ( build.getExtensions() == null ) )
        {
            return Collections.emptyList();
        }
        else
        {
            return build.getExtensions();
        }
    }
View Full Code Here

    {
        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;
    }
View Full Code Here

        Map<String, String> managedVersions = new HashMap<String, String>();

        for ( int i = lineage.size() - 1; i >= 0; i-- )
        {
            Model model = lineage.get( i ).getModel();
            Build build = model.getBuild();
            if ( build != null )
            {
                for ( Plugin plugin : build.getPlugins() )
                {
                    String key = plugin.getKey();
                    if ( versions.get( key ) == null )
                    {
                        versions.put( key, plugin.getVersion() );
                        plugins.put( key, plugin );
                    }
                }
                PluginManagement mngt = build.getPluginManagement();
                if ( mngt != null )
                {
                    for ( Plugin plugin : mngt.getPlugins() )
                    {
                        String key = plugin.getKey();
View Full Code Here

                                             project.getPackaging() );
        project.setArtifact( projectArtifact );

        if ( project.getFile() != null )
        {
            Build build = project.getBuild();
            project.addScriptSourceRoot( build.getScriptSourceDirectory() );
            project.addCompileSourceRoot( build.getSourceDirectory() );
            project.addTestCompileSourceRoot( build.getTestSourceDirectory() );
        }

        List<Profile> activeProfiles = new ArrayList<Profile>();
        activeProfiles.addAll( result.getActivePomProfiles( result.getModelIds().get( 0 ) ) );
        activeProfiles.addAll( result.getActiveExternalProfiles() );
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Build

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.