Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to prevent maven from checking foreign repositories?

Tags:

maven-2

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 can only be found in the local repository? Basically I want to do what m2eclipse does with workspace resolution but on the command line.

[INFO] snapshot com.myorg:core:0.0.1-SNAPSHOT: checking for updates from sun-jms
[INFO] snapshot com.myorg:core:0.0.1-SNAPSHOT: checking for updates from hibernate
[INFO] snapshot com.myorg:util:0.0.1-SNAPSHOT: checking for updates from sun-jms
[INFO] snapshot com.myorg:util:0.0.1-SNAPSHOT: checking for updates from hibernate
...

Background: I have a hierarchical maven project (one level). I want to do a full build so i go to the top and do mvn clean install.

  • com.myorg (parent)
    • pom.xml
    • com.myorg.core
      • pom.xml
    • com.myorg.util
      • pom.xml
like image 378
Justin Avatar asked Sep 03 '10 15:09

Justin


1 Answers

You can try with passing the "-o" option to Maven. -o activates the "Offline mode", in which Maven doesn't query remote repositories to check for updates or new artifacts.

I don't think that you can specify this on a per-dependency basis.

like image 84
Vivien Barousse Avatar answered Dec 09 '22 08:12

Vivien Barousse