Jump to: navigation, search

Difference between revisions of "IAM Buckminster Maven Actor"

(Features)
(Features)
 
(8 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
=Features=
 
=Features=
The Maven actor is capable of the following right now; expect the list to grow!
+
The Maven actor is capable of the following right now. Expect the list to grow!
  
 
* Execution of Maven goals:
 
* Execution of Maven goals:
 
** Without parameters (install, eclipse:eclipse)
 
** Without parameters (install, eclipse:eclipse)
** With parameters (archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app artifactId=my-app)
+
** With parameters (archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app ...)
 
** Without an existing Maven project (archetype:generate ...)
 
** Without an existing Maven project (archetype:generate ...)
 +
*** The base directory for this kind of goal can be selected
 
* Profiles selection
 
* Profiles selection
  
 
=Maven actor syntax=
 
=Maven actor syntax=
  
Actor properties and regular properties can be passed to the Maven actor. Right now, there's only one supported actor property, named "goal", which specifies which Maven goal needs to be performed. Maven goals can be parametrized, and those parameters (if needed) must be specified in the "executionParameters" property. The executionParameters value must consist in a list of key-value pairs, optionally preceded by the usual "-D" prefix. Let's see some valid action examples (by the way, the Maven actor name is "maven"):
+
This is the supported Maven actor syntax at the moment:
 +
 
 +
* The actor name (to be used in the actions' "actor" attribute) is <b>maven</b>.
 +
* Actor properties:
 +
** <b>goal</b>. The desired Maven goal goes here.
 +
* Properties:
 +
** <b>executionParameters</b>. This is an optional list of execution parameters for the specified goal. This list must follow the same syntax as in console Maven (but it's allowed to remove the "-D" prefix in the key-value pairs). These parameters must be enough for the goal so no user intervention is needed during the execution (in other case, the action will never finish when invoked).
 +
** <b>baseDirectory</b>. Here you can specify a base directory (absolute or relative to the workspace directory) for the goal. This property's value will only be taken into account if the corresponding goal is of the no-pom-needed kind. By default, the base directory will be the component's folder in the workspace (/home/workspace/foo-component, for example).
 +
** <b>profiles</b>. Here you can choose a list of profiles to be active during the goal execution. These profiles must be defined inside the project's pom.xml.
 +
** <b>deactivateProfiles</b>. If set to true, this option will cause the goal to be executed without taking into account any active profile (except for those which may be specified in the <b>profiles</b> property). This is set to false by default.
 +
 
 +
Here you have some valid examples:
  
 
<source lang=xml>
 
<source lang=xml>
 
<cs:actions>
 
<cs:actions>
 +
  <cs:public name="foo-install-action" actor="maven">
 +
      <cs:actorProperties>
 +
        <cs:property key="goal" value="install"/>
 +
      </cs:actorProperties>
 +
  </cs:public>
 +
  <cs:public name="foo-eclipse-eclipse-action" actor="maven">
 +
      <cs:actorProperties>
 +
        <cs:property key="goal" value="eclipse:eclipse"/>
 +
      </cs:actorProperties>
 +
  </cs:public>
 
   <cs:public name="foo-action-with-parameters" actor="maven">
 
   <cs:public name="foo-action-with-parameters" actor="maven">
 
       <cs:actorProperties>
 
       <cs:actorProperties>
Line 26: Line 48:
 
         <cs:property key="executionParameters"  
 
         <cs:property key="executionParameters"  
 
             value="-DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app"/>
 
             value="-DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app"/>
 +
        <cs:property key="baseDirectory" value="foo-folder/foo-subfolder"/>
 
       </cs:properties>
 
       </cs:properties>
 
   </cs:public>
 
   </cs:public>
 
   <cs:public name="foo-action-with-parameters-2" actor="maven">
 
   <cs:public name="foo-action-with-parameters-2" actor="maven">
 
       <cs:actorProperties>
 
       <cs:actorProperties>
         <cs:property key="goal" value="archetype:generate"/>
+
         <cs:property key="goal" value="install"/>
 
       </cs:actorProperties>
 
       </cs:actorProperties>
 
       <cs:properties>
 
       <cs:properties>
         <cs:property key="executionParameters"  
+
         <cs:property key="profiles" value="profile-1 profile-2 profile-3"/>
            value="archetypeGroupId=org.apache.maven.archetypes groupId=com.mycompany.app artifactId=my-app"/>
+
        <cs:property key="deactivateProfiles" value="true"/>
 
       </cs:properties>
 
       </cs:properties>
  </cs:public>
 
  <cs:public name="foo-install-action" actor="maven">
 
      <cs:actorProperties>
 
        <cs:property key="goal" value="install"/>
 
      </cs:actorProperties>
 
  </cs:public>
 
  <cs:public name="foo-eclipse-eclipse-action" actor="maven">
 
      <cs:actorProperties>
 
        <cs:property key="goal" value="eclipse:eclipse"/>
 
      </cs:actorProperties>
 
 
   </cs:public>
 
   </cs:public>
 
</cs:actions>
 
</cs:actions>

Latest revision as of 12:48, 4 November 2008

< To: IAM

Introduction

An IAM-based Maven actor for Buckminster is under development and here we'll describe its features and API. If you are not familiar with Buckminster's actions and actors, here you will find detailed information.

Features

The Maven actor is capable of the following right now. Expect the list to grow!

  • Execution of Maven goals:
    • Without parameters (install, eclipse:eclipse)
    • With parameters (archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app ...)
    • Without an existing Maven project (archetype:generate ...)
      • The base directory for this kind of goal can be selected
  • Profiles selection

Maven actor syntax

This is the supported Maven actor syntax at the moment:

  • The actor name (to be used in the actions' "actor" attribute) is maven.
  • Actor properties:
    • goal. The desired Maven goal goes here.
  • Properties:
    • executionParameters. This is an optional list of execution parameters for the specified goal. This list must follow the same syntax as in console Maven (but it's allowed to remove the "-D" prefix in the key-value pairs). These parameters must be enough for the goal so no user intervention is needed during the execution (in other case, the action will never finish when invoked).
    • baseDirectory. Here you can specify a base directory (absolute or relative to the workspace directory) for the goal. This property's value will only be taken into account if the corresponding goal is of the no-pom-needed kind. By default, the base directory will be the component's folder in the workspace (/home/workspace/foo-component, for example).
    • profiles. Here you can choose a list of profiles to be active during the goal execution. These profiles must be defined inside the project's pom.xml.
    • deactivateProfiles. If set to true, this option will cause the goal to be executed without taking into account any active profile (except for those which may be specified in the profiles property). This is set to false by default.

Here you have some valid examples:

<cs:actions>
   <cs:public name="foo-install-action" actor="maven">
      <cs:actorProperties>
         <cs:property key="goal" value="install"/>
      </cs:actorProperties>
   </cs:public>
   <cs:public name="foo-eclipse-eclipse-action" actor="maven">
      <cs:actorProperties>
         <cs:property key="goal" value="eclipse:eclipse"/>
      </cs:actorProperties>
   </cs:public>
   <cs:public name="foo-action-with-parameters" actor="maven">
      <cs:actorProperties>
         <cs:property key="goal" value="archetype:generate"/>
      </cs:actorProperties>
      <cs:properties>
         <cs:property key="executionParameters" 
             value="-DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app"/>
         <cs:property key="baseDirectory" value="foo-folder/foo-subfolder"/>
      </cs:properties>
   </cs:public>
   <cs:public name="foo-action-with-parameters-2" actor="maven">
      <cs:actorProperties>
         <cs:property key="goal" value="install"/>
      </cs:actorProperties>
      <cs:properties>
         <cs:property key="profiles" value="profile-1 profile-2 profile-3"/>
         <cs:property key="deactivateProfiles" value="true"/>
      </cs:properties>
   </cs:public>
</cs:actions>