Ant no importará propiedades

My build begins by defining 2 properties files, importing another build XML, and then commencing with all my other targets & tasks:


<project name="${}" default="assemble" basedir=".">
    <!-- Define build properties. -->
    <property file=""/>
    <property file=""/>

    <!-- Imports. -->
    <import file="${}"/>

    <!-- Rest of buildscript omitted for brevity... -->

Parece que build.main.xml cannot seem to see/find cualquier properties defined inside; específicamente:

  • It cannot resolve ${}, and when I add the build.main.xml file to the Eclipse Ant view, the name of the build shows up as ${}
  • No puede encontrar importado de build.main.xml

What's going on here? Do ant builds only get to import one properties file or something?!? Where could I start troubleshooting?

Editar: using Eclipse editor my buildscript does not have any red/highlighted syntax errors that might be causing the ant plugin to work incorrectly, etc.

Editar: I am noticing issues with properties defined inside the to. If I try to echo them they don't get noticed by Ant either...

preguntado el 10 de marzo de 12 a las 01:03

Just a wild guess, but I think ant reads files sequential, so you need the property "" before you have imported the property file. And the filenames you have in the code don't match the filename you mention in your question (*.xml vs. *.properties). Have you checked that you are trying to import the right files? -

1 Respuestas

The Ant project name cannot be itself a property for the reason Jochen mentioned in his comment.

Try running your script with the -v option to see more logging. I have used a technique very similar to your <import file="${}"/> to branch my script based on the db platform, so there should be no problem with it.

I wondered if your property files are in the same directory then your build script is.

respondido 12 mar '12, 12:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.