Reputation:
I unfortunately may have two questions in one, or rather the solution may go two different ways. I have log4j loggers set up in a few classes that I unit test on. When I run mvn clean install
it obviously runs those tests and in turn creates a log file (that is usually empty as nothing exciting is being logged). This isn't necessarily a problem except that Jenkins doesn't seem to like this when I do Perform Maven Release
. It yells about the workspace having local changes and it cites the log file before declaring failure.
I know its the unit tests because if I changed them to integration tests or ignore them, everything works fine. But I'd like a solution not a workaround.
Are there configurations in Jenkins that can allow me to remedy this?
Or is there a strategy for mocking or ignoring logging for Unit tests?
I don't necessarily want to ignore them, but it is interfering with creating a release.
Upvotes: 1
Views: 166
Reputation: 1137
Amit has some good ideas, and I'll suggest a few more:
Upvotes: 1
Reputation: 1006
I am not quite aware of what Perform Maven Release
does, but I can suggest a couple of solutions:
Hope this helps!
Upvotes: 2