Does maven take the default repositories if no repositories are mentioned for a specific profile?
I would be developing a pom.xml for my project, the issue is we will have almost 15 different profiles depending on the modules we want to build for that s开发者_JAVA百科pecific profile.(Its a multi-war project and lot of wars do not need a few core dependencies).So I was wondering , how does maven react when no repositories are mentioned in a profile element in pom.xml.
Would it take the repositores from the default build element or not??
Thanks
Neeraj
There are several places where a repository can be defined:
- In the root
pom.xml
, where the Maven Central repository is defined: http://repo1.maven.org/maven2/; - In your
settings.xml
file; - In your
pom.xml
; - In a
<profile>
inside yourpom.xml
.
Thus, if no repository is defined in your default pom.xml
or in an active <profile>
, Maven will use the ones defined in your settings.xml
file, or if no one is defined there, it will use the Maven Central repository.
Also, note that there is a mvn help:effective-pom
command that will display the complete pom.xml
file that is processed. So in your case, you can run this command and enable / disable some profiles, to see the impact in the repositories list.
精彩评论