par Israel Barbosa Il y a 9 années
373
Plus de détails
Allows you to specify a default profile to be active for Maven to use.
Allow you to group certain configuration elements, such as repositories and pluginRepositories.
Contains the HTTP proxy information to connect to the internet.
setting up a proxy
As we will discuss in detail in Chapter 3, Maven requires an Internet connection to
download plug-ins and dependencies. Some companies employ HTTP proxies to
restrict access to the Internet. In those scenarios, running Maven will result in Unable to
download artifact errors. To address this, edit the settings.xml file and add the proxy
information specific to your company. A sample configuration is shown in Listing 2-2.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<proxy>
<id>companyProxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.company.com</host>
<port>8080</port>
<username>proxyusername</username>
<password>proxypassword</password>
<nonProxyHosts />
</proxy>
</proxies>
</settings>
Allow you to specify alternate locations for your repositories.
Maven can interact with a variety of servers, such as Apache subversion (SVN), build servers, and remote repository servers. This element allows you specify security credentials such as the username and password, which you need to connect to those servers.
When set to true, this configuration instructs Maven to operate in offiline mode. The default is true.
As the name suggest, when this value is set to true, the default value, Maven interacts with the user for input.
Maven stores copies of plug-ins and dependencies locally in C:\Users\israelfap\.m2\repository folder.
This element can be used to change the path of the local repository.
For exemple, <localRepository>c:\mavenrepo</localRepository
will change the repository location to the mavenrepo folder.