如何在openshift.com上部署Spring MVC项目

Ars*_*Ali 5 java spring-mvc openshift

我想部署一个简单的Spring MVC APP来打开我为google搜索并发现spring-mvc-3-on-jboss但是项目结构不同我有基本的Spring MVC项目结构是
在此输入图像描述

就是在这个repo,在openshift.com我创建了应用程序并配置为:

但是当我转到我的app-url时,我看不到我的home.jsp文件作为欢迎文件我只看到默认/传统的欢迎页面.
有任何建议如何配置项目正常工作?

Cra*_*der 3

您的 pom.xml 存在一个主要问题,我认为这会导致您的应用程序无法在 openshift.com 上运行。您应该将以下行添加到 pom.xml 中

<profiles>
    <profile>
        <!-- When built in OpenShift the 'openshift' profile will be used when 
            invoking mvn. -->
        <!-- Use this profile for any OpenShift specific customization your app 
            will need. -->
        <!-- By default that is to put the resulting archive into the 'webapps' 
            folder. -->
        <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
        <id>openshift</id>
        <build>
            <finalName>yourAppName</finalName>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <outputDirectory>webapps</outputDirectory>
                        <warName>ROOT</warName>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)

我尚未使用 测试此代码JBoss Application Server,因此请将您的服务器更改为Apache Tomcat 7. 这对我来说是正确的。