import sys pom_template = """ 4.0.0 ml.dmlc xgboost4j-tester_2.12 1.0-SNAPSHOT xgboost4j-tester_2.12 UTF-8 {maven_compiler_source} {maven_compiler_target} {spark_version} {scala_version} {scala_binary_version} com.esotericsoftware kryo 4.0.2 org.scala-lang scala-compiler ${{scala.version}} org.scala-lang scala-reflect ${{scala.version}} org.scala-lang scala-library ${{scala.version}} commons-logging commons-logging 1.2 com.typesafe.akka akka-actor_${{scala.binary.version}} 2.5.23 compile com.typesafe.akka akka-testkit_${{scala.binary.version}} 2.5.23 test org.scalatest scalatest_${{scala.binary.version}} 3.0.8 test org.scalactic scalactic_${{scala.binary.version}} 3.0.8 test org.apache.commons commons-lang3 3.4 org.apache.spark spark-core_${{scala.binary.version}} ${{spark.version}} provided org.apache.spark spark-sql_${{scala.binary.version}} ${{spark.version}} provided org.apache.spark spark-mllib_${{scala.binary.version}} ${{spark.version}} provided junit junit 4.13.2 test ml.dmlc xgboost4j_${{scala.binary.version}} {xgboost4j_version} ml.dmlc xgboost4j_${{scala.binary.version}} {xgboost4j_version} tests test-jar test ml.dmlc xgboost4j-spark_${{scala.binary.version}} {xgboost4j_version} ml.dmlc xgboost4j-example_${{scala.binary.version}} {xgboost4j_version} maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-jar-plugin 3.0.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 org.apache.maven.plugins maven-assembly-plugin 2.4 jar-with-dependencies ml.dmlc.xgboost4j.tester.App package single maven-site-plugin 3.7.1 maven-project-info-reports-plugin 3.0.0 org.apache.maven.plugins maven-surefire-plugin 2.22.1 ml.dmlc:xgboost4j_2.12 """ if __name__ == '__main__': if len(sys.argv) != 7: print('Usage: {} [xgboost4j version] [maven compiler source level] [maven compiler target level] [spark version] [scala version] [scala binary version]'.format(sys.argv[0])) sys.exit(1) with open('pom.xml', 'w') as f: print(pom_template.format(xgboost4j_version=sys.argv[1], maven_compiler_source=sys.argv[2], maven_compiler_target=sys.argv[3], spark_version=sys.argv[4], scala_version=sys.argv[5], scala_binary_version=sys.argv[6]), file=f)