Eclipse stopped building my WAR file after making some Maven pom.xml changes

I recently took the opportunity to refactor our pom.xml file to use more filtering and get rid of some duplicate properties files. The build now works fine from the command line and in our CI environment, it is capable of building a WAR and Jenkins deploys it without issue.

Eclipse is another story. I am working with Build Automatically checked and Eclipse starts Tomcat for me. For most code changes, Eclipse detects the change, creates the code and a new WAR file, and publishes a new WAR for Tomcat. After all these Maven changes, it no longer does it. I'm not sure if the problem is that I right clicked on the pom file multiple times and selected manual Maven clean and installed and confused Eclipse something, but I can't get it back to the point where Eclipse knows how to build WAR file for me and deploy it.

I'm going to assume that my pom.xml file is not the problem and not post it here, since the manual build (mvn clean install) creates the WAR file in the target directory and our CI build works fine without any modification. Several maven and Project -> Clean in Eclipse cleanup commands were run without help.

I can't see anything in Eclipse logs from Window -> View -> General -> Error Log.

I've read a bunch of suggestions on StackOverflow and many of the answers show that Eclipse support for Maven sucks. I don't necessarily need Maven work. I need Eclipse to generate the code and then create a WAR and understand that it needs to be deployed to a Tomcat instance that is already running. Besides ditching Eclipse for good and paying IntelliJ, is there a way to get this working again?

- change - In case it helps. I stopped Tomcat and Eclipse, mvn clean from the command line, checked that the target directory was removed, started Eclipse, enabled Build Automatically, and now this is what I see in the target directory:

$ cd target
$ ls -la *
classes:
total 40
drwxr-xr-x  7 chris  staff   238 Oct 22 16:49 .
drwxr-xr-x  5 chris  staff   170 Oct 22 16:49 ..
-rw-r--r--  1 chris  staff  1088 Oct 22 16:49 application.properties
-rw-r--r--  1 chris  staff   727 Oct 22 16:49 deviceEnrollment.vm
-rw-r--r--  1 chris  staff    31 Oct 22 16:49 hibernate.properties
-rw-r--r--  1 chris  staff  1061 Oct 22 16:49 log4j2.xml
-rw-r--r--  1 chris  staff   354 Oct 22 16:49 portalEnrollment.vm

m2e-wtp:
total 0
drwxr-xr-x  3 chris  staff  102 Oct 22 16:49 .
drwxr-xr-x  5 chris  staff  170 Oct 22 16:49 ..
drwxr-xr-x  3 chris  staff  102 Oct 22 16:49 web-resources

test-classes:
total 16
drwxr-xr-x  4 chris  staff   136 Oct 22 16:49 .
drwxr-xr-x  5 chris  staff   170 Oct 22 16:49 ..
-rw-r--r--  1 chris  staff  1103 Oct 22 16:49 application.properties
-rw-r--r--  1 chris  staff    44 Oct 22 16:49 temp.txt

      

+3


source to share


2 answers


Try Maven> Refresh Project (Alt + F5) and uncheck clean build



+1


source


It turns out that building with Maven via Eclipse created a new launch configuration under both "Apache Tomcat" and "Maven Build". After I removed those two startup configurations everything worked again.



0


source







All Articles