Allow custom settings configs for maven projects

Allow custom settings & global-settings config files to be configured
for maven projects.

In addition, the previously defined empty nodes for these configurations
were misnamed and this corrects that as well.

This change also switches to using an included test as an example.

Change-Id: I9f832f498e358268b3896ead3a78462e408bdd9d
Signed-off-by: Andrew Grimberg <grimbeaj@gmail.com>
Fix "delete-all"

It was broken by 14ed8b12, resulting in:

    $ jenkins-jobs delete-all
    Traceback (most recent call last):
      File "/Users/marca/python/virtualenvs/jenkins-job-builder/bin/jenkins-jobs", line 10, in <module>
        sys.exit(main())
      File "/Users/marca/dev/git-repos/jenkins-job-builder/jenkins_jobs/cmd.py", line 143, in main
        if options.path == sys.stdin:
    AttributeError: 'Namespace' object has no attribute 'path'

Change-Id: I42a3ef9f3cfca7b4667498009351e0027aa316d7
Fix recursion depth error caused by Git-remotes

In "SCM module: Add support for multiple Git remotes."
(change Ifef2da85, commit 8a956bcc) there is
recursive dict creation introduced when git repo
does not have any remote configured explicitely in yaml.

But infinite recursion confuses builder.deep_format,
so when defaults section contains scm git entry without
remotes specified, and is used by both:
- single job section (which creates the recursive dict),
- job template (which makes deep_format called on that dict)
it fails on RuntimeException.

Tried to build xmls localy with for example
'test -o /tmp/jobs' action.

Traceback looks like:
 File "/jenkins_jobs/cmd.py", line 168, in main
   output=options.output_dir)
 File "/jenkins_jobs/builder.py", line 583, in update_job
   self.parser.generateXML(names)
 File "/jenkins_jobs/builder.py", line 241, in generateXML
   self.getXMLForTemplateJob(d, template, jobs_filter)
 File "/jenkins_jobs/builder.py", line 260, in getXMLForTemplateJob
   expanded = deep_format(template, params)
 File "/jenkins_jobs/builder.py", line 99, in deep_format
   ret[item.format(**paramdict)] = deep_format(obj[item], paramdict)
 File "/jenkins_jobs/builder.py", line 95, in deep_format
   ret.append(deep_format(item, paramdict))
 File "/jenkins_jobs/builder.py", line 99, in deep_format
   ret[item.format(**paramdict)] = deep_format(obj[item], paramdict)
 File "/jenkins_jobs/builder.py", line 99, in deep_format
   ret[item.format(**paramdict)] = deep_format(obj[item], paramdict)
 File "/jenkins_jobs/builder.py", line 95, in deep_format
   ret.append(deep_format(item, paramdict))
 File "/jenkins_jobs/builder.py", line 80, in deep_format
   if isinstance(obj, str):
 RuntimeError: maximum recursion depth exceeded while calling a Python object

Obj passed to deep_format may look like:
    {'origin': {'basedir': 'our-repo',
                'branches': ['origin/master'],
                'remotes': [<Recursion on dict with id=26090448>],
                'url': 'https://our-gerrit.com/our-repo'}}

This patch changes the code to use copy of the git repo dict,
as data for in-place creation of remotes/origin entry,
and as it does not contain 'remotes' key yet, it does not create loop.

Change-Id: Iacd15839c5741cb171253fe45bdd122d7927aa39
Checkstyle publisher did not honor 0 values

The Checkstyle publisher would not honor value of 0 and instead emit
an empty XML element.  This was due to the 'if someval' which would be
false whenever someval is 0.  Adjusted tests to match the new (and
correct) behavior.

While at it slightly simplified the repeating logic in checkstyle
publisher.

Change-Id: I7443b93aa116dc049de565ff96ca40526b390409
Merge "Fix "delete-all""
Merge "Allow custom settings configs for maven projects"
Modularize to enable easier testing

Change-Id: I85c5d95658c0be57c4ce87fac53556475ae53207
Merge "Checkstyle publisher did not honor 0 values"
Merge "Fix recursion depth error caused by Git-remotes"
Merge "Modularize to enable easier testing"