user1882582
user1882582

Reputation: 81

Eclipse Launched Maven project not using classes in the \target folder

I have a project which I am converting from plain Java to Maven.

I used the "Configure -> Convert to Maven Project" option in eclipse.

I removed all jars in the classpath and referenced them in my POM file and built the project

My new classes are built in project/target but when I launch from eclipse, (using the original launcher) , the old classes are in project\bin folder are used.

How do I reconfigure this to use the correct classes ?

Upvotes: 1

Views: 2203

Answers (1)

JosemyAB
JosemyAB

Reputation: 407

Seems that the configuration for output files in eclipse has not change. Try to change the output of generated files in eclipse manually:

  1. Right click in project -> Properties.
  2. Select "Java build path" and tab "Sources".
  3. At bottom you have a field named "Default output folder". Change it for: <your-project>/target/classes

For example:

enter image description here Hope it works.

Upvotes: 1

Related Questions