开发者

Maven project worked before "clean install". Why?

开发者 https://www.devze.com 2023-04-08 22:51 出处:网络
I have two maven projects and both are working fine independently. I am able to create a jar file and run it from console as well as from eclipse.

I have two maven projects and both are working fine independently. I am able to create a jar file and run it from console as well as from eclipse.

I copied over some classes from the second project into the first and made a few changes so that it runs as a single project with features from both.

I have two pom files, so I combined them into a single pom file.

开发者_开发知识库

The thing is that I am able to run it from eclipse fine and able to get the output I was hoping for. But I am not able to run it after executing the jar file created from "mvn package".

I am using shade maven plugin.

If I use maven build.. with clean install as goal, it again showing errors.

My question is this, why this discrepancy?


We would need more information to correctly diagnose the issue. One thing to look at is to ensure that any changes to dependencies which are projects in Eclipse have been installed as a command line build will only look in your repo, not at your Eclipse project.


This may happen when you have a dependency which exists as an open project in your eclipse workspace.

Try closing every project except the one where you're having this problem. Does it still compile in eclipse then?

0

精彩评论

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

关注公众号