简体   繁体   English

XMLBeans模式编译-scomp实用程序

[英]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.

相关问题 使用scomp工具时如何导入其他架构jar - how to import other schema jars when using the scomp tool 使用XMLBeans编译2 WSDL使用的共享模式 - Compiling shared schema used by 2 WSDL using XMLBeans 架构到代码生成,XMLBeans或JAXB哪个更好? - Which one is better for schema to code generation, XMLBeans or JAXB? 来自xmlbeans的RuntimeException - 找不到已编译的模式 - RuntimeException from xmlbeans - can't find compiled schema 如何使用Apache XMLBeans从Xsd-Schema中读取Xsd-Annotations? - How to read Xsd-Annotations from Xsd-Schema using Apache XMLBeans? 带有XMLBeans数据绑定的Axis2-从具有anyType的XSD架构生成的Java客户端出现问题 - Axis2 with XMLBeans data binding - Problem with a java client generated from a XSD schema with anyType 指定表架构时编译时的 StructField 问题 - StructField issue at compilation when specifying table schema 使用JAXB 2.2进行单独的模式编译 - Making separate schema compilation work with JAXB 2.2 XML-BEANS编译模式:无法找到已编译的模式资源schemaorg_apache_xmlbeans / system / sE130CAA0A01A7CDE5A2B4FEB8B311707 / index.xsb - XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/system/sE130CAA0A01A7CDE5A2B4FEB8B311707/index.xsb 'scomp' 不是内部或外部命令,也不是可运行的程序或批处理文件 - 'scomp' is not recognized as an internal or external command, operable program or batch file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM