trautonen / coveralls-maven-plugin

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

Output a meaningful error message if Git metadata cannot be found #115

Open ferrarimarco opened 7 years ago

ferrarimarco commented 7 years ago

Hi. I had this error when building my Maven project in a Docker container:

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:4.3.0:report (default-cli) on project database-uploader: Build error: One of setGitDir or setWorkTree must be called

My Maven project was not in the root of the repository and I was mounting only the subdirectory in the build container. I solved by mounting the root of the project (which contains the .git directory).

Here you can see the full build log: https://travis-ci.org/aifa-gov-it/invoices-processor/jobs/235953051

It could be useful to output an error message explaining the situation.

vitalijr2 commented 6 years ago

I've met the same issue. But my repository is not a Git repository at all.

slachiewicz commented 6 years ago

Looks like git repository is required

Caused by: java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
    at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree (BaseRepositoryBuilder.java:590)
    at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup (BaseRepositoryBuilder.java:555)
    at org.eclipse.jgit.lib.BaseRepositoryBuilder.build (BaseRepositoryBuilder.java:580)
    at org.eluder.coveralls.maven.plugin.domain.GitRepository.load (GitRepository.java:51)
    at org.eluder.coveralls.maven.plugin.CoverallsReportMojo.createJob (CoverallsReportMojo.java:322)
    at org.eluder.coveralls.maven.plugin.CoverallsReportMojo.execute (CoverallsReportMojo.java:238)