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


Java Plugin.setVersion方法代码示例

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


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

示例1: createPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的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.Plugin; //导入方法依赖的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: getOrCreateResourcesPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin getOrCreateResourcesPlugin(Model mavenModel) {

		Build build = getOrCreateBuild(mavenModel);

		// Locate the plugin and returns if exists
		for (Iterator<Plugin> iterator = build.getPlugins().iterator(); iterator.hasNext();) {
			Plugin next = iterator.next();
			if ("maven-resources-plugin".equals(next.getArtifactId())) {
				return next;
			}
		}

		// Creates if couldn't be found.
		Plugin resourcesPlugin = new Plugin();
		resourcesPlugin.setGroupId("org.apache.maven.plugins");
		resourcesPlugin.setArtifactId("maven-resources-plugin");
		resourcesPlugin.setVersion("${maven.resources.plugin.version}");
		build.getPlugins().add(resourcesPlugin);
		return resourcesPlugin;
	}
 
开发者ID:awltech,项目名称:eclipse-asciidoctools,代码行数:21,代码来源:MavenEnablerJob.java

示例4: addPluginExecutions

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private void addPluginExecutions(MavenProject project) throws MavenExecutionException {
	Properties properties = new Properties();
	try {
		properties.load(this.getClass().getResourceAsStream("version.properties"));
	} catch (IOException e) {
		throw new MavenExecutionException("Could not read plugin properties", e);
	}
	Plugin plugin = new Plugin();
	plugin.setGroupId(properties.getProperty("groupId"));
	plugin.setArtifactId(properties.getProperty("artifactId"));
	plugin.setVersion(properties.getProperty("version"));
	addPluginExecution(plugin, "compile", Phase.GENERATE_SOURCES);
	addPluginExecution(plugin, "compile", Phase.PRE_SITE);
	Phase[] lifecyclePhases = Phase.values();
	for (int i = 0; i < lifecyclePhases.length; i++) {
		addPluginExecution(plugin, "execute", lifecyclePhases[i]);
	}
	project.getBuild().addPlugin(plugin);
}
 
开发者ID:javabuild,项目名称:builder-parent,代码行数:20,代码来源:MavenBuilderExtension.java

示例5: update

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private Plugin update(final org.guvnor.common.services.project.model.Plugin from,
                      final Plugin to) {

    to.setGroupId(from.getGroupId());
    to.setArtifactId(from.getArtifactId());
    to.setVersion(from.getVersion());

    // false is the default value, so we only set it if value is true
    if (from.isExtensions()) {
        to.setExtensions(from.isExtensions());
    } else {
        to.setExtensions(null);
    }

    new DependencyUpdater(to.getDependencies()).updateDependencies(from.getDependencies());

    return to;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:MavenPluginUpdater.java

示例6: prepareBuildWithSurefirePlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
static Build prepareBuildWithSurefirePlugin(String version) {
    Plugin surefirePlugin = new Plugin();
    surefirePlugin.setArtifactId(ApplicablePlugins.SUREFIRE.getArtifactId());
    surefirePlugin.setVersion(version);

    Build build = new Build();
    build.addPlugin(surefirePlugin);

    return build;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:11,代码来源:ModelUtil.java

示例7: getVersionFixPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
public Plugin getVersionFixPlugin() {
    PluginExecution execution = new PluginExecution();
    execution.setId("versionfix");
    execution.addGoal("versionfix");

    Plugin result = new Plugin();
    result.setGroupId("com.iggroup.maven.cdversion");
    result.setArtifactId("versionfix-maven-plugin");
    result.setVersion("${project.version}");
    result.addExecution(execution);
    
    return result;
}
 
开发者ID:IG-Group,项目名称:cdversion-maven-extension,代码行数:14,代码来源:Plugins.java

示例8: getBuildWithDockerPluginDefinition

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static void getBuildWithDockerPluginDefinition(Model model) {
    Build build = new Build();
    model.setBuild(build);
    Plugin plugin = new Plugin();
    plugin.setGroupId("io.fabric8");
    plugin.setArtifactId("docker-maven-plugin");
    plugin.setVersion("0.14.2");
    build.addPlugin(plugin);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-maven-plugin,代码行数:10,代码来源:MavenModelUtils.java

示例9: getSurefirePlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin getSurefirePlugin() {
    final Plugin surefirePlugin = new Plugin();
    surefirePlugin.setGroupId("org.apache.maven.plugins");
    surefirePlugin.setArtifactId("maven-surefire-plugin");
    surefirePlugin.setVersion("2.19.1");
    final Xpp3Dom mavenPluginConfiguration = new Xpp3Dom("configuration");
    final Xpp3Dom skipTests = new Xpp3Dom("skipTests");
    skipTests.setValue("${skipTests}");
    mavenPluginConfiguration.addChild(skipTests);

    surefirePlugin.setConfiguration(mavenPluginConfiguration);
    return surefirePlugin;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-maven-plugin,代码行数:14,代码来源:MavenModelUtils.java

示例10: createPluginAndInitPropertyResolver

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin createPluginAndInitPropertyResolver(String version, String resolverOutput) {
  Mockito.when(propertyResolver.expandPropertyReferences(version)).thenReturn(resolverOutput);

  Plugin p = new Plugin();
  p.setVersion(version);
  return p;
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:8,代码来源:IsSnapshotPluginTest.java

示例11: createPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static Plugin createPlugin(String gid, String aid, String version) {
  Plugin p = new Plugin();
  p.setGroupId(gid);
  p.setArtifactId(aid);
  p.setVersion(version);
  return p;
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:8,代码来源:PluginToStringTest.java

示例12: loadPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
Plugin loadPlugin(Xpp3Dom pluginDef) {
    String groupId = pluginDef.getChild("groupId").getValue();
    String artifactId = pluginDef.getChild("artifactId").getValue();
    String version = pluginDef.getChild("version").getValue();
    Plugin plugin = new Plugin();
    plugin.setGroupId(groupId);
    plugin.setArtifactId(artifactId);
    plugin.setVersion(version);
    return plugin;
}
 
开发者ID:apache,项目名称:karaf-boot,代码行数:11,代码来源:GenerateMojo.java

示例13: getMavenBundleMojo

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private MojoDescriptor getMavenBundleMojo() throws Exception {
    Plugin plugin = new Plugin();
    plugin.setGroupId("org.apache.felix");
    plugin.setArtifactId("maven-bundle-plugin");
    plugin.setVersion("3.0.0");
    plugin.setInherited(true);
    plugin.setExtensions(true);
    PluginDescriptor desc = pluginManager.loadPlugin(plugin, mavenProject.getRemotePluginRepositories(), mavenSession.getRepositorySession());
    return desc.getMojo("bundle");
}
 
开发者ID:apache,项目名称:karaf-boot,代码行数:11,代码来源:GenerateMojo.java

示例14: updatePluginVersion

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
protected void updatePluginVersion(Model model) {
	for (Plugin plugin : model.getBuild().getPluginManagement().getPlugins()) {
		if (plugin.getKey().equals(pluginDescriptor.getPluginLookupKey())) {
			plugin.setVersion(pluginDescriptor.getVersion());
		}
	}
}
 
开发者ID:fastconnect,项目名称:tibco-bwmaven,代码行数:8,代码来源:AbstractPOMGenerator.java

示例15: newPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
static Plugin newPlugin( String groupId, String artifactId, String version )
{
    Plugin plugin = new Plugin();
    plugin.setArtifactId( artifactId );
    plugin.setGroupId( groupId );
    plugin.setVersion( version );
    return plugin;
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:9,代码来源:RequirePropertyDivergesTest.java


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