Embracing the Messiness in Search of Epic Solutions

Maven: Enabling Snapshot Downloads

Posted

in

By default, Maven does not allow us to download snapshots. To enable this feature so that we can download snapshots from Nexus, add the following configuration to [USER.HOME]/.m2/settings.xml:-

<?xml version="1.0"?>
<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">
	<profiles>
		<profile>
			<id>allow-snapshots</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<repositories>
				<repository>
					<id>snapshots</id>
					<url>http://snapshots</url>
					<releases>
						<enabled>false</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
			</repositories>
		</profile>
	</profiles>
</settings>

Replace http://snapshots with the actual snapshot link.

Comments

Leave a Reply