[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Build problem

Posted on 2011-03-14
53
Medium Priority
?
363 Views
Last Modified: 2012-05-11
Hi ,

I have some ant script to build my project , I think it was working fine before . but now its not ? It reffer my old files and old folders . i have create some folder in web content  called wsdl . some days back i deleted that folder . in my project (eclispse work sepace ) today i bulid the
project . i saw the files again how can it possible ?  is this build error or some other error ?
 
<?xml version="1.0" encoding="UTF-8"?>
<project name="Deploy From Eclipse to Tomcat" basedir=".">
<property name="warfile" value="x"/>
<target name="unpack">
<unwar src="${warfile}.war" dest="${warfile}" />
</target>
<target name="create">
<war destfile="${warfile}.war" webxml="WebContent/WEB-INF/web.xml" update="true">
<classes dir="build\classes"/>
<fileset dir="WebContent">
<exclude name="WEB-INF/web.xml"/>
</fileset>
</war>
</target>
<target name="copy">
<copy todir="c:\Tomcat55\webapps" overwrite="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<target name="deploy">
<antcall target="create"/>
<antcall target="copy"/>
</target>
</project>

Open in new window

0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 28
  • 17
  • 7
  • +1
53 Comments
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35128040
And i deleted some jars --- its maintain the same size not reduce . old war and new war file size are same !!
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35128209
And aslo

I put some hard code value in one Jsp file . but that value not present in that war file(after deploy i checked)
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35129200
So, if it is not working, do you see some error message?
I think some more details could be helpful
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:CEHJ
ID: 35129835
Make sure that particular build file is actually getting run.

>>I put some hard code value in one Jsp file . but that value not present in that war file(after deploy i checked)

Also, is that jsp under directory WebContent? If it isn't, it won't be included

Please run ant thus and please post the file ant.log
ant -d -f <absolute path to ant build file here without angle brackets> deploy >ant.log 2>&1

Open in new window

0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35131017
>>>>>>>>if it is not working, do you see some error message?
no its created successfully .

>>>>I think some more details could be helpful

I dont know which type of deatils will give .Please ask me question


>>>>>>>>Make sure that particular build file is actually getting run.

yes i am sure build is running ,  because  while running the target values are printed in console.

>>>>>>>>Also, is that jsp under directory WebContent? If it isn't, it won't be included

ya that file is webcontent/jsp folder only

>>>>>>>Please run ant thus and please post the file ant.log
i will run this 2mmorrow because i am room now !
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35131248
>>yes i am sure build is running ,  because  while running the target values are printed in console.

Yes, but it might not be the build file you think it is
0
 
LVL 92

Assisted Solution

by:objects
objects earned 600 total points
ID: 35133066
eclipse could be creating them, check your eclipse setup
and your build should have a clean option that first deletes all generated content before building
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35135520
>>>>>>>your build should have a clean option that first deletes all generated content before building

How to do that ??
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35135570
ant -d -f <absolute path to ant build file here without angle brackets> deploy >ant.log 2>&1

how to run this ?? give  an example ??
0
 
LVL 92

Assisted Solution

by:objects
objects earned 600 total points
ID: 35135684
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136055
2 build folder are created ??

outside the webcontent and inside webcontent/web-inf/build  which one will be reffred by the deployement code ??
0
 
LVL 92

Expert Comment

by:objects
ID: 35136065
it deploys from build.home
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136077
Sorry i am not getting ?
0
 
LVL 92

Expert Comment

by:objects
ID: 35136090
the directory ${build.home} is what is deployed to tomcat, which what that property is set to
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136114
in my ant script >>
<classes dir="build\classes"/>

which hulid path its reffer ? its out side or inside the web content !!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35136118
>>how to run this ?? give  an example ??

ant -d -f "c:\my projects\webstuff\build.xml" deploy >ant.log 2>&1

Open in new window

0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 1400 total points
ID: 35136121
To subsequently view as well (but attach the file please):
ant -d -f "c:\my projects\webstuff\build.xml" deploy >ant.log 2>&1
notepad ant.log

Open in new window

0
 
LVL 92

Expert Comment

by:objects
ID: 35136122
> which hulid path its reffer ? its out side or inside the web content !!

its the build/classes folder, not really anything to do with the build path
Its the folder containing your compiled classes
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136544
ant -d -f "C:\sathishkumar\new1103\xxbuild.xml" deploy >ant.log 2>&1 notepad ant.log

i run this in command promt it nothing is happend .
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35136554
That's two separate commands:


ant -d -f "C:\sathishkumar\new1103\xxbuild.xml" deploy >ant.log 2>&1
notepad ant.log

Open in new window

0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136565
>>>>> the directory ${build.home} is what is deployed to tomcat, which what that property is set to


I put echo message in ant builder with ${build.home} but it reuturn nothing
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136581
the result is

'ant' is not recognized as an internal or external command,
operable program or batch file.
0
 
LVL 92

Expert Comment

by:objects
ID: 35136594
which build file are you referring to?
the one you posted in the question does not do a deploy, it just creates the war
the one I posted sets it to

  <property name="build.home"    value="${basedir}/build"/>
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35136618
${warfile} is the only variable used, so if you haven't set it subsequently in the build file, you'd need to do it something like this. Please attach the file ant.log
ant -Dwarfile=mywar.war -d -f "C:\sathishkumar\new1103\xxbuild.xml" deploy >ant.log 2>&1

Open in new window

0
 
LVL 92

Expert Comment

by:objects
ID: 35136632
Creating a build file from scratch is rarely needed, better to start with an existing one and tune it to your needs.
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35136868
@CEHJ: same result

>>>>Creating a build file from scratch is rarely needed, better to start with an existing one and tune it to your needs.

I am tring with exiting ant builder but have some
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35136968
>>@CEHJ: same result

You won't see anything happening. The result is in ant.log in the directory in which you run the command
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137009
>>>You won't see anything happening. The result is in ant.log in the directory in which you run the command

c:\ant -Dwarfile=mywar.war -d -f "C:\sathishkumar\new1103\xxbuild.xml" deploy >ant.log 2>&1

C:\ notepad ant.log

'ant' is not recognized as an internal or external command,
operable program or batch file.

0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 1400 total points
ID: 35137043
>>
ant' is not recognized as an internal or external command,
operable program or batch file.
>>

You need to make sure that either

a. the ant.bat directory is on PATH
b. you use the full path to ant.bat

(The former is preferable)
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137112
>>>>>>>a. the ant.bat directory is on PATH
b. you use the full path to ant.bat


Where it should be? ant.bat file there but i dont it on path

path means enviroment varibale ?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137182
>>path means enviroment varibale ?

Yes. See'Environment Variables' in Windows help
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137232
yes i add in ant.bat in envi path
but same result only coming
'ant' is not recognized as an internal or external command,
operable program or batch file.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 1400 total points
ID: 35137300
Did you start a new command window? You need to
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137358
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137416
OK, so what do you think you're missing in the result, or what is unexpected?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137497
see the last 2 lines

   [copy] Copying C:\sathishkumar\new1103\x\x.war to c:\Tomcat55\webapps\x.war
     [copy] Copying C:\sathishkumar\new1103\x\x.war.war to c:\Tomcat55\webapps\x.war.war

that 2war size are diffrent ?

U dont how its create 2 time . This is the 1st time i am seeing
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137518
Just in case there have been any changes in build.xml, can you attach the version you're using?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137542
if i deploy \x.war
then unwanted files are created (i already delete folder are there)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137570
Your copy task (if still the same as the original) can be simplified to
<target name="copy">
	<copy todir="c:\Tomcat55\webapps" overwrite="true" file="${warfile}" />
    </target>

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137618
You also must decide whether you're going to enter either

x

or

x.war

as the ${warfile} parameter. If the latter, then you must decide whether

${warfile}.war

should appear in the build file - probably not
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137670
>>file="${warfile}" />

build fails !!
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137687
file="${warfile}.war" /> working fine but it still reffer wrong folders
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35137691
Try the following as

ant deploy

(in the correct directory)
build.xml
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137791
your build.xml and mine are same right ??
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35137818
Devlopement view    deploy dev
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1400 total points
ID: 35138250
Delete all the stuff from the deploy directory and run the one i just gave you from the correct directory. It should be OK. You need to do this from the command line, in the same directory as the build.xml
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35138305
ya while i deploy i dellted the extact folder no use ...

>>>>>>>>>>>>>>>>>see the last 2 lines

   [copy] Copying C:\sathishkumar\new1103\x\x.war to c:\Tomcat55\webapps\x.war
     [copy] Copying C:\sathishkumar\new1103\x\x.war.war to c:\Tomcat55\webapps\x.war.warthat 2war size are diffrent ?

U dont how its create 2 time . This is the 1st time i am seeing

while i deploy that code its having correct file and my hard coded values also !!


0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35138346
But now its not genrating !!  :(
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35138537
Yes its done it ! i delted only in tomcat folder but now i deleted in my project folder aslo now its working

Thanks a lot !!
0
 
LVL 20

Author Closing Comment

by:Sathish David Kumar N
ID: 35138587
Thanks lot ........
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35139368
That's OK. Can you confirm that you can run the deploy task from the ide successfully too?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35158769
http:#35137358   replace file with old one ant.txt
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35158782
yes i can deploy from IDE also.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question