[ 
http://jira.codehaus.org/browse/MEXEC-4?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jerome Lacoste updated MEXEC-4:
-------------------------------

    Fix Version/s:     (was: before-1.1)
                   1.1-beta-1

> Extension to support the use of plugin dependencies when executing java class 
> (Important for non-java builds)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: MEXEC-4
>                 URL: http://jira.codehaus.org/browse/MEXEC-4
>             Project: Maven 2.x Exec Plugin
>          Issue Type: Improvement
>    Affects Versions: 1.0
>         Environment: Tested on Windows XP, but solution should work on any OS
>            Reporter: James Carpenter
>            Assignee: Brett Porter
>             Fix For: 1.1-beta-1
>
>         Attachments: exec-maven-plugin.patch, exec-maven-plugin.zip
>
>
> I have added new optional functionality to the exec:java goal of the Maven 
> Exec Plugin.  The relevant enhancements to Introduction.apt are copied below. 
>  The attached patch contains all the changes I have made.  I have also added 
> a new manual integration test alongside the existing manual integration tests 
> which covers the new usage.
> Note: The version of the Maven Exec Plugin found at the HEAD of SVN refers to 
> the parent pom org.codehaus.mojo:mojo:9 which is not publicly released.  
> After checking to ensure there were no changes between the latest release of 
> the Maven Exec Plugin and what was on the HEAD, I simply rolled the parent 
> POM version back to the most recent version on ibiblio.  
> (org.codehaus.mojo:mojo:7).  The patch will reflect this change, which you 
> may wish to undo.
> ==========================================
> * Using Plugin Dependencies Instead of Project Dependencies
>   Ocassionally it is desirable to execute a java class without affecting your 
> project's dependencies.
>   For example, if you are using the maven csharp plugins, adding java 
> dependencies to your project
>   will upset the csharp compiler.  Therefore the maven exec plugin allows you 
> specify dependencies of
>   your executable class as plugin dependencies.  Since maven takes plugin 
> dependencies into consideration
>   when determining build order for a multi-module project your build order 
> should automatically be
>   appropriately adjusted (I think).
>   If you specify your executable class dependencies as plugin dependencies, 
> you may end up with extraneous
>   undesirable dependences required by the maven exec plugin but not by your 
> executable class.  If this
>   causes a problem, or if you simply prefer to avoid the extraneous 
> dependencies you can use the
>   executableDependency configuration element.  The executableDependency 
> element allows you to identify
>   the particular artifact in the list of the plugin's dependencies which 
> contains your executable class.
>   The maven exec plugin will ensure that only the selected artifact 
> identified by the executableDependency
>   configuration element and the selected artifact's transitive dependencies 
> are used when the mainClass
>   is executed.
>   Although the use of the executableDependency configuration element will 
> prevent the java class being
>   executed from seeing extraneous classes, the maven exec plugin itself will 
> still see all of the plugin
>   dependencies.  For example if your executable java class has a dependency 
> upon a brand new version of
>   org.codehaus.plexus:plexus-utils and you specify this as a plugin 
> dependency then the maven exec plugin,
>   which already has a transitive dependency upon 
> org.codehaus.plexus:plexus-utils, will end up using
>   the brand new version you explictly supplied.  It is unlikely you will 
> encounter a situation
>   where this will be a problem, but hopefully this knowledge will help you 
> diagnose such a problem if
>   it occurs.  None of this is relevant unless your using the plugin 
> dependencies for your
>   executable (includePluginDependencies=true).
> ** Example POM Configuration using Plugin Dependencies
> -------------------
> <project>
>   ...
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>exec-maven-plugin</artifactId>
>         <executions>
>           <execution>
>             ...
>             <goals>
>               <goal>java</goal>
>             </goals>
>           </execution>
>         </executions>
>         <configuration>
>         <includeProjectDependencies>false</includeProjectDependencies>
>         <includePluginDependencies>true</includePluginDependencies>
>           <executableDependency>
>               <groupId>com.example.myproject</groupId>
>               <artifactId>mylib</artifactId>
>         </executableDependency>
>           <!--assume this starts some server process used in an integration 
> test-->
>           <keepAlive>true</keepAlive>
>           <mainClass>com.example.Main</mainClass>
>           <arguments>
>             <argument>argument1</argument>
>             ...
>           </arguments>
>           <systemProperties>
>             <systemProperty>
>               <key>myproperty</key>
>               <value>myvalue</value>
>             </systemProperty>
>             ...
>         </configuration>
>       <dependencies>
>            <dependency>
>               <groupId>com.example.myproject</groupId>
>               <artifactId>mylib</artifactId>
>               <version>1.3.5</version>
>               <type>jar</type>
>             </dependency>
>       </dependencies>
>       </plugin>
>     </plugins>
>   </build>
>    ...
> </project>
> -------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to