考虑以下jfiddle http://jsfiddle.net/bchapman26/9uUBU/29/
//angular.js example for factory vs service
var app = angular.module('myApp', ['module1', 'module2']);
var service1module = angular.module('module1', []);
service1module.factory('myService', function() {
return {
sayHello: function(text) {
return "Service1 says \"Hello " + text + "\"";
},
sayGoodbye: function(text) {
return "Service1 says \"Goodbye " + text + "\"";
}
};
});
var service2module = angular.module('module2', []);
service2module.factory('myService', function() {
return {
sayHello: function(text) {
return "Service2 says \"Hello " + text + "\"";
},
sayGoodbye: function(text) {
return "Service2 …Run Code Online (Sandbox Code Playgroud) 我的配置:
我的jenkins.xml文件
<service>
<id>jenkins</id>
<name>Jenkins</name>
<env name="JENKINS_HOME" value="%BASE%"/>
<executable>C:\Program Files\IBM\SDP8.5\jdk\bin\java.exe</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 -Djava.net.preferIPv4Stack=true</arguments>
</service>
Run Code Online (Sandbox Code Playgroud)
我的hudson.tasks.Mailer.xml文件
<hudson.tasks.Mailer_-DescriptorImpl plugin="mailer@1.4">
<defaultSuffix>@example.com</defaultSuffix>
<hudsonUrl>http://localhost:8081/</hudsonUrl>
<adminAddress>Jenkins Build Server <do-not-reply@example.com></adminAddress>
<smtpHost>smtp.example.com</smtpHost>
<useSsl>false</useSsl>
<charset>UTF-8</charset>
</hudson.tasks.Mailer_-DescriptorImpl>
Run Code Online (Sandbox Code Playgroud)
注意:"example.com"取代了我的真实域名/电子邮件/ smtp服务器.
当我指示Jenkins发送测试电子邮件时,我收到此错误:
Failed to send out e-mail
javax.mail.MessagingException: Could not connect to SMTP host: smtp.example.com, port: 25;
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:295)
Run Code Online (Sandbox Code Playgroud)
我对此错误的理解是,Windows 7中存在一个关于防火墙以及Java 7如何使用ipv4映射的ipv6地址的错误.
据报道,这可以通过在java运行时添加-Djava.net.preferIPv4Stack = true来解决.我在使用ANT电子邮件任务在此计算机上添加-Djava.net.preferIPv4Stack = true方面取得了成功.然而,在詹金斯,我没有运气.
请注意,jenkins.xml文件似乎完全被忽略.未设置-Djava.net.preferIPv4Stack = true参数.PATH和JAVA_HOME都指向IBM运行时,但Jenkins仍然从Oracle v7运行时开始.Jenkins必须产生一个新进程来启动并获取系统java …