Skip to content

Commit

Permalink
1. Replaced the default Zap repository with a fork of the trunk on Gi…
Browse files Browse the repository at this point in the history
…tHub that fixes some building issues

2. Added a feature to allow the checkout destination of ZAP source code
  • Loading branch information
adedayo committed May 5, 2015
1 parent c524cf1 commit 49bc3aa
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -8,7 +7,7 @@
</parent>

<artifactId>zapper</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>Jenkins OWASP ZAP Plugin</name>
<description>Runs, after optionally building, OWASP ZAP for your automated security assessment</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@
*/
public class ZapInstallDescription {

//Install type ("auto" means automatically download and compile ZAP, otherwise an installed ZAP location is provided)
private final String type;
//ZAP install path
private final String path;
//ZAP source repository
private final String repositoryURL;
//Local path to checkout ZAP source to
private final String sourcePath;


@DataBoundConstructor
public ZapInstallDescription(String value, String path,
String repositoryURL) {
String repositoryURL, String sourcePath) {
this.type = value;
this.path = path;
this.repositoryURL = repositoryURL;
this.sourcePath = sourcePath;
}

public String getType() {
Expand All @@ -30,4 +37,8 @@ public String getPath() {
public String getRepositoryURL() {
return repositoryURL;
}

public String getSourcePath() {
return sourcePath;
}
}
12 changes: 8 additions & 4 deletions src/main/java/org/jenkinsci/plugins/zapper/ZapRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
}

//Checkout ZAP
new File("zapSource").mkdir();
File source = new File("zapSource");
new File(zapInstallDescription.getSourcePath()).mkdir();
File source = new File(zapInstallDescription.getSourcePath());
checkout(zapInstallDescription.getRepositoryURL(), source, logger);

//Build ZAP
Expand Down Expand Up @@ -189,7 +189,7 @@ public ZapRunnerDescriptor() {
*
* @param value This parameter receives the value that the user has typed.
* @return Indicates the outcome of the validation. This is sent to the browser.
*
* <p/>
* Note that returning {@link FormValidation#error(String)} does not
* prevent the form from being saved. It just means that a message
* will be displayed to the user.
Expand Down Expand Up @@ -226,13 +226,17 @@ public String getDefaultHost() {
}

public String getDefaultRepository() {
return "http://zaproxy.googlecode.com/svn/trunk/";
return "https://github.com/adedayo/owasp-zaproxy.git/trunk";
}

public String getDefaultPath() {
return System.getProperty("user.dir");
}

public String getDefaultSourcePath() {
return "zapSource";
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<f:textbox default="${descriptor.getDefaultRepository()}"
value="${instance.getZapInstallDescription().getRepositoryURL()}"/>
</f:entry>
<f:entry title="${%Local path to be used for ZAP checkout}" field="sourcePath">
<f:textbox default="${descriptor.getDefaultSourcePath()}"
value="${instance.getZapInstallDescription().getSourcePath()}"/>
</f:entry>
</f:radioBlock>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
Specify the local source path to checkout the ZAP source to. Zapper will use this as a staging area
to build your newly checked out ZAP sources.
</div>

0 comments on commit 49bc3aa

Please sign in to comment.