开发者

How can I bind the execution of a Maven plugin to a different Maven plugin's execution?

I am using the maven-开发者_开发问答eclipse-plugin to configure my eclipse workspace with the configure-workspace goal of the plugin.

I need to perform some additional setup within the workspace that standard eclipse plugins do not appear to accomplish. Setup MAVEN_HOME and setup an external build tool for example. I have some corporately built plugins that can perform these tasks. What I would like to do is bind the execution of this plugin to the execution of eclipse:workspace-configure.

I have tried to do this by:

<executions>
  <execution>
    <goals>
      <goal>eclipse:configure-workspace</goal>
    </goals>
  </execution>
</executions>

But have had no luck. Is this possible?


I am using the maven-eclipse-plugin to configure my eclipse workspace with the configure-workspace goal of the plugin.

The goal eclipse:configure-workspace doesn't do much things, it just adds the classpath variable M2_REPO to Eclipse.

What I would like to do is bind the execution of this plugin to the execution of eclipse:workspace-configure

Not possible, you can only bind a plugin goal to a phase. Your best option is IMO to create an init script that would call the goals sequentially.


You can't bind an maven plugin to an other. You can configure to run one plugin after an other. For example to run the eclipse plugin first and you coperate after that. You need to define them directly within the same phase. On the other hand the example you give can't really work cause you're trying to bind a goal which with the plugin name. You have to use the configure-workspace only in the goal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜