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


Java Extension类代码示例

本文整理汇总了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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LocationAwareMavenXpp3Writer.java

示例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 ) );
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:20,代码来源:XMvnModelValidator.java

示例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 );
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:17,代码来源:MavenJDOMWriter.java

示例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 );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:11,代码来源:DefaultModelInheritanceAssembler.java

示例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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:36,代码来源:MavenProject.java

示例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();
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:13,代码来源:MavenProject.java

示例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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:ProjectSorterTest.java

示例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 );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:ModelMerger.java

示例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" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例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" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例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" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例12: replaceBuildExtension

import org.apache.maven.model.Extension; //导入依赖的package包/类
@Override
public Extension replaceBuildExtension( Extension extension )
{
    return extension;
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:6,代码来源:AbstractModelVisitor.java

示例13: visitBuildExtension

import org.apache.maven.model.Extension; //导入依赖的package包/类
@Override
public void visitBuildExtension( Extension extension )
{
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:5,代码来源:AbstractModelVisitor.java

示例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() ) );
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:7,代码来源:BuildDependencyVisitor.java

示例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();
            }
        }
    }
}
 
开发者ID:immutables,项目名称:maven-shade-plugin,代码行数:54,代码来源:MavenJDOMWriter.java


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