本文整理了Java中org.apache.maven.model.Plugin.setVersion()
方法的一些代码示例,展示了Plugin.setVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.setVersion()
方法的具体详情如下:
包路径:org.apache.maven.model.Plugin
类名称:Plugin
方法名:setVersion
[英]Set the version (or valid range of versions) of the plugin to be used.
[中]设置要使用的插件的版本(或有效版本范围)。
代码示例来源:origin: apache/maven
protected void mergePlugin_Version( Plugin target, Plugin source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getVersion();
if ( src != null )
{
if ( sourceDominant || target.getVersion() == null )
{
target.setVersion( src );
target.setLocation( "version", source.getLocation( "version" ) );
}
}
}
代码示例来源:origin: org.apache.maven/maven-project
private void mergeDeterministicPluginElements( List iPlugins, List dPlugins )
{
if ( dPlugins != null )
{
for ( int i = 0; i < dPlugins.size(); i++ )
{
Plugin dPlugin = (Plugin) dPlugins.get( i );
Plugin iPlugin = (Plugin) iPlugins.get( i );
dPlugin.setGroupId( iPlugin.getGroupId() );
dPlugin.setArtifactId( iPlugin.getArtifactId() );
dPlugin.setVersion( iPlugin.getVersion() );
dPlugin.setDependencies( iPlugin.getDependencies() );
List dExecutions = dPlugin.getExecutions();
if ( dExecutions != null )
{
List iExecutions = iPlugin.getExecutions();
for ( int j = 0; j < dExecutions.size(); j++ )
{
PluginExecution dExec = (PluginExecution) dExecutions.get( j );
PluginExecution iExec = (PluginExecution) iExecutions.get( j );
dExec.setId( iExec.getId() );
}
}
}
}
}
代码示例来源:origin: apache/maven
private void resolvePluginVersion( Plugin plugin, MavenSession session, MavenProject project )
throws PluginVersionResolutionException
{
PluginVersionRequest versionRequest =
new DefaultPluginVersionRequest( plugin, session.getRepositorySession(),
project.getRemotePluginRepositories() );
plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() );
}
代码示例来源:origin: org.apache.maven/maven-project
modelPlugin.setVersion( profilePlugin.getVersion() );
代码示例来源:origin: apache/maven
plugin.setGroupId( tok.nextToken() );
plugin.setArtifactId( tok.nextToken() );
plugin.setVersion( tok.nextToken() );
goal = tok.nextToken();
代码示例来源:origin: org.apache.maven/maven-project
child.setVersion( parent.getVersion() );
代码示例来源:origin: apache/maven
plugin.setVersion( pluginVersionResolver.resolve( request ).getVersion() );
plugin.setVersion( versions.get( plugin.getKey() ) );
if ( plugin.getVersion() == null )
new DefaultPluginVersionRequest( plugin, session.getRepositorySession(),
project.getRemotePluginRepositories() );
plugin.setVersion( pluginVersionResolver.resolve( request ).getVersion() );
代码示例来源:origin: apache/maven
plugin.setGroupId( extension.getGroupId() );
plugin.setArtifactId( extension.getArtifactId() );
plugin.setVersion( extension.getVersion() );
extensionPlugins.add( plugin );
代码示例来源:origin: apache/maven
private void injectPluginDeclarationFromProject( Plugin plugin, MavenProject project )
{
Plugin pluginInPom = findPlugin( plugin, project.getBuildPlugins() );
if ( pluginInPom == null && project.getPluginManagement() != null )
{
pluginInPom = findPlugin( plugin, project.getPluginManagement().getPlugins() );
}
if ( pluginInPom != null )
{
if ( plugin.getVersion() == null )
{
plugin.setVersion( pluginInPom.getVersion() );
}
plugin.setDependencies( new ArrayList<>( pluginInPom.getDependencies() ) );
}
}
代码示例来源:origin: apache/maven
plugin.setGroupId( gs.groupId );
plugin.setArtifactId( gs.artifactId );
plugin.setVersion( gs.version );
existing.setVersion( plugin.getVersion() );
代码示例来源:origin: apache/maven
child.setVersion( parent.getVersion() );
代码示例来源:origin: apache/maven
private List<Artifact> resolveExtension( CoreExtension extension, RepositorySystemSession repoSession,
List<RemoteRepository> repositories, DependencyFilter dependencyFilter )
throws PluginResolutionException
{
Plugin plugin = new Plugin();
plugin.setGroupId( extension.getGroupId() );
plugin.setArtifactId( extension.getArtifactId() );
plugin.setVersion( extension.getVersion() );
DependencyNode root =
pluginDependenciesResolver.resolveCoreExtension( plugin, dependencyFilter, repositories, repoSession );
PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
root.accept( nlg );
List<Artifact> artifacts = nlg.getArtifacts( false );
return artifacts;
}
}
代码示例来源:origin: apache/maven
plugin.setGroupId( request.getGroupId() );
plugin.setArtifactId( request.getArtifactId() );
plugin.setVersion( version );
代码示例来源:origin: apache/maven
public PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings,
ArtifactRepository localRepository )
throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
PluginVersionNotFoundException
{
MavenSession session = legacySupport.getSession();
if ( plugin.getVersion() == null )
{
PluginVersionRequest versionRequest =
new DefaultPluginVersionRequest( plugin, session.getRepositorySession(),
project.getRemotePluginRepositories() );
plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() );
}
try
{
return pluginManager.getPluginDescriptor( plugin, project.getRemotePluginRepositories(),
session.getRepositorySession() );
}
catch ( PluginResolutionException e )
{
throw new PluginNotFoundException( plugin, project.getPluginArtifactRepositories() );
}
catch ( PluginDescriptorParsingException | InvalidPluginDescriptorException e )
{
throw new PluginManagerException( plugin, e.getMessage(), e );
}
}
代码示例来源:origin: apache/maven
pp.setGroupId( report.getGroupId() );
pp.setArtifactId( report.getArtifactId() );
pp.setVersion( report.getVersion() );
代码示例来源:origin: apache/maven
try
plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() );
代码示例来源:origin: apache/maven
plugin.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
代码示例来源:origin: org.apache.maven/maven-project
public static Plugin clonePlugin( Plugin src )
{
Plugin result = null;
if ( src != null )
{
result = new Plugin();
result.setArtifactId( src.getArtifactId() );
result.setConfiguration( cloneConfiguration( src.getConfiguration() ) );
result.setDependencies( cloneList( src.getDependencies(), DEPENDENCY_CLONER ) );
result.setExecutions( cloneList( src.getExecutions(), PLUGIN_EXECUTION_CLONER ) );
result.setExtensions( src.isExtensions() );
result.setGroupId( src.getGroupId() );
result.setInherited( src.getInherited() );
result.setVersion( src.getVersion() );
}
return result;
}
代码示例来源:origin: takari/polyglot-maven
public Plugin mergePlugin(Plugin plugin) {
plugin.setGroupId(groupId);
plugin.setArtifactId(artifactId);
if(version != null) plugin.setVersion(version);
return plugin;
}
代码示例来源:origin: apache/maven
plugin.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
内容来源于网络,如有侵权,请联系作者删除!