• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Ant + Junit + Log4J Problem

Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant 1.7.1
JUnit 4.4
JBoss 4.2.1

Hi I have a project consisting of several subprojects. One of them is a Test-Project.
My Ant build.xml within this project works perfectly:

The JUnit test is

When I run the Test with the build.xml the log4j.xml (and the jndi.properties) are found.
Now I have a "main" build.xml which only purpose is to execute the builds of the subprojects in the right order (this build.xml is either in a folder parallel to the other subproject or in the root, both variations have the same effect):

When I run this build.xml everything works fine (compilation, deployment, test-execution ...) the only problem is that the the log4j.xml configuration is not found. Instead of finding it in the BafoegTest folder it is now searched for in the folder in which the "main" build.xml resides.

I really don't want to duplicate configuration files just to work around this problem. Does anybody know to solve this problem properly?
Posts: 3281
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you reference/copy in the log4j.xml file via a property that has an absolute path?
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic