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

generateEpisode=false does not work #156

Closed
zappee opened this issue Feb 5, 2020 · 2 comments
Closed

generateEpisode=false does not work #156

zappee opened this issue Feb 5, 2020 · 2 comments
Labels

Comments

@zappee
Copy link

zappee commented Feb 5, 2020

I am using jaxb2-maven-plugin to generate POJOs from XSD.
I do not need episode file so I turned it off this way:

<generateEpisode>false</generateEpisode>

But it seems that this setting does not work because the plugin still generating an episode file under the given directory:
src/main/java/META-INF/JAXB/episode_default.xjb

This is so bad because this file appears in the source directory after each maven build.

The only one workaround I have found is to add this crazy directory to the gitignore list to avoid to be pushed to the source code repo.

Plugin version: 2.5.0

configuration:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.5.0</version>
    <executions>
        <execution>
            <goals>
                <goal>xjc</goal>
            </goals>
        </execution>
    </executions>
    <configuration>

        <xjbSources>
            <xjbSource>src/main/resources/schema/binding</xjbSource>
        </xjbSources>

        <sources>
            <source>src/main/resources/schema/message.xsd</source>
        </sources>

        <packageName>a.b.model</packageName>
        <clearOutputDir>false</clearOutputDir>
        <outputDirectory>src/main/java</outputDirectory>
        <noGeneratedHeaderComments>true</noGeneratedHeaderComments>
        <noPackageLevelAnnotations>true</noPackageLevelAnnotations>
        <readOnly>true</readOnly>

        <generateEpisode>false</generateEpisode>
    </configuration>
</plugin>

@lennartj
Copy link
Member

lennartj commented Feb 5, 2020

You should really not use the outputDirectory to stash the sources under src/main/java.
They are generated sources, and should go under target/generated-sources/jaxb2 which is the default.

The sources will still be included in the compilation unit when stashed in the generated sources directory.

@zappee
Copy link
Author

zappee commented Feb 6, 2020

Thanks for the useful response.

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

No branches or pull requests

2 participants