我正试图利用ant移民工具实现销售部队应用自动化。 我遵循所有基本步骤:
- Installation of jdk 11, ant and force.com ant migration tool
- Adding ant-salesforce.jar in ANT_HOME/lib/ and then configuring build.xml, package.xml and build.properties files.
第一,我只尝试了<斯特隆>,部署全程<>/斯特隆>指挥系统,但我的 CI工具建设状况却每时都失败。 因此,我试图通过使用<ant-verbose的指挥来核对错误,这种指挥始终显示如下:
BUILD FAILED
Target "test" does not exist in the project "Sample usage of Salesforce Ant tasks".
at org.apache.tools.ant.Project.tsort(Project.java:1921)
at org.apache.tools.ant.Project.topoSort(Project.java:1833)
at org.apache.tools.ant.Project.topoSort(Project.java:1796)
at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
at org.apache.tools.ant.Main.runBuild(Main.java:818)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
我没有增加任何步骤来检查目标测试。 经过一些改动后,错误改变为:
BUILD FAILED
/var/jenkins_home/workspace/SF-Ant-deploy/build.xml:15: Failed to login: Failed to send request to https://login.salesforce.com/services/Soap/u/57.0
at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:237)
at com.salesforce.ant.SFDCAntTask.getApexConnection(SFDCAntTask.java:242)
at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:48)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
at org.apache.tools.ant.Main.runBuild(Main.java:818)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: com.sforce.ws.ConnectionException: Failed to send request to https://login.salesforce.com/services/Soap/u/57.0
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:128)
at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:845)
at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:230)
... 19 more
Caused by: java.net.UnknownHostException: login.salesforce.com
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1232)
at java.base/sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1071)
at java.base/sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1069)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:795)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1068)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1367)
at java.base/sun.net.www.protocol.http.HttpURLConnection$8.run(HttpURLConnection.java:1334)
at java.base/sun.net.www.protocol.http.HttpURLConnection$8.run(HttpURLConnection.java:1332)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:795)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1331)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:246)
at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.java:143)
at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:103)
at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:98)
at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:94)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:104)
... 21 more
Total time: 11 seconds
https://login.salesforce.com/services/Soap/u/57.0“rel=” 从浏览器中发现:
HTTP 405 error
for request /services/Soap/u/57.0
Only POST Method
下面是我建筑中的法典 pe。 xml file:
<target name="test">
<sf:compileAndTest username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}">
<!--runTest>SampleDeployClass</runTest-->
</sf:compileAndTest>
</target>
<!-- Shows deploying code & running tests for package codepkg -->
<target name="retrieveCode">
<!-- Retrieve the contents listed in the file codepkg/package.xml into the codepkg directory -->
<sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="force-app/main/default" unpackaged="force-app/main/default/package.xml"/>
</target>
<target name="deployall">
<!-- Upload the contents of the "codepkg" package, running the tests for just 1 class -->
<sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="force-app/main/default" runAllTests="true">
<!--runTest>SampleDeployClass</runTest-->
</sf:deploy>
</target>
我是在代位环境后面执行这一ant的指挥,我甚至使用以下指挥:
export ANT_OPTS="-Dhttp.proxyHost=host -Dhttp.proxyPort=port
ant配置指挥。
我认为,这名罪犯可能是这里的代理。 当我重复我个人系统中的相同步骤[不包括代理组合]时,我会照预期。 是否需要增加任何其他步骤来没收代理? 我是否误解了什么? 请帮助我解决这个问题。 advance!