how to download biz.aQute.bnd.gradle using an alternate maven repo ?

64 views
Skip to first unread message

Pierre De Rop

unread,
Aug 23, 2017, 9:36:20 AM8/23/17
to bndtools-users
Hi all,

I'm trying to build a bndtools 3.4.0 project from jenkins (using gradle).
My problem is that the jenkins machine does not have access to outside world. it however has access to a corporate artifactory maven repository, which from its side can proxy maven central.

So, from jenkins, when the "gradle jar" command is run, then the biz.aQute.bnd.gradle-3.3.0.pom resource can't be downloaded, because by default the https://repo1.maven.org/maven2 repo is used.

here is the debug output (using gradle jar -d):

--------------------------------------------------------------------------------------------------------------------
...
15:11:55.538 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency unspecified:unspecified:unspecified(classpath) -> biz.aQute.bnd:biz.aQute.bnd.gradle:3.3.0(classpath)
15:11:55.546 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Selecting new module version biz.aQute.bnd:biz.aQute.bnd.gradle:3.3.0
15:11:55.548 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for biz.aQute.bnd:biz.aQute.bnd.gradle:3.3.0 using repositories [MavenRepo]
15:11:55.564 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache module-metadata.bin (/home/nxuser/.gradle/caches/modules-2/metadata-2.17/module-metadata.bin)
15:11:55.576 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.gradle/3.3.0/biz.aQute.bnd.gradle-3.3.0.pom
15:11:55.579 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.gradle/3.3.0/biz.aQute.bnd.gradle-3.3.0.pom
15:11:55.580 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache artifact-at-url.bin (/home/nxuser/.gradle/caches/modules-2/metadata-2.17/artifact-at-url.bin)
15:11:55.588 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.gradle/3.3.0/biz.aQute.bnd.gradle-3.3.0.pom
15:11:55.593 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.gradle/3.3.0/biz.aQute.bnd.gradle-3.3.0.pom
--------------------------------------------------------------------------------------------------------------------

so, since the jenkins host don't have access to the outside internet, then the HTTP GET is blocked and after a timeout, I'm getting this error:

--------------------------------------------------------------------------------------------------------------------
> Could not resolve all dependencies for configuration 'classpath'.
   > Could not resolve biz.aQute.bnd:biz.aQute.bnd.gradle:3.3.0.
     Required by:
         unspecified:unspecified:unspecified
      > Could not resolve biz.aQute.bnd:biz.aQute.bnd.gradle:3.3.0.
               > Connect to repo1.maven.org:443 [repo1.maven.org/151.101.120.209] failed: Connection timed out (Connection timed out)
--------------------------------------------------------------------------------------------------------------------


- so, does anyone have a work around for this problem ?

- Since the jenkins host has access to an artifactory maven repository which can proxy to maven central, then is there a property somewhere which I could change in order to use

thank you for your help;

kind regards
Pierre

BJ Hargrave

unread,
Aug 23, 2017, 9:41:31 AM8/23/17
to bndtool...@googlegroups.com
You would need to configure the buildscript in your settings.gradle file to use a maven repo your build system has access to that contains the bnd gradle jar.
See https://github.com/osgi/enroute.workspace/blob/15991b9b32f62861c516b53a251368de96bd92ca/settings.gradle#L2. Replace mavenCentral() with

    maven {
      url 'your repo url'
    }



--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
BJ

Pierre De Rop

unread,
Aug 23, 2017, 10:16:08 AM8/23/17
to bndtool...@googlegroups.com
thanks a lot ! it works fine now;

kind regards
Pierre

To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
BJ

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages