0

I have created a sample java application and packaged it JavaHelloWorldApp.war.

I deploy it to IBM Bluemix using the command cf push MyHelloWorldApp -p JavaHelloWorldApp.war

After deploy, when I navigate to Runtime file of my deployed application I see that the war file name is shown as myapp.war. See the image in the link below

Image showing generated war file with default name

I would like to retain my original war file name. As I want to encode my app version details in the war file name and would like the retain it for the reference. How to achieve it?

Mustansir Ali
  • 305
  • 1
  • 2
  • 9

2 Answers2

1

Push a liberty server package zip instead of the war

https://www.ibm.com/blogs/bluemix/2015/01/modify-liberty-server-xml-configurations-ibm-bluemix/

Ram Vennam
  • 3,536
  • 1
  • 12
  • 19
0

Without Liberty profile :

I could retain the war file name by deploying the JavaHelloWorldApp.war. I have listed the steps below:-

  1. Follow the step provided at Bluemix documentation  https://console.ng.bluemix.net/docs/runtimes/liberty/optionsForPushing.html

    Go to section Server Directory -> then follow steps for, If a Liberty profile is not installed on your workstation, you can use the following steps to create a server directory with your application...

  2. Follow all the steps listed there.

  3. Finally the defaultServer directory structure should look like this.

    enter image description here

    My server.xml looks like as given below

     <server>
        <featureManager>
            <feature>servlet-3.1</feature>
        </featureManager>
    
        <httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="${port}">
            <tcpOptions soReuseAddr="true"/>
        </httpEndpoint>
    
        <application name="JavaHelloWorldApp" context-  
         root="/JavaHelloWorldApp" location="JavaHelloWorldApp.war"     
         type="war"/>
     </server>
    
  4. Now to deploy defaultServer run command: cf push -p defaultServer 

  5. The java application will deploy into Bluemix and the war file name will be named JavaHelloWorldApp.war, same as the application war file
    name.Snapshot below :-

    Custom War file name

Mustansir Ali
  • 305
  • 1
  • 2
  • 9