Making HTTP requests during maven archetype:generate

江枫思渺然 提交于 2019-12-03 20:26:16

There are couple of of ways you can do this. Two ways we did this previously were using:

1. Using groovy - gmaven plugin and RESTClient inside it

Our code is a bit complicated to paste here, but we did some thing very similar to this:

Groovy Rest Invocation Using Maven

2. Antcontrib's loadresource :

Example:

<loadresource property="build_start_date">
   <url url="${JOB_URL}/lastSuccessfulBuild/api/xml?xpath=/*/id/text()"/>
</loadresource>

This connects to a hudson rest api and get's me the last build date which is stored in the property build_start_date.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!