Foros de discusión

Ant build error when running from with the IDE

thumbnail
Raymond Gardner, modificado hace 12 años.

Ant build error when running from with the IDE

Regular Member Mensajes: 118 Fecha de incorporación: 15/07/11 Mensajes recientes
Hello,

I am trying to run the build.xml file from within my Liferay Developer Studio EE 6.0 IDE. Actually, I added a few targets to the build.xml generated during project creation. I want to have a few custom targets for our build/deploy process and I decided to use the one given, since it is already there.

The build.xml works when I run it from the command-line. I had to set ANT_HOME to the IDE's Ant plugin folder.
But, when I run it within the IDE it fails:
Buildfile: C:\Sandbox\Liferay\eVolve-sdk\portlets\eVolve-plugin-portlet\build.xml

BUILD FAILED
C:\Sandbox\Liferay\eVolve-sdk\portlets\eVolve-plugin-portlet\build.xml:4: The following error occurred while executing this line:
C:\Sandbox\Liferay\eVolve-sdk\portlets\build-common-portlet.xml:6: The following error occurred while executing this line:
C:\Sandbox\Liferay\eVolve-sdk\build-common-plugin.xml:4: The following error occurred while executing this line:
C:\Sandbox\Liferay\eVolve-sdk\build-common.xml:72: .

Task cannot continue because ECJ is not installed.

ECJ was automatically installed. Please rerun your task.

Total time: 310 milliseconds


I run it again but I get the same error. Looking at build-common.xml line 72, it is trying to copy the ecj.jar file from project lib to ant home lib.
But, the ecj.jar file exists under ant home. I also find it in the sdk lib.
thumbnail
Gregory Amerson, modificado hace 12 años.

RE: Ant build error when running from with the IDE

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
You can fix this problem by adding the ECJ.jar to the global ant runtime path.
Window > Preferences > Ant > Runtime > Global entries > Add jar
Point to the ecj.jar that is in the SDK_dir/lib/ecj.jar location.
thumbnail
Raymond Gardner, modificado hace 12 años.

RE: Ant build error when running from with the IDE

Regular Member Mensajes: 118 Fecha de incorporación: 15/07/11 Mensajes recientes
Thanks! That did the trick.

I'd like to see the IDE/Studio be able to run these ant build files provided by the SDK without having to make this Eclipse Preferences change.
Not sure what would be the best way to do that, however.
thumbnail
Gregory Amerson, modificado hace 12 años.

RE: Ant build error when running from with the IDE

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
Actually we have been discussing this issue internally. The problem is rather complex one as it turns out. You can see more detail here:

http://issues.liferay.com/browse/IDE-411


So as you can see in the Ticket our solution is going to be put context menu actions/commands so that you can invoke any SDK command that you would need using a Liferay IDE action. This way we can be sure that the ECJ.jar classpath issue doesn't crop up but also we can prevent adding a global ECJ entry that could harm other project ant operating environment.
thumbnail
Raymond Gardner, modificado hace 12 años.

RE: Ant build error when running from with the IDE

Regular Member Mensajes: 118 Fecha de incorporación: 15/07/11 Mensajes recientes
Sounds like you guys know best!
thumbnail
Mazhar Alam, modificado hace 11 años.

RE: Ant build error when running from with the IDE

Regular Member Mensajes: 191 Fecha de incorporación: 25/11/11 Mensajes recientes
Helpful post