How to get the information where runtime dependencies are downloaded from - inside my project?


(amin.zamani) #1

I am writing a gradle plugin and what I need is the following:

Assuming in gradle some configures following project dependencies:

project(':myProject') {
   dependencies {
     runtime ('extensions:javascript-console-repo-4.0.x:0.5')
      providedCompile( 'org.alfresco.enterprise-sdk:alfresco:'+alfrescoTargetVersion ) { exclude group:'com.sun.jdmk', module: 'jmxtools' }
  providedCompile( 'javax.servlet:servlet-api:2.5' )
  providedCompile( 'javax.servlet:jsp-api:2.1' )
  providedCompile( 'org.alfresco.enterprise:alfresco:'+alfrescoTargetVersion+'@war' )
 }
}

Inside of my plugin I want to know which runtime dependencies are included in the project (in that example extensions:javascript-console-repo-4.0.x:0.5) AND FROM WHERE IT WAS DOWNLOADEDS! That means I need the repository download information/path (of the artifactory). Is there a way to get this information? I need them, because I must generate a file with this information, for an other application who must download this files - the runtime dependencies.

Thank you very much for helping to find the answer!

Best regards Amin Zamani


(amin.zamani) #2

It seems that I can find the runtime dependencies on this kind:

project.subprojects.each {
                    it.configurations.runtime.dependencies .each {
    println "runtime dependency: " + it;
   }
}

But how can I get download information from where they where downloaded?


(amin.zamani) #3

When I execute above code in my plugin following output is rendered:

runtime dependency: DefaultExternalModuleDependency{group=‘extensions’, name=‘javascript-console-repo-4.0.x’, version=‘0.5’, configuration=‘default’}

Exists an object to retrieve more information as only the group, module and version ?


(amin.zamani) #4

By more I mean the download information of that runtime dependency


(Peter Niederwieser) #5

I’m not aware of a way to find out which repository a dependency was downloaded from.


(amin.zamani) #6

Is there a way to test from which repository the dependency was downloaded from? For example, is it possbile progammatically try to download the same extension again from repository a, or repository b or repository c ?

So it would be possible to test if the dependency is from this or that artifactory - that would work or could be a solution if we only make use of 4 artifactories.