I have hierarchival build with parent root and some modules.
root
- somejar
- someejb
- somewebapp
I want to define a profile which deploys my ejb and webapp to a server. This
profile has plugin maven-glassfish-plugin for the deployment. Plugin has a
lot of configuration so I would not like to repeat it. All my modules (eg.
somejar) do NOT want to use the plugin. Can I define the plugin
configuration in the root pom.xml and define the execution in the module
pom.xmls?
Another problem is that part of the plugin configuration
(components-component-name/artifact) is different in different modules
(someejb.jar vs somewebapp.war for example). So I would need to define most
of the plugin confguration in the root pom.xml, and override some parts in
the module pom.xml....is this possible?
Example of the plugin configuration:
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${glassfish.home}</glassfishDirectory>
<user>${domain.username}</user>
<adminPassword>${domain.password}</adminPassword>
<autoCreate>false</autoCreate>
<debug>true</debug>
<echo>true</echo>
<force>true</force>
<terse>true</terse>
<skip>${test.int.skip}</skip>
<domain>
<name>${domain.name}</name>
<adminPort>${domain.adminPort}</adminPort>
<httpPort>${domain.httpPort}</httpPort>
<httpsPort>${domain.httpsPort}</httpsPort>
<iiopPort>${domain.iiopPort}</iiopPort>
<jmsPort>${domain.jmsPort}</jmsPort>
<reuse>false</reuse>
<properties>
<property>
<name>server.log-service.file</name>
<value>${domain.log.dir}/server.log</value>
</property>
</properties>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.jar</artifact>
</component>
</components>
</configuration>
<executions>
<execution>
<id>glassfish-undeploy</id>
<phase>compile</phase>
<goals>
<goal>undeploy</goal>
</goals>
</execution>
<execution>
<id>glassfish-deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>