eclipse 中使用maven的jetty插件进行debug出现Source not found的问题解决方案

当在eclipse中使用maven的jetty插件进行debug的时候,会出现“Source not found”的问题。你把java项目的文件夹加入到它的搜索路径中,点击确定之后,发现它根本不生效。你多次尝试,依然会有这个问题。

怎么解决呢?停掉jetty服务,然后再次启动jetty服务,问题就解决了。可以进行debug了。

参考了国外的网站,下面有链接和原文。

    <build>
    	<defaultGoal>package</defaultGoal>
    	<finalName>dmeta2-api-server</finalName>
    	
        <plugins>
            <!-- web server for jetty begin -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.24</version>
                <configuration>
                    <scanIntervalSeconds>5</scanIntervalSeconds>
                    <contextPath>/dmeta2-api-server</contextPath>
                    <reload>automatic</reload>
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>8090</port>
                            <headerBufferSize>80000</headerBufferSize>
                        </connector>
                    </connectors>
                </configuration>
            </plugin>
            <!-- web server for jetty end -->
        </plugins>
    </build>

----------------------

地址:http://www.javavids.com/video/how-to-solve-source-not-found-error-during-debug-in-eclipse.html

How to solve Source not found error during debug in Eclipse

If you run your web application using embedded Java EE server in Maven (like Tomcat or Jetty) and try to run it in debug mode, once you hit some breakpoint, you will encounter this error: "Source not found".

If you run your web application using embedded Java EE server and try to run it in debug mode, once you hit some breakpoint, you will encounter this error: "Source not found". Just simply press "Edit Source Lookup Path ...", add your project and restart your web application. And now it works.

猜你喜欢

转载自kanpiaoxue.iteye.com/blog/2300847