0

I have made some changes to an existing Java web application. When I deploy this file to Apache, via WAR file, it regenerates the website as it appeared before my changes.

I delete the existing website directory before deployment, and I've moved out all existing WAR files. I have committed my changes to source control and recreated the WAR file, but still no effect. I even added a small text file to the solution and that was included in the WAR file and deployed to the server, but still my changes were not active.

I am using Spring as my IDE to create the WAR file, and Apache Tomcat to host the website.

Why aren't my changes being packed in the WAR file?

EDIT: I am very new to Java, but have plenty of experience in .NET. Please excuse stupid questions from me.

EDIT 2: As far as I can see, the changes are actually included in the WAR file and are deployed to the server (the class files contain certain strings that they never did before). But the code just isn't executing as it should with those changes (despite Tomcat and the machine itself being restarted).

4

1 回答 1

2

也许尝试将 Maven 添加到您的项目中,然后尝试使用 mvn package 制作一个war文件。前段时间我遇到了类似的问题。我试图在没有 Maven 的情况下构建一个战争文件,但没有看到 Tomcat 上的更改。然后 Maven 帮助了我。

编辑:

  1. 将现有的 Eclipse 项目转换为 Maven 项目
  2. http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/

也许这可以帮助你。

于 2012-08-08T08:40:39.070 回答