aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Changing user using ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Changing user using ant" Watch "Changing user using ant" New topic
Author

Changing user using ant

Vinayak patil
Ranch Hand

Joined: Aug 30, 2005
Posts: 67
Hi,

Is there a way to change the user using ant?

I need it to change some permissions on a file. This is a deployable war file so I need to change the permissions every time it is deployed.

I was thinking of incorporating the command in the ant file itself

Thanks in advance,

Vinayak


"I can resist everything except temptation"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

The concept of "user" is very OS-dependent, so the answer depends on what OS you're using.


Customer surveys are for companies who didn't pay proper attention to begin with.
Vinayak patil
Ranch Hand

Joined: Aug 30, 2005
Posts: 67
Hi,

I am deploying the application on LINUX

-Vinayak
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

A lot depends on what you're doing to deploy the WAR, but assuming that you're deploying it to the same machine Ant runs of and just copying it, you can use the ant "exec" task to execute the "chown" Linux command.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing user using ant
 
Similar Threads
Problems with Ant "copy".
Storing XML in the Database
is this not a security issue
Maintaining File Permissions in a WAR file
Setting PATH in Ubuntu