wsdl2java .bat命令

这是一个批处理脚本,用于调用 Apache CXF 的 wsdl2java 工具,从 WSDL 文件生成 Java 代码。脚本检查必要的环境变量,如 JAVA_HOME 和 CXF_HOME,并确定使用的 Java 版本来设置适当的类路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

@echo off
rem
rem
rem Licensed to the Apache Software Foundation (ASF) under one
rem or more contributor license agreements. See the NOTICE file
rem distributed with this work for additional information
rem regarding copyright ownership. The ASF licenses this file
rem to you under the Apache License, Version 2.0 (the
rem “License”); you may not use this file except in compliance
rem with the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing,
rem software distributed under the License is distributed on an
rem “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem KIND, either express or implied. See the License for the
rem specific language governing permissions and limitations
rem under the License.
rem
rem

rem
rem invoke the Apache CXF wsdl2java tool
rem
@setlocal

if not defined CXF_HOME goto set_cxf_home

:cont
if not defined JAVA_HOME goto no_java_home

rem Retrieve java version
for /f tokens=2-5 delims=.-_+" %%j in (’"%JAVA_HOME%\bin\java" -fullversion 2>&1’) do (
if %%j==1 (set JAVA_VERSION=%%k) else (set JAVA_VERSION=%%j)
)

if %JAVA_VERSION% LSS 9 (
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar;
)

if not exist “%CXF_HOME%\lib\cxf-manifest.jar” goto no_cxf_jar

set CXF_JAR=%CXF_HOME%\lib\cxf-manifest.jar

if “%JAVA_MAX_MEM%” == “” (
set JAVA_MAX_MEM=512M
)

if %JAVA_VERSION% GTR 8 (
“%JAVA_HOME%\bin\java” -Xmx%JAVA_MAX_MEM% -cp “%CXF_JAR%;%CLASSPATH%” -Djava.util.logging.config.file="%CXF_HOME%\etc\logging.properties" org.apache.cxf.tools.wsdlto.WSDLToJava %*
) else (
“%JAVA_HOME%\bin\java” -Xmx%JAVA_MAX_MEM% -Djava.endorsed.dirs="%CXF_HOME%\lib\endorsed" -cp “%CXF_JAR%;%TOOLS_JAR%;%CLASSPATH%” -Djava.util.logging.config.file="%CXF_HOME%\etc\logging.properties" org.apache.cxf.tools.wsdlto.WSDLToJava %*
)

@endlocal

goto end

:no_cxf_jar
echo ERROR: Unable to find cxf-manifest.jar in %cxf_home/lib
goto end

:no_java_home
echo ERROR: Set JAVA_HOME to the path where the JDK (6.0 or higher) is installed
goto end

:set_cxf_home
set CXF_HOME=%~dp0…
goto cont

:end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值