使用 maven 为 WTP 项目运行 eclipse:eclpise 后无法看到 Web 资源文件夹
我发现 m2e 能够创建构建我的 Web 应用程序所需的所有工件。
然而,我面临的问题是我在项目资源管理器中看不到“Web 资源”部分。
要导航到我的 Web 资源(jsp、js、css ...)(恰好位于 src/main/webapp 下),我每次都需要展开文件夹结构。
以下是我的 pom
<?xml version="1.0" encoding="UTF-8"?>
<project>
...
<packaging>war</packaging>
<dependencies>
...
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<wtpversion>2.0</wtpversion>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
</configuration>
</plugin>
</plugins>
</build>
</project>
如何更改我的 POM 以便 Eclipse 将 src/main/webapps 映射到“Web 资源”?
我正在使用 eclipse 3.7.0 和 m2e 1.0.100
感谢任何帮助!
I see that m2e is able to create all the necessary artifacts for building my web application.
However the problem I'm facing is that I don't see the "Web Resources" section in the project explorer.
To navigate to my web resources(jsp, js, css ...) (which happen to be under src/main/webapp), I need to expand the folder structure everytime.
the following is my pom
<?xml version="1.0" encoding="UTF-8"?>
<project>
...
<packaging>war</packaging>
<dependencies>
...
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<wtpversion>2.0</wtpversion>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
</configuration>
</plugin>
</plugins>
</build>
</project>
How to I change my POM such that Eclipse maps src/main/webapps to "Web Resources"??
I'm using eclipse 3.7.0 and m2e 1.0.100
Any help is appreciated!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否安装了 Maven Integration for WTP(又名 m2e-wtp)?它可以从 Eclipse Marketplace 或 m2e 市场获得。请参阅http://community.jboss.org/en/tools/blog/2011/08/01/m2eclipse-wtp-0131-back-to-the-m2e-marketplace了解更多信息关于如何安装它。
您还可以在以下位置找到有关已部署资源节点(以前称为 Web 资源)的更多信息:
http://community.jboss .org/en/tools/blog/2011/06/23/m2eclipse-wtp-0130-new-noteworthy
Have you installed the Maven Integration for WTP (a.k.a m2e-wtp)? It's available from the Eclipse Marketplace, or the m2e marketplace. See http://community.jboss.org/en/tools/blog/2011/08/01/m2eclipse-wtp-0131-back-to-the-m2e-marketplace for more informations on how to install it.
You can also find more informations on the Deployed Resources node (formerly Web Resources) in
http://community.jboss.org/en/tools/blog/2011/06/23/m2eclipse-wtp-0130-new-noteworthy
只是在黑暗中一枪:右键单击您的项目,Maven->更新项目配置...
或者您可能安装了错误的 Eclipse 版本?面向 Java EE 开发人员的 Eclipse IDE 应该可以解决这个问题。
Just a shot in the dark: Right click on your project, Maven->Update Project configuration...
Or maybe you installed the wrong Eclipse version? Eclipse IDE for Java EE Developers should do the trick.