[英]Stopping m2e to create non-existing source folders specified in build-helper-maven-plugin
In the parent pom of my projects I've the following build-helper-maven-plugin setup: 在我的项目的父pom中,我具有以下build-helper-maven-plugin设置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-test-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/it/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
so that when I do Maven -> Update project, m2e adds the src/it/java folder to the sources of the project. 这样,当我执行Maven-> Update project时,m2e将src / it / java文件夹添加到项目的源中。 That folder exists in most of the projects using that parent pom, but for the projects that don't have the folder, m2e will create it.
使用该父pom的大多数项目中都存在该文件夹,但是对于没有该文件夹的项目,m2e会创建该文件夹。 I would like that folder to not be created.
我希望不创建该文件夹。 Is there a way to tell eclipse/m2/build-helper plugin to not create the source folder if does not exist?
如果不存在,有没有办法告诉eclipse / m2 / build-helper插件不创建源文件夹? I'm using eclipse Kepler and m2e 1.4 with build-helper connector 0.5.
我正在使用带有构建助手连接器0.5的eclipse Kepler和m2e 1.4。
When I do Maven -> Update project and untick the "Update project configuration from pom", then the folder is not created, but I would rather tell m2e not to create the folder instead of unticking the option for certain projects only. 当我执行Maven->更新项目并取消选中“从pom更新项目配置”时,不会创建该文件夹,但是我宁愿告诉m2e不要创建该文件夹,而不是仅取消某些项目的选项。
This issue is not happening using an old version of the plugin (0.10.2) in eclipse Indigo. 在Eclipse Indigo中使用旧版本的插件(0.10.2)不会发生此问题。
why don't you update the required projects folder's path instead of using a plugin to do it ? 为什么不更新所需项目文件夹的路径而不是使用插件来完成呢?
m2e will pick it up more easily, and it will be more standard from a maven point of view. m2e可以更轻松地拾取它,并且从专家的角度来看它将更加标准。 Here is a link to the entry to update: http://maven.apache.org/pom.html#Build_Element
这是要更新的条目的链接: http : //maven.apache.org/pom.html#Build_Element
If not using your current plugin is not an option you could add a profile which activates your current plugin, only if your folder exist in the current module. 如果您不选择不使用当前插件,则可以添加一个配置文件来激活您的当前插件,前提是您的文件夹存在于当前模块中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.