I am very new in Ant (I came from Maven) and I am finding some difficulties with this simple Ant script that compile a Java project located into Eclipse workspace:
The Ant script code is:
<?xml version="1.0"?>
<project>
<!-- ============================================ -->
<!-- Load build properties -->
<!-- ============================================ -->
<property name="project.buildfile" value="build.num" />
<property file="${project.buildfile}" />
<property file="info.properties" />
<!-- Elimina le cartelle contenenti le classi compilate ed i jar -->
<target name="clean">
<delete dir="../Release" />
<!-- Elimina directory del jar finale -->
<delete dir="bin" />
<!-- Elimina directory delle classi compilate -->
</target>
<target name="compile">
<mkdir dir="bin" />
<javac srcdir="src" destdir="bin" />
</target>
</project>
So this script have a first target named clean that simply delete 2 directory into my project (this part work well)
The other target is named compile that implements 2 simple tasks related the compilation of the project:
1) Create a directory named bin in my project (this is ok)
2) Compile the sources that are into src project folder and put the .class file into the bin directory.
And here I have some problem because when I execute this ant script I obtain these errors messages:
Buildfile: /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/build.xml
clean:
[delete] Deleting directory /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/bin
compile:
[mkdir] Created dir: /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/bin
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/build.xml:22: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 35 source files to /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/bin
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Settings.java:12: package org.apache.log4j does not exist
[javac] import org.apache.log4j.Logger;
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Settings.java:14: package com.adamtaft.eb does not exist
[javac] import com.adamtaft.eb.EventBusService;
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Settings.java:26: cannot find symbol
[javac] symbol : class Logger
[javac] location: class com.techub.crystalice.xmlhandler.Settings
[javac] public static final Logger logger = Logger.getLogger("gui");
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Utils.java:9: package org.apache.log4j does not exist
[javac] import org.apache.log4j.Logger;
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Utils.java:16: cannot find symbol
[javac] symbol : class Logger
[javac] location: class com.techub.crystalice.xmlhandler.Utils
[javac] private static final Logger logger = Logger.getLogger("gui");
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Settings.java:26: cannot find symbol
[javac] symbol : variable Logger
[javac] location: class com.techub.crystalice.xmlhandler.Settings
[javac] public static final Logger logger = Logger.getLogger("gui");
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Settings.java:130: cannot find symbol
[javac] symbol : variable EventBusService
[javac] location: class com.techub.crystalice.xmlhandler.Settings
[javac] EventBusService.publish(new SettingsEvent(this, SettingsEventType.UPDATED));
[javac] ^
[javac] /home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/src/com/techub/crystalice/xmlhandler/Utils.java:16: cannot find symbol
[javac] symbol : variable Logger
[javac] location: class com.techub.crystalice.xmlhandler.Utils
[javac] private static final Logger logger = Logger.getLogger("gui");
[javac] ^
[javac] 8 errors
BUILD FAILED
/home/andrea/Documenti/XCloud/Implementazione/CrossPlatform/CrystalIceXMLHandler/Project/build.xml:22: Compile failed; see the compiler error output for details.
Total time: 1 second
Why I have these errors? How can I solve?
Tnx
Andrea