4

I'm using Eclipse Indigo, with the "Jboss Maven Integration" and "JBossAS Tools" plugins from JBoss Tools 3.3 installed (none of the other twenty or so JBoss Tools plugins). The application is being deployed to a JBoss 4.2 using the JBossAS Tools 4.2 runtime.

Here are the steps to reproduce the problem...

1. Create Dynamic Web Project

Dynamic Web Project with default settings for JBoss AS 4.2 runtime

Standard Maven webapp directory structure

Still using Maven standard directory structure

The project is created with a default deployment descriptor which contains a list of welcome files. The "Welcome Pages" icon can be expanded in the Project Explorer, listing the files in "web.xml".

Project Explorer reflects the contents of web.xml

2. Convert to Maven Project

I right-click the project and select "Configure > Convert to Maven Project". I specify "war" packaging and give it a name and description.

Settings to be put into the pom.xml file

At this point, you can modify and save "web.xml" and the changes will immediately reflected in the Project Explorer.

3. Update Project Configuration

Have Maven update the project configuration by right-clicking the project, then selecting "Maven > Update Project Configuration...". (Usually you would change some build configuration in the POM before doing this, but the problem happens even if you just update right away.)

4. Web.xml isn't Read by Eclipse Anymore

Immediately after updating the project, everything looks fine. But the next time you save "web.xml" it is no longer properly displayed in the Project Explorer.

Project Explorer no longer reflects the contents of web.xml

It's really weird because even though "web.xml" isn't being displayed properly, Eclipse opens the file correctly when you double click on Deploymen Descriptor in the Project Explorer.

The Project Explorer's inability to display the contents isn't the real problem. It just indicates that Eclipse can't see "web.xml" properly. The real problem is that using JBoss Tools, I can't redeploy the solution by pressing the "Touch Descriptors" button (the little hand) because it tells me the project doesn't have any descriptors to touch. It seems like Eclipse is unable to give a reference to "web.xml" to the JBoss plugin or something...

Any ideas? :)

Brendan
  • 1,853
  • 11
  • 18

1 Answers1

1

It should "just work" assuming you have m2e-wtp installed. m2e-wtp is the plugin for m2e that does a best-effort to wire up Mavens project model with Eclipse's Web Project model.

The simplest way of installing m2e-wtp and get additional automatic configuration for CDI, Hibernate, JSF, etc. is to install JBoss Maven Tools.

If you for some reason do not want this additional ease-of-use then you can get m2e-wtp from Eclipse Marketplace.

p.s. in recent versions of jboss tools you can also simply restart the individual modules in the server view - which is there to support descriptor less projects. The "touch descriptors" should be moved to support this instead.

Max Rydahl Andersen
  • 3,630
  • 2
  • 23
  • 28