return [cls.IsolatedCodegenStrategy]
def execute_codegen(self, target, target_workdir):
distribution = DistributionLocator.cached(jdk=True)
// Note, using tools.jar will only work with Java 8 and lower. The tools.jar does not exist
// in JDK 9 and this will have to be revisted when Java 9 is released.
// See http://openjdk.java.net/jeps/220 for more information
classpath = distribution.find_libs(["tools.jar"])
wsdl_directory = target.payload.sources.rel_path
for source in target.payload.sources.source_paths:
url = os.path.join(wsdl_directory, source)
args = self._format_args_for_relative_path(target, target_workdir, url)
result = self.runjava(
classpath=classpath,
main="com.sun.tools.internal.ws.WsImport",
jvm_options=self.get_options().jvm_options,
args=args,
workunit_name="wsimport")
if result != 0:
raise TaskError("JAX-WS compiler exited non-zero ({0})".format(result))
def _format_args_for_relative_path(self, target, target_workdir, url):
// Ported and trimmed down from:
// https://java.net/projects/jax-ws-commons/sources/svn/content/trunk/
// jaxws-maven-plugin/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java?rev=1191
After Change
wsimport_cmd = self._build_wsimport_cmd(target, target_workdir, url)
with self.context.new_workunit(name="wsimport",
cmd=" ".join(wsimport_cmd),
labels=[WorkUnitLabel.TOOL]) as workunit:
self.context.log.debug("Executing {}".format(" ".join(wsimport_cmd)))
return_code = subprocess.Popen(wsimport_cmd,
stdout=workunit.output("stdout"),