简体   繁体   English

Maven无法将src / main / java识别为代码的源文件夹

[英]Maven does not recognise src/main/java as the source folder for code

I have an issue in that in eclipse the folder "java" in src/main/java is considered as a package. 我有一个问题,就是在Eclipse中,src / main / java中的文件夹“ java”被视为一个包。 The folder structure in which I have the code is "workspace\\map_reduce\\src\\main\\java\\map_reduce". 我具有代码的文件夹结构是“ workspace \\ map_reduce \\ src \\ main \\ java \\ map_reduce”。 When i do "mvn clean install" it works fine, but when i integrate it with eclipse, the folder stricture is "src/main/" and the package is "java.map_reduce". 当我执行“ mvn clean install”时,它可以正常工作,但是当我将其与eclipse集成时,文件夹约束为“ src / main /”,而程序包为“ java.map_reduce”。

I want the folder structure as "src/main/java" and the package as "map_reduce". 我希望文件夹结构为“ src / main / java”,而软件包为“ map_reduce”。

Can anyone tell me how to fix this issue. 谁能告诉我如何解决此问题。

右键单击[Project Explorer]中的项目,从弹出的上下文菜单中选择[Build Path]-> [Configure Build Path ...],切换到[source]选项卡,然后删除“ src / main /”并添加文件夹源为“ src / main / java”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven只选择src / main / java或src / main / scala作为源文件夹,而不是两者 - Maven only picks src/main/java or src/main/scala as source folder, never both Maven 无法识别 testNG 文件的注释 maven 测试通过 ZDFDAC4524A7FA1A965 执行 maven 时“/src/main/java”中的文件 - Maven won't recognise testNG annotation for files in '/src/main/java' when maven test is executed through cmd 在没有 Maven 的情况下在 Eclipse 中创建 src/main/java 文件夹结构 - Creating a src/main/java folder structure in Eclipse without Maven 无法从 src/main/resources Java 项目 Maven 获取文件夹 - cannot get folder from src/main/resources Java project Maven 使用 maven 创建 eclipse 源文件 src/main/java 和 src/main/groovy - Creating eclipse source files src/main/java and src/main/groovy with maven Sonarqube 6.7.5即使项目没有src / main / java文件夹,也要计算代码覆盖率 - Sonarqube 6.7.5 Calculating Code Coverage even when the project does not have src/main/java folder 其他maven源文件夹,如src / main / javascript或src / main / css? - Additional maven source folders such as src/main/javascript or src/main/css? Maven项目中src / main / java和src / test / java之间的区别 - Difference between src/main/java and src/test/java in a Maven project 使用没有src / main / java的Maven - Use Maven without src/main/java Maven布局:如何确保src / main不依赖于src / test? - Maven layout: How to be sure that src/main does not depend on src/test?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM