0

I have a question about how maven manage the severity of the warnings.

I have two environments, in one Environment (My local computer, maven 3.2.2), maven throws the error "unmappable character for encoding UTF-8" with severity "WARNING", so, i can compile with no problem.

On the other environment (Jenkins, mavne 3.2.1), this error is throw with severity "ERROR", so, the compilation ends at this point.

You know how I can tell Maven to throw this error as "WARNING" on the Jenkins environment?

Ildelian
  • 1,278
  • 5
  • 15
  • 38
  • Maybe this helps: https://stackoverflow.com/a/41026794/4494577 ? – jannis Sep 04 '18 at 08:07
  • Thanks, but the error is throw on the compile step. The analysis of dependencies works with no problem. – Ildelian Sep 04 '18 at 08:09
  • The link was wrong. Check the updated one - maven-compiler-plugin has such flag as well. – jannis Sep 04 '18 at 08:10
  • You should fix the problem, not try to ignore it. – Max Vollmer Sep 04 '18 at 08:45
  • Possible duplicate of ["Unmappable character for encoding UTF-8" error](https://stackoverflow.com/questions/4995057/unmappable-character-for-encoding-utf-8-error) – Max Vollmer Sep 04 '18 at 08:45
  • Is not duplicate. The scope is not the error, is the severity of the exception throwed by Maven. – Ildelian Sep 04 '18 at 08:51
  • I strongly recommend to fix those issues is the best and simplest solution... – khmarbaise Sep 04 '18 at 08:52
  • @khmarbaise If correcting the errors was the best solution, I would have chosen that as my first choice – Ildelian Sep 04 '18 at 08:54
  • @jannis failOnWarning is not an option of my maven-compiler-plugin. I only have failOnErrors. Thank for your response. – Ildelian Sep 04 '18 at 08:56
  • @Ildelian it is the best solution - the fact you didnt pick it up in the first place is the real issue here - and its yours issue. – Antoniossss Sep 04 '18 at 09:01
  • I don't want to enter on a loop of comments about why I cannot modify this sources. The problem is that maven throws two different error severity for the same compile validation. – Ildelian Sep 04 '18 at 09:04
  • Have you tried other answers from the linked question? As [this one](https://stackoverflow.com/a/33823355/4494577) for example? – jannis Sep 04 '18 at 09:09
  • Yes, I try but the error continue showing as "WARNING" but the compiler stop. On jenkin the error is thrown as "ERROR". Thanks. – Ildelian Sep 04 '18 at 09:13
  • Cant you change your maven to 3.2.2 in Jenkins that should solve the issue or at least apply maven 3.2.2 only for building this project – rohit thomas Sep 04 '18 at 10:10

1 Answers1

1

The problem is that the Maven version installed on Jenkins uses the Maven Compiler Plugin version 2.5.1, this version throws the "unmappable character" as "ERROR" instead of "WARNING". This causes that the Maven Compiler Plugin stop at this error.

I forced on the POM.xml to use a newer version (3.5.1) and the problem was solved.

Ildelian
  • 1,278
  • 5
  • 15
  • 38