重复类R&安培; BuildConfig后"重新导入所有的Maven项目"安培、有的、项目、QUOT

2023-09-07 04:33:05 作者:飘逸的、南国风

我们正在建设我们的Andr​​oid项目,Maven和IntelliJ IDEA的。有时候,我们必须执行重新导入所有Maven项目,如:更新依赖关系。这问题是,它总是食堂了对资源的源文件夹:所有模块得到根和目标/生成的源/ R,这似乎是值得重复的。所以重新导入后,我们需要手动删除其中的一个(通常是根文件夹)。当然,我们要避免这一步。我们尝试了几种设置为Android方面,但至今没有运气。

We are building our Android projects with Maven and IntelliJ IDEA. Sometimes we must execute "Reimport All Maven Projects", e.g. to update dependencies. The problem with that is that it always messes up the source folders for resources: all modules get "gen" and "target/generated-source/r" which seems to be the cause for the duplicates. So after reimporting, we need to manually delete one of those (usually the "gen" folder). Of course, we want to avoid this step. We tried several settings for the Android facet, but no luck so far.

那么,我们该如何配置的IntelliJ做一个适当的Maven重新导入,只是工作的?

So, how can we configure IntelliJ to do a proper Maven reimport that just works?

推荐答案

据斯文Strohschein处的 http://youtrack.jetbrains.com/issue/IDEA-94901 你可以尝试:

According to the reply of Sven Strohschein at http://youtrack.jetbrains.com/issue/IDEA-94901 you can try to:

删除根,目标和出的文件夹 还原中的知识产权的修改和IML文件(或只是将它们全部删除,甚至.idea文件夹) 在开始的IntelliJ 12 打开POM文件 右键单击 - >Maven的 - >重新导入 在生成 - >重建工程 Delete the "gen", "target" and "out" folders Revert the changes within the "ipr" and "iml" files (or just delete them all, maybe even .idea folder) Start IntelliJ 12 Open the pom file Right click -> "Maven" -> "Reimport" "Build" -> "Rebuild project"

作品FO我。