Maven3实战笔记02项目需求和模块分析


1 / 15 0DYHQ     (PDLVXKXDQ]KHQJ#FRP   ¡ ¢ £ ¤ ¥ ¦ § ¨ ©     ¢ £                 ! " § #$%& '  ( !  )*  +  ,- .  / 0 1 ! 2 3 4 56 708 9 :; 0 8 < =>  ? @A B C 08  D  EF GH IJKL M NOP  Q, 9  RS © T U J K  VW XY Z[  Q, 9 ?\  Q, ] ^ F G_ I ' `a b c 9 d ¡  e f g h  0 8f i j kl a / m no a / p q j k $ r ! s $ r t u 9 v w 4 5 m / 0 1 ¤ Ux    y z M{ | v  } O zM { |  ! ~€  ‚ 9 € ) ƒ m „ … 4 5 € „ ƒ † 1  „ ƒ‡ „ 9 ˆ  m  ‰ / 0 1 ! ˆ  Š‹ 9 Š‹ Œ = > Ž    ¨ © ] f  2 3  v 9 ] ‘ ’ L M NO P  “ ”• –  — ˜™ š 9 › ¡ 4 5   @ œ : '  ž” Ÿ  C¡    ¨ © ¢ c  v 0 8   † 1 £ ¤ L M NO P  W X  ! c  ¥¦ cf § S ©  4 5  9 ¨  Š‹ © ª « ¬­  ® „ « ¯ ° { P ± ²³ ¨ © 2 3 ´  — ˜ 9i Ž µ ¶ · ¸Š‹  ¹   ¨ © > º i  4 5 08 » ¼   ¢ £  ½  < ¶ Š‹     9 ¨ © ¢ ¾ 4 5    @ ´ ¿  ÀÁ  C x b Ž package com.liuyan.account.mail.impl; 2 / 15 import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import com.liuyan.account.mail.AccountEmailService; public class AccountEmailServiceImpl implements AccountEmailService { private JavaMailSender javaMailSender ; public JavaMailSender getJavaMailSender() { return javaMailSender ; } public void setJavaMailSender(JavaMailSender javaMailSender) { this .javaMailSender = javaMailSender; } private String systemEmail ; public String getSystemEmail() { return systemEmail ; } public void setSystemEmail(String systemEmail) { this .systemEmail = systemEmail; } @Override public void sendMail(String to, String subject, String message) throws MessagingException { MimeMessage msg = javaMailSender .createMimeMessage(); MimeMessageHelper msgHelper = new MimeMessageHelper(msg); msgHelper.setFrom( systemEmail ); msgHelper.setTo(to); msgHelper.setSubject(subject); msgHelper.setText(message); javaMailSender .send(msg); 3 / 15 } } † 1 n ª  ° à ªÄ O  Ī Å M N MÆÇ ÈÉ „ I package com.liuyan.account.mail; import javax.mail.MessagingException; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext ; import com.icegreen.greenmail.util.GreenMail; import com.icegreen.greenmail.util.ServerSetup; public class AccountEmailServiceTest { private GreenMail greenMail ; @Before public void startTest() { greenMail = new GreenMail(ServerSetup. SMTP); greenMail .setUser( "suhuanzheng7784877@163.com" , "1111"); greenMail .start(); } @Test public void sendMail() throws MessagingException { ApplicationContext ctx = new ClassPathXmlApplicationContext( "applicationContext.xml" ); AccountEmailService accountEmailService = (AccountEmailService) ctx .getBean( "accountEmailService" ); String to = "suhuanzheng7784877@163.com" ; 4 / 15 String subject = "ÊË "; String message = " Ì Í "; accountEmailService.sendMail(to, subject, message); } @After public void stop() { greenMail .stop(); } } > Î ÈÉ] Ç Ï Ž  † 1  ¢ £ ­ »Ð Ñn Ž 9 †Ò ¨ © c ¾ ¾ « ¯ °{ P ± Ó Ô Õ5  Ö × classpath:mail.properties 5 / 15 true true zM { | ¡ ¯ ° å ¯ O ° Ä { O Â Ö × mail.host= smtp .163.com mail.username= suhuanzheng7784877@163.com mail.password= 111111 mail.from= suhuanzheng7784877@163.com mail.to= suhuanzheng7784877@163.com Væ  ¤ U L M NOP b ç Ž 9 è ¡ L M NOP  é § ?@; æ  ê  Ñn ë ìí î Ž L M NOP  ¹ ï Ž ð ¨ © ñ c ¾¾  ¢ £    ò l ó ­ 6 / 15 ô òlµ #  ° à õ z M{ P õ Å M N M Væ  ÓÔ Õ5µ #  ° à õ zM { P õ ° O  å ö° à O V æ  >Î ÈÉ ò l  ° à õÄ O  Äõ Å M N M V 9 ¨ © c Ç ¢ £ ÷ ø Õ 5 ¯ å z ¡ ù z | 9 £ ¤ L ú y à | { ¯  O "5 < û Ç b ¯ å z ¡ ù z | Õ5 Ö × 7 / 15 4.0.0 com.liuyan.account MavenAccount-email 0.0.1-SNAPSHOT org.springframework spring-core 2.5.6 org.springframework spring-beans 2.5.6 org.springframework spring-context 2.5.6 org.springframework spring-context-support 2.5.6 javax.mail mail 1.4.1 junit junit 4.7 test com.icegreen greenmail 1.3.1b test 8 / 15 src/main/resource ü 3  V ý þ 9 z NP à | O M P Ä O Â Ä ÿ    4 ¡ ¾¾ ¢£  ¤ Ž  } 4 5 9 ¥ ¦  ñ ¾ h § ¨ &  © ððð ÿ    à Ž C   9 h § ¨ &  c  ¶ 9  „  U  ˜     ! £ ¤ ÓÔ    h § ¨ &   Ô 9 @ ! ;  £¤   I " JK W X ¥ ¦ 9 L M NOP '  W X  # ™   $ ­ » % §  &    W X  ¤ ' 9 ]  ± ° å ö ¯ ( ) Ð M ° Ä { * MÃ Ä ( ) Ð NO °  { å P Ð ¯ Mà ¦ M± { P ± +  Î , -. Ž ? / » +  X 0 1 à | M  { * { O ° 2 ¾ #  3 £ 1 æ ¾ # Ž ñ 4 5 2 c 6 9 Ò æ ] 7 8 6 ¤ Ž ± ° å ö ¯ ( )  ¢ £ /  X 0 Ð M ° Ä { * MÃ Ä ( )   X 0 Ð NO °  { å P  9 h * X 0 Ð ¯ Mà ¦ M± { P ±  Ñn   :;  Å M °   9 3 G ¾ c < Î , ÷ ø Ž   C8A =  X 0  ± ° å ö ¯ ( ) > M ° Ä { * MÃ Ä ( ) > NO °  { å P >? ¡ ? > ¯ Mà ¦ M± { P ± ¨  @ ¨ &'  C AB A = 9 com.liuyan.account MavenAccount-email 0.0.1-SNAPSHOT D ? C ¢ £ ¤ U D   i ? E F  G H  ]  I % W X J # D   9  % b Ž Væ Z[ ¢  ÓÔ 9  Z[ Ž « ¯ °{ P ±  C K  ¨ © L zM NOP ¨ &' M N Z[  ! Ž  Væ  O P  m ¨ © ¤ U Q < Z [ R < Z[  9 h STR £ ¤ ë / 5  W X  ¨ © ! UV L L M NOP '  &' W N Z[ n org.springframework spring-context-support 9 / 15 2.5.6 ÷ ø ¨ ©  4 5 Z [ å ° ± ¡  ¯ °{ P ± * ° M z O X å ° ¦ ¡  ¯ ° { P ± Y Ãå P Ä O ù Ä Y  ö ¯¯ å ° Ä ¡ d ¡ Z ¡ [ ¡ Å M °   9 £  ü 3 1 h § ¨ &' J # Ž ¢ £ Z[ ! ! V + $ ÓÔ \]   m Ãå z ¯ { | O m :; ^   ò _ L M NOP ¢ £ ` a  Æ b Ð ÈÉ Ð ü 3  ›  à | M  ¯ M Ä c d a ¢  ]  J L M NOP ÿ   ¢ £ C e a ý ` a  „  à | M  ¯ M Ä c C     f ÓÔ Ž Ãå z ¯ { | O  g T ! ; h  ` a i Z [ Å M ° µ # C e `a à | M  ¯ M Ä c ' 9 d m Ä O Â Ä m ÈÉ a j ¢  ü 3 a j C k % §   l Å ö P { Ä n  ü 3 a j  2 k U % § Ž 9 › m ¯ ° å N { ) O ) m Æ b Ð ÈÉ a j ¢  ?\ ` a d 2 „ #  Œ 3  O ° N | O Ä Y M ¯ { ¡ Å M °  X O m × n 6 o Ž G¹ \ M ¯ { Å M °  @ 9 è m °ö P Ä { z O m p ü 3 Ð ÈÉ a j a ¢  ! q rs  q r © t ¹ \ i ò _  u  ( q M N M yy  q v w ¹ \ 9 Z m  ú Â Ä O z m Y h x Š‹ y z{ .  Æ b Ð ÈÉ a j ¢  ||  h x yz{ .   } , C¡ ‘ 9 Z[ ~ m > € C /   ‚ ƒ C / „ 9   ¢ £ ¤ U Z[< ¤ … ³ n  ¨ ©   ¯ ° { P ± ] C I † 9 V æ  h ¢ £  Z[ ‡ Š t 10 / 15 S ©  ˆ  ¯ °{ P ± Y Ãå ° O c J ‰ @ ¿  h ¢ £ Š À Z[ … ‹  ‹ Œ ] C  ,   ] ¤ U Ž      C ¤ U M ¯ Mà c O  Ãå z z å P  Y | å±± { P ± 9 g T  ‘ ’ Ž 3 £ ¨ © š U  „  ¯ °{ P ± Y Ãå ° O  08  k “ ” % §  Ãå z z å P  Y | å±± { P ± n • 9 2 L M NOP †Ò  ¨ ©  – d  ¢ % §¨ © Š À ¤ U  n  † 1 I % —˜ ‚ ¦ ; ¨ © ÿ ™   vì j     M š ; V › ¨ © œ  n ¤ U  ? C n 9  /  ó £   ž Ž ¶ Ÿ  G j š ; J n  ‘ C × V i ¢ £ °ö P   c Ž  ¡ 3   ¢ £ 1  v ü 3  G H ( ¤ U Ž  Å M ° n  3 G I % — ˜ ‚ | = š ; J ¤‡ Å M ° n 9 ¥ 1 v ÿ    < = >  ¢ £ ¦ T% § Ž g T¤  n § ¨  „ L M NOP — ˜ ¢ £  ©  ‹  ÿ ª i « J $ ~ ¬ ,  Z[  ­ i L M NOP '  ¨ &  ¢ £ ÷ ø ' d ë ì ®¯ ° ø Ž    ô ¢ £  Z[ ‡ Š 9 ±  $ ~¬ ,Z[ ]  \]  O P 9 ¨ © ˆ ; æ  ² I "  h v w 4 5  ¢ £ Z[ …  ¯ °{ P ± Y Ãå ° O Z [ \]  Ãå z ¯ { | O  D  ¯ °{ P ± Y Ãå ° O Z[ … Ãå zzå P  Y | å±± { P ± ]  Ãå z ¯ { | O \] 9 g T £¤ ~¬ ,  h ¢ £ ³ à å zzå P  Y | å±± { P ±  Z []  à å z ¯ { | O 9 ¾ V _ 11 / 15 Š À Z [ \] Ãå z ¯ { | O Ä O Â Ä ¯ ° å N { ) O ) ° ö P Ä { z O Ãå z ¯ { | O Ãå z ¯ { | O Y Y ° ö P Ä { z O Ä O Â Ä Ä O Â Ä Y Y Ä O Â Ä ¯ ° å N { ) O ) ¯ ° å N { ) O Y ¯ ° å N { ) O ) ¯ ° å N { ) O ) ° ö P Ä { z O ° ö P Ä { z O Y Y ° ö P Ä { z O  _  ´ # ™ Œ R  J   ¢ £  µ  Š À Z [ ¶ 3  Ãå z ¯ { | O \]  g T ‹  µ · Z[ n 3 £ ]  à å z ¯ { | O  g T h ¢ £  µ · Z[ n  Z [ \]  Ãå z ¯ { | O 9 3 £   ¢ £  µ  Š À Z [ ¶ 3  à å z ¯ { | O \]  g T ‹  µ · Z[ n 3 £  Ä O Â Ä  g T h ¢ £  µ · Z[ n C  ¸¹ Z[ ‡ Š  ]   µ  Š À Z[ n  µ · Z[ n È É G H ‡ „ # 9 º ¤ » ¼ # ? C „  9 Z ¡ Z[ ½ R ¶ 3 T   ¾ ¿  ¢ £ w YÀ Á Z[  ¢ £ © YÀ ¢ £ t YÀ ÃÁ  ¡ Ä Â  ¢ £ w YÀ ¢ £ r YÀ ÃÁ   ¡ Z  9 g T ¢ £ w  C ” C Z[ … ¢ £ à 9 g ¨ ©  ¢ £ w # Å  V › à ¢ £  Q  9 h Œ R L M NOP › ³ … $ ¾¿ d  Æ Ç  ÈÉ ÊËÌ ÍÎÏ Ð Ñ Ò Ó ÈÔ ÊË Ì Õ Ö × Ø ÙÚ ÛÜ Ý Þ Üß à á Ð Ö × Õ â ã áä åæ ç 9 ¢ £ èé  ê Z[  ë ì Œ 3 w YÀ Á Z[  ¢ £ © YÀ ¢ £ t YÀ ÃÁ   ¡ Ä Â   à  w  µ h ë Z[  w YÀ ¢ £ r YÀ ÃÁ  ¡ Z Â Ç  à  w  µ · ë Z[ 9 g T I % Æ Ç    à   ¡ Z 9 h  í î ¢ ïð  „ 9 [ ¡ ï Z[    ¢ £ b Ž Z [ ï ññ å ¯ Ä { å P M | i Ä ° ö O  G H JK  p  Ò  ¢ £ Z[ … G ï Z[  D Ž  ¢ £ ¤ U G ¢ £  G H  G ¢ £  ï Z[ ò C  l ? C Z [ ´ ¸ ó §  ï Z[ C  ~¬ x Ž  ¢ £ 9 Ž  ¢ £ ¤ U ¤‡  ï Z[  G H ( ¤ U 12 / 15 ¯ å z ¡ ù z | Õ 5 ' ô H  2 3 õ K 9 ?@ ï Z[ ò C ö‘  ï Z[  # ÷ ø G    ù 8Œ  = ú  C >  9  –û „  Ï/ Ž C B Ï/  08 9 B üý Ž q M N M þ ÿ    ù 8 >  Æ Ç 9   ¡ Z[ ¥ ¡ ¢ @   6 m £ ´ Z[ m  ˆ S ©  4 5  c J  „ # Ž « ¯ °{ P ± d ¡ Z ¡ [  ? ' „ # Ž « ¯ °{ P ± ¢ £  C e    ô  ¢ £  c  ž ¤  ¢   ù 8 >  ¢ 9 ¥ ! ¾# | |    ô ¢ £ < ¤ Å M °  „ # g   % § Q  Å M °  « ¯ °{ P ± Ð ¦ { m O ° P M Ä O d  T   9 g T ¶ 3 ¨ ©  ¢ £ U § ì 9 h  « ¯ °{ P ± d ¡ Z ¡ [ ë ì C 8 ¨ © Ž  U § ì # › ¡ Ä 9 h  ¦ T R   M ! c  9 h * R  ]    C ¤ B   9     C —    « ¯ ° { P ± Ó Ô Õ 5 % §  g   ô Õ 5 Æ ˜    õ K    Ÿ ‚  ¥ „ #  § d „   Ÿ ‚   Ž  3 V ¨ ©  1  ÓÔ 4.0.0 com.liuyan.account MavenAccount-email 0.0.1-SNAPSHOT jar 2.5.6 2.5.6 org.springframework spring-core ${springversion} 13 / 15 org.springframework spring-beans ${springversion} org.springframework spring-context ${springversion} org.springframework spring-context-support ${springversion} javax.mail mail 1.4.1 junit junit 4.7 test com.icegreen greenmail 1.3.1b test src/main/resource d 6 m   Z[ m ¶ 3 T   ç  ¢ £ w YÀ ¢ £ © Y ¢ £ t  D w Y t   / Ž j À Z[  D t Œ   C  . 9 g T ­ » ¢ £ w  G H 3 £ V › Ž ¢ £ t    . 9 h 14 / 15  < C  9 g T C ! T   ¢ £ w  Z[ ' " .  U ÓÔ ¢ £ ©   ÓÔ ¢ £ ©  e G  “ #  ¢ £ ©  $ ¢ £ t   w ñ ¦  Z[   w „ ø  i  .  9 h t 9 ÓÔ 3 V org.springframework spring-beans ${springversion} org.apache logging org.apache logging 1.1.0  „ ( r y % & ! ô H Z[ t    ! £ ¤ ýþ ªª ô H Z[ ¢ z NP ) O ¯ OP ) OP à ú ' | { Â Ä ªª ô H Z[ ( z NP ) O ¯ OP ) OP à ú ' Ä ° OO ªª Z[ ¢ f § Y J b g < Z[ ¢ 2 „ z NP ) O ¯ OP ) OP à ú ' M P M | ú ) O * ¡ + ó ¨ © ,  v Ž    é - Ž  V L M NOP  ­ » Q,  Å M ° n Z[ Q, 9 † 1 ó – ( r y 15 / 15 ° ø Ž L M NO P  ¯ å z ¡ ù z | Õ 5   < Ö × ññ W X 9 † 1 é - Ž  V ¢ £ Z [  ¥ ¦ 9
还剩14页未读

继续阅读

下载pdf到电脑,查找使用更方便

pdf的实际排版效果,会与网站的显示效果略有不同!!

需要 3 金币 [ 分享pdf获得金币 ] 0 人已下载

下载pdf

pdf贡献者

zhyp29

贡献于2014-05-13

下载需要 3 金币 [金币充值 ]
亲,您也可以通过 分享原创pdf 来获得金币奖励!
下载pdf