2015-06-20 53 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推! –