You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Clifton <cl...@gmail.com> on 2008/02/12 16:43:42 UTC

Re: Multimodule application and exec pluggin

Hi,

Reading your question gave me insight to my issue. I'm no expert but I might
have an idea for you to try. If I understand correctly, you need to bind the
exec:exec goal to some normal build phase like install. Do this binding from
within the appear pom then when you call that goal from the root pom that
goal will be executed. Another option (if you don't like abusing install)
would be to define a custom phase for your root project. I'm not sure if
that phase would be inherited in the siblings and I've never actually tried
defining custom phases. It would be just one more option to look into.

-Cliff

Leonardo Postacchini wrote:
> 
>  Greetings all,
> 
>  We have an multi-module application that we build with maven but we work
> on
> the code with eclipse, to avoid trauma with eclipse schema we have the
> modules all flat on the workspace, something like this:
> workspace/appRoot
> workspace/appEar
> workspace/appWar
> workspace/appCore
> workspace/appBizz
> ...
> 
> Where the appRoot work as if the root of all the modules and appEar is
> where
> the .ear is assembled. On the root pom we have:
>     <modules>
>         <module>../appEar</module>
>         <module>../appWar</module>
>         <module>../appCore</module>
>         <module>../appBizz</module>
>         ...
>     </modules>
> 
> In the modules pom we have:
>     <parent>
>         <artifactId>AppRoot</artifactId>
>         <groupId>example</groupId>
>         <version>1.0-SNAPSHOT</version>
>     </parent>
> 
> It all work fine up to package and insall, but we want to deploy the
> application to a Glassfish Server, in order to do that we tried to add a
> goal to the appEar pom:
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>exec-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>exec</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <executable>asadmin</executable>
>                     <arguments>
>                         <argument>deploy</argument>
>                         <argument>--user=admin</argument>
>                         <argument>--passwordfile=${user.home
> }/.asadminpass</argument>
>                         <argument>--host=${glassfish.host}</argument>
>                         <argument>--port=4848</argument>
>                         <argument>--name=${artifactId}</argument>
> 
> <argument>target/${artifactId}-${version}.${packaging}</argument>
>                     </arguments>
>                 </configuration>
>             </plugin>
> 
> It works, if I call mvn exec:exec only on the appEar dir, but if I try to
> deploy it through the appRoot, it seems to not get the config and it
> complaigns that there is no executable set up.
> 
> I tried to move the plugin config to the root pom, but it runs for every
> module on the project, giving errors, until it reaches the appEar when it
> works.
> 
> I would like to know if there is a way to have the plugin on the module
> project and have it understood by the root and run during the build or if
> there is a way to run the plugin set on the root to run only on a specific
> module.
> 
> Thank you for reading this and for the help in advance.
> 
> 

-- 
View this message in context: http://www.nabble.com/Multimodule-application-and-exec-pluggin-tp14263462s177p15434492.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org