Using Snapshots

While you are developing an application with multiple modules, it is usually the case that each of the modules are in flux. Your APIs might be undergoing some change or your implementations are undergoing change and are being fleshed out, or you may be doing some refactoring. Your build system needs to be able to deal easily with this real-time flux, and this is where Maven’s concept of a snapshot comes into play. A snapshot in Maven is an artifact that has been prepared using the most recent sources available. If you look at the top-level POM for Proficio you will see a snapshot version specified:

<project>
    [...]
    <version>1.0-SNAPSHOT</version>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.exist.mvnbook.proficio</groupId>
                <artifactId>proficio-model</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.exist.mvnbook.proficio</groupId>
                <artifactId>proficio-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-container-default</artifactId>
                <version>1.0-alpha-9</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    [...]
</project>
Note: Specifying a snapshot version for a dependency means that Maven will look for new versions of that dependency without you having to manually specify a new version. Snapshot dependencies are assumed to be changing, so Maven will attempt to update them. By default Maven will look for snapshots on a daily basis, but you can use the -U command line option to force the search for updates. Controlling how snapshots work will be explained in detail in Chapter 7. When you specify a non-snapshot version of a dependency Maven will download that dependency once and never attempt to retrieve it again.

Thank you for requesting a Maestro evaluation! This is our passion, and we want you to be successful. Please let us know how we may help!

Please enter your name, company email address and phone, and we will send you a link to your pre-built hosted evaluation within minutes.






I have read and agree to the Terms and Conditions.