Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (e.g pom.xml) required to start a new project. But it is ok set up the development machine once with a settings file (e.g $M2_HOME/settings.xml)

like image 470
sheki Avatar asked Feb 03 '26 14:02

sheki


1 Answers

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

like image 173
Alex Gitelman Avatar answered Feb 06 '26 05:02

Alex Gitelman