【发布时间】:2013-03-21 17:09:38
【问题描述】:
我正在使用 eclipse 来管理一个 maven 项目。
在这个项目的 pom 中,我有一个特殊的插件,它在 generate-ressources 阶段创建一个文件:
<plugin>
<groupId>org.eclipse.acceleo</groupId>
<artifactId>maven</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>acceleo-compile</goal>
</goals>
</execution>
</executions>
</plugin>
我已将此插件目标链接到 eclipse 生命周期,以便在 eclipse 编译期间执行它:
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.acceleo</groupId>
<artifactId>maven</artifactId>
<versionRange>[3.2.1,)</versionRange>
<goals>
<goal>acceleo-compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
当我用eclipse做一个干净的项目时,项目再次编译,并且在eclipse编译期间文件生成良好(我可以在目标目录中找到它)。
现在,我想在 tomcat 服务器上部署我的 webapp。我使用 eclipse 的服务器视图创建了一个 tomcat 服务器,并将项目拖放到该服务器中以同步和发布它。
项目部署良好,我可以启动服务器并测试我的应用程序。
但是,需要maven插件生成的文件在发布操作时没有复制...
所以我的问题是:为什么一个maven插件生成的文件在eclipse编译时生成的很好,但是在eclipse自动服务器管理的发布/同步操作过程中没有部署到服务器上?
【问题讨论】:
-
我假设你只在插件管理区域添加了插件。
-
不,它在 build/plugins 中定义
标签: eclipse maven tomcat compilation