swingMan
swingMan

Reputation: 752

Converting eclipse java project to maven doesn't create src/test/java directory

I successfully converted an eclipse (Luna 4.4) Java project to Maven. To use JUnit, I added that as a maven dependency. Here is my resulting project structure as seen in eclipse:

enter image description here

I was expecting that adding JUnit would also create the src/test/Java source folder to hold my JUnit source code, but it's not there. Is this expected? Does one have to manually add these folders after a conversion from a Java project? I saw that when I created a new Maven project in eclipse and added the very same JUnit dependency, the test folder gets created automatically.

Upvotes: 2

Views: 1898

Answers (1)

Srikanta
Srikanta

Reputation: 1147

The creation of test folder happens when you create a new maven project, it is not when you add the jUnit dependency. This is part of the "mvn archetype:generate" command.

So in your case, i would suggest you create a new maven project and copy the /src/ folder manually

Upvotes: 4

Related Questions