本文整理汇总了Java中org.apache.maven.model.Extension类的典型用法代码示例。如果您正苦于以下问题:Java Extension类的具体用法?Java Extension怎么用?Java Extension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Extension类属于org.apache.maven.model包,在下文中一共展示了Extension类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
private void writeExtension(Extension extension, String tagName, XmlSerializer serializer)
throws java.io.IOException {
serializer.startTag(NAMESPACE, tagName);
flush(serializer);
StringBuffer b = b(serializer);
int start = b.length();
if (extension.getGroupId() != null) {
writeValue(serializer, "groupId", extension.getGroupId(), extension);
}
if (extension.getArtifactId() != null) {
writeValue(serializer, "artifactId", extension.getArtifactId(), extension);
}
if (extension.getVersion() != null) {
writeValue(serializer, "version", extension.getVersion(), extension);
}
serializer.endTag(NAMESPACE, tagName).flush();
logLocation(extension, "", start, b.length());
}
示例2: customizeModel
import org.apache.maven.model.Extension; //导入依赖的package包/类
void customizeModel( Model model )
{
BuildSettings settings = configurator.getConfiguration().getBuildSettings();
Build build = model.getBuild() != null ? model.getBuild() : new Build();
List<Dependency> dependencies = model.getDependencies();
List<Extension> extensions = build.getExtensions();
List<Plugin> plugins = build.getPlugins();
if ( settings.isSkipTests() )
dependencies.removeIf( d -> StringUtils.equals( d.getScope(), "test" ) );
dependencies.forEach( d -> d.setVersion( replaceVersion( d.getGroupId(), d.getArtifactId(),
d.getVersion() ) ) );
extensions.forEach( e -> e.setVersion( replaceVersion( e.getGroupId(), e.getArtifactId(), e.getVersion() ) ) );
plugins.forEach( p -> p.setVersion( replaceVersion( p.getGroupId(), p.getArtifactId(), p.getVersion() ) ) );
plugins.stream().filter( p -> p.getGroupId().equals( "org.apache.maven.plugins" )
&& p.getArtifactId().equals( "maven-compiler-plugin" ) ).forEach( p -> configureCompiler( p ) );
}
示例3: updateExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
/**
* Method updateExtension
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateExtension( Extension value, String xmlTag, Counter counter, Element element )
{
Element root = element;
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "groupId", value.getGroupId(), null );
findAndReplaceSimpleElement( innerCount, root, "artifactId", value.getArtifactId(), null );
findAndReplaceSimpleElement( innerCount, root, "version", value.getVersion(), null );
}
示例4: mergeExtensionLists
import org.apache.maven.model.Extension; //导入依赖的package包/类
private static void mergeExtensionLists( Build childBuild, Build parentBuild )
{
for ( Extension e : parentBuild.getExtensions() )
{
if ( !childBuild.getExtensions().contains( e ) )
{
childBuild.addExtension( e );
}
}
}
示例5: getExtensionArtifacts
import org.apache.maven.model.Extension; //导入依赖的package包/类
public Set<Artifact> getExtensionArtifacts()
{
if ( extensionArtifacts != null )
{
return extensionArtifacts;
}
extensionArtifacts = new HashSet<Artifact>();
List<Extension> extensions = getBuildExtensions();
if ( extensions != null )
{
for ( Iterator<Extension> i = extensions.iterator(); i.hasNext(); )
{
Extension ext = i.next();
String version;
if ( StringUtils.isEmpty( ext.getVersion() ) )
{
version = "RELEASE";
}
else
{
version = ext.getVersion();
}
Artifact artifact = repositorySystem.createArtifact( ext.getGroupId(), ext.getArtifactId(), version, null, "jar" );
if ( artifact != null )
{
extensionArtifacts.add( artifact );
}
}
}
extensionArtifactMap = null;
return extensionArtifacts;
}
示例6: getBuildExtensions
import org.apache.maven.model.Extension; //导入依赖的package包/类
public List<Extension> getBuildExtensions()
{
Build build = getBuild();
if ( ( build == null ) || ( build.getExtensions() == null ) )
{
return Collections.emptyList();
}
else
{
return build.getExtensions();
}
}
示例7: createExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
private Extension createExtension( String groupId, String artifactId, String version )
{
Extension extension = new Extension();
extension.setGroupId( groupId );
extension.setArtifactId( artifactId );
extension.setVersion( version );
return extension;
}
示例8: mergeExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
protected void mergeExtension( Extension target, Extension source, boolean sourceDominant,
Map<Object, Object> context )
{
mergeExtension_GroupId( target, source, sourceDominant, context );
mergeExtension_ArtifactId( target, source, sourceDominant, context );
mergeExtension_Version( target, source, sourceDominant, context );
}
示例9: mergeExtension_GroupId
import org.apache.maven.model.Extension; //导入依赖的package包/类
protected void mergeExtension_GroupId( Extension target, Extension source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getGroupId();
if ( src != null )
{
if ( sourceDominant || target.getGroupId() == null )
{
target.setGroupId( src );
target.setLocation( "groupId", source.getLocation( "groupId" ) );
}
}
}
示例10: mergeExtension_ArtifactId
import org.apache.maven.model.Extension; //导入依赖的package包/类
protected void mergeExtension_ArtifactId( Extension target, Extension source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getArtifactId();
if ( src != null )
{
if ( sourceDominant || target.getArtifactId() == null )
{
target.setArtifactId( src );
target.setLocation( "artifactId", source.getLocation( "artifactId" ) );
}
}
}
示例11: mergeExtension_Version
import org.apache.maven.model.Extension; //导入依赖的package包/类
protected void mergeExtension_Version( Extension target, Extension 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" ) );
}
}
}
示例12: replaceBuildExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
@Override
public Extension replaceBuildExtension( Extension extension )
{
return extension;
}
示例13: visitBuildExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
@Override
public void visitBuildExtension( Extension extension )
{
}
示例14: visitBuildExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
@Override
public void visitBuildExtension( Extension extension )
{
artifacts.add( new DefaultArtifact( extension.getGroupId(), extension.getArtifactId(),
extension.getVersion() ) );
}
示例15: iterateExtension
import org.apache.maven.model.Extension; //导入依赖的package包/类
/**
* Method iterateExtension
*
* @param counter
* @param childTag
* @param parentTag
* @param list
* @param parent
*/
protected void iterateExtension( Counter counter, Element parent, java.util.Collection list,
java.lang.String parentTag, java.lang.String childTag )
{
boolean shouldExist = list != null && list.size() > 0;
Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
Iterator it = list.iterator();
Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
if ( !elIt.hasNext() )
{
elIt = null;
}
Counter innerCount = new Counter( counter.getDepth() + 1 );
while ( it.hasNext() )
{
Extension value = (Extension) it.next();
Element el;
if ( elIt != null && elIt.hasNext() )
{
el = (Element) elIt.next();
if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
el = factory.element( childTag, element.getNamespace() );
insertAtPreferredLocation( element, el, innerCount );
}
updateExtension( value, childTag, innerCount, el );
innerCount.increaseCount();
}
if ( elIt != null )
{
while ( elIt.hasNext() )
{
elIt.next();
elIt.remove();
}
}
}
}