views:

83

answers:

1

I am using eclipse with maven2 plugin.

When doing a Run-As -> build with a goal of 'deploy' I am getting this error:

Error message:org.codehaus.plexus.component.configurator.ComponentConfigurationException: Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated

I'm not sure I even need to do a 'deploy', I have another build that does a 'compile' goal, and from what I have learned doing a Run-As -> Run on Server (tomcat) is enough to deploy my application locally to tomcat.

Do I need run this build 'deploy' goal to run locally, should I just delete it and use 'run on server'?

+2  A: 

Running mvn deploy won't "deploy your application on Tomcat", deploy is something different here, deploy is a phase done in an integration or release environment and copies the final package to the remote repository for sharing with other developers and projects.

In other words, unless you are dealing with a remote repository to distribute your application (and this requires to configure a valid <distributionManagement/> section in your POM), just forget about deploy for now, this is not what you think it is :)

So, to run your application and "deploy it on Tomcat" from Eclipse, use Run As > Run on Server. If you want to run it from outside Eclipse, you can use mvn tomcat:run but this isn't really appropriate here (this goal is an handy way to run a webapp without importing it in a IDE). And if really you want to deploy your application on Tomcat from the command line, the Maven Tomcat plugin supports many methods for Deployment. But again, I don't think that this is what you're looking for for now.

Pascal Thivent
It just isn't working when I do a 'run on server', I am getting a 404 error. I copied all my files over to netbeans and it worked fine, so it is my tomcat setup that is messed. where exactly is the folder that tomcat would be using to run the app? maybe this should be another question...
Blankman
@Blankman Just try this one thing: run `mvn install` before **Run on Server** and see if it helps. If it doesn't work, maybe start a new question indeed, as this is a different topic.
Pascal Thivent
@Pascal yeah that unfort. didn't make it work. I started a new q: http://stackoverflow.com/questions/2242105/spring-3-mvc-application-runs-on-netbeans-with-tomcat-struggling-with-eclipse
Blankman