4

I already asked the opposite question but now I'm growing fond of Maven and would like to set compiler warnings in my pom that are actually mapped to the eclipse project, enabling eclipse to mark "wrong" lines with warnings.

I think(?) Maven already sets the tick to overwrite the default warnings per project, but then just copies the default values into the non default settings. Then it shouldn't be a big hasle for a plugin to e.g. set "Member can be static" to warn?

Which is the write plugin? I can't the the compiler plugin to have any options for this.

Community
  • 1
  • 1
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
  • Good question. I suppose you need to raise a feature request for `m2elcipse` plugin to capture the maven output and duplicate it as project errors. Hudson already has come parsing code, as it highlights warnings and errors. – dma_k Jan 15 '12 at 18:00
  • May I ask, who or what is Hudson? It sounds promising what you say, but I do not quite understand where to find the code you are talking about. Please enlight me. – Franz Kafka Jan 16 '12 at 23:25
  • [Hudson CI](http://www.hudson-ci.org/) will not help you so much: it is web application. But is has build-in functionality to [parse Maven output](https://wiki.jenkins-ci.org/download/attachments/43713289/parsed_console_output_1.JPG?version=1&modificationDate=1271216347000) – you can e-user their code if you want to improve `m2elcipse` plugin yourself. – dma_k Jan 17 '12 at 18:14

1 Answers1

0

Not sure I fully understand your question. For the warnings bit, you can override it using the showWarnings entity in the maven compiler plugin:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
            <encoding>${project.build.sourceEncoding}</encoding>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
        </configuration>
    </plugin>
dimitrisli
  • 20,895
  • 12
  • 59
  • 63