abyin007
abyin007

Reputation: 401

Need to run mvn clean install every time. Changes made in Eclipse are not reflected

I need to run mvn clean install every time. Changes made in Eclipse are not reflected.

Build automatically is enabled and Eclipse is Neon.3

If I made some changes in Junit, to make that get reflected I need to manually do mvn clean install outside Eclipse and then run the Junit from Eclipse. It's like the class files are not getting generated from Eclipse.

Because of this I can't even run a standalone Java class and run it through Eclipse, it will show "Error: Could not find or load main class Test".

Any advice?

Upvotes: 4

Views: 5274

Answers (2)

Black.Jack
Black.Jack

Reputation: 1959

  1. Make sure your Maven instance is the same as used by Eclipse and double check the directory of the project is the same as the command line root dir you are using to fire Maven outside the IDE.

  2. After you run mvn clean install (I presume from command line), right click on you Maven project in Eclipse, choose "Maven\Update Project" and flag "Force Update Snapshots/Releases" if necessary.

  3. Check if your IDE has "Build Automatically" set. You can find it in the toolbar "Project" menu.

Let me know if that has helped you.

Upvotes: 0

mhlaskar1991
mhlaskar1991

Reputation: 71

In eclipse, right click on the project and do a Maven Update.

Eclipse snapshot

Upvotes: 2

Related Questions