开发者

How do I view the webcontent of a maven project in Eclipse

I have imported a Maven project into Eclipse. I have also run the command mvn jetty:run to check that the project works.

The files that used to be under the MyProject/WebContent directory are now under MyProject/src/main/webapp/. I can see them on the file system, but not in ecl开发者_如何学编程ipse. How do I view and edit these files in Eclipse.


The src/main/webapp folder is not a source folder in eclipse terminology, so it's not listed among src/main/java, src/main/resources etc. This is correct, because it's not a source folder for maven, either (just for the war plugin)

So you have to expand the src folder manually in Eclipse:

How do I view the webcontent of a maven project in Eclipse

However, you can then right-click the folder and select Build Path > Use as Source Folder. (Adding it as a source folder in Eclipse won't change your maven setup)


you can try to switch project facet in eclipse to web-project... Can't check it right now -so it's just assumption.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜