caarlos0
caarlos0

Reputation: 20633

Configure m2e to ignore warnings in generated-sources folder

I have a project which generates some code using Axis. This code is full of warnings (most of them, lack of generics), so, I usually just configure that source folder to ignore warnings.

Is there a way to do that using m2e or another maven plugin?

The advantage of that would show up when more people start using the project.

Upvotes: 9

Views: 723

Answers (1)

cpetry
cpetry

Reputation: 198

I do not use AXIS but I had a similar problem when using JAXB for code generation. My solution was to annotate each class with @SuppressWarnings.

For JAXB I used the annox plugin. You can create a binding file that contains the following:

<jaxb:bindings schemaLocation="YourSchema.xsd"
    xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="annox">
    <jaxb:bindings multiple="true" node="/xs:schema/xs:complexType">
        <annox:annotate>
            <annox:annotateClass annox:class="java.lang.SuppressWarnings">
                <annox:annotate annox:field="value">all</annox:annotate>
            </annox:annotateClass>
        </annox:annotate>
    </jaxb:bindings>

so you do not have to touch your schema.

Upvotes: 1

Related Questions