zoukankan      html  css  js  c++  java
  • 从svn中check out maven项目 所遇到的一系列问题:

    1、maven项目从svn导出后,不是maven结构:

    右键项目-->configure--->convert  to maven project 

    2、maven项目check out后,java文件是空心J,不是实心:

    原因: 
    eclipse认为检出内容为资源文件,而不是项目。 
    解决办法: 
    编辑项目下的.project文件, 
    (1)在<buildCommand>中加<name>org.eclipse.jdt.core.javabuilder</name> 
    (2)<natures>中加<nature>org.eclipse.jdt.core.javanature</nature> 

    3、tomcat中不能识别刚检出的web项目:

    右键项目--->config->convert to fat project


    右键项目--->config->convert to plug_in

    4、pom文件总是有错误提示,红‘X’号,提示有错误。

    setting.xml文件是否配置正确。(E:apache-maven-3.3.1confsetting.xml)

    查看setting.xml的路径:windows-->properties-->maven-->user settings -->看右半部分内容。

    5、新导出的项目总没有Maven Dependencies 和JRE System Library :

    右键项目---》properties---》Deployment Assembly --->add --->maven Dependencies

    后来再上网搜索,找到了解决办法:

    找自己出错项目的.classpath文件,打开,ctrl+f,找是否有以下文件,如果没有在末尾加进去,再refresh项目即可:

    <span style="font-size:14px;"><classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    		<attributes>
    			<attribute name="maven.pomderived" value="true"/>
    			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    		</attributes>
    </classpathentry></span>

    添加后我的.classpath文件是这样的:

    <span style="font-size:14px;"><?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    	<classpathentry kind="src" path="src/main/java"/>
    	<classpathentry kind="src" path="src/main/resources"/>
    	<classpathentry kind="src" path="src/extend/java"/>
    	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
    		<attributes>
    			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
    	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0 (2)">
    		<attributes>
    			<attribute name="owner.project.facets" value="jst.web"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7">
    		<attributes>
    			<attribute name="owner.project.facets" value="java"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    		<attributes>
    			<attribute name="maven.pomderived" value="true"/>
    			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="output" path="build/classes"/>
    </classpath></span>

    右键项目---》build path -->configre build path --->右面窗口Libraries -->add Library--->jar system library 

    6、在tomcat中启动maven项目,提示找不到类:严重: Error configuring application listener of class org.springframework.web.context.request.RequestContextListener
    java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener

    (1)普通的web项目:http://www.cnblogs.com/zhouyalei/archive/2011/11/30/2268606.html

    (2)maven项目:http://www.yihaomen.com/article/java/471.htm

    右键项目---》properties-->Deployment Assembly --->

    1、右键单击工程项目 ->点击 properties
    2. 选择 Deployment Assembly
    3. 点击 Add -> Java Build Path Entries -> Next
    4. 选择 Maven Dependencies -> Finish -> Apply -> OK
    5. Clean project and server. 重启server

    8、新建出的项目转换成maven项目后,目录结构不是标准的maven项目:




    选中项目,在右上角”倒三角“的地方,Package Presentation --->Hierarchical,此时目录显示为标准包结构。


  • 相关阅读:
    STM32F4 SPI双机通讯调试总结
    Altium Designer (DXP) 复制粘贴,放器件 出错报异常的原因
    C++中一个0xC0000005访问冲突问题
    将Windows 7安装到移动固态硬盘(U盘)
    Delphi 的TStringBuilder防止服务器内存碎片化
    Delphi XE5的Android开发平台搭建
    利用RTTI实现Delphi的多播事件代理研究
    博客即将同步至 OSCHINA 社区
    用太极拳讲分布式理论,真舒服!
    记录一次C#调用Delphi编写Dll程序过程
  • 原文地址:https://www.cnblogs.com/yeemi/p/7470182.html
Copyright © 2011-2022 走看看