• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MavenModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中hudson.maven.MavenModule的典型用法代码示例。如果您正苦于以下问题:Java MavenModule类的具体用法?Java MavenModule怎么用?Java MavenModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MavenModule类属于hudson.maven包,在下文中一共展示了MavenModule类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: artifactVersion

import hudson.maven.MavenModule; //导入依赖的package包/类
/** helper to get the version of the artifact from pom definition */
   @SuppressWarnings("rawtypes")
private String artifactVersion( AbstractBuild build, BuildListener listener ) {
   	 String version = "";
        if ( build instanceof MavenModuleSetBuild ) {
	        try {
				MavenModuleSetBuild mavenBuild = (MavenModuleSetBuild) build;
				MavenModuleSet parent = mavenBuild.getParent();
				Collection<MavenModule> modules = parent.getModules();
				MavenModule module = modules.iterator().next();
				version = module.getVersion();
	        	listener.getLogger().println( "[WSO2 Deployer] "+warTargetFileName+" version: "+version );
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
	        	listener.getLogger().println( "[WSO2 Deployer] Waning: Version is not set" );
			}
        } else {
        	listener.getLogger().println( "[WSO2 Deployer] Waning: Version is not set" );
        }
   	return version;
   }
 
开发者ID:ma-ha,项目名称:Jenkins-WSO2AS-Deployer,代码行数:23,代码来源:Wso2asPublisher.java


示例2: perform

import hudson.maven.MavenModule; //导入依赖的package包/类
public void perform(AbstractMavenProject<?, ?> project, AbstractBuild<?, ?> build,
		BuildListener listener) throws InterruptedException, IOException {

	EnvVars env = build.getEnvironment(listener);
	env.overrideAll(build.getBuildVariables());

	VirtualChannel channel = build.getWorkspace().getChannel();

	MavenModuleSet prj = (MavenModuleSet) this.project;
	for (MavenModule module : prj.getModules()) {

	  FilePath fp = new FilePath(channel, build.getWorkspace().getRemote() + File.separator
             + (module.getRelativePath().isEmpty() ? "" : module.getRelativePath() + File.separator)
             + Properties.CTG_DIR + File.separator + Properties.CTG_PROJECT_INFO);

	  if (!fp.exists()) {
	    listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "There is not any " +
	        fp.getRemote() + " file for module " + module.getName());
	    continue ;
	  }

	  ByteArrayOutputStream out = new ByteArrayOutputStream();
	  fp.copyTo(out);
	  ByteArrayInputStream projectXML = new ByteArrayInputStream(out.toByteArray());

	  listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Analysing " +
	      Properties.CTG_PROJECT_INFO + " file from " + fp.getRemote());

	  ModuleAction m = new ModuleAction(build, module.getName());
	  if (!m.build(channel, projectXML, listener)) {
	    continue ;
	  }

	  this.modules.add(m);
	}
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:37,代码来源:ProjectAction.java


示例3: getCurrentVersion

import hudson.maven.MavenModule; //导入依赖的package包/类
public String getCurrentVersion() {
    final MavenModule rootModule = getRootModule();
    if (rootModule != null && StringUtils.isNotBlank(rootModule.getVersion())) {
        return rootModule.getVersion();
    } else {
        return null;
    }
}
 
开发者ID:orctom,项目名称:branch-plugin,代码行数:9,代码来源:BranchAction.java


示例4: getVersionComputer

import hudson.maven.MavenModule; //导入依赖的package包/类
private VersionComputer getVersionComputer() {
    String currentVersion = "NaN-SNAPSHOT";
    final MavenModule rootModule = getRootModule();
    if (rootModule != null && StringUtils.isNotBlank(rootModule.getVersion())) {
        currentVersion = rootModule.getVersion();
    }
    String selectedVersionMode = getDefaultVersioningMode();

    return VersionComputerFactory.getVersionComputer(selectedVersionMode, currentVersion, project.getName());
}
 
开发者ID:orctom,项目名称:branch-plugin,代码行数:11,代码来源:BranchAction.java


示例5: commit

import hudson.maven.MavenModule; //导入依赖的package包/类
@Override
   public int commit(AbstractMavenProject<?, ?> project, AbstractBuild<?, ?> build,
       BuildListener listener, String branchName, String ctgBestsDir) {
	try {
		listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Commiting new test cases");

		Set<String> branches = this.getBranches(build.getWorkspace(), listener);
		if (!branches.contains(branchName)) {
			// create a new branch called "evosuite-tests" to commit and
			// push the new generated test suites
			listener.getLogger()
					.println(EvoSuiteRecorder.LOG_PREFIX + "There is no branch called " + branchName);
			if (this.hgClient.run("branch", branchName).pwd(build.getWorkspace()).join() != 0) {
				listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Unable to create a new branch called " + branchName);
				return -1;
			}
		}

		// switch to EVOSUITE_BRANCH
		if (this.hgClient.run("update", branchName).pwd(build.getWorkspace()).join() != 0) {
			listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Unable to switch to branch " + branchName);
			return -1;
		}

		// start adding all removed files to commit
		if (this.hgClient.run("remove", "--after").pwd(build.getWorkspace()).join() != 0) {
			this.rollback(build, listener);
			return -1;
		}

		MavenModuleSet prj = (MavenModuleSet) project;

		// parse list of new and modified files
		int number_of_files_committed = 0;
		for (MavenModule module : prj.getModules()) {
		    for (String file : this.parseStatus(this.hgClient.popen(build.getWorkspace(), listener,
		        true, new ArgumentListBuilder("status")),
		        (module.getRelativePath().isEmpty() ? "" : module.getRelativePath() + File.separator) + ctgBestsDir)) {

		      if (this.hgClient.run("add", file).pwd(build.getWorkspace()).join() != 0) {
                     this.rollback(build, listener);
                     return -1;
		      }

                 number_of_files_committed++;
		    }
		}

		if (number_of_files_committed == 0) {
		    listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Nothing to commit");
               return 0;
		}

		// commit
		String commit_msg = SCM.COMMIT_MSG_PREFIX + build.getProject().getName().replace(" ", "_") + "-" + build.getNumber();
		listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + commit_msg);

		if (this.hgClient.run("commit", "--message", commit_msg).pwd(build.getWorkspace()).join() != 0) {
			this.rollback(build, listener);
			return -1;
		}

		return number_of_files_committed++;

	} catch (IOException | InterruptedException e) {
		e.printStackTrace();
		return -1;
	}
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:70,代码来源:Mercurial.java


示例6: createAggregatedAction

import hudson.maven.MavenModule; //导入依赖的package包/类
/** {@inheritDoc} */
public MavenAggregatedReport createAggregatedAction(final MavenModuleSetBuild build, final Map<MavenModule, List<MavenBuild>> moduleBuilds) {
    return new CheckStyleMavenResultAction(build, getHealthDescriptor(), getDefaultEncoding(),
            new CheckStyleResult(build, getDefaultEncoding(), new ParserResult(), false));
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:6,代码来源:CheckStyleMavenResultAction.java


示例7: getProjectActions

import hudson.maven.MavenModule; //导入依赖的package包/类
@Override
public List<CheckStyleProjectAction> getProjectActions(final MavenModule module) {
    return Collections.singletonList(new CheckStyleProjectAction(module, getResultActionClass()));
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:5,代码来源:CheckStyleReporter.java


示例8: createAggregatedAction

import hudson.maven.MavenModule; //导入依赖的package包/类
/** {@inheritDoc} */
public MavenAggregatedReport createAggregatedAction(final MavenModuleSetBuild build, final Map<MavenModule, List<MavenBuild>> moduleBuilds) {
    return new MavenCheckStyleResultAction(build, getHealthDescriptor(), defaultEncoding);
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:5,代码来源:MavenCheckStyleResultAction.java


示例9: getModules

import hudson.maven.MavenModule; //导入依赖的package包/类
public Collection<MavenModule> getModules() {
    return project.getModules();
}
 
开发者ID:orctom,项目名称:branch-plugin,代码行数:4,代码来源:BranchAction.java


示例10: getRootModule

import hudson.maven.MavenModule; //导入依赖的package包/类
public MavenModule getRootModule() {
    return project.getRootModule();
}
 
开发者ID:orctom,项目名称:branch-plugin,代码行数:4,代码来源:BranchAction.java


示例11: isMavenJob

import hudson.maven.MavenModule; //导入依赖的package包/类
/**
 * Returns {@code true} if and only if the supplied type is a Maven job type class.
 *
 * @param jobType the job type.
 * @return {@code true} if and only if the supplied type is a Maven job type class.
 */
public static boolean isMavenJob(Class<? extends AbstractProject> jobType) {
    return jobType != null && (MavenModuleSet.class.isAssignableFrom(jobType) || MavenProject.class
            .isAssignableFrom(jobType) || MavenModule.class.isAssignableFrom(jobType));
}
 
开发者ID:jenkinsci,项目名称:deployer-framework-plugin,代码行数:11,代码来源:DeploySourceDescriptor.java


示例12: update

import hudson.maven.MavenModule; //导入依赖的package包/类
/**
 * Called whenever a new module build is completed, to update the aggregated
 * report. When multiple builds complete simultaneously, Jenkins serializes
 * the execution of this method, so this method needs not be
 * concurrency-safe.
 *
 * @param moduleBuilds
 *            Same as <tt>MavenModuleSet.getModuleBuilds()</tt> but provided
 *            for convenience and efficiency.
 * @param newBuild
 *            Newly completed build.
 */
public void update(final Map<MavenModule, List<MavenBuild>> moduleBuilds, final MavenBuild newBuild) {
    // not used anymore
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:16,代码来源:MavenCheckStyleResultAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java URLBuilder类代码示例发布时间:2022-05-22
下一篇:
Java DateTimeUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap