Java 类org.apache.maven.model.CiManagement 实例源码

项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeCiManagement(CiManagement ciManagement, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (ciManagement.getSystem() != null) {
        writeValue(serializer, "system", ciManagement.getSystem(), ciManagement);
    }
    if (ciManagement.getUrl() != null) {
        writeValue(serializer, "url", ciManagement.getUrl(), ciManagement);
    }
    if ((ciManagement.getNotifiers() != null) && (ciManagement.getNotifiers().size() > 0)) {
        serializer.startTag(NAMESPACE, "notifiers");
        for (Iterator iter = ciManagement.getNotifiers().iterator(); iter.hasNext();) {
            Notifier o = (Notifier) iter.next();
            writeNotifier(o, "notifier", serializer);
        }
        serializer.endTag(NAMESPACE, "notifiers");
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(ciManagement, "", start, b.length());
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitCiManagement( ModelVisitor visitor, CiManagement ciManagement )
{
    List<Notifier> notifiers = ciManagement.getNotifiers();
    if ( notifiers != null )
    {
        ListIterator<Notifier> notifierIterator = notifiers.listIterator();
        while ( notifierIterator.hasNext() )
        {
            Notifier notifier = notifierIterator.next();
            visitor.visitCiManagementNotifier( notifier );
            visitCiManagementNotifier( visitor, notifier );
            notifier = visitor.replaceCiManagementNotifier( notifier );
            if ( notifier == null )
                notifierIterator.remove();
            else
                notifierIterator.set( notifier );
        }
    }
}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateCiManagement
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateCiManagement( CiManagement value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "system", value.getSystem(), null );
        findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
        iterateNotifier( innerCount, root, value.getNotifiers(), "notifiers", "notifier" );
    }
}
项目:apache-archiva    文件:Maven2RepositoryStorage.java   
private org.apache.archiva.metadata.model.CiManagement convertCiManagement( CiManagement ciManagement )
{
    org.apache.archiva.metadata.model.CiManagement ci = null;
    if ( ciManagement != null )
    {
        ci = new org.apache.archiva.metadata.model.CiManagement();
        ci.setSystem( ciManagement.getSystem() );
        ci.setUrl( ciManagement.getUrl() );
    }
    return ci;
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateCiManagement
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateCiManagement( CiManagement value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "system", value.getSystem(), null );
        findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
        iterateNotifier( innerCount, root, value.getNotifiers(), "notifiers", "notifier" );
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeCiManagement( CiManagement target, CiManagement source, boolean sourceDominant,
                                  Map<Object, Object> context )
{
    mergeCiManagement_System( target, source, sourceDominant, context );
    mergeCiManagement_Url( target, source, sourceDominant, context );
    mergeCiManagement_Notifiers( target, source, sourceDominant, context );
}
项目:oceano    文件:ModelMerger.java   
protected void mergeCiManagement_System( CiManagement target, CiManagement source, boolean sourceDominant,
                                         Map<Object, Object> context )
{
    String src = source.getSystem();
    if ( src != null )
    {
        if ( sourceDominant || target.getSystem() == null )
        {
            target.setSystem( src );
            target.setLocation( "system", source.getLocation( "system" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeCiManagement_Url( CiManagement target, CiManagement source, boolean sourceDominant,
                                      Map<Object, Object> context )
{
    String src = source.getUrl();
    if ( src != null )
    {
        if ( sourceDominant || target.getUrl() == null )
        {
            target.setUrl( src );
            target.setLocation( "url", source.getLocation( "url" ) );
        }
    }
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public CiManagement getCiManagement()
{
    return null;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public CiManagement replaceCiManagement( CiManagement ciManagement )
{
    return ciManagement;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitCiManagement( CiManagement ciManagement )
{
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public CiManagement get( Model model )
{
    return model.getCiManagement();
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public void set( Model model, CiManagement value )
{
    model.setCiManagement( value );
}
项目:oceano    文件:MavenProject.java   
public CiManagement getCiManagement()
{
    return getModel().getCiManagement();
}
项目:oceano    文件:MavenProject.java   
public void setCiManagement( CiManagement ciManagement )
{
    getModel().setCiManagement( ciManagement );
}
项目:jpct-maven-plugin    文件:RunMojo.java   
/**
 * Attempt to create new jenkins client instance. If credentials are null, attempt to connect without authentication.
 * 
 * @return null on failure
 */
private JenkinsClient setupJenkins(String url, String user, String token, CiManagement ciManagement)
        throws MojoExecutionException
{
    String savedUrl = config.get("jenkinsUrl");
    String savedUser = config.get("jenkinsUser");
    String savedToken = config.get("jenkinsToken");
    if (url == null) {
        if(savedUrl != null) {
            url = savedUrl;
        } else {
            // try to use <ciManagement>
            if(ciManagement != null
                && Pattern.matches(CI_MANAGEMENT_SYSTEM_NAME_PATTERN, ciManagement.getSystem())
                && ciManagement.getUrl() != null)
            {
                url = ciManagement.getUrl();
                log.info("Using Jenkins URL from <ciManagement> settings in POM.");
            } else {
                if(ciManagement != null) {
                    log.warn("<ciManagement> settings found in POM but could not be used "
                           + "because the CI system name does not match '"+ CI_MANAGEMENT_SYSTEM_NAME_PATTERN +"' "
                           + "pattern or the URL is not set.");
                }
            }
        }
    }
    if (user == null)
        user = savedUser;
    if (token == null)
        token = savedToken;

    if (url == null)
        fail("Jenkins URL is a required parameter:\n"
           + "* 'jenkinsUrl' parameter is null.\n"
           + "* There is no suitable <ciManagement> setting in POM.\n"
           + "* There is no saved URL from previous executions.\n"
           + "URL must point to the root of the server.");

    // this is to avoid problems when connecting via https
    System.setProperty("jsse.enableSNIExtension", "false");

    JenkinsClient jc;

    if (user == null || token == null) {
        jc = JenkinsClientFactory.createClient(url, log); // TODO url as argument?
        log.debug("Setting up the jenkins client without authentication.");
    } else {
        jc = JenkinsClientFactory.createClient(url, user, token, log);
        log.debug("Setting up the jenkins client with authentication.");
    }
    if (jc == null) {
        fail("Failed to connect to Jenkins. "
                + "Check if the server is accessible and URL (" + url + ") and credentials" +
                " (user = '" + user + "', token = '" + token + "') are correct.");
    } else {
        log.debug("Saving Jenkins access config.");
        config.put("jenkinsUrl", url);
        config.put("jenkinsUser", user);
        config.put("jenkinsToken", token);
    }
    return jc;
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public CiManagement getCiManagement() {
    return getDelegate().getCiManagement();
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public void setCiManagement(final CiManagement management) {
    getDelegate().setCiManagement(management);
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public void setCiManagement( CiManagement ciManagement )
{

}
项目:xmvn    文件:ModelVisitor.java   
CiManagement replaceCiManagement( CiManagement ciManagement );
项目:xmvn    文件:ModelVisitor.java   
void visitCiManagement( CiManagement ciManagement );