2

while generating schema with xmlbeans version 4.0.0 and xmlbeans-maven-plugin 2.3.3, I am facing following issue. It is because xmlbeans verion 4.0.0 have removed XMLStreamException and XMLInputStream classes.But question is why it is trying to generate schema with classes that does not exist.

error: cannot find symbol symbol: class XMLInputStream location: package org.apache.xmlbeans.xml.stream fil2.java:148:

error: cannot find symbol public static com.mypackage.ConfigurationType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {

symbol:   class XMLStreamException
  location: package org.apache.xmlbeans.xml.stream
file1.java:201: 

error: cannot find symbol
        public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {


[ERROR] Failed to execute goal org.codehaus.mojo:xmlbeans-maven-plugin:2.3.3:xmlbeans (generate-source) on project dummyProject: XmlBeans compile failed:
[ERROR]  xml ErrorLoading schema file 
 

pom.xml is something like below:

<dependencies>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>4.0.0</version>
        </dependency>
</dependencies>

<plugins>
<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <inherited>true</inherited>

 

                <executions>
                    <execution>
                        <id>generate-source</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                        <inherited>true</inherited>
                    </execution>
                </executions>

 

                <configuration>
                    <schemaDirectory>${schema.directory}</schemaDirectory>
                    <sourceGenerationDirectory>${generated.directory}</sourceGenerationDirectory>
                    <javaSource>1.5</javaSource>
                    <xmlConfigs>
                        <xmlConfig implementation="java.io.File">${source.resources}/config/config.xsdconfig</xmlConfig>
                    </xmlConfigs>
                </configuration>
            </plugin>

</plugins>
  • if you like, grab a nightly build and try the [new maven plugin](http://xmlbeans.apache.org/guide/Maven.html). Of course you need to install the plugin into your local maven repo. – kiwiwings Feb 28 '21 at 11:24
  • @Shikha were you able to find more about the error. – vipin agrahari Mar 16 '21 at 07:18

0 Answers0