当前位置:   article > 正文

传统java web改造为maven

传统java web改造为maven

重点在iml文件和pom文件很容易忽略里面的配置,自动生成iml文件启动会无法加载出项目

项目名称iml文件生成

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
  3. <component name="FacetManager">
  4. <facet type="web" name="Web">
  5. <configuration>
  6. <descriptors>
  7. <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
  8. </descriptors>
  9. <webroots>
  10. <root url="file://$MODULE_DIR$/web" relative="/" />
  11. </webroots>
  12. <sourceRoots>
  13. <root url="file://$MODULE_DIR$/src/main/java" />
  14. <root url="file://$MODULE_DIR$/src/main/resources" />
  15. </sourceRoots>
  16. </configuration>
  17. </facet>
  18. <facet type="Spring" name="Spring">
  19. <configuration />
  20. </facet>
  21. </component>
  22. <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
  23. <output url="file://$MODULE_DIR$/target/classes" />
  24. <output-test url="file://$MODULE_DIR$/target/test-classes" />
  25. <content url="file://$MODULE_DIR$">
  26. <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
  27. <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
  28. <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
  29. <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
  30. <excludeFolder url="file://$MODULE_DIR$/target" />
  31. </content>
  32. <orderEntry type="inheritedJdk" />
  33. <orderEntry type="sourceFolder" forTests="false" />
  34. <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.2" level="project" />
  35. <orderEntry type="library" name="Maven: commons-io:commons-io:1.4" level="project" />
  36. <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
  37. <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.1.33" level="project" />
  38. <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.4" level="project" />
  39. <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.7" level="project" />
  40. <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.4" level="project" />
  41. <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
  42. <orderEntry type="library" name="Maven: org.apache.commons:commons-imaging:1.0-alpha2" level="project" />
  43. <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
  44. <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
  45. </component>
  46. </module>

WebContent对应src\main\webapp

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.xxxxx</groupId>
  5. <artifactId>xxxxx</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <packaging>war</packaging>
  8. <properties>
  9. <java.version>1.8</java.version>
  10. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  11. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  12. </properties>
  13. <dependencies>
  14. <dependency>
  15. <groupId>commons-fileupload</groupId>
  16. <artifactId>commons-fileupload</artifactId>
  17. <version>1.2</version>
  18. </dependency>
  19. <dependency>
  20. <groupId>commons-io</groupId>
  21. <artifactId>commons-io</artifactId>
  22. <version>1.4</version>
  23. </dependency>
  24. <dependency>
  25. <groupId>commons-lang</groupId>
  26. <artifactId>commons-lang</artifactId>
  27. <version>2.4</version>
  28. </dependency>
  29. <dependency>
  30. <groupId>com.alibaba</groupId>
  31. <artifactId>fastjson</artifactId>
  32. <version>1.1.33</version>
  33. </dependency>
  34. <dependency>
  35. <groupId>org.apache.httpcomponents</groupId>
  36. <artifactId>httpclient</artifactId>
  37. <version>4.5.4</version>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.apache.httpcomponents</groupId>
  41. <artifactId>httpcore</artifactId>
  42. <version>4.4.7</version>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.apache.httpcomponents</groupId>
  46. <artifactId>httpmime</artifactId>
  47. <version>4.5.4</version>
  48. </dependency>
  49. <!-- <dependency>-->
  50. <!-- <groupId>log4j</groupId>-->
  51. <!-- <artifactId>log4j</artifactId>-->
  52. <!-- <version>1.2.15</version>-->
  53. <!-- </dependency>-->
  54. <dependency>
  55. <groupId>log4j</groupId>
  56. <artifactId>log4j</artifactId>
  57. <version>1.2.17</version>
  58. </dependency>
  59. <dependency>
  60. <groupId>org.apache.commons</groupId>
  61. <artifactId>commons-imaging</artifactId>
  62. <version>1.0-alpha2</version>
  63. </dependency>
  64. <dependency>
  65. <groupId>javax.servlet</groupId>
  66. <artifactId>javax.servlet-api</artifactId>
  67. <version>3.0.1</version>
  68. </dependency>
  69. <!-- 单元测试支持 -->
  70. <dependency>
  71. <groupId>junit</groupId>
  72. <artifactId>junit</artifactId>
  73. <version>4.12</version>
  74. <scope>test</scope>
  75. </dependency>
  76. </dependencies>
  77. <build>
  78. <plugins>
  79. <plugin>
  80. <groupId>org.apache.maven.plugins</groupId>
  81. <artifactId>maven-war-plugin</artifactId>
  82. <version>3.2.2</version>
  83. <configuration>
  84. <warSourceDirectory>web</warSourceDirectory>
  85. <warName>image</warName>
  86. </configuration>
  87. </plugin>
  88. </plugins>
  89. </build>
  90. </project>

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/48893
推荐阅读
相关标签
  

闽ICP备14008679号