简体   繁体   中英

How to maintain different maven environments for production and development?

In a Java world where people use Maven/Ivy to manage dependencies, how should one maintain multiple environments/repositories (artifactory) for production and development environments?

The developers need to have a local repository for development (and sharing prototype libraries) where as a few of the jars need to be available in the Production repository. Some of the projects should build seamlessly in development environment and production.

This can be achieved by maintaining separate repository URL's in different environment, but what is the best way to do it, with minimal changes in configurations (pom.xml).

What can be the approaches to automate this?

Update: Also a good feature to have would be least config (eg pom.xml) required to start a new project. But it is ok set up the development machine once with a settings file (eg $M2_HOME/settings.xml)

You may want to consider profiles. They support repository override. http://maven.apache.org/guides/introduction/introduction-to-profiles.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM