Wednesday 13 February 2013

Cloudbees private repository

My problem

Recently I was attempting to use a Cloudbees 'clickstart' to help get users of my project up and running.  This has worked in the past and was going great, but then for some unknown reason my maven project dependencies could not be found.

My error was the typical maven dependency error:
cause : Failed to read artifact descriptor for com.temenos.interaction:interaction-sdk-rim-plugin:jar:0.2.0-SNAPSHOT
Stack trace : 
org.apache.maven.plugin.PluginResolutionException: Plugin com.temenos.interaction:interaction-sdk-rim-plugin:0.2.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.temenos.interaction:interaction-sdk-rim-plugin:jar:0.2.0-SNAPSHOT


Searching for a solution (ask Google approach)

There didn't seem to be any information related to my problem and I started to doubt that I could actually use a 'repository' declaration in my pom.xml with Cloudbees.  Thankfully that was just a red herring and Cloudbees supports pom.xml repository declarations just fine.  Whether their usage is a good idea or not is a separate question.


Debugging the issue

The best thing you can do in these situations is turn on some debugging and see what's going on.  I changed my Jenkins build target to '-X clean install'.  This shows all the dependency resolution information.  Sure enough my repo was never accessed, but I still could tell why.  I happened to notice that the private repo being access had a familiar id 'cloudbees-private-snapshot-repository'.  This id happened to be the same id I choose to use for my external maven repository.  Change the name and bobs your uncle, it all works again.


My configuration

Didn't work:
<repositories>
<repository>
<id>cloudbees-private-snapshot-repository</id>
<url>https://repository-aphethean.forge.cloudbees.com/snapshot/</url>
<releases><enabled>true</enabled></releases> 
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>

Works:
<repositories>
<repository>
<id>cloudbees-aphethean-snapshot-repository</id>
<url>https://repository-aphethean.forge.cloudbees.com/snapshot/</url>
<releases><enabled>true</enabled></releases> 
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>

No comments:

Post a Comment