把MAVEN提交到SVN,再拉下来发现没有maven和buildpath的解决办法
 个人随笔
目录
把MAVEN提交到SVN,再拉下来发现没有maven和buildpath的解决办法
2019-02-13 23:12:49

在把maven项目从svn检出后,发现没有了maven和build path,此时只需要在项目路径下面加入如下两个文件,然后刷新项目即可。
一、maven项目
.classpath

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" output="target/classes" path="src/main/java">
  4. <attributes>
  5. <attribute name="optional" value="true"/>
  6. <attribute name="maven.pomderived" value="true"/>
  7. </attributes>
  8. </classpathentry>
  9. <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10. <attributes>
  11. <attribute name="maven.pomderived" value="true"/>
  12. </attributes>
  13. </classpathentry>
  14. <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15. <attributes>
  16. <attribute name="optional" value="true"/>
  17. <attribute name="maven.pomderived" value="true"/>
  18. </attributes>
  19. </classpathentry>
  20. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  21. <attributes>
  22. <attribute name="maven.pomderived" value="true"/>
  23. </attributes>
  24. </classpathentry>
  25. <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
  26. <attributes>
  27. <attribute name="maven.pomderived" value="true"/>
  28. </attributes>
  29. </classpathentry>
  30. <classpathentry kind="output" path="target/classes"/>
  31. </classpath>

.project

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <projectDescription>
  3. <name>项目名称</name>
  4. <comment></comment>
  5. <projects>
  6. </projects>
  7. <buildSpec>
  8. <buildCommand>
  9. <name>org.eclipse.jdt.core.javabuilder</name>
  10. <arguments>
  11. </arguments>
  12. </buildCommand>
  13. <buildCommand>
  14. <name>com.genuitec.eclipse.springframework.springbuilder</name>
  15. <arguments>
  16. </arguments>
  17. </buildCommand>
  18. <buildCommand>
  19. <name>org.eclipse.m2e.core.maven2Builder</name>
  20. <arguments>
  21. </arguments>
  22. </buildCommand>
  23. </buildSpec>
  24. <natures>
  25. <nature>com.genuitec.eclipse.springframework.springnature</nature>
  26. <nature>org.eclipse.jdt.core.javanature</nature>
  27. <nature>org.eclipse.m2e.core.maven2Nature</nature>
  28. </natures>
  29. </projectDescription>

二、java project
其实很多项目都可以这样,比如纯java项目就直接建个java project 拷贝这两个文件过来,改下项目名字刷新即可。这里提供java项目的两个文件内容。
.classpath

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" path="src"/>
  4. <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  5. <classpathentry kind="output" path="bin"/>
  6. </classpath>
  7. .project
  8. <?xml version="1.0" encoding="UTF-8"?>
  9. <projectDescription>
  10. <name>项目名</name>
  11. <comment></comment>
  12. <projects>
  13. </projects>
  14. <buildSpec>
  15. <buildCommand>
  16. <name>org.eclipse.jdt.core.javabuilder</name>
  17. <arguments>
  18. </arguments>
  19. </buildCommand>
  20. </buildSpec>
  21. <natures>
  22. <nature>org.eclipse.jdt.core.javanature</nature>
  23. </natures>
  24. </projectDescription>

三、JavaWeb项目
.classpath

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classpath>
  3. <classpathentry kind="src" path="src"/>
  4. <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
  5. <attributes>
  6. <attribute name="owner.project.facets" value="java"/>
  7. </attributes>
  8. </classpathentry>
  9. <classpathentry kind="con" path="com.genuitec.runtime.library/com.genuitec.generic_6.0">
  10. <attributes>
  11. <attribute name="owner.project.facets" value="jst.web"/>
  12. </attributes>
  13. </classpathentry>
  14. <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
  15. <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
  16. <classpathentry kind="con" path="com.genuitec.runtime.library/com.genuitec.jstl_1.2.1">
  17. <attributes>
  18. <attribute name="org.eclipse.jst.component.dependency" value="WEB-INF/lib"/>
  19. <attribute name="owner.project.facets" value="jst.web.jstl"/>
  20. </attributes>
  21. </classpathentry>
  22. <classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
  23. </classpath>
  24. .project
  25. <?xml version="1.0" encoding="UTF-8"?>
  26. <projectDescription>
  27. <name>项目名称</name>
  28. <comment></comment>
  29. <projects>
  30. </projects>
  31. <buildSpec>
  32. <buildCommand>
  33. <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
  34. <arguments>
  35. </arguments>
  36. </buildCommand>
  37. <buildCommand>
  38. <name>org.eclipse.jdt.core.javabuilder</name>
  39. <arguments>
  40. </arguments>
  41. </buildCommand>
  42. <buildCommand>
  43. <name>org.eclipse.wst.common.project.facet.core.builder</name>
  44. <arguments>
  45. </arguments>
  46. </buildCommand>
  47. <buildCommand>
  48. <name>org.eclipse.wst.validation.validationbuilder</name>
  49. <arguments>
  50. </arguments>
  51. </buildCommand>
  52. <buildCommand>
  53. <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
  54. <arguments>
  55. </arguments>
  56. </buildCommand>
  57. <buildCommand>
  58. <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
  59. <arguments>
  60. </arguments>
  61. </buildCommand>
  62. </buildSpec>
  63. <natures>
  64. <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  65. <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  66. <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  67. <nature>org.eclipse.jdt.core.javanature</nature>
  68. <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  69. </natures>
  70. </projectDescription>
 581

啊!这个可能是世界上最丑的留言输入框功能~


当然,也是最丑的留言列表

有疑问发邮件到 : suibibk@qq.com 侵权立删
Copyright : 个人随笔   备案号 : 粤ICP备18099399号-2