ant

Why isn't my log4j.properties file getting used?

I have a log4j.properties file in my current directory that specifies some things to log at DEBUG level, and everything else as INFO: log4j.rootLogger=WARN, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:...

Ant: How can I see the std output of Java task?

I have a java program to run and it will print out some messages on the console. When I put the program as an Ant java task, I can't see my output on the console. What should I do? I should add that I run Ant from Eclipse. The console output does not appear in Eclipse console. ...

How to change JAVA.HOME for Eclipse/ANT

I am trying to sign a jar file using an ANT script. I know this has to be pointed at the JDK directory for jarsigner.exe to run, but when I echo java.home it returns the JRE directory. This isnt a problem for javac because I can set the executeable path, but that does not exist for signjar. How do I change the java.home path? When I ...

What is the best way to compile J2ME and J2SE apps from the same codebase?

Hi all, I'm trying to build an app for both J2ME and J2SE. The presentation code will obviously be different, but I'm hoping to keep the logic common, as much as possible. My plan is to use Ant or Antenna's preprocessor to select either the J2ME or J2SE Graphics object, with that class being the only intersection between my logic and d...

What would make Ant execute 'javac' in Eclipse with UTF-8 instead of my system default Cp1252?

The last week I've been trying to figure out why some stream decoding my newly adopted application is doing was giving me some major encoding problems. Finally I figured out that the problem was that the JARs/WAR being built with Ant and deployed to the server were being compiled with the javac task using the encoding UTF-8 instead of th...

How do you load a file into a variable in ant using the <loadfile> task?

I'm trying the following and it doesn't seem to work. <property name="file.configs.txt" value="" /> ... <target name="..."> <loadfile property="file.configs.txt" srcFile="remoteConfig/configs.txt" /> </target> I read here that the <loadfile> task is supposed to load the contents of a file into the specified property. ...

How to get access to the current JUnitCore to add a listener?

I have some test infrastructure classes that I'd like to add as listeners of JUnitCore , specifically for testRunFinished. I'm invoking Junit 4 from ant's task. Is there some way for me to get access to the JUnitCore created by the task so that I can add a listener? ...

How to debug error while compiling gwt source: "An unexpected error has been detected by Java Runtime Environment"?

While compiling gwt source, I get the error : "An unexpected error has been detected by Java Runtime Environment " Following is the hs_err_pid14267.log (error log) file is generated on server How would you debug this? # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f8d00a8d25a,...

Adding finder copyright info to my info.plist in my ant build

I am trying to add copyright info to the finder for my app and I have discovered that I want to see the NSHumanReadableCopyright Info.plist variable but I am not sure how do this with my ant build. To set my version I added a call to version="3.0" to the jarbundler portion of my ant build but I cannot find a similar attribute to add cop...

What is the most cross-platform way to execute a Perl script from Ant?

What is the most cross platform way to execute a pPerl script from ant? Windows does not like the Perl script as the executable. Is there any way other than just running Perl using an OS specific executable and passing the Perl script in as an argument? ...

IllegalAccessError when calling ant script from maven-antrun-plugin

I just updated Maven from 2.0.9 to 2.2.1 and I'm getting the following exception when running a maven build: INFO] [antrun:run {execution: precompile-jsp}] [INFO] Executing tasks default: jspc: [mkdir] Created dir: C:\builds\trunk\webapps\vyre_portlets\WEB-INF\jsp_src [INFO] -------------------------------------------------------...

Can I write an ant task which takes parameters when being executed from another ant task?

Can I write an ant task which takes parameters when being executed from another ant task? What I try to achieve in general, is re-using existing tasks with different parameters. What I don't know is: is there something such a sub-task in ant? can it take parameters? how and where such sub-task is specified? Concept of what I need t...

Creating database (not populating it) through Ant build file.

Hi all. I've managed to do some ant-script to populate my databases.. (simple script that runs some .sql files, like 'create', 'populate', 'drop', etc.) Is there any way in hell that an ant-script can create the database itself from scratch? This is for JavaDB-Derby (from the glassfish bundle). Since it's a project for university, we f...

ant deploy problem

I am working on a spring project. I use ant to deploy application and STS (eclipse based) IDE to develop. I set the CATALINA_HOME environment variable echo $CATALINA_HOME /home/username/springsource/apache-tomcat When I run the deploy ant task from IDE it deploys to a folder under /home/username/workspace/myproject/${env.CATALINA...

Application server-agnostic build script

I have a J2EE application that needs to be distributed to customers, who will have application servers of their own choice. What is the recommended way of writing a build script that would compile the J2EE application sources (at customer sites) so that they will eventually be able to deploy the application on their servers ? Moreover, ...

How do I set -Dfile.encoding within ant's build.xml?

I've got java source files with iso-8859-1 encoding. When I run ant, I get "warning: unmappable character for encoding UTF-8". I can avoid this if I run ant -Dfile.encoding=iso-8859-1 or add encoding="ISO-8859-1" to each javac statement. Is there a way to set the property globally within build.xml? <property name="file.encoding" valu...

Ant Copy Task: Failed to copy due to java.io.FileNotFoundException

I'm trying to compile a Flex application in Ant (no problems here, I can do it fine). When I try to publish the contents of the project to a Windows network drive (known as "Z:\" on my system), I get the following LAME exception thrown by Java/Ant: BUILD FAILED C:\workspace\bkeller\build.xml:42: Failed to copy C:\workspace\bkeller\web\...

How to derive a relative path using Ant

I'm using Ant and mxmlc to compile ActionScript classes and MXML into swfs, while maintaining the default organization of a Flex Builder (Flash Builder) project. Many of my ActionScript classes are in project subdirectories, so my project is organized like the following: MyBigProject -build-imports.xml -build.xml -bin-debug --src ---f...

how do I extract the 1st element from a ant CSV property..

given a CSV ant property, <property name="module.list" value="mod1,mod2,mod3,mod4,mod5"/> how can I just get the first element (ie "mod1" here)? I want to execute a command that will take in "mod1" as one of the arguments. Moreover.. I cannot modify this original "module.list" property to a list or anything else.. although I can crea...

Invoking FindBugs from Ant: passing a space-separated list of files to java

I'm trying to invoke FindBugs from inside Ant. In order to control the amount of memory available to FindBugs, I've chosen not to use the ant-task. The problem I have now is that I want to pass a number of jars on the command-line to FindBugs: java -jar .../findbugs.jar foo.jar bar.jar fie.jar However, since these jars actually are Ec...