如何获取jar包版本 – 校验方法和清单文件未提供版本

huangapple go评论71阅读模式
英文:

How to get jar versions - checksum method and manifest file not giving version

问题

我正在处理一个旧的应用程序,它使用Ant构建。现在我们正在将其从Ant迁移到Maven,这需要在pom.xml中配置jar文件的依赖项。
有大约60个jar文件,我需要生成这些信息。我已尝试了以下两种方法来获取jar版本:

  1. 生成jar文件的校验和,并使用校验和在[https://search.maven.org/][1]上检查相应的jar文件。
  2. 生成jar文件的清单文件,检查implementation-versionbundle-version,然后通过找到的版本确定jar依赖项的详细信息。

这对大多数jar文件有效,但有大约25个jar文件,以上两种方法都不起作用。

校验和已生成,但对于这些剩下的jar文件,校验和在[https://search.maven.org/][1]上没有返回任何内容。

对于一些jar文件,清单文件中也没有版本详细信息。

请告诉我如何继续进行,我现在陷入困境了。我不知道对于这些jar文件,有什么方法可以起作用。

即使对于某些jar文件找不到详细信息,是否仍然可以将它们包含在我的pom文件中 - 是否有方法可以这样做?如果没有,我是否可以简单地将它们保留为jar文件,而不配置在pom中?

英文:

I am working on a legacy app and its in Ant build. Now we are moving it from Ant to Maven which requires dependency config of jar files in pom.xml.
There are some 60 jars for which I need to generate this info. I have tried below 2 methods for getting jar versions:

  1. generate jar checksum and check the corresponding jar on [https://search.maven.org/][1] using checksum
  2. generate manifest file of jar and check implementation-version or bundle-version and find out the jar dependency details through the version found.

This has worked for most of jars, but there are some 25 jars for which none of above methods are working.

Checksum is generated for all but for these remaining jars, checksum doesn't give anything on [https://search.maven.org/][1]

And for some, no version detail is there in manifest file.

Please let me know how to proceed with this, I am stuck here now. I don't know what can work here for such jars.

Even if I find no details for some jars, what can be way to still include them in my pom file - is there a way or not? If not, can I simply keep them as jars only instead configuring in pom?

答案1

得分: 3

如果您真的想要更新项目,我会拿这25个JAR包,并在MavenCentral查找它们是否有任何版本。

所以,如果您在您的目录中找到了junit.jar,请添加一个相对新的版本的junit。

当然,这可能会破坏需要修复的东西,但在继续前进时,最好依赖于官方的新工件。

如果某些工件无法实现这一点,将它们添加到您公司的Nexus/Artifactory(如果有的话)。

英文:

If you really want to update the project, I would take these 25 jars and look in MavenCentral if there any version of them.

So if you just find junit.jar in your directory, add a reasonably new version of junit.

Of course, this might break things that need to be repaired, but in going forward, it is better to rely on official, new artifacts.

If this is not possible for some artifacts, add them to your company Nexus/Artifactory if you have one.

huangapple
  • 本文由 发表于 2020年7月28日 15:45:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/63129294.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定