英文:
Maven Eclipse Debugging
问题
我用Maven和Eclipse创建了一个简单的“hello world”程序。我可以将其作为Java应用程序运行和调试。我能够在“创建、管理、运行”>“Java应用程序”下创建名为Helloworld的配置。在这个配置中,我可以指定项目和类。
我在Eclipse中有一个现有的Maven项目。这与之前的情况有很大不同。它在“包资源管理器”中不显示为Maven或Java项目,因为它不显示任何包/src/main/java,而是显示为文件夹(文件夹旁边没有Maven或Java的图标)。
当我点击并尝试在“创建、管理、运行”>“Java应用程序”下配置它时,我无法浏览到项目或类。
有什么方法可以在Eclipse中对这个Maven项目进行调试?
该项目在“创建、管理、运行”>“Maven构建”下进行了配置。它可以编译成JAR文件,并通过依赖的pom XML文件引入必要的库。
英文:
I created simple hello world program with Maven and Eclipse. I can Run and Debug as Java application. I was able to create configuration under Create,Manage,Run > Java Application as Helloworld. Within this configuration I could assign Project and class.
I have existing Maven project in Eclipse. This is significantly different. It does not appear with Package Explorer as a Maven or Java project, as it does not show any packages /src/main/java but as file folders (no icons for Maven or Java next to file folders).
When I click and attempt to configure this under Create,Manage,Run > Java Application, I am not able to browse to project or classes.
How would one go about Debugging this Maven project in Eclipse?
Project does have Create,Manage,Run > Maven Build configured. Compiles into Jar fine and pulls in necessary libraries with dependent pom XML.
答案1
得分: 1
我猜Eclipse不知道你的Maven项目是一个Maven项目。你可以按照以下步骤进行更改:
用鼠标右键单击你的项目 => "配置" => "转换为Maven项目"
这应该会自动触发构建,然后你应该能看到Java和Maven图标。
英文:
I guess Eclipse does not know, that your Maven project is a Maven project.<br>
You can change this as follows:<br>
Right click with mouse on your project => "Configure" => "Convert to Maven Project"
This should trigger automatically a build and then you should see the Java and Maven icons.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论