trautonen / coveralls-maven-plugin

Maven plugin for submitting Java code coverage reports to Coveralls web service.
MIT License
312 stars 124 forks source link

Build error: Null charset name #30

Closed BoyCook closed 10 years ago

BoyCook commented 10 years ago

I'm trying to integrate my Java project with coveralls and cobertura using your plugin but get the following error:

Build error: Null charset name

I've followed the instructions in the documentation, adding the cobertura-maven-plugin and coveralls-maven-plugin running the mvn clean cobertura:cobertura coveralls:cobertura command.

The project can be found here: https://github.com/BoyCook/MovieService and the build here https://travis-ci.org/BoyCook/MovieService/builds

trautonen commented 10 years ago

The issue is how the plugin's source loader loads the source files. It currently relies on project.build.sourceEncoding unless the plugin's <configuration> section contains sourceEncoding property. It is good practice to define project.build.sourceEncoding for all maven projects anyway. See http://maven.apache.org/general.html#encoding-warning for more information.

I never thought this could actually be undefined and at least I should throw more informative exception on how to fix the issue.

BoyCook commented 10 years ago

Thanks for the info, I've explicitly set project.build.sourceEncoding and it works now.

trautonen commented 10 years ago

Ok. Nice to hear. Improved exception message will be released with 2.2.0.

set321go commented 10 years ago

FYI: I still had to search this repository for the reason why the build failed, even though maven was warning me before it started that I hadn't set anything.

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!