Skip to content

Commit

Permalink
#299: document disableXmlSecurity flag,
Browse files Browse the repository at this point in the history
add support to ant tasks and maven plugin

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Mar 26, 2022
1 parent 9551f11 commit 133732e
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 4 deletions.
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -85,6 +85,7 @@
protocol="soap1.1|Xsoap1.2"
servicename="..."
portname="..."
disableXmlSecurity="true|false"
extension="true|false"
inlineSchemas="true|false"
fork="true|false"
Expand Down Expand Up @@ -273,6 +274,15 @@
<entry><literal>-portname</literal></entry>
</row>

<row>
<entry><para><literal>disableXmlSecurity</literal></para></entry>

<entry><para>Disable XML security features when parsing XML documents.
<literal>false</literal> by default.</para></entry>

<entry><para>No</para></entry>
</row>

<row>
<entry><literal>extension</literal></entry>

Expand Down
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -107,6 +107,12 @@
files.</entry>
</row>

<row>
<entry><literal>-disableXmlSecurity</literal></entry>

<entry>disables XML security features when parsing XML documents.</entry>
</row>

<row>
<entry><literal>-extension</literal></entry>

Expand Down
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -101,6 +101,7 @@
destdir="directory for generated class files"
sourcedestdir="directory for generated source files"
keep="true|false"
disableXmlSecurity="true|false"
encoding="..."
extension="true|false"
verbose="true|false"
Expand Down Expand Up @@ -183,6 +184,15 @@
<entry><literal>-s</literal></entry>
</row>

<row>
<entry><para><literal>disableXmlSecurity</literal></para></entry>

<entry><para>Disable XML security features when parsing XML documents.
<literal>false</literal> by default.</para></entry>

<entry><para>No</para></entry>
</row>

<row>
<entry><literal>encoding</literal></entry>

Expand Down
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -160,6 +160,12 @@
sample.</entry>
</row>

<row>
<entry><literal>-disableXmlSecurity</literal></entry>

<entry>disables XML security features when parsing XML documents.</entry>
</row>

<row>
<entry><literal>-extension</literal></entry>

Expand Down
Expand Up @@ -82,6 +82,14 @@ abstract class AbstractJaxwsMojo extends AbstractMojo {
@Parameter(defaultValue = "true")
protected boolean keep;

/**
* Disable XML security features when parsing XML documents.
*
* @since 4.0.0
*/
@Parameter(defaultValue = "false")
private boolean disableXmlSecurity;

/**
* Allow to use the JAXWS Vendor Extensions.
*/
Expand Down Expand Up @@ -242,6 +250,9 @@ protected List<String> getCommonArgs() throws MojoExecutionException {
}
}

if (disableXmlSecurity) {
commonArgs.add("-disableXmlSecurity");
}
if (isExtensionOn()) {
commonArgs.add("-extension");
}
Expand Down
Expand Up @@ -126,6 +126,27 @@ public void setDestdir(File base) {
}


/* ****************** -disableXmlSecurity option ********************* */
private boolean disableXmlSecurity;

/**
* Gets the "disableXmlSecurity" flag.
*
* @return true if extension mode is on, false otherwise.
*/
public boolean getDisableXmlSecurity() {
return disableXmlSecurity;
}

/**
* Sets the "disableXmlSecurity" flag.
*
* @param disableXmlSecurity true to disable XML security features when parsing XML documents, false otherwise.
*/
public void setDisableXmlSecurity(boolean disableXmlSecurity) {
this.disableXmlSecurity = disableXmlSecurity;
}

/* ****************** -extensions option ********************* */
private boolean extension;

Expand Down Expand Up @@ -483,6 +504,10 @@ protected CommandlineJava setupCommand() {
getCommandline().createArgument().setValue("-d");
getCommandline().createArgument().setFile(getDestdir());
}
// disableXmlSecurity flag
if (getDisableXmlSecurity()) {
getCommandline().createArgument().setValue("-disableXmlSecurity");
}
// extension flag
if (getExtension()) {
getCommandline().createArgument().setValue("-extension");
Expand Down
Expand Up @@ -92,6 +92,8 @@ public class Options {
public boolean nocompile;

/**
* -disableXmlSecurity
* <p>
* If true XML security features when parsing XML documents will be disabled.
* The default value is false.
*
Expand Down
Expand Up @@ -21,6 +21,7 @@ wsimport.help=\nUsage: {0} [options] <WSDL_URI>\n\n\
\ -classpath <path> specify where to find user class files and wsimport extensions\n\
\ -cp <path> specify where to find user class files and wsimport extensions\n\
\ -d <directory> specify where to place generated output files\n\
\ -disableXmlSecurity disables XML security features when parsing XML documents\n\
\ -encoding <encoding> specify character encoding used by source files\n\
\ -extension allow vendor extensions - functionality not specified\n\
\ by the specification. Use of extensions may\n\
Expand Down Expand Up @@ -84,6 +85,7 @@ wsgen.help=\nUsage: {0} [options] <SEI>\n\n\
\ -classpath <path> specify where to find input class files and wsgen extensions\n\
\ -cp <path> specify where to find input class files and wsgen extensions\n\
\ -d <directory> specify where to place generated output files\n\
\ -disableXmlSecurity disables XML security features when parsing XML documents\n\
\ -encoding <encoding> specify character encoding used by source files\n\
\ -extension allow vendor extensions - functionality not specified\n\
\ by the specification. Use of extensions may\n\
Expand Down

0 comments on commit 133732e

Please sign in to comment.