Schema Class Generations Failing with XMLBeans version 5.0.1 and xmlbeans-maven-plugin 5.0.1

942 Views Asked by At

While generating classes using below new xmlbeans-maven-plugin 5.0.1, i am getting exception

<plugin>
                <groupId>org.apache.xmlbeans</groupId>
                <artifactId>xmlbeans</artifactId>
                <version>5.0.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceDir>${basedir}/xsd</sourceDir>
                    <javaTargetDir>src/main/java</javaTargetDir>
                    <debug>true</debug>
                </configuration>
                   <dependencies>
                    <dependency>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-core</artifactId>
                        <version>2.14.0</version>
                    </dependency>
                </dependencies>
</plugin>
    

Exception:

Cannot find symbol:   class XMLInputStream
     [exec]   location: package org.apache.xmlbeans.xml.stream

Cannot find symbol: symbol:   class XMLStreamException
     [exec]   location: package org.apache.xmlbeans.xml.stream

I know this issue occurs because the new xmlbeans 5.0.1 doesnt have the 2 classes mentioned above. But i want to upgrade to latest xmlbeans version and also used the latest maven-plugin provided by xmlbeans. Still facing the issue. Could anyone help me to solve this issue?

1

There are 1 best solutions below

0
On

You should add extentions part in configuration.

<configuration>
...
    <repackage>com.xxx.yyy.metadata</repackage>
    <name>pgmessages</name>
    <partialMethods>ALL,-GET_LIST,-XGET_LIST,-XGET_ARRAY</partialMethods>
    <extensions>
       <extension>
            <className>org.apache.xmlbeans.impl.tool.Extension</className>
        </extension>
    </extensions>
</configuration>