IDEA - Ant (Cannot resolve symbol sshexec, Scp)

Card Puncher Data Processing

IDEA - Ant (Cannot resolve symbol sshexec, Scp)

About

When using an out of the box Idea installation and scripting an ant build file, you may get the following error:

Cannot resolve symbol sshexec
Cannot resolve symbol scp

Ant Idea Cannot Resolve Scp

Why

This is because the additional jar that needs this task ie jsch-0.1.55.jar is not in the class path.

A lot of ant task needs additional jar to be able to run. The steps below will show you how to install all of them.

Steps

Install ant

Why ? because:

  • the ant installation has a build script called fetch.xml that help installing all this additional jars
  • you can then call ant also from the command line

See install the additional jars

Install the additional jars in the user scope

  • Go to your installation directory and run fetch.xml with the user scope
cd %ANT_HOME%
ant -f fetch.xml -Ddest=user
  • it will install all additional jars in the directory
echo %USERPROFILE%\.ant\lib
C:\Users\userName\.ant\lib

  • Check

Ant Additional Jar User Lib

Restart Idea

Idea reads the directory C:\Users\userName\.ant\lib at start time, you need them to restart Intellij.

Solved ..

Idea Ant Scp Problem Solved







Share this page:
Follow us:
Task Runner