91

春のサポートを利用してメールを送信したいのですが。私のプロジェクトはmaven-2で構築されており、spring-core 2.5.5を使用しています。pom.xmlに含めるアーティファクトをmaven中央リポジトリで調べようとしましたが、見つかったのはspringsupportだけです。問題は、リポジトリの最高バージョンが2.0.8であり、Spring-corev。2.0.8に依存していることです。それを追加してその依存関係からspring-core、spring-aopなどを除外する必要がありますか、それとも別のアーティファクトを探す必要がありますか(ただし、どちらを実行しますか?)、または別のリポジトリを使用しますか?org.springframework.mailの適切なmaven-2アーティファクトはどれですか?どこで見つけることができますか?

4

3 に答える 3

147

メールの内容は、奇妙なことに、context-support artifactにあります。

于 2009-09-02T12:10:33.197 に答える
33
 <!-- ########### SPRING-CONTEXT-SUPPORT ############ -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
于 2013-11-04T04:18:04.743 に答える
1

For using MailSender and SimpleMailMessage through Spring you can use these imports in your code:

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

And add their jars in your project.

Otherwise if you are using maven then you have to make these imports in your source and then add dependencies :

  1. http://mvnrepository.com/artifact/org.springframework/spring-support/2.0.6
  2. http://mvnrepository.com/artifact/org.springframework/spring-context-support/3.2.0.RELEASE

You will get the mail support from both of them.

于 2015-08-18T05:09:53.587 に答える