Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 672
caarlos0 Avatar asked Sep 17 '14 17:09

caarlos0


1 Answers

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.

like image 147
cpetry Avatar answered Oct 17 '22 09:10

cpetry