当使用“导入Maven项目”调用从git导入maven项目进入eclipse时,m2e插件似乎生成了一个新的.project和.classpath以及其他一些文件,即使这些文件已经签入。
为了解决这个问题,我想不检查任何eclipse特定文件,但是对每个项目文件进行了自定义,例如自定义保存操作,或者更改验证以忽略特定内容,或者更改为javascript需要保留的动态Web项目的配置,因此要么需要检查这些文件,要么需要由m2e生成这些设置。
任何使用m2e配置eclipse项目验证器的方法吗?
答案 0 :(得分:1)
过去我们遇到过类似的问题。我们通过
解决了这个问题答案 1 :(得分:0)
另一个答案提出了eclipse的解决方案。但是如果你使用不同的IDE是灵活的,我建议使用带有git的Netbeans。我测试了两个IDE,最后发现我可以使用Netbeans在不同的情况下节省时间!没有上述问题。
答案 2 :(得分:0)
我将m2e-codestyle-maven-plugin用于其他目的,但它也应该满足您的需求(在我的情况下,我想设置默认设置,以便从我的coding-standards项目启用所有验证。
您需要做的关键是分叉我的coding-standards项目的副本,并在org.eclipse.wst.validation.prefs
中添加/更改相应的设置,即
vals/org.eclipse.wst.xml.core.xml/global=FF03
例如,禁用XML的验证。您可以通过使用此处显示的配置文件仅在m2e
上激活它
https://github.com/trajano/jee/blob/master/jee-domain-api/pom.xml#L24
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>net.trajano.mojo</groupId>
<artifactId>m2e-codestyle-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>configure</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.trajano</groupId>
<artifactId>coding-standards</artifactId>
<version>${coding-standards.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>