Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty lines in generated XSD via schemagen goal with JDK 11 #160

Open
ondrejlerch opened this issue May 7, 2020 · 0 comments
Open

Empty lines in generated XSD via schemagen goal with JDK 11 #160

ondrejlerch opened this issue May 7, 2020 · 0 comments

Comments

@ondrejlerch
Copy link

After upgrading from JDK 8 to JDK 11 there are many empty lines in generated XSD, e.g.:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:EchoService="http://example/EchoService" elementFormDefault="qualified" targetNamespace="http://example/EchoService" version="1.0">



  <xs:element name="echoServiceRequest" type="EchoService:echoServiceRequest"/>



  <xs:complexType name="echoServiceRequest">



    <xs:sequence>



      <xs:element name="message" type="xs:string"/>



    </xs:sequence>



  </xs:complexType>



</xs:schema>

With JDK 8 and the same jaxb2-maven-plugin configuration generated XSD looked reasonable:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:EchoService="http://example/EchoService" elementFormDefault="qualified" targetNamespace="http://example/EchoService" version="1.0">

  <xs:element name="echoServiceRequest" type="EchoService:echoServiceRequest"/>

  <xs:complexType name="echoServiceRequest">
    <xs:sequence>
      <xs:element name="message" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

My jaxb2-maven-plugin configuration looks like:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>schemagen</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <clearOutputDir>true</clearOutputDir>
                <outputDirectory>${outputDirectory}</outputDirectory>
                <transformSchemas>
                    <transformSchema>
                        <uri>http://example/EchoService</uri>
                        <toPrefix>EchoService</toPrefix>
                        <toFile>EchoService.xsd</toFile>
                    </transformSchema>
                </transformSchemas>
            </configuration>
        </execution>
    </executions>
</plugin>

I am using jaxb2-maven-plugin in latest version 2.5.0.

Is my configuration wrong or is there a problem with jaxb2-maven-plugin / xjc / JDK 11?

See also:
https://stackoverflow.com/questions/57309893/empty-lines-in-generated-xsd/61653789#61653789

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant