Question

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'.

Was it helpful?

Solution 2

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top