ant

How to re-use a dependent project in ant?

We have a project that includes all of our re-usable classes, third-party library JARs and what not. This project is basically just where ALL of the dependencies for every project we are working on. We may only use ant and we may not use Ivy unfortunately. So for example: ./Common-Project (includes all dependencies -build.xml (will bu...

running applet via ant from eclipse

hello, i would like to launch an applet in an build.xml like this: <java classname="sun.applet.AppletViewer" classpath="${libraries}"> </java> (at least that is how it works in netbeans) but i get the error message: [java] JVM args ignored when same JVM is used. [java] Could not find sun.applet.AppletViewer. Make sure you have it...

Eclipse Generated Build Files

Hello all, I am using the ZK Studio plugin to create a web based project based on the ZK framework. Now, in order to deploy this project, all I do is right click on the project and select "Export" then select "WAR file". However, I would like build files to be created so that someone else can just make a change and run the build file to...

Executing command line code in an ant build file

How can I execute following command line code in an ant build file? cd backend/doctrine/ export PC_ZEND_ENV=testing php doctrine migrations:migrate << EOF y EOF The solution With the feedback I've got I figured out the following working exec command. <exec dir="backend/doctrine" executable="php"> <env key="PC...

ant: Need help packaging an EJB and its dependencies into an EAR

My goal is pretty simple: to use ant to build an EAR which contains 1 EJB and 1 jar containing all of the dependencies. This jar, called common.jar for the sake of example has vendor jar files in it as well as other xml files that the EJB depends on and will need to be able to see during runtime.... So far I have everything packaged cor...

Java Manifest file's class path and how it determines relative dirs

How does the Class-path in the MANIFEST.MF file determine the relative location? 1) Say I have a JAR with a jar inside lib/somejar.jar and ofc the manifest file is inside META-INF/MANIFEST.MF. How would I set the classpath....? Would it be Class-path: lib/somejar.jar or ../lib/somejar.jar ? 2) Let's say the somejar.jar also has other j...

Ant + Class-path Issue

I have written an ANT script and finally am building the jar here is the building of jar section <jar jarfile="${destination}/@{name}.jar"> <fileset dir="${output}"> <include name="abc/xyz/@{name}/**"/> </fileset> <zipfileset dir="lib" prefix="lib/"/> <manifest> ...

JBoss Arquillian integration with Apache Ant and Junit

Has anyone managed to integrate Arquillian with Ant and JUnit? If so, could you provide an example? ...

Ant replaceTokens with line numbers and file names

Is there any way in an Ant script to use the <copy> task (replaceTokens) to preprocess Java files and replace a "__FILE__" string with the file name of the copied file and "__LINE__" with the line number in that file? This would go a long way toward solving Java's lack of a preprocessor. The docs on replaceTokens show examples of fixed ...

Teamcity build counter not being passed into Ant

I'm using Teamcity to build with an Ant runner. I'm trying to pass the current build counter into the "Additional Ant command line parameters" using the following -lib %teamcity.build.checkoutDir%/MI/CustomAntTasks/jars/CustomAntTasks.jar -Dlabel={0} The value -Dlabel={0} is being passed into the Ant script as the literal value {0} a...

MyEclipse is formatting my Java code when I run an Ant build

When I run an Ant build, MyEclipse (happens for v6.0 and 7.5) formats my code. When I open the file it says it was modified on the file system and when I reload it it is formatted. The thing that is even stranger is that it is not formatted as specified in the Code Style in my Preferences (seems like Java Sun codding rules). As far as ...

JAXB Ant Task Error: xjc2 [ERROR] null unknown location

When binding on some valid XML documents using Ant's xjc2 task, I get the following failure message: [xjc2] [ERROR] null [xjc2] unknown location The documents are very similar to other files which have bound successfully, all imported schemas exist. Running xjc in verbose mode produced: Parent is not Defined Class...I cannot get the...

Setting Environmental Variables to configure ANT,JAVA and TOMCAT

Recently I have been trying to make changes so I can do builds through Ant and the command line. This has forced me to reconfigure my setup. In order to make java available on the class path I typed the following in the command propmt... set JAVA_HOME=C:\Java\JDK 1.6.0_08 that being the directory of my java installation. Then I will s...

[ant-build-error] java.lang.SecurityException: Prohibited package name: java.lang

I'm getting the following error when trying to build my very simple webservice project. I've given the build.xml, my java file and path values The class file is getting generated, but service is not getting generated. Please help... It's bugging for a looooong time.. Thanks! :) CLASSPATH=C:\bea\weblogic81\server\lib\weblogic.jar;C...

Override ignored for property

Content of Build.xml File <?xml version="1.0"?> <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="ant-contrib-0.6.jar"/> <taskdef classpath="orangevolt-ant-tasks-1.3.2.jar" resource="com/orangevolt/tools/ant/taskdefs.properties"/> <project name="initinstaller" default="all" basedir="." > <targ...

Running an JUnit test as Ant target

Hi, I've got a simple test case in /build directory that I'm trying to compile and run with Ant. Compilation is fine, but I can't figure out how to run this. The class is: package money; import org.junit.*; import static org.junit.Assert.*; public class MoneyTest { @Test public void testAmount() { Money m = new Money(...

svnant command to copy files from an ssh repository to a sever?

Hi is there anybody who knows how to write the copy command for svn-ant or just svn to copy files from an ssh repository(svn+ssh://[email protected]/media/repository/files) to a server folder (var/httdocs/files) ...

Nested imports in Ant

Let's say I have a.xml which imports b.xml and b.xml imports c.xml. If I define a macro in c.xml called macro-from-c, will it be visible to a.xml? I'm asking this in the context of IntelliJ, which doesn't seem to want to acknowledge the macros I've defined. Thanks ...

Add a copyright notice to all files in a directory using Ant

Hi! I want to add a copyright notice to a series of files generated in an Ant build. What's the easiest way to do it? I thought about using <concat> but I don't understand how to run it on a fileset without concatenating all the files in the fileset. Thanks! ...

Jar sizes different for different people

So, I have an interesting question. I have three people using the same ant build xml file creating a jar file for an Eclipse project that hasn't changed in two months. We each do a build using this xml file and we each get a different sized jar (62 KB, 78 KB, and 101 KB). Also, when I do a winmerge on them, they are dramatically differe...