Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public class TestInsertionMojo extends AbstractJenkinsMojo {
@Parameter(property = "jelly.requirePI", defaultValue = "true")
private boolean requirePI;

/**
* If true, verify that all the jelly scripts don't contain inline javascript.
*/
@Parameter(property = "jelly.prohibitInlineJS", defaultValue = "true")
private boolean prohibitInlineJS;

/**
* Optional string that represents "groupId:artifactId" of the Jenkins test harness.
* If left unspecified, the default groupId/artifactId pair for the Jenkins test harness is looked for.
Expand Down Expand Up @@ -138,7 +144,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
class %s extends org.jvnet.hudson.test.injected.InjectedTestBase {

%s() {
super("%s", "%s", "%s", "%s", %b);
super("%s", "%s", "%s", "%s", %b, %b);
}
}
""".formatted(
Expand All @@ -149,12 +155,12 @@ class %s extends org.jvnet.hudson.test.injected.InjectedTestBase {
project.getArtifactId(),
project.getVersion(),
escape(project.getBuild().getOutputDirectory()),
requirePI);
requirePI,
prohibitInlineJS);
Files.writeString(javaFile.toPath(), content);
} catch (IOException e) {
throw new MojoExecutionException("Failed to create injected tests", e);
}

project.addTestCompileSourceRoot(f.getAbsolutePath());

try {
Expand Down