Hello,
I am trying to use Gradle with an enterprise repository manage by nexus. The nexus repository is accessible via HTTPS with user auhtentication and work well with my ~/.m2/settings.xml configuration (see settings.xml at the end).
However I can’t get this repository working with my Gradle configuration. I tried both with using mavenLocal() or with a specific gradle repository section. In both situation I get a ModuleVersionNotFoundException Could not find com.google.android:support-v4:r12.
The same dependecy work well in a maven project.
Please find below my config details and thanks for Gradle: I am using Gradle 1.4 with Sonatype Nexus 2.3.0-04.
I configure gradlew with the following:
DEFAULT_JVM_OPTS=" \
-Djavax.net.ssl.trustStore=trust.jks \
-Djavax.net.ssl.trustStoreType=jks \
-Djavax.net.ssl.trustStorePassword=password"
My gradle config:
buildscript {
repositories {
mavenLocal()
//
mavenCentral()
//maven {
//
credentials {
//
username 'user'
//
password 'pwd'
//}
//url "https://dev/nexus/content/groups/public"
//}
}
dependencies {
compile 'com.google.android:support-v4:r12'
}
}
~/.m2/settings.xml
<settings>
<servers>
<server>
<id>nexus</id>
<username>user</username>
<password>pwd</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>https://dev/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>