本文整理汇总了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;
}
示例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);
}
}
示例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;
}
}
示例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());
}
示例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;
}
}
示例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));
}
示例7: getProjectActions
import hudson.maven.MavenModule; //导入依赖的package包/类
@Override
public List<CheckStyleProjectAction> getProjectActions(final MavenModule module) {
return Collections.singletonList(new CheckStyleProjectAction(module, getResultActionClass()));
}
示例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);
}
示例9: getModules
import hudson.maven.MavenModule; //导入依赖的package包/类
public Collection<MavenModule> getModules() {
return project.getModules();
}
示例10: getRootModule
import hudson.maven.MavenModule; //导入依赖的package包/类
public MavenModule getRootModule() {
return project.getRootModule();
}
示例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));
}
示例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
}