简体   繁体   English

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

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

I am working on a legacy app and its in Ant build.我正在开发一个遗留应用程序及其在 Ant 版本中。 Now we are moving it from Ant to Maven which requires dependency config of jar files in pom.xml.现在我们将它从 Ant 移动到 Maven ,这需要在 pom.Z0F635D0EC132874 中的 jar 文件的依赖项配置。 There are some 60 jars for which I need to generate this info.有一些 60 jars 我需要为其生成此信息。 I have tried below 2 methods for getting jar versions:我尝试了以下两种获取 jar 版本的方法:

  1. generate jar checksum and check the corresponding jar on [https://search.maven.org/][1] using checksum生成 jar 校验和并使用校验和在 [https://search.maven.org/][1] 上检查相应的 jar
  2. generate manifest file of jar and check implementation-version or bundle-version and find out the jar dependency details through the version found.生成 jar 的清单文件并检查implementation-versionbundle-version并通过找到的版本找出 jar 依赖项详细信息。

This has worked for most of jars, but there are some 25 jars for which none of above methods are working.这适用于大多数 jars,但也有一些 25 jars 以上方法都不起作用。

Checksum is generated for all but for these remaining jars, checksum doesn't give anything on [https://search.maven.org/][1]为除这些剩余的 jars 之外的所有生成校验和,校验和在 [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.我不知道这样的 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?即使我没有找到某些 jars 的详细信息,有什么方法可以将它们仍然包含在我的 pom 文件中 - 有没有办法? If not, can I simply keep them as jars only instead configuring in pom?如果没有,我可以简单地将它们保留为 jars 而不是在 pom 中配置吗?

If you really want to update the project, I would take these 25 jars and look in MavenCentral if there any version of them.如果你真的想更新项目,我会拿这 25 个 jars 并在 MavenCentral 中查看它们是否有任何版本。

So if you just find junit.jar in your directory, add a reasonably new version of junit.因此,如果您只是在目录中找到junit.jar ,请添加一个相当新的 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.如果某些工件无法做到这一点,请将它们添加到您的公司 Nexus/Artifactory(如果您有的话)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM