【发布时间】:2012-05-30 21:13:08
【问题描述】:
我正在尝试使用 maven 插件将 maven java 项目的源文件夹添加到 Eclipse。
当尝试使用 org.codehaus.mojo 插件时,我收到以下错误
未能在项目应用程序框架上执行目标 org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source (default-cli):目标 org.codehaus.mojo 的参数“源”: build-helper-maven-plugin:1.7:add-source 丢失或无效 -> [帮助 1]
通过阅读http://mojo.codehaus.org/build-helper-maven-plugin/usage.html 上的文档,这应该是正确的吗? 文件夹 target/sources/mygeneratedfiles 存在。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/sources/mygeneratedfiles</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
-
要添加源文件夹,您应该在目标文件夹之外添加一个源文件夹。也许您可以提供更多您想要实现的细节。
-
@khmarbaise 我需要添加一个生成的文件夹。请查看修改
-
问题是从什么样的工具生成什么样的文件夹?你在使用某种生成插件吗?
-
@khmarbaise 是一个maven生成的文件夹——它的路径是target/sources/mygeneratedfiles 文件夹是Maven生成的
-
您没有回答问题,但无论如何问题似乎是 build-helper 插件在错误的阶段执行。