[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: getting started
From:       Rolf Schumacher <rolf () august ! de>
Date:       2020-11-01 5:51:57
Message-ID: 825d073a-f449-cf78-952c-581c140307fd () august ! de
[Download RAW message or body]

Thank you Andreas for your great and patient help.

Using maven, I am now able to generate the sources and build a module
out of it. I install it ito my local maven repository.

I can use that module in a Java application program by referring to the
namespace of the xml schema from the module-info.java file and from a
dependency in the pom.xml.

One key to success - as I understood it - is the maven 
build-helper-maven-plugin. It makes the TypeSystemHolder class available 
for satisfying the needs of the generated classes. 
TypeSystemHolder.class is generated as a binary class while all others 
come as source code. I wonder whether it would be possible to get 
TypeSystemHolder in source as well, somehow in the namespace of the 
generated classes. Or as a jar module that can be placed in local maven 
repository, referenced via usual dependency in pom.xml. The helper 
plugin could be omitted in that case.

And: do I need those other generated-resources - the *.xsb files - after 
generation?

But these are questions for the future to come. The current solution 
solved my task at hand.

Kind Regards


Rolf

On 10/27/20 8:28 PM, Andreas Beeker wrote:
> Hi Rolf,
>
> frankly said, I haven't tested any of the shell scripts, as I was 
> happy that the modifications for JPMS worked ok with POI.
> Therefore I recommend to call the SchemaCompiler directly and use the 
> srconly option.
> If you look at the ooxml-schema maven pom, you'll see the parameters 
> to be given:
> https://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema/pom.xml?view=markup#l71 
>
>
> I've also added some JPMS information to the user guide:
> http://xmlbeans.apache.org/guide/JPMS.html
>
> We haven't discussed this yet, but I rather would remove all the shell 
> scripts and put the effort in fixing the maven plugin.
>
> Sorry to maybe disappoint you - currently there's even less XmlBeans 
> community than POI community and we actually are in dare need of 
> testers :S ... but having that big chunk of JPMS migration after us, I 
> hope for faster releases now.
>
> Andi
>
>
> SchemaCompiler options:
> Compiles a schema into XML Bean classes and metadata.
> Usage: java -cp xmlbeans-4.0.0.jar 
> org.apache.xmlbeans.impl.tool.SchemaCompiler [opts] [dirs]* 
> [schema.xsd]* [service.wsdl]* [config.xsdconfig]*
> Options include:
>     -cp [a;b;c] - classpath
>     -d [dir] - target binary directory for .class and .xsb files
>     -src [dir] - target directory for generated .java files
>     -srconly - do not compile .java files or jar the output.
>     -out [xmltypes.jar] - the name of the output jar
>     -name - the name of the schema type - defaults to autogenerated name
>     -dl - permit network downloads for imports and includes (default 
> is off)
>     -noupa - do not enforce the unique particle attribution rule
>     -nopvr - do not enforce the particle valid (restriction) rule
>     -noann - ignore annotations
>     -novdoc - do not validate contents of <documentation>
>     -noext - ignore all extension (Pre/Post and Interface) found in 
> .xsdconfig files
>     -compiler - path to external java compiler
>     -ms - initial memory for external java compiler (default '8m')
>     -mx - maximum memory for external java compiler (default '256m')
>     -debug - compile with debug symbols
>     -quiet - print fewer informational messages
>     -verbose - print more informational messages
>     -version - prints version information
>     -license - prints license information
>     -allowmdef \"[ns] [ns] [ns]\" - ignores multiple defs in given 
> namespaces (use ##local for no-namespace)
>     -catalog [file] -  catalog file for 
> org.apache.xml.resolver.tools.CatalogResolver. (Note: needs 
> resolver.jar from 
> http://xml.apache.org/commons/components/resolver/index.html)
>
>
>
> On 27.10.20 19:03, Rolf Schumacher wrote:
>> let me extend to be clear:
>>
>> regardless what I am doing scomp claims that javac is not available 
>> in the current directory. But why does scomp try to find javac there? 
>> It shall locate it along the %PATH%.
>>
>> I also tried a javac.bat in the current directory executing javac 
>> from its bin\javac location. Does not help.
>>
>> How to run scomp?
>>
>>
>> On 10/27/20 5:36 PM, Rolf Schumacher wrote:
>>> tried to use scomp.
>>>
>>> xmlbeans-4.0.0\bin is on the path as well as jdk-11.0.8\bin.
>>>
>>> when starting scomp from the commandline it cannot find javac:
>>>
>>>
>>> C:\Users\rschumacher\eclipse-jee-workspace\manager>scomp -out 
>>> target\ManagerConfiguration.jar src\main\xsd\ManagerConfiguration.xsd
>>> Time to build schema type system: 0.412 seconds
>>> Time to generate code: 0.351 seconds
>>> java.io.IOException: Cannot run program 
>>> "C:\Users\rschumacher\eclipse-jee-workspace\manager\javac": 
>>> CreateProcess error=2, The system cannot find the file specified
>>> java.io.IOException: CreateProcess error=2, The system cannot find 
>>> the file specified
>>> java.io.IOException: Cannot run program 
>>> "C:\Users\rschumacher\eclipse-jee-workspace\manager\javac": 
>>> CreateProcess error=2, The system cannot find the file specified
>>>         at java.lang.ProcessBuilder.start(Unknown Source)
>>>         at java.lang.Runtime.exec(Unknown Source)
>>>         at java.lang.Runtime.exec(Unknown Source)
>>>         at 
>>> org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil.java:195)
>>>         at 
>>> org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil.java:93)
>>>         at 
>>> org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1000)
>>>         at 
>>> org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:333)
>>> Caused by: java.io.IOException: CreateProcess error=2, The system 
>>> cannot find the file specified
>>>         at java.lang.ProcessImpl.create(Native Method)
>>>         at java.lang.ProcessImpl.<init>(Unknown Source)
>>>         at java.lang.ProcessImpl.start(Unknown Source)
>>>         ... 7 more
>>> BUILD FAILED
>>>
>>>
>>> What may have cause this?
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: user-help@poi.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic