EvoSuite test generation stucks when using maven plugin - evosuite

I Have followed steps given in the site to configure maven plugin. When I give "mvn evosuite:generate", it hangs with below detail in console.
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl.
Following are the environment detail
Windows 7
maven-3.2.1
jdk1.7.0_72
Following are the detail shown in console
[INFO] --- evosuite-maven-plugin:0.2.0:generate (default-cli) # gws-grouprequest-implementation ---
[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.12 is missing, no dependency information available
[WARNING] The POM for org.ow2.asm:asm-all:jar:5.0.4 is missing, no dependency information available
[WARNING] The POM for dk.brics.automaton:automaton:jar:1.11-8 is missing, no dependency information available
[WARNING] The POM for com.googlecode.gentyref:gentyref:jar:1.2.0 is missing, no dependency information available
[WARNING] The POM for net.sf.jgrapht:jgrapht:jar:0.8.3 is missing, no dependency information available
[WARNING] The POM for commons-cli:commons-cli:jar:1.3 is missing, no dependency information available
[WARNING] The POM for org.kohsuke:graphviz-api:jar:1.1 is missing, no dependency information available
[INFO] Going to generate tests with EvoSuite
[INFO] Total memory: 800mb
[INFO] Time per class: 2 minutes
[INFO] Number of used cores: 1
[INFO] Target: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation\target\classes
[INFO] Basedir: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-master/0.2.0/evosuite-master-0.2.0.jar!/org/slf4j/impl/S
taticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-runtime/0.2.0/evosuite-runtime-0.2.0.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[INFO] * EvoSuite
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
[INFO] Going to execute 32 jobs
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl

From your settings, it looks like you are using 1 core, 2 minutes per class, and trying to generate tests for 32 classes: this means it will take up to 64 minutes to complete. However, each time a new class is done (roughly every 2 minutes), you should get a new entry in the logs.
Btw, it seems you are using only 800MB of memory. Just in case, it is better to use some more, eg 1-1.5GB
Following is bit worrying:
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
Java does have limits on how large a method can be. EvoSuite needs to add some instrumentation on the bytecode to work, and that might lead to exceed the limit :(

Related

Automation test report issues with JENKINS/MAVEN/ECLIPSE

I am facing issues while generating reports after successful build using maven in jenkins.
First, I have created java code into my local machine using eclipse.
Second, After creating the code I converted it to the Maven and completed all required setup of pom.xml file inside jenkins using Maven.
Third, I ran the script it gives me the success response.
Below, it is my maven success build result logs.
Started by user jenkin
Building in workspace /var/lib/jenkins/workspace/TestProject
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 35275
[TestProject01] $ java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1/conf/logging jenkins.maven3.agent.Maven35Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.27.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12.jar 35275
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /home/user/Documents/eclipse-workspace/TestProject01/pom.xml clean install
[INFO] Scanning for projects...
[HUDSON] Collecting dependencies info
[INFO]
[INFO] ------------------< TestProject01:TestProject01 >-------------------
[INFO] Building TestProject01 0.0.1-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TestProject01 ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # TestProject01 ---
[INFO] Installing /home/user/Documents/eclipse-workspace/TestProject01/pom.xml to /var/lib/jenkins/.m2/repository/TestProject01/TestProject01/0.0.1-SNAPSHOT/TestProject01-0.0.1-SNAPSHOT.pom
[WARNING] Attempt to (de-)serialize anonymous class org.jfrog.hudson.maven2.MavenDependenciesRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] BUILD SUCCESS
[INFO] Total time: 2.821 s
[INFO] Finished at: 2019-02-05T19:09:16+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /home/user/Documents/eclipse-workspace/TestProject01/pom.xml to TestProject01/TestProject01/0.0.1-SNAPSHOT/TestProject01-0.0.1-SNAPSHOT.pom
/home/user/Documents/eclipse-workspace/TestProject01/pom.xml is not inside /var/lib/jenkins/workspace/TestProject/home/user/Documents/eclipse-workspace/TestProject01/; will archive in a separate pass
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /home/user/Documents/eclipse-workspace/TestProject01/test-output to /var/lib/jenkins/jobs/TestProject/htmlreports/HTML_20Report
Finished: SUCCESS
Now, The issue is I do not know how can I check if all testcases covered with success. Here, HTML report been generated but it stays the same after every build success which creating lot of confusion.
Please help!!!!!!!!

Apache Isis build failure migrating from v1.12.2. Unknown repositories ApplicationUser,

I am migrating an Apache Isis application from version 1.12.2 and currently using the legacy addons Security, Audit, and SessionLogger. I plan on updating to the latest Isis version and using the latest Incode addons here.
When changing the Isis version to 1.13.0 it fails the build. I did not see anything in the migration notes that will fix this. The build error is unkown repository for ApplicationRole, ApplicationTenancy, ApplicationUser. The bootstrap class lists the addon modules and there are no errors using Isis 1.12.2.
(update)
I thought it possible that Isis and the Incode addons should upgrade together at some point and someone would mention it, but I wasn't sure. Then looking more into this, I noticed the Apache Isis isis-app-todoapp uses an Isis version one major release higher, as well as the Incode addons, which are also one major release higher than what I have. Any idea about this? I would like to get to the latest Isis and Incode versions.
[ERROR]
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.role.ApplicationRole specifies unknown repository 'org.isisaddons.module.security.dom.role.ApplicationRoleRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.tenancy.ApplicationTenancy specifies unknown repository 'org.isisaddons.module.security.dom.tenancy.ApplicationTenancyRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.user.ApplicationUser specifies unknown repository 'org.isisaddons.module.security.dom.user.ApplicationUserRepository'
[ERROR]
[ERROR]
[INFO] calling #PreDestroy on all domain services
[INFO] shutting down
org.apache.isis.core.metamodel.specloader.SpecificationLoader#1e2fe282
[INFO] ---------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] App ................................. SUCCESS [ 0.652s]
[INFO] App DOM ............................. FAILURE [ 37.945s]
[INFO] App Fixtures ........................ SKIPPED
[INFO] App App ............................. SKIPPED
[INFO] App Webapp .......................... SKIPPED
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.974 s
[INFO] Finished at: 2018-05-25T09:47:05-04:00
[INFO] Final Memory: 84M/692M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.13.2:validate (default) on project App-dom: 3 meta-model problems found. -> [Help 1]
[ERROR]
Solved by removing a maven build-profile slash validation step, after reading similar SO question, and updating the Incode addon modules with each major Isis release. I successfully went through Apache Isis release 1.13.0, 1.14.0, 1.15.0, 1.16.2.

Maven : How to use Maven for generating Spring and CXF Support Application

I need to create a Simple web Application with Spring and CXF Setup
I am using apache-maven-3.0.3 Support for this.
Please tell me what me what number to enter in mvn command prompt , to generate those required artifacts for this.
I tried this way , it only generated the Java Interface and Implementation class
HelloWorld 2. HelloWorldImpl
and two xml files inside WEB-INF
beans 2. web
But i don't know why no jar files have been got created.
I tried this way
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 135: 116
Define value for property 'groupId': : com
Define value for property 'artifactId': : MyAPP
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com: :
Confirm properties configuration:
groupId: com
artifactId: MyAPP
version: 1.0-SNAPSHOT
package: com
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: cxf-jaxws-javafirst:2.1.4
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com
[INFO] Parameter: packageName, Value: com
[INFO] Parameter: package, Value: com
[INFO] Parameter: artifactId, Value: MyAPP
[INFO] Parameter: basedir, Value: C:\myapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\myapp\MyAPP
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:49.062s
[INFO] Finished at: Sun Sep 25 16:47:29 IST 2011
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
Archetypes are convenient, but I don't think they are going to be helpful to you for this case. This tutorial is a nice, basic example that outputs a running webapp using Spring and Maven. I would suggest you download the code, have a play around and figure out how it works, then start layering in your CXF functionality.
Go forth and build something awesome!

Nexus repository contains artifact but only makes POM available

I have a Nexus instance with Maven 2 repositories hosted on a non-Internet-connected corporate development domain. I need to use the maven-jaxb-schemagen plugin from Sun, however, it was only available in Maven 1 format (along with many other Maven 1 dependencies, so this is not a one-off edge case).
I made a new Maven 1 hosted repository in Nexus (maven1), then made a Maven1-to-Maven2 virtual repository as well (maven1as2). Because some of the needed artifacts are snapshots, the policy for maven1 (and by extension maven1as2) is Snapshot.
I imported all of the Maven 1 artifacts through the filesystem to this repository's overridden local storage location.
I then added maven1as2 to my Public Repositories group. Some of the reference I have found says that Nexus will not allow you to browse or search a Maven1 repository. I have had mixed results. If I select Public Repositories or maven1as2 in Nexus, I can go to Browse Storage and drill down to com/sun/tools/jxc/maven2/maven-jaxb-schemagen-plugin/1.3-SNAPSHOT/ and view the maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom file and its checksum. However, I cannot view the JAR artifact that should be there and is on the filesystem.
When I try to use Maven to build, I get the following:
$ mvn clean compile
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] MyProject
[INFO] MyModule1
[INFO] MyModule2
...
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [cobertura:clean {execution: default}]
[INFO] No goals needed for project - skipping
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyModule1
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
Downloading: http://my.nexus.server:8081/nexus/content/groups/public/com/sun/tools/jxc/maven2/maven-jaxb-schemagen-plugin/1.3-SNAPSHOT/maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom
6K downloaded (maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom)
[INFO] ---------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ---------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file -Durl=[url] -DrepositoryId=[id]
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
[INFO] ---------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ---------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Jul 06 15:05:08 EDT 2010
[INFO] Final Memory: 7M/17M
[INFO] ---------------------------------------------------------------------------
Sometimes it happens when working with m2eclipse. You chose a dependency and the default scope is pom and not jar. You didn't show your pom file. validate that all dependencies are jar scoped.
I learned that most of the time rebuilding metadata of the repositories helps to solve such problems.
I find it annoying how often this is necessary.
Select the repository
In the "Browse Storage" tab open the context menu of the root node (it sometimes is hidden behind the Firefox default context menu - pressing Esc helps in this case and brings the Nexus context menu into view)
Select rebuild metadata
Expire cache and reindex may help too for some cases.
Most of the time these steps didn't solve the problem at the first try but at last they solved it each time though.
I run Nexus as a WAR in Glassfish 2.1

Maven FTP distribution problem

maven release:perform is failing to distribute via FTP.
The first thing I checked is that I can access the target server with the given credentials from the command line. I can with passive FTP but not with active FTP (known firewall restriction). What I can see from googling is that Maven uses passive FTP by default. Is that correct? If not, how can I cause it to use passive FTP?
Assuming Maven is using passive FTP, I would appreciate any other advice.
My configuration:
settings.xml:
<servers>
<server>
<id>repo-ftp</id>
<username>myUserName</username>
<password>myPassword</password>
</server>
</servers>
parent POM:
<distributionManagement>
<repository>
<id>repo-ftp</id>
<url>ftp://myServer</url>
</repository>
<snapshotRepository>
<id>repo-ftp</id>
<url>ftp://myServer</url>
</snapshotRepository>
</distributionManagement>
The error message:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] FATAL ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] org.apache.maven.wagon.AbstractWagon.openConnection()V
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Trace
[INFO] java.lang.AbstractMethodError: org.apache.maven.wagon.AbstractWagon.openConnection()V
[INFO] at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:143)
[INFO] at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:235)
[INFO] at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:153)
[INFO] at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162)
[INFO] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:616)
[INFO] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[INFO] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[INFO] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[INFO] at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 16 seconds
[INFO] [INFO] Finished at: Wed Oct 21 17:43:11 UTC 2009
[INFO] [INFO] Final Memory: 25M/47M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution failed, exit code: '1'
UPDATE
I did have an extension node in the parent POM:
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-beta-5</version>
</extension>
After reviewing the reply from cetnar I realized that I need beta-2 for my particular version of maven. When I switched the extension node to reference beta-2, maven properly complained about not having it available. So, I downloaded and installed using
mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-ftp -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=./wagon-ftp-1.0-beta-2-sources.jar
(which is a cut-and-paste from the error message I got, with my local copy of the .jar in the appropriate location).
Now, I get:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp
[INFO]
[INFO] Component descriptor cannot be found in the component repository: org.apache.maven.wagon.Wagonftp.
Any advice for that problem?
UPDATE 2
I did not have wagon-ftp.jar or commons-net.jar in $M2_HOME/lib but do now. I get the same error.
$M2_HOME/lib:
commons-cli.jar -> ../../java/commons-cli.jar
commons-net.jar -> ../../java/commons-net.jar
doxia-sink-api.jar -> ../../java/doxia-sink-api.jar
jsch.jar -> ../../java/jsch.jar
jtidy.jar -> ../../java/jtidy.jar
maven2.jar -> ../../java/maven2.jar
plexus-container-default.jar -> ../../java/plexus-container-default.jar
plexus-interactivity-api.jar -> ../../java/plexus-interactivity-api.jar
plexus-utils.jar -> ../../java/plexus-utils.jar
wagon-file.jar -> ../../java/wagon-file.jar
wagon-ftp-1.0-beta-2.jar -> ../../java/wagon-ftp.jar
wagon-ftp.jar -> ../../java/wagon-ftp.jar
wagon-http-lightweight.jar -> ../../java/wagon-http-lightweight.jar
wagon-http-shared.jar -> ../../java/wagon-http-shared.jar
wagon-provider-api.jar -> ../../java/wagon-provider-api.jar
wagon-ssh-common.jar -> ../../java/wagon-ssh-common.jar
wagon-ssh-external.jar -> ../../java/wagon-ssh-external.jar
wagon-ssh.jar -> ../../java/wagon-ssh.jar
xml-apis.jar -> ../../java/xml-apis.jar
Note that all other dependencies were deployed using symbolic links to another directory so I continued the same pattern. Access rights are the same for all files. I tried providing both a wagon-ftp.jar and wagon-ftp-1.0-beta-2.jar symbolic link.
I'm not very excited about the prospect of upgrading to the latest version of maven (for fear of new problems), but is that my best option? Any other ideas?
SOLUTION
It worked! Kind of. Now I get an authentication error, but that's a different issue.
The a-ha moment was the mention of -sources and I realized I had downloaded wagon-ftp-1.0-beta-2-sources.jar but installed with -Dversion=1.0-beta-2 (no -sources)... so I copied the sources JAR to the binary jar file name :-).
Thank you all for your help with this!
The setup looks good. And yes, passive mode is the default (see WAGON-143). That said, according to the trace (java.lang.AbstractMethodError is thrown when something tries to call an abstract method), it's obvious that your wagon isn't compatible with your version of maven. Wagon madness...
It's surely not the best place but this is actually documented in the Guide to using Extenstions (pay a special attention to the "Note" at the bottom):
Extensions are used to enable Wagon
providers, used for the transport of
artifact between repositories, and
plug-ins which provide lifecycle
enhancements. Wagon providers
<project>
...
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
</build>
...
</project>
Note: Wagon 1.0-beta-3+ requires Maven 2.1.0 or above. For Maven 2.0.10
and earlier, use Wagon 1.0-beta-2.
EDIT: About the new error, the maven deploy plugin FAQ describes something very similar:
If you are using the deploy:deploy-file goal and encounter this error:
"Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp"
Then you need to place the appropriate wagon provider in your %M2_HOME%/lib. In this case the provider needed is ftp, so we have to place the wagon-ftp jar in the lib directory of your Maven 2 installation.
If the error description is something like this:
"Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp org/apache/commons/net/ftp/FTP"
Then you need to place the commons-net jar in %M2_HOME%/lib.
I don't get why one would have to do that but try to put wagon-ftp-1.0-beta-2.jar in %M2_HOME%/lib.
EDIT2: I've read the question again and it looks like you did install a "sources" jar which, of course, doesn't contain the required classes for the runtime. Before following the advice above, try to put wagon-ftp-1.0-beta-2.jar in your repository (and not wagon-ftp-1.0-beta-2-sources.jar).
Did you define wagon-ftp as a extension in your pom?
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-3</version>
</extension>
</extensions>
If yes I thing the problem is in wrong versions maven and wagon-ftp. Here is one article about this problem.
In maven-user-list I found that you need to use 1.0-beta-2 of the ftp wagon with 2.0.9. 1.0-beta-3 will work with 2.0.10 and Wagon 1.0-beta-5 release will only work as an extension in Maven 2.1.0-M1 and above.