This is what I've done so far:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<tempfile property="ant.temp-ear" deleteonexit="true" destdir="/tmp" />
<copy
file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
tofile="${ant.temp-ear}" verbose="true" />
<exec executable="${glassfish.home}/glassfish/bin/asadmin"
failonerror="true">
<arg value="--user=${glassfish.username}"/>
<arg value="--passwordfile=${glassfish.passwordfile}"/>
<arg value="--interactive=false"/>
<arg value="--host=${glassfish.host}"/>
<arg value="--port=${glassfish.adminport}"/>
<arg value="deploy"/>
<arg value="--force"/>
<arg value="--name=${project.artifactId}"/>
<arg value="${ant.temp-ear}"/>
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Works perfectly, but asadmin
(and the entire GlassFish, I assume) has to be installed on the same machine where mvn
is executed.
Is it possible to perform the same task with Cargo plugin?