4

I am using WebSphere 7 and trying to deploy war from MyEclipse (Server > WebSphere 7 > right click > Add Deployment).

I am using below maven war plug-in:

    <groupId>com.xxx.my.app</groupId>
    <artifactId>my-app</artifactId>
    <packaging>war</packaging>
    <name>my-app</name>

     <build>
            <finalName>my-app-context-root</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                </plugin>           
            </plugins>
        </build>

To change context root of my war I tried below options:

First option:

<properties>
    <m2eclipse.wtp.contextRoot>my-app-context-root</m2eclipse.wtp.contextRoot>      
</properties>

Second Option:

  <finalName>my-app-context-root</finalName>

But no Luck so for with these options. Whenever I deploy my application/war from MyEclipse and check context root in WebSphere server, WebSphere still shows the context root as 'my-app' (which is mentioned in name tag) not 'my-app-context-root'.

Udo Held
  • 12,314
  • 11
  • 67
  • 93
Narendra Verma
  • 2,372
  • 6
  • 34
  • 61

3 Answers3

2

One approach could be changing the war file [ my-app tag] to context root name. This way it will deploy the application with desired context root name.

Vinay
  • 33
  • 3
1

deploy your war file or application in myeclipse tomcat server and right click on the project folder, select properties and go to web option from the MyEclipse menu. there you can change the context-root of an application. The below link may helpful to you.

Change application context-root in myeclipse

Mdhar9e
  • 1,376
  • 4
  • 23
  • 46
0

For the direct deployment by MyEclipse, MyEclipse generates some special configuration files like the ibm-web-bnd.xml. These files contain the root path. If you want to specify the context root you have to either get those to work WAS specific files to work or pack your war file into a ear file and deploy the ear.

Udo Held
  • 12,314
  • 11
  • 67
  • 93
  • Thanks for your reply. I agree with you. EAR packaging is one of the option to change the context root of a module/war. But, I want my war file only to be deployed. Is there any configuration required in MyEclipse that can solve this problem. – Narendra Verma Oct 17 '13 at 05:58