Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't have a public example but I have this scenario successfully setup in a internally-hosted Nexus repository. Here is the setup:</p> <p>App - Android application project LibraryB - Android library project picasso - Open source library from Square (available on Maven Central) LibraryA - Android library project</p> <p>App depends on LibraryB and picasso LibraryB depends on LibraryA</p> <p>Here is the POM for LibraryB (downloaded from Nexus)</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;LibraryB&lt;/artifactId&gt; &lt;version&gt;0.1&lt;/version&gt; &lt;packaging&gt;aar&lt;/packaging&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;LibraryA&lt;/artifactId&gt; &lt;version&gt;3.0.1&lt;/version&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.squareup.picasso&lt;/groupId&gt; &lt;artifactId&gt;picasso&lt;/artifactId&gt; &lt;version&gt;2.1.1&lt;/version&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>Here is the build.gradle for LibraryB</p> <pre><code>buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android-library' apply plugin: 'maven' version versionProp group 'com.example' repositories { mavenCentral() maven { url(exampleReleaseRepoUrl) } } android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 8 targetSdkVersion 19 } release { runProguard false proguardFile 'proguard-rules.txt' proguardFile getDefaultProguardFile('proguard-android.txt') } } dependencies { compile 'com.example:LibraryA:3.0.1' compile 'com.squareup.picasso:picasso:2.1.1' } uploadArchives { repositories { mavenDeployer { repository(url: uri(exampleReleaseRepoUrl)) { authentication(userName: nexusUsername, password: nexusPassword) } snapshotRepository(url: uri(exampleSnapshotRepoUrl)) { authentication(userName: nexusUsername, password: nexusPassword) } } } } </code></pre> <p>Here is the POM for LibraryA (downloaded from Nexus)</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;LibraryA&lt;/artifactId&gt; &lt;version&gt;3.0.1&lt;/version&gt; &lt;packaging&gt;aar&lt;/packaging&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.android.support&lt;/groupId&gt; &lt;artifactId&gt;support-v4&lt;/artifactId&gt; &lt;version&gt;19.0.0&lt;/version&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>The build.gradle for LibraryA is very similar to the one for LibraryB above.</p> <p>The artifacts and POM for LibraryA and LibraryB were uploaded via the following Gradle command</p> <pre><code>gradle uploadArchives </code></pre> <p>The build.gradle for App looks like this</p> <pre><code>buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url(exampleReleaseRepoUrl) } } android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 8 targetSdkVersion 19 } buildTypes { release { runProguard false proguardFile getDefaultProguardFile('proguard-android.txt') } } productFlavors { defaultFlavor { proguardFile 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:19.0.0' compile 'com.android.support:appcompat-v7:19.0.0' compile 'com.example:LibraryB:0.1' } </code></pre> <p>If you need any further information let me know.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload