马文2pom.xml文件对于在Eclipse Europa+m2eclipse中工作的webapp

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了马文2pom.xml文件对于在Eclipse Europa+m2eclipse中工作的webapp相关的知识,希望对你有一定的参考价值。

1. mvn archetype:create -DgroupId=deng -DartifactId=mywebapp -DarchetypeArtifactId=maven-archetype-webapp
2. Replace web.xml with http://snipplr.com/view/3800/minimal-webxml-webapp-descriptor-version-24
3. Replace pom.xml in this snipplet.
4. mvn eclipse:m2eclipse -Dwtpversion=1.5
5. Import project into Eclipse
6. In project properties > Java Build Path. Add a "Server Runtime" Library ( with Tomcat6)
7. In project properties > J2EE Module Dependencies. Check Maven2Dependencies
8. Project > Clean

If you re-importing a project back into Eclipse, be sure to:
1. Delete your existing project in eclipse
2. mvn clean eclipse:clean
3. Repeat steps 4-8 above.
  1. <project xmlns="http://maven.apache.org/POM/4.0.0"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <groupId>deng.mywebapp</groupId>
  6. <artifactId>mywebapp</artifactId>
  7. <packaging>war</packaging>
  8. <version>1.0-SNAPSHOT</version>
  9. <name>mywebapp Maven Webapp</name>
  10. <url>http://maven.apache.org</url>
  11.  
  12. <profiles>
  13. <profile>
  14. <id>servlet</id>
  15. <activation>
  16. <activeByDefault>false</activeByDefault>
  17. </activation>
  18. <dependencies>
  19. <dependency>
  20. <groupId>javax.servlet</groupId>
  21. <artifactId>servlet-api</artifactId>
  22. <version>2.5</version>
  23. <scope>provided</scope>
  24. </dependency>
  25. <dependency>
  26. <groupId>javax.servlet.jsp</groupId>
  27. <artifactId>jsp-api</artifactId>
  28. <version>2.1</version>
  29. <scope>provided</scope>
  30. </dependency>
  31. </dependencies>
  32. </profile>
  33. </profiles>
  34. <dependencies>
  35. <dependency>
  36. <groupId>junit</groupId>
  37. <artifactId>junit</artifactId>
  38. <version>4.4</version>
  39. <scope>test</scope>
  40. </dependency>
  41. <dependency>
  42. <groupId>javax.servlet</groupId>
  43. <artifactId>jstl</artifactId>
  44. <version>1.1.2</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>taglibs</groupId>
  48. <artifactId>standard</artifactId>
  49. <version>1.1.2</version>
  50. </dependency>
  51. </dependencies>
  52. <build>
  53. <finalName>mywebapp</finalName>
  54. <plugins>
  55. <plugin>
  56. <groupId>org.mortbay.jetty</groupId>
  57. <artifactId>maven-jetty-plugin</artifactId>
  58. </plugin>
  59. <plugin>
  60. <artifactId>maven-compiler-plugin</artifactId>
  61. <configuration>
  62. <source>1.5</source>
  63. <target>1.5</target>
  64. </configuration>
  65. </plugin>
  66. </plugins>
  67. </build>
  68. </project>

以上是关于马文2pom.xml文件对于在Eclipse Europa+m2eclipse中工作的webapp的主要内容,如果未能解决你的问题,请参考以下文章

idea 查看tomcat源码

如何通过 Maven2 pom.xml 获取 Hibernate + javax.persistence

马文冷静配置文件.xml模板

纽约时报人工智能之父马文·明斯基(Marvin Minsky)去世,享年 88 岁

rtl8188eu芯片,在kail中开启监听功能,解决PHY=null问题

powershell PowerShell并行代码示例。对于http://mxii.eu.org/2016/09/16/parallel-processing-in-powershell/