diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 57c9a89fe..2ca3cd7a5 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -2022,7 +2022,8 @@ def maven_deploy(parser, xml_parent, data): """ p = XML.SubElement(xml_parent, 'hudson.maven.RedeployPublisher') - XML.SubElement(p, 'id').text = data['id'] + if 'id' in data: + XML.SubElement(p, 'id').text = data['id'] XML.SubElement(p, 'url').text = data['url'] XML.SubElement(p, 'uniqueVersion').text = str( data.get('unique-version', True)).lower() diff --git a/tests/publishers/fixtures/mavendeploy001.xml b/tests/publishers/fixtures/mavendeploy001.xml new file mode 100644 index 000000000..6db0030ee --- /dev/null +++ b/tests/publishers/fixtures/mavendeploy001.xml @@ -0,0 +1,10 @@ + + + + + file:///path/to/repo + true + false + + + diff --git a/tests/publishers/fixtures/mavendeploy001.yaml b/tests/publishers/fixtures/mavendeploy001.yaml new file mode 100644 index 000000000..d16b9632d --- /dev/null +++ b/tests/publishers/fixtures/mavendeploy001.yaml @@ -0,0 +1,4 @@ +publishers: + - maven-deploy: + url: file:///path/to/repo +