пятница, 18 мая 2012 г.

yet another gotcha this week )

when running scp task from ant (1.8) script - you need place jsch-0.1.48.jar to ant classpath (via IDE e.g.), otherwise you'll get "class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found" (SO).

And in case of running it from maven - instead of standart form:
          
                maven-antrun-plugin
                1.7
                
                    
                        deploy
                        
                            
                                
                                       ....
                                
                            
                        
                        
                            run
                        
                    
                
            
you'll need to add the following dependencies:
          
                maven-antrun-plugin
                1.7

                
                    
                        org.apache.ant
                        ant-jsch
                        1.7.0
                    
                    
                        com.jcraft
                        jsch
                        0.1.48
                    
                

                
                    
                        deploy
                        
                            
                                
                                       ....
                                
                            
                        
                        
                            run
                        
                    
                
            
otherwise you'll get in maven smth like that:


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ...
ildException has occured: Problem: failed to create task or type scp
[ERROR] Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found.
[ERROR] This looks like one of Ant's optional components.
[ERROR] Action: Check that the appropriate optional JAR exists in
[ERROR] -ANT_HOME\lib
[ERROR] -the IDE Ant configuration dialogs
[ERROR]
[ERROR] Do not panic, this is a common problem.
[ERROR] The commonest cause is a missing JAR.
[ERROR]
[ERROR] This is not a bug; it is a configuration problem
[ERROR]
[ERROR] around Ant part ...<scp ....
[ERROR] -> [Help 1]

Комментариев нет:

Отправить комментарий