本文整理汇总了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;
}
示例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();
}
}
示例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 );
}
}
}
示例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 );
}
}
}
示例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 );
}
}
}
示例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 );
}
}
}
示例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;
}
示例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 );
}
示例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 )
{
}
}
}