2015-06-20 25 views
5

Spring MVC的项目,我想部署一个简单的Spring MVC应用程序打开移我用Google搜索,发现这个spring-mvc-3-on-jboss但项目的结构是不同的我有基本的Spring MVC项目结构
enter image description here

即在this repo,在openshift.com我创建的应用程序并将其配置为:

但我不能看到我的回到Home.jsp文件作为欢迎文件,当我转到我的应用程序的URL我只看到默认/传统欢迎页面。
任何建议如何配置项目正常工作?如何部署上openshift.com

回答

2

没有与你的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> 

我没有测试此代码JBoss Application Server,让您的服务器更改为Apache Tomcat 7。这对我正确工作。

+0

我已经厌倦了这种方式,但我仍然无法让我的应用程序正常工作。请你为我做这件事我会把你作为__contributor__添加到我的项目中。在[g +]上添加我(https://plus.google.com/+ArshadAliSoomro),我们将在那里完成更多步骤。 –

+0

毕竟它已经解决了。 –

2

首先你克隆你的git仓库,然后在文档文件夹中自动创建文件夹。

那么你的WAR文件提取物和你过去的克隆目录到文件夹中的webapps

,并创建测试文件夹粘贴到文件夹中的代码,并根war文件。

然后你的文件夹名称ulr写入并输入。

例如

这样。

git clone ssh://[email protected] 

将您的解压缩war文件粘贴到您的克隆目录中。

那么火混帐条命令

$ git add . 
$ git commit -m "A checkin to my application" 
$ git push 
+0

我已经从github推回购回来如何获得这项工作? –

+0

你有推回购,然后部署成功你的应用程序消息在terminal.then在浏览器中打开。 – 2015-06-20 12:59:45

+0

对不起,我没有得到你想说的,但我没有在我的本地机器的任何副本,我已经从github.com推! –