0
我正在使用artifactory版本3.0.4。我需要根據groupId:artifacId:*
計算指定工件的版本列表。神器版本在artifactory中搜索
這似乎可以利用REST和artifactory的商用版本:
我已經在Groovy腳本如下:
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.3.2')
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils
import org.apache.http.client.methods.HttpGet;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;
def url = "http://artifactory:8089/artifactory/agg/libs-snapshot-local/com/mygroup/my-artifact/";
HttpGet request = new HttpGet(url);
DefaultHttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
String responseString = EntityUtils.toString(entity, "UTF-8");
println responseString
但在responseString版本爲my-artifact
是淹沒在無關的信息中。任何建議來執行一個更明智的請求還是我需要解析這個醜陋的字符串?