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.

Reply via email to