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


Java PluginExecution.setConfiguration方法代码示例

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


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

示例1: createPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
protected Plugin createPlugin(String groupId, String artifactId, String version, String configuration,
		String executionId, String goal, String phase) throws MavenExecutionException {
	Plugin plugin = new Plugin();
	plugin.setGroupId(groupId);
	plugin.setArtifactId(artifactId);
	plugin.setVersion(version);

	PluginExecution execution = new PluginExecution();
	execution.setId(executionId);
	execution.addGoal(goal);
	if (phase != null) {
		execution.setPhase(phase);
	}
	if (configuration != null) {
		execution.setConfiguration(mavenConfig.asXpp3Dom(configuration));
	}
	plugin.addExecution(execution);

	return plugin;
}
 
开发者ID:commsen,项目名称:EM,代码行数:21,代码来源:DynamicMavenPlugin.java

示例2: getEnforcerPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
public Plugin getEnforcerPlugin(MavenProject project)
        throws MavenExecutionException {
    StringBuilder configString = new StringBuilder()
            .append("<configuration><rules>")
            .append("<requireReleaseDeps><message>No Snapshots Allowed!</message><excludes><exclude>"+project.getGroupId()+":*</exclude></excludes></requireReleaseDeps>")
            .append("</rules></configuration>");
    Xpp3Dom config = null;
    try {
        config = Xpp3DomBuilder.build(new StringReader(configString.toString()));
    } catch (XmlPullParserException | IOException ex) {
        throw new MavenExecutionException("Issue creating cofig for enforcer plugin", ex);
    }

    PluginExecution execution = new PluginExecution();
    execution.setId("no-snapshot-deps");
    execution.addGoal("enforce");
    execution.setConfiguration(config);

    Plugin result = new Plugin();
    result.setArtifactId("maven-enforcer-plugin");
    result.setVersion("1.4.1");
    result.addExecution(execution);

    return result;
}
 
开发者ID:IG-Group,项目名称:cdversion-maven-extension,代码行数:26,代码来源:Plugins.java

示例3: testExecuteInParentWithConfigurationInExecution

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
/**
 * Test of execute method, of class RequirePropertyDiverges.
 */
@Test
public void testExecuteInParentWithConfigurationInExecution() throws EnforcerRuleException
{
    RequirePropertyDiverges mockInstance = createMockRule();
    final MavenProject project = createMavenProject( "company", "company-parent-pom" );
    final Build build = new Build();
    build.setPluginManagement( new PluginManagement() );
    final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0" );
    final Xpp3Dom configuration = createPluginConfiguration();
    PluginExecution pluginExecution = new PluginExecution();
    pluginExecution.setConfiguration( configuration );
    plugin.addExecution( pluginExecution );
    build.addPlugin( plugin );
    project.getOriginalModel().setBuild( build );
    setUpHelper(project, "parentValue");
    mockInstance.execute( helper );
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:21,代码来源:RequirePropertyDivergesTest.java

示例4: expand

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private void expand( List<Plugin> plugins )
{
    for ( Plugin plugin : plugins )
    {
        Xpp3Dom pluginConfiguration = (Xpp3Dom) plugin.getConfiguration();

        if ( pluginConfiguration != null )
        {
            for ( PluginExecution execution : plugin.getExecutions() )
            {
                Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();

                executionConfiguration =
                    Xpp3Dom.mergeXpp3Dom( executionConfiguration, new Xpp3Dom( pluginConfiguration ) );

                execution.setConfiguration( executionConfiguration );
            }
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:21,代码来源:DefaultPluginConfigurationExpander.java

示例5: getNewCompilerPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
protected Plugin getNewCompilerPlugin() {

        Plugin newCompilerPlugin = new Plugin();
        newCompilerPlugin.setGroupId(conf.get(ConfigurationKey.ALTERNATIVE_COMPILER_PLUGINS));
        newCompilerPlugin.setArtifactId(conf.get(ConfigurationKey.ALTERNATIVE_COMPILER_PLUGIN));
        newCompilerPlugin.setVersion(conf.get(ConfigurationKey.ALTERNATIVE_COMPILER_PLUGIN_VERSION));

        PluginExecution execution = new PluginExecution();
        execution.setId(MavenCLIArgs.COMPILE);
        execution.setGoals(Arrays.asList(MavenCLIArgs.COMPILE));
        execution.setPhase(MavenCLIArgs.COMPILE);

        Xpp3Dom compilerId = new Xpp3Dom(MavenConfig.MAVEN_COMPILER_ID);
        compilerId.setValue(compiler.name().toLowerCase());
        Xpp3Dom configuration = new Xpp3Dom(MavenConfig.MAVEN_PLUGIN_CONFIGURATION);
        configuration.addChild(compilerId);

        execution.setConfiguration(configuration);
        newCompilerPlugin.setExecutions(Arrays.asList(execution));

        return newCompilerPlugin;
    }
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:DefaultPomEditor.java

示例6: updateSourceFolder

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private static void updateSourceFolder(IProject project, MavenProject mavenProject, File mavenProjectSaveLocation) throws JavaModelException{
	Plugin sourcePluginEntry = createPluginEntry(mavenProject, "org.codehaus.mojo", "build-helper-maven-plugin", "1.8", false);
	PluginExecution pluginExecution=new PluginExecution();
	IPackageFragmentRoot[] sourceFoldersForProject =
	                                                 JavaUtils.getSourceFoldersForProject(project);
	if (sourceFoldersForProject.length > 0) {
		String sourceFolder =
		                      FileUtils.getRelativePath(mavenProjectSaveLocation.getParentFile(),
		                                                sourceFoldersForProject[0].getResource()
		                                                                          .getLocation()
		                                                                          .toFile()).replaceAll(Pattern.quote(File.separator), "/");
		mavenProject.getModel().getBuild().setSourceDirectory(sourceFolder);
		Xpp3Dom configurationNode = createMainConfigurationNode();
		pluginExecution.setConfiguration(configurationNode);
		Xpp3Dom sourcesNode = createXpp3Node(configurationNode, "sources");
		for (int i = 1; i < sourceFoldersForProject.length; i++) {
			IPackageFragmentRoot packageFragmentRoot = sourceFoldersForProject[i];
			File sourceDirectory = packageFragmentRoot.getResource().getLocation().toFile();
			String relativePath =
			                      FileUtils.getRelativePath(mavenProjectSaveLocation.getParentFile(),
			                                                sourceDirectory).replaceAll(Pattern.quote(File.separator), "/");
			Xpp3Dom sourceNode = createXpp3Node(sourcesNode, "source");
			sourceNode.setValue(relativePath);
		}
		sourcePluginEntry.addExecution(pluginExecution);
       }
	
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:29,代码来源:MavenUtils.java

示例7: mergePluginExecutionDefinitions

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private static void mergePluginExecutionDefinitions( PluginExecution child, PluginExecution parent )
{
    if ( child.getPhase() == null )
    {
        child.setPhase( parent.getPhase() );
    }

    List<String> parentGoals = parent.getGoals();
    List<String> childGoals = child.getGoals();

    List<String> goals = new ArrayList<String>();

    if ( ( childGoals != null ) && !childGoals.isEmpty() )
    {
        goals.addAll( childGoals );
    }

    if ( parentGoals != null )
    {
        for (  String goal : parentGoals )
        {
            if ( !goals.contains( goal ) )
            {
                goals.add( goal );
            }
        }
    }

    child.setGoals( goals );

    Xpp3Dom childConfiguration = (Xpp3Dom) child.getConfiguration();
    Xpp3Dom parentConfiguration = (Xpp3Dom) parent.getConfiguration();

    childConfiguration = Xpp3Dom.mergeXpp3Dom( childConfiguration, parentConfiguration );

    child.setConfiguration( childConfiguration );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:38,代码来源:ModelUtils.java


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