开发者

maven deploy goal failing

开发者 https://www.devze.com 2022-12-19 16:45 出处:网络
I am using eclipse with maven2 plugin. When doing a Run-As -> build with a goal of \'deploy\' I am getting this error:

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'?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消