[ 
http://jira.codehaus.org/browse/MANTRUN-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126098
 ] 

gotama commented on MANTRUN-53:
-------------------------------


This Maven config uses the optional ant tasks scp and sshexec to remotely stop 
JBoss, copy an EAR file to a remote server, and remotely start JBoss.


        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant-jsch</artifactId>
                        <version>1.7.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.jcraft</groupId>
                        <artifactId>jsch</artifactId>
                        <version>0.1.31</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <configuration>
                            <tasks>
                                <property environment="env"/>

                                <sshexec host="hostname"
                                         username="username"
                                         
keyfile="${env.USERPROFILE}/.ssh/id_rsa"
                                         command="service jboss stop"
                                        />

                                <scp file="c:/deploy/myApp.ear"
                                     todir="[EMAIL 
PROTECTED]:/opt/jboss/server/default/deploy"
                                     keyfile="${env.USERPROFILE}/.ssh/id_rsa"
                                     passphrase=""
                                     verbose="true"
                                        />

                                <sshexec host="hostname"
                                         username="username"
                                         
keyfile="${env.USERPROFILE}/.ssh/id_rsa"
                                         command="service jboss start"
                                        />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin> 


> add ant optional task support
> -----------------------------
>
>                 Key: MANTRUN-53
>                 URL: http://jira.codehaus.org/browse/MANTRUN-53
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Improvement
>    Affects Versions: 1.2
>         Environment: windows 2000,java 1.4.2
>            Reporter: bingwuli
>            Assignee: Carlos Sanchez
>
> I use maven-antrun-plugin for my project recently. Althought this plugin give 
> me some convenience, I find it doesn't support ant optional task. In my 
> project ,I need to use native2ascii to convert my messages. When I put such 
> ant segment  <tasks><native2ascii encoding="GBK" src="src/main/conf/message" 
> dest="${project.build.outputDirectory}" includes="**/*.txt"  ext = 
> ".properties"/></tasks> into plugin's configuration, it doesn't work. 
> After I carefully study plugin's docment ,I find the plugin doesn't depend on 
> ant optional jar .After I add ant-optional jar into dependency path ,and 
> rewrite ant segent as such ,it does work for me.
> <task><taskdef name="native2ascii" 
> classname="org.apache.tools.ant.taskdefs.optional.Native2Ascii" classpathref 
> = "maven.compile.classpath" /><native2ascii encoding="GBK" 
> src="src/main/conf/message"dest="${project.build.outputDirectory}" 
> includes="**/*.txt"  ext = ".properties"/></task>
> I think it good idea that this plugin  will support ant optional task.

-- 
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

        

Reply via email to