ant

How can I embed one file into another with Ant?

I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion. I have references to external files, for instance: <script type="text/javascript" src="jquery-1.2.6.pack.js"></script> <link type="text/css" rel="stylesheet" href=...

What are some good java make utilities?

I'm looking for a make utility for building large java programs. I'm aware of ANT already, but want to see what else is available. Ideally, it should be able to handle the .java->.class package directory weirdness that fouls up GNU Make. Win32, but cross platform is a plus. EDIT: I see some cons to using ANT, which is why I wanted to ...

Minimal Java web app struture / ant build file

Hello, Can some describe the minimal conventional directory structure for a Java web app, and the minimal build.xml to get ant to build it, and make a war? Target for today is deploy a Wicket app to Tomcat outside of an IDE, just with ant and my favourite text editor. ...

How do I change the "level" of validation that Ant's XMLValidate task provides?

I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of type IDREF. Most of these reference IDs outside of the current document. Because of this, my build fails, since t...

How best to store Subversion version information in EAR's?

When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question. I the case of releasing Java JAR (ear, jar, rar, war) files I would like to be able to look in/at the JAR and ...

How do I unit test a custom ant task?

I am writing a custom ant task that extends Task. I am using the log() method in the task. What I want to do is use a unit test while deveoping the task, but I don't know how to set up a context for the task to run in to initialise the task as if it were running in ant. This is the custom Task: public class CopyAndSetPropertiesForFiles...

Regexp: Substituting a version number in an XML file

Ok I give up, I've been trying to write a regexp in ant to replace the version number from something that I have in a properties file. I have the following: <?xml version="1.0" encoding="UTF-8"?> <feature id="some.feature.id" label="Some test feature" version="1.0.0" provider-name="Provider">...

Need help writing a custom BuildListener

I would like to add a BuildListener to my headless build process, which is building an Eclipse product. The docs on how to do this are, shall we say, a bit scanty. I think I need to put my custom jar in a plugin and then use the org.eclipse.ant.core.extraClasspathEntries extension point to make that jar visible to Ant. But everything I h...

Interpreting newlines with XSLT xsl:text?

I have an XSL stylesheet with content in an xsl:text node like this: <xsl:text> foo bar baz </xsl:text> The stylesheet itself is a text file with "unix-style" newline line terminators. I invoke this stylesheet on Windows as well as unix-like platforms. It would be nice to have the output conform to the conventions of the platform on w...

What is your method to generate Websphere 6 EJB with Ant / JDK 1.4.x ?

The only working method I found, several years ago, was : Generating ibm-ejb-jar-bnd.xmi and ibm-ejb-jar-ext.xmi for each session bean by using XDoclet (ejbdoclet task) Making a jar (without stubs) with task jar; ; Calling the binary EJBDEPLOY with this jar without stub in parameters. But I feel there must be a cleaner method. Whi...

How can I pull artifacts from TeamCity?

I would like to pull artifacts from teamcity. I've been trying to use c# and the HtmlAgilityPack to goto the website and find the latest version and its artifacts. I'm currently stuck at the login, I think I just need to be sending Session Cookies out. Am I going in the right direction, has anyone else tried this? I realize that pushi...

Ant's wrong directory on property

I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here: When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into build/ver_2.0.0/classes it creates a file ${cv.build.dir}/clas...

Is Ant still the best choice for a Java build tool?

From my small amount of experience, I've only used Ant as a build tool. Are there any other projects which are better, and why? ...

How can ASDoc Ant Task work without -source-path option?

I am tring to get the ASDoc Ant task to work: <target name="asdoc" depends="compile"> <mkdir dir="${dist_asdocs}"/> <asdoc docSources="${srcdir}" output="${dist_asdocs}" executable="${FLEX_HOME}/bin/asdoc.exe" /> </target> When I run it I get errors from ASDoc like "Error: Type was not found or was not a compile-time constant: X...

Are there any Ant conventions similar to Maven2 conventions?

For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant. What I'm wondering about is this: In Maven we had directory conventions for seperating our java so...

compiling only part of the source tree with ant

Say I have my sources in my src/ tree (and possibly in my test/ tree). Say I would like to compile only part of that tree. The reasons why I might want to do that are various. Just as an example, I might want to create the smallest possible jar (without including certain classes), or I might want the fastest compile time for what I am co...

How to determine build architecture (32bit / 64bit) with ant?

We have inherited an ant build file but now need to deploy to both 32bit and 64bit systems. The non-Java bits are done with GNUMakefiles where we just call "uname" to get the info. Is there a similar or even easier way to mimic this with ant? ...

What to do when your build process craps on your Version Control(Ant question)

So ive got a nice Java project, builds with Ant to a /dist folder. The whole project is under version control, so I can deploy the latest version just by 'svn export' on the path to the dist folder. But my build keeps deleting the .svn folders inside my dist folder, and all its dependents, because it cleans out the folder when building...

xdoclet vs xdoclet2 ?

Hi all, I'm updating an old project & my version of xdoclet complains about my Java 1.5 annontations (ArrayList data = ....) when parsing for Hibernate (hibernate3) tags. So my question is this... Is there a fix for Xdoclet 1.2.3, or should I look to move to Xdoclet2? I've already started moving some of the code over, but xdoclet2 do...

groovy inside ant: how to access refids from grooy that are defined by ant tags

I'm using a groovy code snippet in an ant build file. Inside the groovy code I'm trying to reference a fileset that has been defined outside of the groovy part, like this: <target name="listSourceFiles" > <fileset id="myfileset" dir="${my.dir}"> <patternset refid="mypatterns"/> </fileset> <groovy> def ant = ...