querydsl / apt-maven-plugin

Maven APT plugin
Apache License 2.0
79 stars 41 forks source link

Multiple <processor> tags should trigger an error #56

Closed cowwoc closed 7 years ago

cowwoc commented 7 years ago

If one provides the following configuration:

<configuration>
    <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
    <processor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</processor>
</configuration>

then the second processor will be ignored silently.

Expected behavior: the plugin should fail, complaining that multiple processors must be enclosed in a <processors> tag.

Shredder121 commented 7 years ago

I just tested if we see multiple calls to setProcessor if the configuration has multiple <processor/> tags. This is not the case.

So there is nothing we can do unfortunately.

To be honest, I would think it's a cleaner solution to have the check upstream (in Maven) so more than just this project benefits from it.

cowwoc commented 7 years ago

Thanks for the update. Filed https://issues.apache.org/jira/browse/MNG-6227 and closing this issue.

Shredder121 commented 7 years ago

Thanks for reporting it. Just for posterity's sake; it would be good if Maven allowed for discerning whether multiple tags of the same name were given, or reject it completely.

michael-o commented 3 years ago

Though this one is old, here is a followup: https://github.com/codehaus-plexus/modello/issues/78

If you need multiple processors, use it as a list with:

<processors>
  <processor>A</processor>
  <processor>B</processor>
  ...
</processors>