Eclipse 和 Maven 配置
我是 Maven 的新手。我刚刚安装并配置了它。 当我开始编码时,我意识到 Eclipse 不会显示错误消息。 我通过谷歌搜索没有找到任何有用的东西。有些消息来源说将 java 构建器添加到您的项目中,但我已经这样做了。
这是屏幕截图。
I'm new to Maven. I've just installed and configured it.
When I started coding, I realized Eclipse doesn't show the error messages.
I haven't found anything helpful by searching Google. Some sources say to add java builder to your project but I already did.
Here's a screenshot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来,您在 Eclipse 中的项目配置为在“src”子目录中包含源代码(并将类编译为“bin”)。
默认情况下,Maven 在 src/main/java 中查找 java 源(并将类编译为“target/classes”)。
因此,您需要将源代码移动到 src/main/java 或修改 pom.xml 以指向“src”作为源目录。
我建议遵循 Maven 约定并将源代码存储在 src/main/java 中。
It looks, that you had project in eclipse configured to have source code in 'src' subdirectory (and compile classes to 'bin').
Maven by default looks for java sources in src/main/java (and compile classes to 'target/classes').
So you'd need to move your source code to src/main/java or modify pom.xml to point to 'src' as source directory.
I'd suggest following maven convention and store source code in src/main/java.
您没有创建 Maven 标准文件夹结构。
创建这样的结构:
src/main/java 用于 Java 类,src/main/resources 用于属性等,然后右键单击该项目并选择 Maven ->更新项目配置。
You didn't create the Maven standard folder structure.
Create the structure like that:
src/main/java for Java classes and src/main/resources for properties etc., then do a right click on the project and choose Maven -> Update project configuration.