UBUNTU下continuum持续构建(二)

UBUNTU下continuum持续构建(二)
1、项目中的POM.XML配置文件
<scm>
<connection>
scm:svn:http://www.sillycat.com/repos/athena
</connection>
<developerConnection>
scm:svn:http://www.sillycat.com/repos/athena
</developerConnection>
<url>
scm:svn:http://www.sillycat.com/repos/athena
</url>
</scm>
配置了SVN的地址

2、Manage Project
登陆到continuum的操作页面

Action: New Project Groups 新增项目分组
click "Add Project Group"

Action: Add a Project      新增项目
click left menu "Maven 2.0.x Project"
POM项目定义配置文件的SVN地址
POM Url: http://www.sillycat.com/repos/athena/pom.xml
SVN的CHECK OUT 用户名
username:sillycat
SVN密码
password:xxxxxxx
no check Use SCM Credentials Cache,if available
(if check this checkbox,I get this error report when I build the project:
we have get a build error:
Provider message: The svn command failed.
Command output:
-------------------------------------------------------------------------------
svn: PROPFIND request failed on '/repos/athena'
svn: PROPFIND of '/repos/athena': authorization failed (http://www.sillycat.com)
-------------------------------------------------------------------------------
)

Project Group: sillycat
Build Definition Template: default maven2 template

click "Add" button

Action:Edit a Project 修改项目信息
click left menu "Show Project Groups"
choose project group sillycat
When you edit a project from the groupSummary, you will see basics informations.

click the tab menu "Notifiers" 新增消息通知信息
Mail recipient Address: [email protected]

Action:Members
the tab menu is next to the tab menu "Project Group Summary"
edit the project you want to build
edit the SCM information

click "build now"

Action:"Build Definitions"
modify the building schedules

3、build后邮件通知出错
2456551 [pool-1-thread-1] INFO org.codehaus.plexus.notification.notifier.Notifier:mail - Sending message: From '"Continuum@kiko" <[email protected]>'.
2456551 [pool-1-thread-1] INFO org.codehaus.plexus.notification.notifier.Notifier:mail - Recipient: To '<[email protected]>'.
2456590 [pool-1-thread-1] ERROR org.apache.maven.continuum.notification.ContinuumNotificationDispatcher:default - Error while trying to use the mail notifier.
org.codehaus.plexus.notification.NotificationException: Exception while sending message.
        at org.apache.maven.continuum.notification.mail.MailContinuumNotifier.sendMessage(MailContinuumNotifier.java:566)
        at org.apache.maven.continuum.notification.mail.MailContinuumNotifier.buildComplete(MailContinuumNotifier.java:387)
        at org.apache.maven.continuum.notification.mail.MailContinuumNotifier.sendNotification(MailContinuumNotifier.java:254)
        at org.apache.maven.continuum.notification.DefaultContinuumNotificationDispatcher.sendNotification(DefaultContinuumNotificationDispatcher.java:199)
        at org.apache.maven.continuum.notification.DefaultContinuumNotificationDispatcher.sendNotification(DefaultContinuumNotificationDispatcher.java:159)
        at org.apache.maven.continuum.notification.DefaultContinuumNotificationDispatcher.buildComplete(DefaultContinuumNotificationDispatcher.java:103)
        at org.apache.maven.continuum.buildcontroller.DefaultBuildController.endBuild(DefaultBuildController.java:221)
        at org.apache.maven.continuum.buildcontroller.DefaultBuildController.build(DefaultBuildController.java:175)
        at org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor.executeTask(BuildProjectTaskExecutor.java:50)
        at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
        at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
        at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.codehaus.plexus.mailsender.MailSenderException: Error while sending the message.
        at org.codehaus.plexus.mailsender.javamail.AbstractJavamailMailSender.send(AbstractJavamailMailSender.java:226)
        at org.apache.maven.continuum.notification.mail.MailContinuumNotifier.sendMessage(MailContinuumNotifier.java:562)
        ... 14 more
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
        java.net.ConnectException: Connection refused
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
        at javax.mail.Service.connect(Service.java:275)
        at org.codehaus.plexus.mailsender.javamail.AbstractJavamailMailSender.send(AbstractJavamailMailSender.java:212)
        ... 15 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:520)
        at java.net.Socket.connect(Socket.java:470)
        at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
        at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
        ... 18 more

连接自己本机的SMTP服务器出错(当然啦,本机都没有开启这个服务)
修改配置
/usr/local/continuum-1.1/conf/plexus.xml

<resource>
<name>mail/Session</name>
<type>javax.mail.Session</type>
<properties>
<property>
<name>mail.smtp.host</name>
<value>smtp.126.com</value>
</property>
<property>
<name>mail.smtp.port</name>
<value>25</value>
</property>
<property>
<name>mail.smtp.auth</name>
<value>true</value>
</property>
<property>
<name>mail.smtp.user</name>
<value>magic_dreamer</value>
</property>
<property>
<name>password</name>
<value>xxxxxx</value>
</property>
<property>
<name>mail.smtp.debug</name>
<value>true</value>
</property>
</properties>
</resource>

修改了配置后,重启,就可以正常使用啦。勾选了构建策略后,每过一个小时系统就会自动build一次,还会给出邮件通知。

回家又配置了一次,结果发送邮件老是报错,报错如下:

Caused by: com.sun.mail.smtp.SMTPSendFailedException: 553 You are not authorized to send mail, authentication is required

        at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
        at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
        at org.codehaus.plexus.mailsender.javamail.AbstractJavamailMailSender.send(AbstractJavamailMailSender.java:214)
        ... 15 more

仔细观察了一下日志,原来是我配置的用户名和密码是126.com的,但是mail from写的确实公司的邮箱,所以老是认证不通过啦。修改了mail from 就好了

cd /usr/local/continuum-1.1/apps/continuum/webapp/WEB-INF/classes/META-INF/plexus
vi application.xml
<from-mailbox>[email protected]</from-mailbox>
<from-name>sillycat</from-name>

你可能感兴趣的:(java,apache,maven,SVN,ubuntu)