Scenario:
You scoped your solution to WebApplication and trying to deploy the solution to a particular Web Application
Error:
This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.
OR
This solution contains no resources scoped for a Web application and cannot be retracted from a particular Web application.
Reason:
Its because of the parameters passed to STSADM , basically features included in the solution does not contain an assembly which can be scoped to a particular Web Application. What ever assemblies are part of solution are suppose to go GAC and that makes solution a candidate for Global deployment.
Resolution:
Before you read the resolution below: Here's a comment that seems to be more better solution
"Better fix your solution by adding some dummy element that will make the solution deploy-able to a web application. If you have multiple web applications in your farm, usually you don't want to deploy your feature to all of them."
If that is not possible
Remove the URL parameter from STSADM. Do not use the Url parameter with the STSADM command while deploying or retracting such a solution
stsadm -o deploysolution -name SolutionFileName -local stsadm -o retractsolution -name SolutionFileName -local