Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 463714 - Ant builder should create problem marker when build fails with error (and not write to log)
Summary: Ant builder should create problem marker when build fails with error (and not...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 13:42 EDT by Markus Keller CLA
Modified: 2020-07-03 03:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2015-04-01 13:42:56 EDT
When an Ant builder fails, the Eclipse Ant plug-in should create a problem marker on the Ant build file and include the error message.

When implementing bug 463236, it happened to me that a snippet evaluation was still running in a runtime Eclipse. Since that locked the /org.eclipse.jdt.debug.ui/snippetsupport.jar file, the Ant builder that is configured on that project failed.

The failure was not obvious to me, since it was only visible in the console for that build, but not as an error marker on the build file.

Console output:
------------------------------------
Buildfile: C:\e\w\master\git\eclipse.jdt.debug\org.eclipse.jdt.debug.ui\scripts\buildExtraJAR.xml

properties:

init:

clean:
      [delete] Deleting: C:\e\w\master\git\eclipse.jdt.debug\org.eclipse.jdt.debug.ui\snippetsupport.jar

BUILD FAILED
C:\e\w\master\git\eclipse.jdt.debug\org.eclipse.jdt.debug.ui\scripts\buildExtraJAR.xml:50: Unable to delete file C:\e\w\master\git\eclipse.jdt.debug\org.eclipse.jdt.debug.ui\snippetsupport.jar
Comment 1 Markus Keller CLA 2016-12-19 11:01:07 EST
For problems reported by javac or ecj, this is already possible (bug 133184, filed bug 509461 to enable the feature by default).

The implementation would best get the build result directly from the invocation of the Ant task. If that's not possible, then looking for "BUILD FAILED" in the output may be an option.
Comment 2 Markus Keller CLA 2016-12-19 11:23:49 EST
Looks like this is already implemented, but in a wrong way.

Compile errors should be represented as markers, not as log entries like this:

eclipse.buildId=4.7.0.I20161219-0145
java.version=1.8.0_102
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -showlocation
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data C:\e\w\master -clean -consolelog -showlocation -console -debug C:\e\w\debug-options.properties

org.eclipse.ant.launching
Error
Mon Dec 19 16:39:38 CET 2016
Failure of Background Ant Build

org.eclipse.core.runtime.CoreException: C:\e\w\master\git\eclipse.jdt.ui\org.eclipse.jdt.ui\scripts\build_jar-in-jar-loader.xml:22: Compile failed; see the compiler error output for details.
	at org.eclipse.ant.core.AntRunner.handleInvocationTargetException(AntRunner.java:448)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
	at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:270)
	at java.lang.Thread.run(Thread.java:745)
Caused by: C:\e\w\master\git\eclipse.jdt.ui\org.eclipse.jdt.ui\scripts\build_jar-in-jar-loader.xml:22: Compile failed; see the compiler error output for details.
	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1181)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:936)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:711)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:531)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:371)
	... 2 more
Comment 3 Eclipse Genie CLA 2020-07-03 03:23:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.