Select Page

Deploy to two different application servers in real-time using Build.xml

Author: Christian Screen | | July 16, 2011

Working on a JEE application, I had a situation where I was using NetBeans as my Java IDE and GlassFish Server as the application server.  Testing in GlassFish was easy but I needed to also test the same application in a WebLogic Server instance at the same time in real time.  Real-time here meaning that as soon as I made a change to a file in my NetBeans IDE that it would be reflected in my development app server connected already to Netbeans, GlassFish, and then updating a deployed Web Application in WebLogic Server.

This is where ANT comes in.  ANT of course is like Make but written for Java.

Anyway, in NetBeans you can simply update the build.xml file which ultimately can add or override existing target settings for the ANT build process.  The script below perfectly takes the compiled build directory files I required for this scenario from the application’s build directory and copies them to the WebLogic Server deployed application reference directory.   By right-clicking the NetBeans project and selecting the “Build” option, the build immediately hits these overridding target nodes in the ANT build.xml file and copies compiled application files where I need them.  This completely eliminates any manual copy and pasting. Sweet!


<target name="-post-compile">
<copy todir="C:\oracle\WLS\DeployedAppDir\">
<fileset dir="${build.web.dir}"/>
</copy>
</target>

<target name="-post-dist">
<copy todir="C:\oracle\WLS\DeployedAppDir_WAR\">
<fileset dir="${dist.jar.dir}"/>;
</copy>
</target>

Resources:
http://blogs.oracle.com/roumen/entry/netbeans_quick_tip_4_extending

Oracle BI Publisher (BIP) Tips: Functions, Calculations & More

Check out these BI Publisher tips including functions & calculations so you can understand more about the production and support of BI Publisher reports.

Sherry Milad | January 15, 2018

How to Index a Fact Table – A Best Practice

At the base of any good BI project is a solid data warehouse or data mart.

Christian Screen | March 16, 2010

Qlik vs. Tableau vs. Power BI: Which BI Tool Is Right for You?

Tableau, Power BI, and Qlik each have their benefits. What are they and how do you choose? Read this blog post for a quick analysis.

Tom Hoblitzell | June 6, 2019

Subscribe to Our Blog

Never miss a post! Stay up to date with the latest database, application and analytics tips and news. Delivered in a handy bi-weekly update straight to your inbox. You can unsubscribe at any time.

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS