阿帕奇mime4j为0.7.2 Maven的依赖 [英] apache mime4j maven dependency for 0.7.2
问题描述
试图使用Apache Mime4J依赖于0.7.2版本是这样的:
Trying to use the Apache Mime4J dependency for Version 0.7.2 like this:
<repositories>
<repository>
<id>org.apache.james</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
<version>0.7.2</version>
</dependency>
我得到的依赖无法下载的错误信息。
检查后,
的http://uk.maven.org/maven2/org/apache/james/apache-mime4j/0.7.2/apache-mime4j-0.7.2.jar
确实不存在
但 http://uk.maven.org/maven2 /org/apache/james/apache-mime4j/0.7.2/
有.bin.tar.gz文件,我用工作解决该问题:
I got an error message that the dependency could not be downloaded. After checking that http://uk.maven.org/maven2/org/apache/james/apache-mime4j/0.7.2/apache-mime4j-0.7.2.jar indeed does not exist but http://uk.maven.org/maven2/org/apache/james/apache-mime4j/0.7.2/ had .bin.tar.gz files I worked around the problem using:
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
<version>0.6.1</version>
</dependency>
这将因此不引用更多的电流0.7.2版本。
This will therefore not reference the more current 0.7.2 release.
这是我的设置的问题:
- 为什么0.7.2版本不包含一个JAR文件?
- 我应该如何引用的依赖,以获得最新罐?
- 请我需要它呢?
- 的0.7.2和之间有什么区别
0.6.1版本?
推荐答案
问题1:为什么一个神器可能不存在
根据更改日志已有一些重构继续到功能分成三部分:核心,DOM和存储。
According to the changelog there has been some refactoring going on to split the functionality into the three parts: core,dom and storage.
问题2:如何获得最新的神器
修改依赖关系:
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-core</artifactId>
<version>0.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-dom</artifactId>
<version>0.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-storage</artifactId>
<version>0.7.2</version>
</dependency>
问3:我需要它
如果你想使用改进的DOM API:是的。您将需要修改
import语句不能使用新的Message()了。使用
if you'd like to use the improved DOM API: yes. You will need to modify your import statements and can not use new Message() any more. Use
MessageServiceFactory.newInstance().newMessageBuilder().newMessage();
来代替。该multipart.getBodyParts()函数也发生了变化,现在返回的实体。
没有isMimeType()的实体。您可能需要使用getMimeType()代替。
instead. The multipart.getBodyParts() function has also changed and returns an Entity now. There is no isMimeType() for the Entity. You might want to use getMimeType() instead.
问题4:版本之间有什么变化
这篇关于阿帕奇mime4j为0.7.2 Maven的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!