how to prevent maven from checking foreign repositories?

前端 未结 3 1328
清酒与你
清酒与你 2021-02-09 17:12

When I build using maven I see it checking all sort of foreign repositories for artifacts which only my local build should produce. How can I tell it that the com.myorg group c

3条回答
  •  庸人自扰
    2021-02-09 17:38

    By default maven checks dependencies in your local repository first, then on external repositories. The only case which will make maven check external repositories, is the use of snapshots.

    If you use snapshots, you can use the markup to change when your external repository will be checked.

    If you wan to work in offline mode you can either set a temporary offline option on your mvn command with the "-o" option, or you can set it up in your "~/.m2/settings.xml" with true.


    Before you do so, remember to use the dependecy:go-offline mojo to download your dependency once before you really activate the offline mode.


    Resources :

    • Maven - Repositories
    • Maven - simple settings values
    • Maven - dependecy:go-offline

提交回复
热议问题