我如何找出Maven工件的最后修改时间?
每个上传到Maven Central的工件都有一个last modified
时间.您可以通过在
Each artifact uploaded to Maven Central has a last modified
time associated with it. You can see an example of this by drilling into an artifact's details on search.maven.org.
如何使用Aether检索工件的last modified
时间?
How do I retrieve an artifact's last modified
time using Aether?
我仅出于供人类使用而检索此信息(即该项目发布多久了?正在积极维护吗?".)
I am retrieving this information purely for human consumption (i.e. "How long ago did this project make a release? Is it being actively maintained?").
检索此信息的一种方法(尽管不受官方支持)是构造工件的URI 并发出HTTP HEAD
来检索Last-Modified
标头.
One way to retrieve this information (though not officially supported) is to construct the Artifact's URI and issue an HTTP HEAD
to retrieve the Last-Modified
header.
我不知道有任何官方API可以做到这一点(建议!)
I'm not aware of any official API to do this (suggestions welcome!)