[英]XMLBeans schema compilation - scomp utility
I have a set of schemas which are not JAXB compatible but are XMLBeans compatible. 我有一组与JAXB不兼容但与XMLBeans兼容的模式。
According to the documentation on XMLBeans, I can use scomp
to compile my schema. 根据XMLBeans的文档,我可以使用
scomp
来编译我的模式。 But I can't find this tool anywhere or documentation on its versions. 但是我在任何地方都找不到该工具,也找不到其版本的文档。
I can use a maven plugin to compile my schema but it is dependent on an older version of XMLBean (2.4 rather than 2.6). 我可以使用maven插件来编译我的架构,但是它依赖于XMLBean的旧版本(2.4而不是2.6)。
Does anyone know what features I am missing out on/bugs in place by having my schema compiled with 2.4 rather than 2.6 and if I can use the compiled classes with the 2.6 dependency (is it backwards compatible - it appears to be?) 没有人知道通过使用2.4而不是2.6编译我的模式以及是否可以使用具有2.6依赖关系的编译类(它向后兼容-看起来是吗?)时,我错过了哪些功能/错误了。
My question is where is the scomp utility? 我的问题是scomp实用程序在哪里?
I created this BATCH to automate the process. 我创建了此BATCH来自动执行该过程。 Hope it helps!
希望能帮助到你!
(in XMLBeans 2.6 you just need xbean.jar) (在XMLBeans 2.6中,您只需要xbean.jar)
@echo off
echo ***
echo * https://xmlbeans.apache.org/docs/2.0.0/guide/tools.html
echo ***
setlocal
SET SOURCE=
if exist %1.xsd SET SOURCE=%1.xsd
if exist %1.wsdl SET SOURCE=%1.wsdl
if not "%SOURCE%"=="" goto JAVA
echo USAGE: COMP XSD/WSDL FILENAME
goto END
:JAVA
if exist "%JAVA_HOME%\bin\javac.exe" goto XMLBEANS
echo JAVA SDK NOT FOUND! PLEASE configure JAVA_HOME
echo %JAVA_HOME%
goto END
:XMLBEANS
SET BEANS_HOME=.
SET BEANS_SRC=%BEANS_HOME%\src
SET BEANS_JAR=%BEANS_HOME%\jars
SET BEANS_LIB=%BEANS_HOME%\lib-2.6
SET BEANS_CP=%BEANS_LIB%\xbean.jar
echo JAVA HOME @ %JAVA_HOME%
echo BEANS HOME @ %BEANS_HOME%
echo BEANS SRC @ %BEANS_SRC%
echo BEANS JAR @ %BEANS_JAR%
echo BEANS LIB @ %BEANS_LIB%
echo BEANS CP @ %BEANS_CP%
if exist %BEANS_LIB% goto COMPILE
echo XMLBEANS LIB NOT FOUND @ %BEANS_LIB%
goto END
:COMPILE
SET JAVA=%JAVA_HOME%\bin\java.exe
SET JAVAC=%JAVA_HOME%\bin\javac.exe
echo ***COMPILING*** %SOURCE%
if not exist %1.xsdconfig goto WITHOUT_CONFIG
"%JAVA%" -classpath %BEANS_CP% org.apache.xmlbeans.impl.tool.SchemaCompiler -src %BEANS_SRC% -out %BEANS_JAR%\%1.jar %SOURCE% %1.xsdconfig -compiler "%JAVAC%" -javasource "1.5"
goto END
:WITHOUT_CONFIG
echo %1.xsdconfig NOT FOUND! Compiling without xsdconfig
"%JAVA%" -classpath %BEANS_CP% org.apache.xmlbeans.impl.tool.SchemaCompiler -src %BEANS_SRC% -out %BEANS_JAR%\%1.jar %SOURCE% -compiler "%JAVAC%" -javasource "1.5"
:END
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.