Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Ant - Directory not created

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys! I'm just wondering why the setup-war-structure target particularly the line

<mkdir dir="${wardir}"/>

doesn't seem to execute. I can't see a directory named war in my basedir. Everything else though are created.




Thanks!
 
Saloon Keeper
Posts: 25461
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using a forward slash instead of a backslash in the directory pathname. That is: "${basedir}/war".

Forward slashes work almost every place backslashes do for filename paths in Java (and Ant is a Java program). However they carry 2 advantages:

1. They work when running the ant builds on non-Windows systems like Solaris.

2. Forward slashes don't have a "magic" meaning. Backslashes are used in Java for escape sequences.

In the case of Ant file and directory operations, I'm pretty sure that item #2 won't bite you, but why take chances? Look for a "${basedir}war" directory that you can't account for. If you find one, that was the problem.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tip! I incorporated you suggestion with my script and I solved the problem by changing project tag's default attribute to setup-war-structure instead of compile.


 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Timothy, your signature nicely matches the problem you had.

Regards, Jan
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only that I wanted it to be made using ant and not by hand.
 
Do you pee on your compost? Does this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic