With the following plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
I generate classes from an XSD schema (let's say entity.xsd
) placed in the /src/main/resources
, the root element with namespace definition is on the example below:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:webpage="https://www.mywebpage.com"
targetNamespace="https://www.mywebpage.com"
elementFormDefault="qualified">
...
</xs:schema>
Upon mvn clean install
, the generated structure in the target/generated-sources/jaxb
is very odd:
target/generated-sources/jaxb
https
www_mywebpage
ObjectFactory.java
Entity.java
EntityDetailsRequest.java
EntityDetailsResponse.java
I expected something like:
target/generated-sources/jaxb
com.mywebpage
ObjectFactory.java
Entity.java
EntityDetailsRequest.java
EntityDetailsResponse.java
What do I do wrong?