[WEAVER-13] weaversettings@includesystemclasspath

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/weaver/trunk@1744318 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java b/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
index dd3104b..7692fda 100644
--- a/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
+++ b/ant/src/main/java/org/apache/commons/weaver/ant/WeaverSettings.java
@@ -40,6 +40,7 @@
  * <li>{@code target} attribute - {@link File}</li>
  * <li>{@code classpath} attribute - {@link Path} (incompatible with {@code classpathref})</li>
  * <li>{@code classpathref} attribute - {@link String} (incompatible with {@code classpath})</li>
+ * <li>{@code includeSystemClasspath} attribute - {@code boolean}</li>
  * <li>nested {@code propertyset} - {@link PropertySet}</li>
  * <li>nested {@code properties} - {@link InlineProperties}</li>
  * </ul>
@@ -51,6 +52,7 @@
     private String classpathref;
     private PropertySet propertySet;
     private InlineProperties inlineProperties;
+    private boolean includeSystemClasspath;
 
     /**
      * Create a new {@link WeaverSettings} object.
@@ -106,8 +108,8 @@
     }
 
     /**
-     * Return the effective classpath (system classpath + configured classpath) as a {@link List} of {@link String}
-     * filesystem paths.
+     * Return the effective classpath as a {@link List} of {@link String}
+     * filesystem paths. If {@link #includeSystemClasspath}, system classpath will be appended.
      * @return List<String>
      */
     public List<String> getClasspathEntries() {
@@ -116,7 +118,9 @@
         if (classpath != null) {
             path.add(classpath);
         }
-        path.add(Path.systemClasspath);
+        if (includeSystemClasspath) {
+            path.add(Path.systemClasspath);
+        }
 
         return Arrays.asList(path.list());
     }
@@ -187,6 +191,16 @@
     }
 
     /**
+     * Set whether to include the system classpath.
+     * @param includeSystemClasspath the includeSystemClasspath to set
+     * @since 1.3
+     * @see Path#systemClasspath
+     */
+    public void setIncludeSystemClasspath(boolean includeSystemClasspath) {
+        this.includeSystemClasspath = includeSystemClasspath;
+    }
+
+    /**
      * Merge nested {@code propertyset} and {@code properties}; latter takes precedence.
      * @return Properties
      */
diff --git a/ant/src/site/markdown/index.md b/ant/src/site/markdown/index.md
index f30bf43..94dfd53 100644
--- a/ant/src/site/markdown/index.md
+++ b/ant/src/site/markdown/index.md
@@ -41,6 +41,7 @@
  * `classpath` attribute - path string (incompatible with `classpathref`)
  * `classpathref` attribute - refid of an Ant **path**
  (incompatible with `classpath`)
+ * `includesystemclasspath` - specifies whether to include the system classpath
  * nested `propertyset` - Ant **PropertySet**
  * nested `properties` - specifies properties using the names and text values
  of nested elements (looks like Maven POM properties)