Using CLI commands in ant's build file

Solution Verified - Updated -

Issue

  • Can we call cli in ant's build file?
  • How to deploy applications from ant's build file using cli commands?
  • We would like to check whether the datasource already exists before adding the datasource. Can we use the "IF" as follows:
if (outcome != success) of /datasource=DATASOURCE_NAME:read-resource   
    data-source add --name=DATASOURCE_NAME --jndi-name=JNDI_NAME --drivername=DRIVER_NAME --connection-url=CONNECTION_URL   
end-if
  • But here above "if" is a multi-line command and hence it cannot be used exactly in a single line. How do we invoke this multi-line command from ant script?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.