|
Question
|
How to make ANT keep source line numbers
When I build with ANT 1.3, exceptions show source code line numbers. For example:
java.lang.Exception: com.ge.med.gemsit.rs.dise.app_server_not_available
at com.ge.med.gemsit.rs.dise.DiseServer.initialize(DiseServer.java:442)
at com.ge.med.gemsit.rs.dise.DiseServer.startServer(DiseServer.java:833)
at com.ge.med.gemsit.rs.dise.DiseServer.main(DiseServer.java:1630)
However, when I switch to ANT 1.5 or ANT 1.5.4, exceptions look like:
java.lang.Exception: com.ge.med.gemsit.rs.dise.app_server_not_available
at com.ge.med.gemsit.rs.dise.DiseServer.initialize(Unknown Source)
at com.ge.med.gemsit.rs.dise.DiseServer.startServer(Unknown Source)
at com.ge.med.gemsit.rs.dise.DiseServer.main(Unknown Source)
The build environment is not changed except for ANT_HOME and PATH to ant script.
The javac task only has srcdir, destdir, excludes attributes plus the classpath and include nested tags. Do I miss something? Thank you.
|
|
Derived from
|
A question posed by Jeff Chu
|
|
Topics
|
Tools:Build:Ant
|
|
Author
|
Eugene Kuleshov PREMIUM
|
|
Created
|
Oct 17, 2003
|
|
Answer
You should turn it on like this:
<javac srcdir="src" destdir="target/classes"
debug="true" debuglevel="lines, vars, and source">
...
</javac>
Is this item
helpful? yes no
Previous votes Yes: 6 No: 0
|
|
Comments and alternative answers
 |
Point of clarification
Bill Wadley, Oct 19, 2003
The debuglevel above should read:
debuglevel="lines, vars, source"
The "and" is from to ant docs.
Is this item
helpful? yes no
Previous votes Yes: 2 No: 0
|
|

|
 |
debuglevel in ant
dieter v. holten, Jan 7, 2004 [replies:3]
i would say, for that purpose debuglevel="lines, source" should be enough - local variable info is needed only for debugger
Is this item
helpful? yes no
Previous votes Yes: 0 No: 0
|
|

|
 |
 |
Re: debuglevel in ant
Eric Schlenz, Apr 13, 2004 [replies:2]
JUST FYI!!!
I only got this to work when my debuglevel setting looked like this:
debuglevel="lines,vars,source"
NO SPACES between the debuglevel values).
Is this item
helpful? yes no
Previous votes Yes: 4 No: 0
|
|

|
 |
 |
 |
Re[2]: debuglevel in ant
Steven Kuypers, Mar 11, 2010
Thanks to all!
adding debug="true" debuglevel="lines,source" (indeed without a space between 'lines,' and 'source') in the <javac> tag solved the problem of missing line numbers.
Without it I would see
package.class(?:?) - message
and now I see
package.class(blabla.java:147) - message
Keywords: log4J missing class missing line number
Is this item
helpful? yes no
Previous votes Yes: 0 No: 0
|
|

|
|
|
 |
|