Maven artifacts for multiple environments
I am working on a project that uses Maven for build and Artifactory as Maven repository where the build is published. All works fine when there is just one set of configuration - build is created and published to Artifactory.
I need to be able to create a single WAR that contains necessary binaries and one additional artifact for each environment that contains environment specific resources (MongoDB connection URL and log4j2 xml). Deployment job in Jenkins should deploy WAR and environment specific resource JAR to the server.
I am stuck in creating and publishing artifacts. Approaches I tried and rejects are:
It seems that Maven + Artifactory is not geared towards multi-environment scenario as there simply does not seem to be any straightforward solution. Am I missing something? What approach should I take?
Update I solved the problem by using https://github.com/khmarbaise/multienv-maven-plugin. This lets me create one WAR and multiple JAR files: - myapp.0.1.0.war - myapp.0.1.0-dev.jar - myapp.0.1.0-qa.jar - myapp.0.1.0-prod.jar
I am stuck at next step. Install phase installs the JARs as WARs and subsequently Deploy phase uploads them to Artifactory as WARs. Any way to keep packaging type as JAR for the JARs?
链接地址: http://www.djcxy.com/p/79984.html上一篇: Heroku预编译资产在Rail 4应用程序上失败
下一篇: 适用于多种环境的Maven工件