Search code examples
eclipseantjar

Creat JAR from .jardesc in eclipse


I have a question with respect to compiling java codes and building a jar file on Eclipse platform. I would like to know if the Create JAR option on eclipse from a .jardesc file will still create a JAR file inspite of errors in the compiled Java codes? If yes, how can i enable this option in my Ant build xml?


Solution

  • If you edit your .jardesc in Eclipse (Open WithJAR Export Wizard), you can modify the behavior regarding errors/warnings on page two of the wizard: Eclipse JAR Export Wizard (Page 2) "Export class files with compile errors".

    This apparently toggles the attributes exportErrors and exportWarnings, respectively, at XPath /jardesc/options in the .jardesc file.

    As far as the behavior of a corresponding Ant build file is concerned, you should probably take a look at the failonerror parameter of the Javac Task.