Ant will not import properties

My assembly begins by defining two properties files, importing another XML assembly file, and then begins with all my other goals and objectives:

build.main.xml :

 <project name="${proj.name}" default="assemble" basedir="."> <!-- BASIC CONFIGURATIONS --> <!-- Define build properties. --> <property file="build.main.properties"/> <property file="build.app.properties"/> <!-- Imports. --> <import file="${alt.build.file}"/> <!-- Rest of buildscript omitted for brevity... --> </project> 

build.app.properties :

 proj.name=test-proj alt.build.file=build.app.xml 

It seems that build.main.xml cannot see / find any properties defined inside build.app.properties ; namely:

  • It cannot resolve ${proj.name} , and when I add the build.main.xml file to the Eclipse Ant view, the assembly name is displayed as ${proj.name}
  • It cannot find build.app.xml imported from build.main.xml

What's going on here? Do Ant builds only get to import a single property file or something?!? Where can I start troubleshooting?

Edit : with the Eclipse editor, my buildscript has no red / highlighted syntax errors that could lead to misuse of the Ant plugin, etc.

Change I notice problems with properties defined inside build.main.properties to. If I try to repeat them, they will not be noticed by Ant either ...

+4
source share
1 answer

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

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

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

+2
source

Source: https://habr.com/ru/post/1400686/


All Articles