Question

I'm trying to import Robolectric into my Maven project, with:

        <dependency>
            <groupId>com.pivotallabs</groupId>
            <artifactId>robolectric</artifactId>
            <version>1.2-SNAPSHOT</version>
            <scope>test</scope>
        </dependency>

The artifact is listed here:

https://oss.sonatype.org/index.html#nexus-search;quick~robolectric

I tried including:

<repositories>
    <repository>
        <id>oss-sonatype</id>
        <name>oss-sonatype</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

as suggested from this post, but it doesn't resolve robolectric.

Was it helpful?

Solution

This should work although you should really install a repository manager like Sonatype Nexus and proxy the oss snapshot repository.

In your case the problem might be that it did not find it previously and that fact is cached in your local repository. To force Maven to check agagin use the -U flag so e.g. run

mvn -U clean install
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top