I am a new to Maven.Needs to find, how to set up settings.xml for Maven in my local machine and which remote repository should be available for it.
Asked
Active
Viewed 471 times
2 Answers
0
which remote repository should be available for it
In most cases you need not write anything in it, as Maven Central repository is available by default. Here are some common cases when it may be necessary to edit settings.xml
:
You're working behind the proxy, so Maven should also be aware about this proxy:
<proxy> <active>true</active> <protocol>http</protocol> <host>proxy.somewhere.com</host> <port>8080</port> <username>proxyuser</username> <password>somepassword</password> <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts> </proxy>
You need to plug in some addidional repositories to fetch the libraries missing in central one:
<repositories> <repository> <id>codehausSnapshots</id> <name>Codehaus Snapshots</name> <releases> <enabled>false</enabled> <updatePolicy>always</updatePolicy> <checksumPolicy>warn</checksumPolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> <checksumPolicy>fail</checksumPolicy> </snapshots> <url>http://snapshots.maven.codehaus.org/maven2</url> <layout>default</layout> </repository> </repositories> <pluginRepositories> ... </pluginRepositories>
You need to set some profiles as active by default
So, necessary settings depend solely on your needs.

Jk1
- 11,233
- 9
- 54
- 64
0
how to set up settings.xml for Maven in my local machine
There is already the answer to Sample settings.xml for maven.
If you need more detailed information about:
- Simple Values
- Servers
- Mirrors
- Proxies
- Profiles
- Activation
- Properties
- Repositories
- Plugin Repositories
- Active Profiles
- Encrypting Passwords in Maven Settings
you can read the Settings Details from the book "Maven: The Complete Reference".

Community
- 1
- 1

taringamberini
- 2,719
- 21
- 29