build-resources.create-deploy-pom.py Maven / Gradle / Ivy
import sys
from string import Template
import os.path
def main():
# build parameters from the command line arguments
params_dict = {'ARTIFACT_ID': sys.argv[1],
'RELEASE_NAME': sys.argv[2],
'PACKAGING':sys.argv[3],
'GROUP_ID': 'org.finos.cdm'}
# add in additional developers if any
if (len (sys.argv) > 4 and os.path.isfile(sys.argv[4])) :
developers_file = open(sys.argv[4], 'r')
params_dict['DEVELOPERS'] = developers_file.read ()
developers_file.close()
else:
params_dict['DEVELOPERS'] = '''
minesh-s-patel
Minesh Patel
[email protected]
http://github.com/minesh-s-patel
REGnosys
https://regnosys.com
+1
Maintainer
Developer
hugohills-regnosys
Hugo Hills
[email protected]
http://github.com/hugohills-regnosys
REGnosys
https://regnosys.com
+1
Maintainer
Developer
'''
deploy_pom_text = '''
4.0.0
$GROUP_ID
$ARTIFACT_ID
$RELEASE_NAME
$PACKAGING
$ARTIFACT_ID
https://www.finos.org/common-domain-model
scm:git:https://github.com/finos/common-domain-model
scm:git:git://github.com/finos/common-domain-model.git
HEAD
https://github.com/finos/common-domain-model
The FINOS Common Domain Model (CDM) is a standardised, machine-readable and machine-executable blueprint for how financial products are traded and managed across the transaction lifecycle. It is represented as a domain model and distributed in open source.
FINOS
https://finos.org
Community Specification License 1.0
https://github.com/finos/common-domain-model/blob/master/LICENSE.md
$DEVELOPERS
'''
deploy_pom_text = Template(deploy_pom_text).safe_substitute(params_dict)
deploy_pom_file = open(params_dict['ARTIFACT_ID'] + '-' + params_dict['RELEASE_NAME']+ '.pom', "w")
deploy_pom_file.write(deploy_pom_text)
deploy_pom_file.close()
if __name__ == "__main__":
main()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy