Search in sources :

Example 1 with JavadocPublisher

use of org.jenkinsci.test.acceptance.plugins.javadoc.JavadocPublisher in project acceptance-test-harness by jenkinsci.

the class JavadocPluginTest method setup.

private void setup(Job job) {
    // https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy#ConfiguringContentSecurityPolicy-JavadocPlugin
    jenkins.runScript("System.setProperty('hudson.model.DirectoryBrowserSupport.CSP', \"default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self';\")");
    job.configure();
    MavenBuildStep m = job.addBuildStep(MavenBuildStep.class);
    m.targets.set("archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app -Dversion=1.0 -B");
    m = job.addBuildStep(MavenBuildStep.class);
    m.targets.set("javadoc:javadoc -f my-app/pom.xml");
    JavadocPublisher jd = job.addPublisher(JavadocPublisher.class);
    jd.javadocDir.set("my-app/target/site/apidocs/");
    job.save();
}
Also used : MavenBuildStep(org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep) JavadocPublisher(org.jenkinsci.test.acceptance.plugins.javadoc.JavadocPublisher)

Aggregations

JavadocPublisher (org.jenkinsci.test.acceptance.plugins.javadoc.JavadocPublisher)1 MavenBuildStep (org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep)1