Note that there are some explanatory texts on larger screens.

plurals
  1. POGradle Artifactory dependencies : SNAPSHOT pattern issues
    primarykey
    data
    text
    <p>I'm having an hard time trying to figure out how to resolve a dependency over a remote artifact in Artifactory, from a Gradle build. </p> <p>This Artifact is available at :</p> <pre><code>http://192.168.2.130:8081/artifactory/simple/libs-snapshot-local/com/company/test/1.0-SNAPSHOT/TestArtifact-1.0-20130607.104006-2.apklib </code></pre> <p>My build.gradle is : </p> <pre><code>buildscript { repositories { maven { url "http://192.168.2.130:8081/artifactory/gradle" credentials { username = "$artifactory_user" password = "$artifactory_password" } } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.12', changing: true) } } } allprojects { apply plugin: 'idea' apply plugin: 'android' apply plugin: 'artifactory' } repositories { maven { url "http://192.168.2.130:8081/artifactory" credentials { username = "$artifactory_user" password = "$artifactory_password" } } } artifactory { contextUrl = 'http://192.168.2.130:8081/artifactory/simple' resolve { repository { repoKey = 'libs-snapshot' maven = true } } } </code></pre> <p>On Artifactory, the repository <code>libs-snapshot</code> use the maven unique snapshot behavior and is binding to the <code>maven-2-default</code> layout which has the following configuration : </p> <p>Artifact Path Pattern : <code>[orgPath]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext]</code></p> <p>Folder Integration Revision RegExp : <code>SNAPSHOT</code></p> <p>File Integration Revision RegExp : <code>SNAPSHOT|(?:(?:[0-9]{8}.[0-9]{6})-(?:[0-9]+))</code></p> <p>So from my understanding Gradle should resolve the dependency by looking at : </p> <pre><code>http://192.168.2.130:8081/artifactory/simple/libs-snapshot/com/company/test/TestArtifact/1.0-SNAPSHOT/TestArtifact-1.0-xxxxxxxx.xxxxxx-x.apklib </code></pre> <p>but it is actually looking at : </p> <pre><code>http://192.168.2.130:8081/artifactory/com/company/test/TestArtifact/1.0/TestArtifact-1.0.apklib </code></pre> <p>So obviously it does not resolve the dependency. I also tried to use the gradle compile line generated by Artifactory but it didn't do the trick either : </p> <pre><code>compile(group: 'com.company.test', name: 'TestArtifact', version: '1.0-20130607.104006-2', ext: 'apklib') </code></pre> <p>Although I spent some times reading posts and Gradle/Artifactory documentations, I'm even more confused now that I was in the beginning... So, I got a few questions : </p> <p>1) Gradle doesn't seem to be using the artifactory {} section. In fact, it is only using the url that I declare in the repositories {} section. But when I remove the repositories {} section, it only looks for dependencies locally. Why is that? What is the proper way to declare the Artifactory repositories?</p> <p>2) Will Gradle be aware of the underlying <code>libs-snapshot</code> layout? If not, does the Artifactory plugin offers a way to customize artifact search pattern (in straight Maven, not with Ivy)? Because I'm only using the free version of Artifactory thus I won't be able to edit repositories layouts.</p> <p>3) Why does Artifactory generate a gradle compile line that do not seems to match the layout used by the artifact container repository? </p> <p>Thanks in advance! </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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