简体   繁体   English

有谁知道是否有一个eclipse插件可以指出pom.xml中不兼容的jar?

[英]Does anyone know if there is an eclipse plugin can point out incompatible jars in pom.xml?

Every decent sized Java EE contains tons of jar files. 每个大小合适的Java EE都包含大量的jar文件。 But what really annoys me is that you have to match different jar files version properly. 但是真正让我烦恼的是,您必须正确匹配不同的jar文件版本。 For example, when using joda-time 2.2 with hibernate-entitymanager, if I choose hibernate-entitymanager 4.2.2 Final, then I will get this weird exception: 例如,将joda-time 2.2与hibernate-entitymanager一起使用时,如果我选择hibernate-entitymanager 4.2.2 Final,那么我会得到这个奇怪的异常:

"java.lang.AbstractMethodError: org.joda.time.contrib.hibernate.PersistentDateTime.nullSafeGet(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;". 

Then if I choose hibernate-entitymanager 3.6.8 Final, then everything works fine. 然后,如果我选择hibernate-entitymanager 3.6.8 Final,则一切正常。 I am wondering if there is a plugin can auto-detect incompatible jar files in the pom.xml editor (ex. gives warning or highlights incompatible jars) and suggest compatible versions? 我想知道是否有一个插件可以在pom.xml编辑器中自动检测不兼容的jar文件(例如,警告或突出显示不兼容的jar)并建议兼容的版本?

I found the maven-dependency-versions-check-plugin on Github when I did a Google search. 进行Google搜索时,我在Github上找到了maven-dependency-versions-check-plugin It looks well thought out, and the documentation looks pretty comprehensive. 经过深思熟虑,文档看起来非常全面。 (Nice!) (真好!)

Note that the documentation says you will need to build it from a source checkout ... but I actually found the plugin in Maven Central . 请注意,文档您将需要通过源代码检修来构建它……但是我实际上在Maven Central中找到了该插件。

It is also not clear how well it will work in practice. 还不清楚它在实践中将如何运作。 For a start, it can only be as good as the dependency compatibility information that is included in the respective POM files. 首先,它只能与各个POM文件中包含的依赖项兼容性信息一样好。

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

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