From version < 8.1 >
edited by Krzysztof Płachno
on 2017/06/12 10:20
To version < 10.1 >
edited by Krzysztof Płachno
on 2017/06/14 16:51
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -132,8 +132,6 @@
132 132  ** Possible solution is that: on Artifactory/Bintray you may have plenty different, logically different maven repos. So prerequisite for connecting Artifactory/Bintray will be providing url to repo containing only xwiki valid extensions.
133 133  
134 134  (((
135 -
136 -
137 137  == Update 12.06.2017 ==
138 138  
139 139  === Summary of mail discussion 2 ===
... ... @@ -143,7 +143,66 @@
143 143  * term Extension does not refer only to typical XWiki extensions that contain [email protected] or XWiki pages but generally all JARs, that can be later used e.g. in groovy script. Typical XWiki extension usually depend on some external JAR that need to be downloaded from Maven Central or JCenter
144 144  * for the future I would be definitely useful to extend Extension Repository UI with an option to choose the repository from which we want to search extensions (e.g. search in Bintray JCenter, search in Extensions.org ect.)
145 145  
144 +== Update 13.06.2017 ==
146 146  
147 147  
147 +=== Investigation report 3 ===
148 148  
149 +It turns out that bintray is only SAS software - you cannot download it and run on private server. The consequence is that - there's common api URL for all accounts on bintray, that is:
150 +
151 +* dl.bintray.com - for dowloading packages
152 +* api.bintray.com - for all other rest calls
153 +
154 +(((
155 +(Yes - the same api has different url for different things - cool - isn't it?)
149 149  )))
157 +
158 +In documentation terminology - different bintray instances (accounts) are called :**subject** and different repositories on bintray instance (account) are called :**repo
159 +**Example:
160 +
161 +* the "jcenter" is a maven repository (:**repo**) running on Bintray instance called "bintray" (:subject)
162 +* according to rest api documentation if you want to download package via rest api you call following URL:
163 + GET [[https:~~/~~/dl.bintray.com/:subject/:repo/:file_path
164 + s>>url:https://dl.bintray.com/:subject/:repo/:file_pathso]]o in case of JCenter and the newest version guava library it'd be:
165 + GET [[https:~~/~~/dl.bintray.com/bintray/jcenter/com/google/guava/guava/22.0/guava-22.0.jar>>url:https://dl.bintray.com/bintray/jcenter/com/google/guava/guava/22.0/guava-22.0.jar]]
166 +* if you want to search a package via rest api:
167 +GET /search/packages[?name=:name&desc=:desc&subject=:subject&repo=:repo]
168 +(look! you do not need to specify nor :subject nor :repo and if they are absent searching goes through all public instances and repos on whole bintray SAS)
169 +in case we want to look for guava package in JCenter the call would be
170 +[[https:~~/~~/api.bintray.com/search/packages?name=guava&subject=bintray&repo=jcenter>>url:https://api.bintray.com/search/packages?name=guava&subject=bintray&repo=jcenter]]
171 +
172 +More over some REST API paths require authentication - like e.g. downloading (probably due to ddos protection). So to be able to download anything via REST you need to have an account on bintray.com (even a free one) and put Basic Auth Credentials in http requests.
173 +Look! We are still talking about accessing Bintray instance (account) that may have different repos (maven, npm, rpm, ...) via common rest api. Still we can access each of those repos directly in their native way. E.g. JCenter is a valid maven repo and we can connect it with maven client and without any authentication download packages.
174 +\\URL template for native connection with repos is dl.bintray.com/:subject/:repo
175 +E.g.
176 +
177 +
178 +* url for maven connection with my private bintray account is: [[http:~~/~~/dl.bintray.com/cristof/xwiki-test>>url:http://dl.bintray.com/cristof/xwiki-test||style="background-color: rgb(255, 255, 255);"]]
179 +* URL for JCenter maven connection due to it's popular has special one: [[http:~~/~~/jcenter.bintray.com>>url:http://jcenter.bintray.com/||style="background-color: rgb(255, 255, 255);"]] but [[http:~~/~~/dl.bintray.com/bintray/jcenter>>url:http://dl.bintray.com/bintray/jcenter||style="background-color: rgb(255, 255, 255);"]] works as well (tested)
180 +
181 +=== Summary and reasonings ===
182 +
183 +* configuring bintray repository connection in xwiki.properties in the same format as other are enabled would not be intuitive e.g.
184 + extension.repositories=maven-xwiki:maven:http:~/~/nexus.xwiki.org/nexus/content/groups/public
185 + since Bintray is only SAS software - there's always the same url, and moreover there are different paths for different operations (see above)
186 +* the only thing to configure are the **:subject** and **:repo** which we want to connect and potentially the type of repo e.g. maven
187 +* this authentication in downloading via REST imho is a bit of nuisance - it's better to skip it using native connection to each type of repo (which does not require auth) and rest connection only for searching (which is not authorized)
188 +
189 +=== Proposal ===
190 +
191 +* the proposal is to not introduce 'bintray' general connector but different connectors with particular type of repos that can be hosted on bintray e.g. 'bintray-maven', 'bintray-npm' and so. In this way we will utilize native connector for downloading and Bintray Rest API for searching
192 +* all those connectors will be packed together in one extension
193 +* to preserve current xwiki.properties configuration syntax, the config of bintray connection would look like following:
194 + jcenter:bintray-maven:http:~/~/dl.bintray.com/bintray/jcenter
195 + and the last two path segments will be parsed as :subject and :repo for usage in REST API calls
196 +* accoring to this in my bintray-maven connector I will implement from scratch only searching and other stuff will be done using maven (aether) connector from xwiki-commons
197 +)))
198 +
199 +== Update 14.06.2017 ==
200 +
201 +
202 +Discussion on riot summary
203 +
204 +* when DefaultExtensionRepositoryManager is initialized and ConfigurationExtensionRepositorySource is used to add ExtensionRepositories basing on configuration in xwiki.properties - components from extensions are not yet loaded. So BintrayMavenExtensionRepository currently cannot be configured in xwiki.properties the same way as other repositories e.g. **extension.repositories=maven:xwiki:http:~/~/nexus.xwiki.org/nexus/content/groups/public**
205 +* for the current moment configuration of connection to bintray maven repositories will be done by **custom** properties in xwiki.properties. How will they look like - it'll be announced
206 +* **bintray-repository** extension will contain JCenterBintrayRepositorySource which will be automatically processed on installment of extension (it'll be possible after fix of Thomas Mortagne in xwiki-commons - creating listener to ComponentAddEvent for role ExtensionRepositorySource). That means installment of bintray-repository extension by default will add JCenter Extension Repository. Probably it will be set up to specify special property in xwiki.properties to disable connection to JCenter

Get Connected