當前位置: 首頁>>代碼示例>>Java>>正文


Java Plugin.getExecutions方法代碼示例

本文整理匯總了Java中org.apache.maven.model.Plugin.getExecutions方法的典型用法代碼示例。如果您正苦於以下問題:Java Plugin.getExecutions方法的具體用法?Java Plugin.getExecutions怎麽用?Java Plugin.getExecutions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.model.Plugin的用法示例。


在下文中一共展示了Plugin.getExecutions方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPluginExecutions

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
/** @see org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator */
private static @NonNull List<PluginExecution> getPluginExecutions(@NonNull Plugin plug, @NullAllowed String goal) {
    if (goal == null) {
        return Collections.emptyList();
    }
    List<PluginExecution> exes = new ArrayList<PluginExecution>();
    for (PluginExecution exe : plug.getExecutions()) {
        if (exe.getGoals().contains(goal) || /* #179328: Maven 2.2.0+ */ ("default-" + goal).equals(exe.getId())) {
            exes.add(exe);
        }
    }
    Collections.sort(exes, new Comparator<PluginExecution>() {
        @Override public int compare(PluginExecution e1, PluginExecution e2) {
            return e2.getPriority() - e1.getPriority();
        }
    });
    return exes;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:PluginPropertyUtils.java

示例2: getRuleConfigurations

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
/**
 * Returns the list of <tt>requirePropertyDiverges</tt> configurations from the map of plugins.
 *
 * @param plugins
 * @return list of requirePropertyDiverges configurations.
 */
List<Xpp3Dom> getRuleConfigurations( final Map<String, Plugin> plugins )
{
    if ( plugins.containsKey( MAVEN_ENFORCER_PLUGIN ) )
    {
        final List<Xpp3Dom> ruleConfigurations = new ArrayList<Xpp3Dom>();

        final Plugin enforcer = plugins.get( MAVEN_ENFORCER_PLUGIN );
        final Xpp3Dom configuration = ( Xpp3Dom ) enforcer.getConfiguration();

        // add rules from plugin configuration
        addRules( configuration, ruleConfigurations );

        // add rules from all plugin execution configurations
        for ( Object execution : enforcer.getExecutions() )
        {
            addRules( ( Xpp3Dom ) ( ( PluginExecution ) execution ).getConfiguration(), ruleConfigurations );
        }

        return ruleConfigurations;
    }
    else
    {
        return new ArrayList();
    }
}
 
開發者ID:mojohaus,項目名稱:extra-enforcer-rules,代碼行數:32,代碼來源:RequirePropertyDiverges.java

示例3: visitBuildPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void visitBuildPlugin( ModelVisitor visitor, Plugin plugin )
{
    List<PluginExecution> executions = plugin.getExecutions();
    if ( executions != null )
    {
        ListIterator<PluginExecution> executionIterator = executions.listIterator();
        while ( executionIterator.hasNext() )
        {
            PluginExecution execution = executionIterator.next();
            visitor.visitBuildPluginExecution( execution );
            visitBuildPluginExecution( visitor, execution );
            execution = visitor.replaceBuildPluginExecution( execution );
            if ( execution == null )
                executionIterator.remove();
            else
                executionIterator.set( execution );
        }
    }

    List<Dependency> dependencies = plugin.getDependencies();
    if ( dependencies != null )
    {
        ListIterator<Dependency> dependencyIterator = dependencies.listIterator();
        while ( dependencyIterator.hasNext() )
        {
            Dependency dependency = dependencyIterator.next();
            visitor.visitBuildPluginDependency( dependency );
            visitBuildPluginDependency( visitor, dependency );
            dependency = visitor.replaceBuildPluginDependency( dependency );
            if ( dependency == null )
                dependencyIterator.remove();
            else
                dependencyIterator.set( dependency );
        }
    }
}
 
開發者ID:fedora-java,項目名稱:xmvn,代碼行數:37,代碼來源:DefaultModelProcessor.java

示例4: visitBuildPluginManagementPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void visitBuildPluginManagementPlugin( ModelVisitor visitor, Plugin plugin )
{
    List<PluginExecution> executions = plugin.getExecutions();
    if ( executions != null )
    {
        ListIterator<PluginExecution> executionIterator = executions.listIterator();
        while ( executionIterator.hasNext() )
        {
            PluginExecution execution = executionIterator.next();
            visitor.visitBuildPluginManagementPluginExecution( execution );
            visitBuildPluginManagementPluginExecution( visitor, execution );
            execution = visitor.replaceBuildPluginManagementPluginExecution( execution );
            if ( execution == null )
                executionIterator.remove();
            else
                executionIterator.set( execution );
        }
    }

    List<Dependency> dependencies = plugin.getDependencies();
    if ( dependencies != null )
    {
        ListIterator<Dependency> dependencyIterator = dependencies.listIterator();
        while ( dependencyIterator.hasNext() )
        {
            Dependency dependency = dependencyIterator.next();
            visitor.visitBuildPluginManagementPluginDependency( dependency );
            visitBuildPluginManagementPluginDependency( visitor, dependency );
            dependency = visitor.replaceBuildPluginManagementPluginDependency( dependency );
            if ( dependency == null )
                dependencyIterator.remove();
            else
                dependencyIterator.set( dependency );
        }
    }
}
 
開發者ID:fedora-java,項目名稱:xmvn,代碼行數:37,代碼來源:DefaultModelProcessor.java

示例5: visitProfileBuildPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void visitProfileBuildPlugin( ModelVisitor visitor, Plugin plugin )
{
    List<PluginExecution> executions = plugin.getExecutions();
    if ( executions != null )
    {
        ListIterator<PluginExecution> executionIterator = executions.listIterator();
        while ( executionIterator.hasNext() )
        {
            PluginExecution execution = executionIterator.next();
            visitor.visitProfileBuildPluginExecution( execution );
            visitProfileBuildPluginExecution( visitor, execution );
            execution = visitor.replaceProfileBuildPluginExecution( execution );
            if ( execution == null )
                executionIterator.remove();
            else
                executionIterator.set( execution );
        }
    }

    List<Dependency> dependencies = plugin.getDependencies();
    if ( dependencies != null )
    {
        ListIterator<Dependency> dependencyIterator = dependencies.listIterator();
        while ( dependencyIterator.hasNext() )
        {
            Dependency dependency = dependencyIterator.next();
            visitor.visitProfileBuildPluginDependency( dependency );
            visitProfileBuildPluginDependency( visitor, dependency );
            dependency = visitor.replaceProfileBuildPluginDependency( dependency );
            if ( dependency == null )
                dependencyIterator.remove();
            else
                dependencyIterator.set( dependency );
        }
    }
}
 
開發者ID:fedora-java,項目名稱:xmvn,代碼行數:37,代碼來源:DefaultModelProcessor.java

示例6: visitProfileBuildPluginManagementPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void visitProfileBuildPluginManagementPlugin( ModelVisitor visitor, Plugin plugin )
{
    List<PluginExecution> executions = plugin.getExecutions();
    if ( executions != null )
    {
        ListIterator<PluginExecution> executionIterator = executions.listIterator();
        while ( executionIterator.hasNext() )
        {
            PluginExecution execution = executionIterator.next();
            visitor.visitProfileBuildPluginManagementPluginExecution( execution );
            visitProfileBuildPluginManagementPluginExecution( visitor, execution );
            execution = visitor.replaceProfileBuildPluginManagementPluginExecution( execution );
            if ( execution == null )
                executionIterator.remove();
            else
                executionIterator.set( execution );
        }
    }

    List<Dependency> dependencies = plugin.getDependencies();
    if ( dependencies != null )
    {
        ListIterator<Dependency> dependencyIterator = dependencies.listIterator();
        while ( dependencyIterator.hasNext() )
        {
            Dependency dependency = dependencyIterator.next();
            visitor.visitProfileBuildPluginManagementPluginDependency( dependency );
            visitProfileBuildPluginManagementPluginDependency( visitor, dependency );
            dependency = visitor.replaceProfileBuildPluginManagementPluginDependency( dependency );
            if ( dependency == null )
                dependencyIterator.remove();
            else
                dependencyIterator.set( dependency );
        }
    }
}
 
開發者ID:fedora-java,項目名稱:xmvn,代碼行數:37,代碼來源:DefaultModelProcessor.java

示例7: ruleDefinedInProject

import org.apache.maven.model.Plugin; //導入方法依賴的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

示例8: attachWsdl

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void attachWsdl()
    throws IOException
{
    File target = new File( project.getBuild().getDirectory() );
    if ( !"war".equalsIgnoreCase( project.getPackaging() ) )
    {
        // META-INF/wsdl for jar etc packagings
        target = new File( project.getBuild().getOutputDirectory(), "META-INF/wsdl" );
    }
    else
    {
        // WEB-INF/wsdl for war
        String targetPath = null;
        Plugin war = project.getBuild().getPluginsAsMap().get( "org.apache.maven.plugins:maven-war-plugin" );
        for ( PluginExecution exec : war.getExecutions() )
        {
            // check execution/configuration
            String s = getWebappDirectory( exec.getConfiguration() );
            if ( s != null )
            {
                targetPath = s;
                break;
            }
        }
        if ( targetPath == null )
        {
            // check global plugin configuration
            targetPath = getWebappDirectory( war.getConfiguration() );
        }
        target =
            targetPath != null ? new File( targetPath ) : new File( target, project.getBuild().getFinalName() );
        target = new File( target, "WEB-INF/wsdl" );
    }
    if ( !target.mkdirs() && !target.exists() )
    {
        getLog().warn( "Cannot create directory: " + target.getAbsolutePath() );
    }
    getLog().debug( "Packaging WSDL(s) to: " + target );
    FileUtils.copyDirectory( getResourceDestDir(), target );
}
 
開發者ID:mojohaus,項目名稱:jaxws-maven-plugin,代碼行數:41,代碼來源:MainWsGenMojo.java

示例9: configureCompiler

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void configureCompiler( Plugin plugin )
{
    boolean minSourceSpecified = false;
    BigDecimal minSource = new BigDecimal( "1.6" );
    String compilerSource = configurator.getConfiguration().getBuildSettings().getCompilerSource();
    if ( compilerSource != null )
    {
        minSourceSpecified = true;
        minSource = new BigDecimal( compilerSource );
    }

    Collection<Object> configurations = new LinkedList<>();
    configurations.add( plugin.getConfiguration() );

    Collection<PluginExecution> executions = plugin.getExecutions();
    for ( PluginExecution exec : executions )
        configurations.add( exec.getConfiguration() );

    for ( Object configObj : configurations )
    {
        try
        {
            Xpp3Dom config = (Xpp3Dom) configObj;
            BigDecimal source = new BigDecimal( config.getChild( "source" ).getValue().trim() );
            BigDecimal target = new BigDecimal( config.getChild( "target" ).getValue().trim() );

            // Source must be at least 1.6
            if ( minSourceSpecified || source.compareTo( minSource ) < 0 )
                source = minSource;

            // Target must not be less than source
            if ( target.compareTo( source ) < 0 )
                target = source;

            config.getChild( "source" ).setValue( source.toString() );
            config.getChild( "target" ).setValue( target.toString() );
        }
        catch ( NullPointerException | NumberFormatException e )
        {
        }
    }
}
 
開發者ID:fedora-java,項目名稱:xmvn,代碼行數:43,代碼來源:XMvnModelValidator.java


注:本文中的org.apache.maven.model.Plugin.getExecutions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。