mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
105 stars 76 forks source link

Package name does not correspond to the file path #176

Open dynekpl opened 3 years ago

dynekpl commented 3 years ago

Hi, I choosed custom output directory for my generated objects which is:

${basedir}/src/main/java/jaxb/model

but all objects were generated to path: /src/main/java/jaxb/model/generated but all the classes contains package generated; line so it leads to error:

Package name 'generated' does not correspond to the file path 'jaxb.model.generated'

and it's very annoying because I need to correct all this packacges manually.

Below is my plugin configuration: `

org.codehaus.mojo
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <!--<xjbSources>-->
                <!--<xjbSource>src/main/resources/global.xjb</xjbSource>-->
                <!--</xjbSources>-->
                <sources>
                    <source>src/main/resources/xsd/Orders_schema12212020.xsd</source>
                </sources>
                <outputDirectory>${basedir}/src/main/java/jaxb/model</outputDirectory>
                <clearOutputDir>true</clearOutputDir>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>2.3.2</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.activation</groupId>
                    <artifactId>jakarta.activation</artifactId>
                    <version>1.2.1</version>
                </dependency>
            </dependencies>
        </plugin>` 

Where is the problem ?