本文整理汇总了Java中org.apache.maven.model.CiManagement类的典型用法代码示例。如果您正苦于以下问题:Java CiManagement类的具体用法?Java CiManagement怎么用?Java CiManagement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CiManagement类属于org.apache.maven.model包,在下文中一共展示了CiManagement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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());
}
示例2: visitCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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 );
}
}
}
示例3: updateCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
/**
* 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" );
}
}
示例4: convertCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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;
}
示例5: mergeCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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 );
}
示例6: mergeCiManagement_System
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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" ) );
}
}
}
示例7: mergeCiManagement_Url
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
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" ) );
}
}
}
示例8: getCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
public CiManagement getCiManagement()
{
return null;
}
示例9: replaceCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
@Override
public CiManagement replaceCiManagement( CiManagement ciManagement )
{
return ciManagement;
}
示例10: visitCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
@Override
public void visitCiManagement( CiManagement ciManagement )
{
}
示例11: get
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
@Override
public CiManagement get( Model model )
{
return model.getCiManagement();
}
示例12: set
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
@Override
public void set( Model model, CiManagement value )
{
model.setCiManagement( value );
}
示例13: getCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
public CiManagement getCiManagement()
{
return getModel().getCiManagement();
}
示例14: setCiManagement
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
public void setCiManagement( CiManagement ciManagement )
{
getModel().setCiManagement( ciManagement );
}
示例15: setupJenkins
import org.apache.maven.model.CiManagement; //导入依赖的package包/类
/**
* 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;
}