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


Java MavenModuleSet类代码示例

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


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

示例1: testMavenAll

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
/** Test copying all artifacts from a maven job */
@Test
public void testMavenAll() throws Exception {
    MavenModuleSet mp = setupMavenJob();
    rule.assertBuildStatusSuccess(mp.scheduleBuild2(0, new UserCause()).get());
    FreeStyleProject p = createProject(mp.getName(), null, "", "", true, false, false, true);
    FreeStyleBuild b = p.scheduleBuild2(0, new UserCause()).get();
    String dir = "org.jvnet.hudson.main.test.multimod/";
    assertFile(true, dir + "moduleA/1.0-SNAPSHOT/moduleA-1.0-SNAPSHOT.jar", b);
    assertFile(true, dir + pomName("moduleA", "1.0-SNAPSHOT"), b);
    assertFile(true, dir + "moduleB/1.0-SNAPSHOT/moduleB-1.0-SNAPSHOT.jar", b);
    assertFile(true, dir + pomName("moduleB", "1.0-SNAPSHOT"), b);
    assertFile(true, dir + "moduleC/1.0-SNAPSHOT/moduleC-1.0-SNAPSHOT.jar", b);
    assertFile(true, dir + pomName("moduleC", "1.0-SNAPSHOT"), b);
    // Test with filters
    p = createProject(mp.getName(), null, "**/*.jar", "", true, false, false, true);
    b = p.scheduleBuild2(0, new UserCause()).get();
    assertFile(true, dir + "moduleA/1.0-SNAPSHOT/moduleA-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleA", "1.0-SNAPSHOT"), b);
    assertFile(true, dir + "moduleB/1.0-SNAPSHOT/moduleB-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleB", "1.0-SNAPSHOT"), b);
    assertFile(true, dir + "moduleC/1.0-SNAPSHOT/moduleC-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleC", "1.0-SNAPSHOT"), b);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:25,代码来源:CopyArtifactTest.java

示例2: testMavenJobWithArchivePostBuildStep

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
/** Test copying from maven job where artifacts manually archived instead of automatic */
@Test
public void testMavenJobWithArchivePostBuildStep() throws Exception {
    MavenModuleSet mp = setupMavenJob();
    // Turn off automatic archiving and use a post-build step instead.
    // Artifacts will be stored with the parent build instead of the child module builds.
    mp.setIsArchivingDisabled(true);
    mp.getPublishersList().add(new ArtifactArchiver("moduleB/*.xml", "", false, false));
    rule.assertBuildStatusSuccess(mp.scheduleBuild2(0, new UserCause()).get());
    FreeStyleProject p = createProject(mp.getName(), null, "", "", true, false, false, true);
    FreeStyleBuild b = p.scheduleBuild2(0, new UserCause()).get();
    // Archived artifact should be copied:
    assertFile(true, "moduleB/pom.xml", b);
    // None of the maven artifacts should be archived or copied:
    String dir = "org.jvnet.hudson.main.test.multimod/";
    assertFile(false, dir + "moduleA/1.0-SNAPSHOT/moduleA-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleA", "1.0-SNAPSHOT"), b);
    assertFile(false, dir + "moduleB/1.0-SNAPSHOT/moduleB-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleB", "1.0-SNAPSHOT"), b);
    assertFile(false, dir + "moduleC/1.0-SNAPSHOT/moduleC-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleC", "1.0-SNAPSHOT"), b);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:23,代码来源:CopyArtifactTest.java

示例3: testPermissionWhenParameterizedForMavenModule

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@LocalData
@Test
public void testPermissionWhenParameterizedForMavenModule() throws Exception {
    // This test fails before Jenkins 1.406
    if (new VersionNumber("1.406").isNewerThan(Hudson.getVersion())) return; // Skip

    MavenModuleSet mp = setupMavenJob();
    mp.addProperty(new AuthorizationMatrixProperty(
            Collections.singletonMap(Item.READ, Collections.singleton("authenticated"))));
    rule.assertBuildStatusSuccess(mp.scheduleBuild2(0, new UserCause()).get());
    FreeStyleProject p = createProject(mp.getName() + "/org.jvnet.hudson.main.test.multimod$FOO",
                                       null, "", "", false, false, false, true);
    ParameterDefinition paramDef = new StringParameterDefinition("FOO", "foo");
    ParametersDefinitionProperty paramsDef = new ParametersDefinitionProperty(paramDef);
    p.addProperty(paramsDef);
    // Build step should succeed when this parameter expands to a job accessible to
    // authenticated users, even when selecting a single maven module, not the parent job:
    FreeStyleBuild b = p.scheduleBuild2(0, new UserCause(),
            new ParametersAction(new StringParameterValue("FOO", "$moduleA"))).get();
    String dir = "org.jvnet.hudson.main.test.multimod/";
    assertFile(true, dir + "moduleA/1.0-SNAPSHOT/moduleA-1.0-SNAPSHOT.jar", b);
    assertFile(true, dir + pomName("moduleA", "1.0-SNAPSHOT"), b);
    assertFile(false, dir + "moduleB/1.0-SNAPSHOT/moduleB-1.0-SNAPSHOT.jar", b);
    assertFile(false, dir + pomName("moduleB", "1.0-SNAPSHOT"), b);
    rule.assertBuildStatusSuccess(b);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:27,代码来源:CopyArtifactTest.java

示例4: executeCheck

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
public boolean executeCheck(Item item) {
    boolean found = false;
    if (Jenkins.getInstance().pluginManager.getPlugin("gradle") != null) {

        if (Jenkins.getInstance().pluginManager.getPlugin("maven-plugin")!=null) {
            if (item instanceof MavenModuleSet) {
                found = isGradlew(((MavenModuleSet) item).getPrebuilders());
            }
        }
        if (item instanceof Project) {
            found = isGradlew(((Project) item).getBuilders());
        }
        if (item instanceof MatrixProject) {
            found = isGradlew(((MatrixProject) item).getBuilders());
        }

    }
    return found;
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:20,代码来源:GradleWrapperChecker.java

示例5: executeCheck

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
public boolean executeCheck(Item item) {
    LOG.log(Level.FINE, "executeCheck " + item);
    boolean found = false;
    if (Jenkins.getInstance().pluginManager.getPlugin("maven-plugin")!=null) {
        if (item instanceof MavenModuleSet) {
            found = isBuilderHarcoded(((MavenModuleSet) item).getPrebuilders());
        }
    }
    if (item instanceof Project) {
        found = isBuilderHarcoded (((Project)item).getBuilders());
    }
    if (item instanceof MatrixProject) {
        found = isBuilderHarcoded (((MatrixProject)item).getBuilders());
    }
    return found;
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:17,代码来源:HardcodedScriptChecker.java

示例6: testMavenModuleJobbWithHardcodedScript

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Test public void testMavenModuleJobbWithHardcodedScript() throws Exception {
    MavenModuleSet project = j.createMavenProject();
    project.getPrebuilders().add(new hudson.tasks.Shell("#!/bin/bash #single line"));
    assertFalse(checker.executeCheck(project));
    project.delete();
    project = j.createMavenProject("Bash_Multiple_Line");
    project.getPrebuilders().add(new hudson.tasks.Shell("#!/bin/bash\nline1\nline2\nline3\nline4\nline5\nline6"));
    assertTrue(checker.executeCheck(project));
    project.delete();
    project = j.createMavenProject("Batch_Single_Line");
    project.getPrebuilders().add(new hudson.tasks.BatchFile("echo first"));
    assertFalse(checker.executeCheck(project));
    project.delete();
    project = j.createMavenProject("Batch_Multiple_Line");
    project.getPrebuilders().add(new hudson.tasks.BatchFile("echo first\nline1\nline2\nline3\nline4\nline5\nline6"));
    assertTrue(checker.executeCheck(project));
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:18,代码来源:HardcodedScriptCheckerTestCase.java

示例7: artifactVersion

import hudson.maven.MavenModuleSet; //导入依赖的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

示例8: testRegisterJobs_MavenProject

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Test
public void testRegisterJobs_MavenProject() throws Exception {

    MavenModuleSet lemon = createMavenProject("lemon");
    lemon.setAssignedLabel(new LabelAtom("linux"));

    AbstractWorkerThread oneiric = new ExecutorWorkerThread("GearmanServer", 4730, "MyWorker", slave.toComputer(), "master", new NoopAvailabilityMonitor());
    oneiric.testInitWorker();
    oneiric.registerJobs();
    Set<String> functions = oneiric.worker.getRegisteredFunctions();

    assertEquals(2, functions.size());
    assertTrue(functions.contains("build:lemon"));
    assertTrue(functions.contains("build:lemon:linux"));

}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:17,代码来源:ExecutorWorkerThreadTest.java

示例9: setupMavenJob

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
private MavenModuleSet setupMavenJob() throws Exception {
    ToolInstallations.configureDefaultMaven();
    MavenModuleSet mp = createMavenProject();
    mp.setGoals("clean package");
    mp.setScm(new ExtractResourceSCM(getClass().getResource("maven-job.zip")));
    return mp;
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:8,代码来源:CopyArtifactTest.java

示例10: testMavenJob

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
/** Test copying from a particular module of a maven job */
@Test
public void testMavenJob() throws Exception {
    MavenModuleSet mp = setupMavenJob();
    rule.assertBuildStatusSuccess(mp.scheduleBuild2(0, new UserCause()).get());
    FreeStyleProject p = createProject(mp.getName() + "/org.jvnet.hudson.main.test.multimod$moduleB",
            null, "", "", true, false, false, true);
    FreeStyleBuild b = p.scheduleBuild2(0, new UserCause()).get();
    String dir = "org.jvnet.hudson.main.test.multimod/";
    assertFile(true, dir + "moduleB/1.0-SNAPSHOT/moduleB-1.0-SNAPSHOT.jar", b);
    assertFile(true, dir + pomName("moduleB", "1.0-SNAPSHOT"), b);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:13,代码来源:CopyArtifactTest.java

示例11: testEnvDataInMavenProject

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Issue("JENKINS-16028")
@Test
public void testEnvDataInMavenProject() throws Exception {
    FreeStyleProject upstream = rule.createFreeStyleProject("upstream");
    upstream.getBuildersList().add(new FileWriteBuilder("artifact.txt", "foobar"));
    upstream.getPublishersList().add(new ArtifactArchiver("**/*", "", false, false));
    FreeStyleBuild upstreamBuild = upstream.scheduleBuild2(0).get();
    rule.assertBuildStatusSuccess(upstreamBuild);
    
    MavenModuleSet downstream = setupMavenJob();
    downstream.getPrebuilders().add(CopyArtifactUtil.createRunSelector(
            "upstream",
            "",
            new BuildNumberRunSelector(Integer.toString(upstreamBuild.getNumber())),
            "**/*",
            "",
            "",
            false,
            false,
            false
    ));
    CaptureEnvironmentBuilder envStep = new CaptureEnvironmentBuilder();
    downstream.getPrebuilders().add(envStep);
    
    MavenModuleSetBuild downstreamBuild = downstream.scheduleBuild2(0).get();
    rule.assertBuildStatusSuccess(downstreamBuild);
    assertFile(true, "artifact.txt", downstreamBuild);
    assertEquals(
            Integer.toString(upstreamBuild.getNumber()),
            envStep.getEnvVars().get("COPYARTIFACT_BUILD_NUMBER_UPSTREAM")
    );
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:33,代码来源:CopyArtifactTest.java

示例12: getMavenProjectResult

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
public LinkedList<Action> getMavenProjectResult(){
    if (project instanceof MavenModuleSet) {
        MavenModuleSet mavenProject = (MavenModuleSet) project;
        if (mavenProject.getPrebuilders().get(CxScanBuilder.class) != null
                || mavenProject.getPostbuilders().get(CxScanBuilder.class) != null) {
            LinkedList<Action> list = new LinkedList<Action>();
            list.add(new CxProjectResult(project));
            return list;
        }
    }
    return null;
}
 
开发者ID:jenkinsci,项目名称:checkmarx-plugin,代码行数:13,代码来源:MavenProjectResult.java

示例13: testControlComment

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Test public void testControlComment() throws Exception {
    FreeStyleProject project = j.createFreeStyleProject();
    assertFalse(checker.isIgnored(project.getDescription()));
    project.setDescription("#lint:ignore:" + checker.getClass().getSimpleName());
    assertTrue(checker.isIgnored(project.getDescription()));
    project.delete();
    MavenModuleSet mavenProject = j.createMavenProject();
    assertFalse(checker.isIgnored(mavenProject.getDescription()));
    mavenProject.setDescription("#lint:ignore:" + checker.getClass().getSimpleName());
    assertTrue(checker.isIgnored(mavenProject.getDescription()));
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:12,代码来源:GradleWrapperCheckerTestCase.java

示例14: testMavenModuleJobbWithHardcodedScript

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Test public void testMavenModuleJobbWithHardcodedScript() throws Exception {
    MavenModuleSet project = j.createMavenProject();
    project.getPrebuilders().add(new hudson.tasks.Shell("#!/bin/bash #single line"));
    assertFalse(checker.executeCheck(project));
    project.delete();
    project = j.createMavenProject("WithoutWrapper");
    project.getPrebuilders().add(new hudson.plugins.gradle.Gradle("description","switches","tasks","rootBuildScriptDir","buildFile","gradleName", false, false, false, false));
    project.save();
    assertTrue(checker.executeCheck(project));
    project.delete();
    project = j.createMavenProject("WithWrapper");
    project.getPrebuilders().add(new hudson.plugins.gradle.Gradle("description","switches","tasks","rootBuildScriptDir","buildFile","gradleName", true, false, false, false));
    assertFalse(checker.executeCheck(project));
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:15,代码来源:GradleWrapperCheckerTestCase.java

示例15: testControlComment

import hudson.maven.MavenModuleSet; //导入依赖的package包/类
@Test public void testControlComment() throws Exception {
    FreeStyleProject project = j.createFreeStyleProject();
    assertFalse(checker.isIgnored(project.getDescription()));
    project.setDescription("#lint:ignore:" + checker.getClass().getSimpleName());
    assertTrue(checker.isIgnored(project.getDescription()));
    MavenModuleSet mavenProject = j.createMavenProject();
    assertFalse(checker.isIgnored(mavenProject.getDescription()));
    mavenProject.setDescription("#lint:ignore:" + checker.getClass().getSimpleName());
    assertTrue(checker.isIgnored(mavenProject.getDescription()));
}
 
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:11,代码来源:HardcodedScriptCheckerTestCase.java


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