使用maven eclipse插件,我可以配置 checkstyle 或声纳配置,通过将必要的调用添加到 pom.xml 并调用“mvn eclipse:eclipse”来创建项目配置。
我团队的一些成员只想使用“导入 Maven 项目”,因此无法获得项目预配置的好处。有没有办法为 m2eclipse 提供相同(或相似)的提示?
我想要实现的是,人们只需“导入 Maven 项目”,他们就会自动获得一个预先配置了正确的 checkstyle 配置的项目(可能是从 POM 中定义的某个位置下载的),而无需手动进入项目首选项并经常点击。这在某种程度上违背了自动项目生成的目的:-)
With the maven eclipse plugin, I can configure checkstyle or sonar configurations by adding the necessary invocations to the pom.xml and calling "mvn eclipse:eclipse" to create the project configuration.
Some members of my team want to just use "Import Maven project" and therefore don't get the benefits of the project preconfigurations. Is there a way to provide the same (or similiar) hints to m2eclipse?
What I want to accomplish is that people simply "Import Maven Project", and they automatically get a project preconfigured with the correct checkstyle configuration (which is possibly downloaded from somewhere as defined in the POM) without having to manually go into the project preferences and click around a lot. That somehow defeats the purpose of automatic project generation :-)
发布评论
评论(2)
我可以通过pom.xml配置m2eclipse吗?对此主题有更详细的解答:只能实现完全自动配置使用项目配置器。但即使对于 FindBugs 和 Sonar,也有一个基于 AntRun 和 XMLTask 的解决方案。结帐后只需手动触发一次。
There are more detailed answers to this topic in Can I Configure m2eclipse through pom.xml?: Completely automatic configuration can only be achieved with a ProjectConfigurator. But there is a solution based on AntRun and XMLTask even for FindBugs and Sonar. It needs manual triggering only once after checkout.
这可以通过编写自定义 ProjectConfigurator 来实现(如本 线程)。看起来有人在 m2e-extensions 中发布了其中一些(针对 Checkstyle、PMD、FindBugs) 项目。
This is doable by writing custom ProjectConfigurator (as mentioned in this thread). And it looks like somebody plublished some of them (for Checkstyle, PMD, FindBugs) in the m2e-extensions project.