jgitver/jgitver-maven-plugin

Add default exclude / warning for ".m2" and/or "repository"

jschneider opened this issue · 3 comments

I hat the issue that my build failed when using "-Dmaven.repo.local=.m2/repository".
This parameter is suggested when using docker to build.

Unfortunately jgitver modifies files stored within the repository.

Adding exclusions to the jtiver-config.xml solves this issue. But it has been very hard for me to diagnose this problem.

Could you add these default exclusions:

    <exclusion>.repository</exclusion> <!-- often used by jenkins -->
    <exclusion>target</exclusion>
    <exclusion>.m2</exclusion>
  </exclusions>

or at least add warnings when entering a directory that is called "repository"?

This parameter is suggested when using docker to build.

what is documented is to copy your local repository to /root/.m2 which is the default location of the maven local repository for root user. But it is a bit strange then to map/copy the project under build at the same place.
Having default directories excluded is a decision a bit difficult to take without enough background on the possible use cases.
As you noticed, even in such a bad situation, by configuration, jgitver is able to work properly. A better documentation on this point might be enough.

The problem is: It is very hard to identify the root problem from the given error messages.
It took me a long time to figure it out - and I know JGitver very well...

But I understand that there might be false positives.

with experience & the behavior described in #90, all POMs resolved with the same version as the project, it was clear that jgitver was changing the versions. It is such a behavior that needs to be better documented regarding what is occurring and how to correct it.
Honestly I think a better documentation, wiki, faq is the first thing to do.