This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to forwards value from Java Servlet variables to Ant variables  RSS feed

 
francisco proenca
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I have got a Ant xml that does some things in my environment. In my xml there are some variables eg: paths and etc, that I set them manually ever I execute it, but I have to change the value in the variable manually ever time that change something in my environment. I'd like to do this dynamically.

eg:

<property name="xxx" value="C:/xxx" />


I'd like to know, if is possible I set them dynamically through of a web interface.

Exemple:

I have a web interface with some fields, I type some values in this fields and pass to a variable in my servlet. Then, I get the values those variables that I set in my servlet and forwards to my xml Ant, to set xml Ant variables.

Anybody knows how can I resolve this ?

tks folks !

 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want a servlet to directly run Ant? If so, you could have the servlet set the properties as part of the ant command to run.

Another possibility: most of this functionality is already built into Jenkins. Yes, Jenkins is a Continuous Integration tool, but in realty it is just a web interface that you can use to manually or automatically run scripts (and that includes ant script).
 
francisco proenca
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that I haven't been quite clear. I'd like to pass values from an Java variable to a Ant variable.

eg:

String valueJava = "C:/xxx";

to

<property name="xxx" value="C:/xxx" />

eg:

<property name="xxx" value="(String value = "C:/xxx";)" />

set String valueJava in value's property

thanks !
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you running Ant?
 
francisco proenca
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Eclipse.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. I thought you wanted your Java app to run Ant. At least that is what you said here:

I'd like to pass values from an Java variable to a Ant variable.


If you are just running Ant from Eclipse, and you should be able to create multiple run configurations for Ant.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!