Here is my build.xml:
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-portlet">
<import file="../build-common-plugin.xml" />
</project>
I am using Liferay portlet in Eclipse. When I run build.xml as an Ant build it fails.
Here is the error trace:
Buildfile: G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\portlets\Sample-portlet\build.xml
[get] Getting: http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: C:\Users\user\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Error getting http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar to C:\Users\user\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Getting: http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: C:\Users\user\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
BUILD FAILED
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\portlets\Sample-portlet\build.xml:5: The following error occurred while executing this line:
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\portlets\build-common-portlet.xml:5: The following error occurred while executing this line:
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\build-common-plugin.xml:5: The following error occurred while executing this line:
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\build-common.xml:60: The following error occurred while executing this line:
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\build-common-ivy.xml:130: The following error occurred while executing this line:
G:\softwares\lifeRay_CMS\plugin\liferay-plugins-sdk-6.2\build-common-ivy.xml:81: HTTP Authorization failure
I had the same problem, you need to check build.[username].properties file in liferay_plugins/build.myUser.properties.
First check if this is pointing the correct directory
app.server.parent.dir = ../liferay-portal-6.2-ce-ga6
Then change this:
ivy.version = 2.3.0
ivy.jar.url =http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar
This link is helpful liferay 6.2 ivy problem
Related
I'm trying to deploy several systems with one script containing two targets. When one systems fails to deploy, I want to stop the whole script and fail.
<target name="deploy_all">
<for list="${systems}" param="system" delimiter="," parallel="false" threadCount="1" trim="true">
<sequential>
<antcall target="deploy_one_system">
<param name="system" value="#{system}" />
</antcall>
</sequential>
</for>
</target>
<target name="deploy_one_system">
<trycatch property="error_system">
<try>
<!-- deployment -->
<!-- Deep in other targets, there's <fail> -->
</try>
<catch>
<echo>Error during deployment of ${system}:</echo>
<echo>${error_system}</echo>
<!-- print logs, errors, cleanup -->
<if>
<contains string="${stop_execution_on_fail}" substring="${system}" />
<then>
<echo message="I should fail here!" />
<fail message="Error occured during deploying ${system}."/>
</then>
</if>
</catch>
</trycatch>
</target>
The problem is that the condition is evaluated correctly and message "I should fail here!" gets printed, but the build doesn't fail and continues deploying next system.
Variable ${stop_execution_on_fail} is supplied to the script and contains list of systems which should fail the whole build (instead of deploying the rest of systems).
Sometimes, the build fails after deploying several systems running out of memory.
17:07:03 deploy.xml:900:
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system1.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system2.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system3.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:4: java.lang.OutOfMemoryError: PermGen space
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:4: java.lang.OutOfMemoryError: PermGen space
I'm running Jenkins 1.642.1, JDK 1.8.0_74 and Ant 1.9.2.
Any ideas?
EDIT (based on pczeus' comment): The following is printed (don't mind timestamps, I took it from another build):
10:12:56 [echo] Error during deployment of system1:
10:12:56 [echo] The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:739: The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:647: The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:473: The following error occurred while executing this line:
10:12:56 [echo] dbmaintain.xml:229: Unable to perform db maintain task.
--- omitted ---
10:12:56 [echo] I should fail here!
As you can see, the condition is evaluated successfully, as the message I should fail here! is printed.
stop_execution_on_fail variable contains comma-separated list of systems where to fail:
system1,system2,system3
I believe your issue is within your
<contains string="${stop_execution_on_fail}" substring="${system}" />
You are checking for a substring matching the system in the overall string stop_execution_on_fail. However, your try:
<trycatch property="error_system">
Is setting the error message within the error_system property, which you are not checking in your contains.
Try changing the <contains> to:
<contains string="${error_system}" substring="${system}" />
I traced the error down using Chad Nouis' suggestion and found out the following:
First, I was stupid when I didn't post the actual code but just excerpt and some variables substituted. Shame to me!
The parallel attribute in <for> call in deploy_all target was set to true. In that case, even with threadCount set to 1, Ant does fail the target, but doesn't prevent the for cycle from running next loop (although I'm convinced it should).
Thank you, Chad Nouis!
I have the following code in my build.properties file
### WebLogic ###
bea.home=${tool.home}/bea
# weblogic 8.1: Change weblogic.home
weblogic.home=${bea.home}/weblogic81
#weblogic.home=${bea.home}/weblogic92
#weblogic.home=${bea.home}/wlserver_10.3
weblogic.version=8.1
ejb.spec.version=3.0
But after running the tools.build file it is showing the following error:
BUILD FAILED
t:\DevEnv\3.1RC25\toolsetup.xml:22:
The following error occurred while executing this line:
t:\DevEnv\3.1RC25\toolsetup.xml:184: Property 'weblogic.8.1.root' is not defined.
I have checked and the weblogic is in the folder T:\bea\weblogic81\server\lib
Is this a problem regarding the wrong versions of weblogic as I have weblogic81 on my machine?
When I am trying to build from cassandra source 1.2.5. I am getting this error:
[root#SudeepMangu apache-cassandra-1.2.5-src]# ant build build.xml run
Buildfile: /home/sudeep/apache-cassandra-1.2.5-src/build.xml
maven-ant-tasks-localrepo:
maven-ant-tasks-download:
[echo] Downloading Maven ANT Tasks...
[get] Getting: http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
[get] To: /home/sudeep/apache-cassandra-1.2.5-src/build/maven-ant-tasks-2.1.3.jar
[get] Error getting http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar to /home/sudeep/apache-cassandra-1.2.5-src/build/maven-ant-tasks-2.1.3.jar
BUILD FAILED
/home/sudeep/apache-cassandra-1.2.5-src/build.xml:266: java.net.UnknownHostException: repo2.maven.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:234)
at sun.net.www.http.HttpClient.New(HttpClient.java:307)
at sun.net.www.http.HttpClient.New(HttpClient.java:324)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:660)
at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:579)
at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:569)
Total time: 50 seconds
You have network issues. Try again when http://repo2.maven.org will work in your browser.
You can add the following setting in Build.xml
**<setproxy proxyhost="**.**.**.**"
proxyport="***"
nonproxyhosts="*****.com"
proxyuser="*****"
proxypassword="****" />**
I want delete a directory only if exists.
<target name="clean">
<delete dir="${COMP_BUILD}" />
</target>
this gets error
clean:
[delete] Deleting directory U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\ENT_APP\ESW\bgc-esw-services\build
BUILD FAILED
U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\BUILD\ESW\ESWBUILD\build.xml:451: The following error occurred while executing this line:
U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\ENT_APP\ESW\bgc-esw-web\build.xml:207: The following error occurred while executing this line:
U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\ENT_APP\ESW\bgc-esw-web\build.xml:84: The following error occurred while executing this line:
U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\ENT_APP\ESW\bgc-esw-services\build.xml:64: Unable to delete directory U:\id824275_03_2011_06_JUN_ESW\CCS_WSC_ECM\ecm_esw\app\ENT_APP\ESW\bgc-esw-services\build\lib
You could specify failonerror:
<delete dir="${COMP_BUILD}" failonerror="false"/>
This will continue execution if the directory doesn't exist.
The trouble with this is that if the directory does exist, but can't be deleted for some other reason, then it will also still carry on.
In my TFSBuild.proj I have the following Exec commands:
<Target Name="AfterCompile">
<Exec Command="#echo Program.cs(12,20): warning CS1002: ; missing"/>
<Exec Command="#echo Program.cs(13,20): Warning CS1003: ;; missing"/>
<Exec Command="#echo Program.cs(14,20): error CS1004: ;;; missing"/>
</Target>
The TFS build fails, because it parses the output and sees an error reported in it.
I get the following output in buildlog.txt:
Program.cs(12,20): warning CS1002: ; missing
Program.cs(13,20): warning CS1003: ;; missing
Program.cs(14,20): error CS1004: ;;; missing
c:\bw\10\BuildType\TFSBuild.proj(228,5): error MSB3073: The command "#echo Program.cs(14,20): error CS1004: ;;; missing" exited with code -1.
But I don't get these errors reported in the result details:
While errors and warnings are reported on a normal project build with a link to a file containing the set with found warnings and errors:
Any idea on getting the list of errors and warnings parsed out of the exec output and into the TFS reporting?
Solved my own question as follows:
I created a myexec.proj file that does the execution of the Exec.
In TFSBuild.proj I execute the solution using <SolutionToBuild Include="myexec.proj"/>.
The output is now automatically parsed for errors and warnings.